From f9fc35785b53aa097a09ab1b865d33497ee1802e Mon Sep 17 00:00:00 2001 From: Carlo Zancanaro Date: Tue, 10 Jul 2012 13:01:48 +1000 Subject: Move antlr. Add `make test` to Makefile. --- antlr/antlr-3.4-complete.jar | Bin 0 -> 2388361 bytes .../libantlr3c-3.4/.deps/antlr3baserecognizer.Plo | 274 + antlr/libantlr3c-3.4/.deps/antlr3basetree.Plo | 237 + .../libantlr3c-3.4/.deps/antlr3basetreeadaptor.Plo | 244 + antlr/libantlr3c-3.4/.deps/antlr3bitset.Plo | 232 + antlr/libantlr3c-3.4/.deps/antlr3collections.Plo | 286 + antlr/libantlr3c-3.4/.deps/antlr3commontoken.Plo | 286 + antlr/libantlr3c-3.4/.deps/antlr3commontree.Plo | 242 + .../.deps/antlr3commontreeadaptor.Plo | 250 + .../.deps/antlr3commontreenodestream.Plo | 255 + antlr/libantlr3c-3.4/.deps/antlr3convertutf.Plo | 227 + antlr/libantlr3c-3.4/.deps/antlr3cyclicdfa.Plo | 276 + antlr/libantlr3c-3.4/.deps/antlr3debughandlers.Plo | 286 + antlr/libantlr3c-3.4/.deps/antlr3encodings.Plo | 286 + antlr/libantlr3c-3.4/.deps/antlr3exception.Plo | 230 + antlr/libantlr3c-3.4/.deps/antlr3filestream.Plo | 286 + antlr/libantlr3c-3.4/.deps/antlr3inputstream.Plo | 242 + antlr/libantlr3c-3.4/.deps/antlr3intstream.Plo | 232 + antlr/libantlr3c-3.4/.deps/antlr3lexer.Plo | 274 + antlr/libantlr3c-3.4/.deps/antlr3parser.Plo | 274 + .../libantlr3c-3.4/.deps/antlr3rewritestreams.Plo | 277 + antlr/libantlr3c-3.4/.deps/antlr3string.Plo | 235 + antlr/libantlr3c-3.4/.deps/antlr3tokenstream.Plo | 249 + antlr/libantlr3c-3.4/.deps/antlr3treeparser.Plo | 274 + antlr/libantlr3c-3.4/AUTHORS | 41 + antlr/libantlr3c-3.4/C.sln | 53 + antlr/libantlr3c-3.4/C.vcproj | 1043 ++ antlr/libantlr3c-3.4/C.vcproj.vspscc | 14 + antlr/libantlr3c-3.4/C.vssscc | 10 + antlr/libantlr3c-3.4/COPYING | 29 + antlr/libantlr3c-3.4/ChangeLog | 550 + antlr/libantlr3c-3.4/INSTALL | 365 + antlr/libantlr3c-3.4/Makefile | 968 ++ antlr/libantlr3c-3.4/Makefile.am | 78 + antlr/libantlr3c-3.4/Makefile.in | 968 ++ antlr/libantlr3c-3.4/NEWS | 2 + antlr/libantlr3c-3.4/README | 1924 +++ antlr/libantlr3c-3.4/aclocal.m4 | 996 ++ antlr/libantlr3c-3.4/antlr3config.h | 187 + antlr/libantlr3c-3.4/antlr3config.h.in | 186 + antlr/libantlr3c-3.4/config.guess | 1501 ++ antlr/libantlr3c-3.4/config.log | 5651 ++++++++ antlr/libantlr3c-3.4/config.status | 2048 +++ antlr/libantlr3c-3.4/config.sub | 1705 +++ antlr/libantlr3c-3.4/configure | 13527 +++++++++++++++++++ antlr/libantlr3c-3.4/configure.ac | 217 + antlr/libantlr3c-3.4/depcomp | 630 + antlr/libantlr3c-3.4/doxyfile | 1659 +++ antlr/libantlr3c-3.4/doxygen/atsections.dox | 143 + antlr/libantlr3c-3.4/doxygen/build.dox | 207 + antlr/libantlr3c-3.4/doxygen/buildrec.dox | 269 + antlr/libantlr3c-3.4/doxygen/changes31.dox | 56 + antlr/libantlr3c-3.4/doxygen/doxygengroups.dox | 243 + antlr/libantlr3c-3.4/doxygen/generate.dox | 57 + antlr/libantlr3c-3.4/doxygen/interop.dox | 327 + antlr/libantlr3c-3.4/doxygen/knownissues.dox | 3 + antlr/libantlr3c-3.4/doxygen/mainpage.dox | 104 + antlr/libantlr3c-3.4/doxygen/runtime.dox | 35 + antlr/libantlr3c-3.4/doxygen/using.dox | 62 + antlr/libantlr3c-3.4/include/antlr3.h | 56 + .../libantlr3c-3.4/include/antlr3baserecognizer.h | 371 + antlr/libantlr3c-3.4/include/antlr3basetree.h | 143 + .../libantlr3c-3.4/include/antlr3basetreeadaptor.h | 152 + antlr/libantlr3c-3.4/include/antlr3bitset.h | 119 + antlr/libantlr3c-3.4/include/antlr3collections.h | 513 + antlr/libantlr3c-3.4/include/antlr3commontoken.h | 367 + antlr/libantlr3c-3.4/include/antlr3commontree.h | 167 + .../include/antlr3commontreeadaptor.h | 70 + .../include/antlr3commontreenodestream.h | 336 + antlr/libantlr3c-3.4/include/antlr3convertutf.h | 176 + antlr/libantlr3c-3.4/include/antlr3cyclicdfa.h | 97 + .../include/antlr3debugeventlistener.h | 398 + antlr/libantlr3c-3.4/include/antlr3defs.h | 632 + antlr/libantlr3c-3.4/include/antlr3encodings.h | 38 + antlr/libantlr3c-3.4/include/antlr3errors.h | 53 + antlr/libantlr3c-3.4/include/antlr3exception.h | 218 + antlr/libantlr3c-3.4/include/antlr3filestream.h | 50 + antlr/libantlr3c-3.4/include/antlr3input.h | 281 + antlr/libantlr3c-3.4/include/antlr3interfaces.h | 239 + antlr/libantlr3c-3.4/include/antlr3intstream.h | 205 + antlr/libantlr3c-3.4/include/antlr3lexer.h | 193 + antlr/libantlr3c-3.4/include/antlr3memory.h | 36 + antlr/libantlr3c-3.4/include/antlr3parser.h | 93 + antlr/libantlr3c-3.4/include/antlr3parsetree.h | 85 + .../include/antlr3recognizersharedstate.h | 218 + .../libantlr3c-3.4/include/antlr3rewritestreams.h | 180 + antlr/libantlr3c-3.4/include/antlr3string.h | 272 + antlr/libantlr3c-3.4/include/antlr3tokenstream.h | 303 + antlr/libantlr3c-3.4/include/antlr3treeparser.h | 81 + antlr/libantlr3c-3.4/install-sh | 520 + antlr/libantlr3c-3.4/libtool | 9239 +++++++++++++ antlr/libantlr3c-3.4/ltmain.sh | 8745 ++++++++++++ antlr/libantlr3c-3.4/m4/libtool.m4 | 7441 ++++++++++ antlr/libantlr3c-3.4/m4/ltoptions.m4 | 369 + antlr/libantlr3c-3.4/m4/ltsugar.m4 | 123 + antlr/libantlr3c-3.4/m4/ltversion.m4 | 23 + antlr/libantlr3c-3.4/m4/lt~obsolete.m4 | 98 + antlr/libantlr3c-3.4/missing | 376 + antlr/libantlr3c-3.4/src/antlr3baserecognizer.c | 2235 +++ antlr/libantlr3c-3.4/src/antlr3basetree.c | 489 + antlr/libantlr3c-3.4/src/antlr3basetreeadaptor.c | 909 ++ antlr/libantlr3c-3.4/src/antlr3bitset.c | 681 + antlr/libantlr3c-3.4/src/antlr3collections.c | 2741 ++++ antlr/libantlr3c-3.4/src/antlr3commontoken.c | 586 + antlr/libantlr3c-3.4/src/antlr3commontree.c | 547 + antlr/libantlr3c-3.4/src/antlr3commontreeadaptor.c | 496 + .../src/antlr3commontreenodestream.c | 968 ++ antlr/libantlr3c-3.4/src/antlr3convertutf.c | 532 + antlr/libantlr3c-3.4/src/antlr3cyclicdfa.c | 204 + antlr/libantlr3c-3.4/src/antlr3debughandlers.c | 1047 ++ antlr/libantlr3c-3.4/src/antlr3encodings.c | 50 + antlr/libantlr3c-3.4/src/antlr3exception.c | 190 + antlr/libantlr3c-3.4/src/antlr3filestream.c | 474 + antlr/libantlr3c-3.4/src/antlr3inputstream.c | 2050 +++ antlr/libantlr3c-3.4/src/antlr3intstream.c | 66 + antlr/libantlr3c-3.4/src/antlr3lexer.c | 904 ++ antlr/libantlr3c-3.4/src/antlr3parser.c | 193 + antlr/libantlr3c-3.4/src/antlr3rewritestreams.c | 844 ++ antlr/libantlr3c-3.4/src/antlr3string.c | 1402 ++ antlr/libantlr3c-3.4/src/antlr3tokenstream.c | 1091 ++ antlr/libantlr3c-3.4/src/antlr3treeparser.c | 255 + antlr/libantlr3c-3.4/stamp-h1 | 1 + antlr/libantlr3c-3.4/vsrulefiles/antlr3lexer.rules | 199 + .../vsrulefiles/antlr3lexerandparser.rules | 201 + .../libantlr3c-3.4/vsrulefiles/antlr3parser.rules | 201 + .../vsrulefiles/antlr3treeparser.rules | 201 + antlr/test-file | 2 + antlr/test-system | 100 + impl/Makefile | 7 +- impl/antlr/antlr-3.4-complete.jar | Bin 2388361 -> 0 bytes .../libantlr3c-3.4/.deps/antlr3baserecognizer.Plo | 274 - impl/antlr/libantlr3c-3.4/.deps/antlr3basetree.Plo | 237 - .../libantlr3c-3.4/.deps/antlr3basetreeadaptor.Plo | 244 - impl/antlr/libantlr3c-3.4/.deps/antlr3bitset.Plo | 232 - .../libantlr3c-3.4/.deps/antlr3collections.Plo | 286 - .../libantlr3c-3.4/.deps/antlr3commontoken.Plo | 286 - .../libantlr3c-3.4/.deps/antlr3commontree.Plo | 242 - .../.deps/antlr3commontreeadaptor.Plo | 250 - .../.deps/antlr3commontreenodestream.Plo | 255 - .../libantlr3c-3.4/.deps/antlr3convertutf.Plo | 227 - .../antlr/libantlr3c-3.4/.deps/antlr3cyclicdfa.Plo | 276 - .../libantlr3c-3.4/.deps/antlr3debughandlers.Plo | 286 - .../antlr/libantlr3c-3.4/.deps/antlr3encodings.Plo | 286 - .../antlr/libantlr3c-3.4/.deps/antlr3exception.Plo | 230 - .../libantlr3c-3.4/.deps/antlr3filestream.Plo | 286 - .../libantlr3c-3.4/.deps/antlr3inputstream.Plo | 242 - .../antlr/libantlr3c-3.4/.deps/antlr3intstream.Plo | 232 - impl/antlr/libantlr3c-3.4/.deps/antlr3lexer.Plo | 274 - impl/antlr/libantlr3c-3.4/.deps/antlr3parser.Plo | 274 - .../libantlr3c-3.4/.deps/antlr3rewritestreams.Plo | 277 - impl/antlr/libantlr3c-3.4/.deps/antlr3string.Plo | 235 - .../libantlr3c-3.4/.deps/antlr3tokenstream.Plo | 249 - .../libantlr3c-3.4/.deps/antlr3treeparser.Plo | 274 - impl/antlr/libantlr3c-3.4/AUTHORS | 41 - impl/antlr/libantlr3c-3.4/C.sln | 53 - impl/antlr/libantlr3c-3.4/C.vcproj | 1043 -- impl/antlr/libantlr3c-3.4/C.vcproj.vspscc | 14 - impl/antlr/libantlr3c-3.4/C.vssscc | 10 - impl/antlr/libantlr3c-3.4/COPYING | 29 - impl/antlr/libantlr3c-3.4/ChangeLog | 550 - impl/antlr/libantlr3c-3.4/INSTALL | 365 - impl/antlr/libantlr3c-3.4/Makefile | 968 -- impl/antlr/libantlr3c-3.4/Makefile.am | 78 - impl/antlr/libantlr3c-3.4/Makefile.in | 968 -- impl/antlr/libantlr3c-3.4/NEWS | 2 - impl/antlr/libantlr3c-3.4/README | 1924 --- impl/antlr/libantlr3c-3.4/aclocal.m4 | 996 -- impl/antlr/libantlr3c-3.4/antlr3config.h | 187 - impl/antlr/libantlr3c-3.4/antlr3config.h.in | 186 - impl/antlr/libantlr3c-3.4/config.guess | 1501 -- impl/antlr/libantlr3c-3.4/config.log | 5651 -------- impl/antlr/libantlr3c-3.4/config.status | 2048 --- impl/antlr/libantlr3c-3.4/config.sub | 1705 --- impl/antlr/libantlr3c-3.4/configure | 13527 ------------------- impl/antlr/libantlr3c-3.4/configure.ac | 217 - impl/antlr/libantlr3c-3.4/depcomp | 630 - impl/antlr/libantlr3c-3.4/doxyfile | 1659 --- impl/antlr/libantlr3c-3.4/doxygen/atsections.dox | 143 - impl/antlr/libantlr3c-3.4/doxygen/build.dox | 207 - impl/antlr/libantlr3c-3.4/doxygen/buildrec.dox | 269 - impl/antlr/libantlr3c-3.4/doxygen/changes31.dox | 56 - .../antlr/libantlr3c-3.4/doxygen/doxygengroups.dox | 243 - impl/antlr/libantlr3c-3.4/doxygen/generate.dox | 57 - impl/antlr/libantlr3c-3.4/doxygen/interop.dox | 327 - impl/antlr/libantlr3c-3.4/doxygen/knownissues.dox | 3 - impl/antlr/libantlr3c-3.4/doxygen/mainpage.dox | 104 - impl/antlr/libantlr3c-3.4/doxygen/runtime.dox | 35 - impl/antlr/libantlr3c-3.4/doxygen/using.dox | 62 - impl/antlr/libantlr3c-3.4/include/antlr3.h | 56 - .../libantlr3c-3.4/include/antlr3baserecognizer.h | 371 - impl/antlr/libantlr3c-3.4/include/antlr3basetree.h | 143 - .../libantlr3c-3.4/include/antlr3basetreeadaptor.h | 152 - impl/antlr/libantlr3c-3.4/include/antlr3bitset.h | 119 - .../libantlr3c-3.4/include/antlr3collections.h | 513 - .../libantlr3c-3.4/include/antlr3commontoken.h | 367 - .../libantlr3c-3.4/include/antlr3commontree.h | 167 - .../include/antlr3commontreeadaptor.h | 70 - .../include/antlr3commontreenodestream.h | 336 - .../libantlr3c-3.4/include/antlr3convertutf.h | 176 - .../antlr/libantlr3c-3.4/include/antlr3cyclicdfa.h | 97 - .../include/antlr3debugeventlistener.h | 398 - impl/antlr/libantlr3c-3.4/include/antlr3defs.h | 632 - .../antlr/libantlr3c-3.4/include/antlr3encodings.h | 38 - impl/antlr/libantlr3c-3.4/include/antlr3errors.h | 53 - .../antlr/libantlr3c-3.4/include/antlr3exception.h | 218 - .../libantlr3c-3.4/include/antlr3filestream.h | 50 - impl/antlr/libantlr3c-3.4/include/antlr3input.h | 281 - .../libantlr3c-3.4/include/antlr3interfaces.h | 239 - .../antlr/libantlr3c-3.4/include/antlr3intstream.h | 205 - impl/antlr/libantlr3c-3.4/include/antlr3lexer.h | 193 - impl/antlr/libantlr3c-3.4/include/antlr3memory.h | 36 - impl/antlr/libantlr3c-3.4/include/antlr3parser.h | 93 - .../antlr/libantlr3c-3.4/include/antlr3parsetree.h | 85 - .../include/antlr3recognizersharedstate.h | 218 - .../libantlr3c-3.4/include/antlr3rewritestreams.h | 180 - impl/antlr/libantlr3c-3.4/include/antlr3string.h | 272 - .../libantlr3c-3.4/include/antlr3tokenstream.h | 303 - .../libantlr3c-3.4/include/antlr3treeparser.h | 81 - impl/antlr/libantlr3c-3.4/install-sh | 520 - impl/antlr/libantlr3c-3.4/libtool | 9239 ------------- impl/antlr/libantlr3c-3.4/ltmain.sh | 8745 ------------ impl/antlr/libantlr3c-3.4/m4/libtool.m4 | 7441 ---------- impl/antlr/libantlr3c-3.4/m4/ltoptions.m4 | 369 - impl/antlr/libantlr3c-3.4/m4/ltsugar.m4 | 123 - impl/antlr/libantlr3c-3.4/m4/ltversion.m4 | 23 - impl/antlr/libantlr3c-3.4/m4/lt~obsolete.m4 | 98 - impl/antlr/libantlr3c-3.4/missing | 376 - .../libantlr3c-3.4/src/antlr3baserecognizer.c | 2235 --- impl/antlr/libantlr3c-3.4/src/antlr3basetree.c | 489 - .../libantlr3c-3.4/src/antlr3basetreeadaptor.c | 909 -- impl/antlr/libantlr3c-3.4/src/antlr3bitset.c | 681 - impl/antlr/libantlr3c-3.4/src/antlr3collections.c | 2741 ---- impl/antlr/libantlr3c-3.4/src/antlr3commontoken.c | 586 - impl/antlr/libantlr3c-3.4/src/antlr3commontree.c | 547 - .../libantlr3c-3.4/src/antlr3commontreeadaptor.c | 496 - .../src/antlr3commontreenodestream.c | 968 -- impl/antlr/libantlr3c-3.4/src/antlr3convertutf.c | 532 - impl/antlr/libantlr3c-3.4/src/antlr3cyclicdfa.c | 204 - .../antlr/libantlr3c-3.4/src/antlr3debughandlers.c | 1047 -- impl/antlr/libantlr3c-3.4/src/antlr3encodings.c | 50 - impl/antlr/libantlr3c-3.4/src/antlr3exception.c | 190 - impl/antlr/libantlr3c-3.4/src/antlr3filestream.c | 474 - impl/antlr/libantlr3c-3.4/src/antlr3inputstream.c | 2050 --- impl/antlr/libantlr3c-3.4/src/antlr3intstream.c | 66 - impl/antlr/libantlr3c-3.4/src/antlr3lexer.c | 904 -- impl/antlr/libantlr3c-3.4/src/antlr3parser.c | 193 - .../libantlr3c-3.4/src/antlr3rewritestreams.c | 844 -- impl/antlr/libantlr3c-3.4/src/antlr3string.c | 1402 -- impl/antlr/libantlr3c-3.4/src/antlr3tokenstream.c | 1091 -- impl/antlr/libantlr3c-3.4/src/antlr3treeparser.c | 255 - impl/antlr/libantlr3c-3.4/stamp-h1 | 1 - .../libantlr3c-3.4/vsrulefiles/antlr3lexer.rules | 199 - .../vsrulefiles/antlr3lexerandparser.rules | 201 - .../libantlr3c-3.4/vsrulefiles/antlr3parser.rules | 201 - .../vsrulefiles/antlr3treeparser.rules | 201 - impl/antlr/test-file | 2 - impl/antlr/test-system | 100 - 257 files changed, 94752 insertions(+), 94749 deletions(-) create mode 100644 antlr/antlr-3.4-complete.jar create mode 100644 antlr/libantlr3c-3.4/.deps/antlr3baserecognizer.Plo create mode 100644 antlr/libantlr3c-3.4/.deps/antlr3basetree.Plo create mode 100644 antlr/libantlr3c-3.4/.deps/antlr3basetreeadaptor.Plo create mode 100644 antlr/libantlr3c-3.4/.deps/antlr3bitset.Plo create mode 100644 antlr/libantlr3c-3.4/.deps/antlr3collections.Plo create mode 100644 antlr/libantlr3c-3.4/.deps/antlr3commontoken.Plo create mode 100644 antlr/libantlr3c-3.4/.deps/antlr3commontree.Plo create mode 100644 antlr/libantlr3c-3.4/.deps/antlr3commontreeadaptor.Plo create mode 100644 antlr/libantlr3c-3.4/.deps/antlr3commontreenodestream.Plo create mode 100644 antlr/libantlr3c-3.4/.deps/antlr3convertutf.Plo create mode 100644 antlr/libantlr3c-3.4/.deps/antlr3cyclicdfa.Plo create mode 100644 antlr/libantlr3c-3.4/.deps/antlr3debughandlers.Plo create mode 100644 antlr/libantlr3c-3.4/.deps/antlr3encodings.Plo create mode 100644 antlr/libantlr3c-3.4/.deps/antlr3exception.Plo create mode 100644 antlr/libantlr3c-3.4/.deps/antlr3filestream.Plo create mode 100644 antlr/libantlr3c-3.4/.deps/antlr3inputstream.Plo create mode 100644 antlr/libantlr3c-3.4/.deps/antlr3intstream.Plo create mode 100644 antlr/libantlr3c-3.4/.deps/antlr3lexer.Plo create mode 100644 antlr/libantlr3c-3.4/.deps/antlr3parser.Plo create mode 100644 antlr/libantlr3c-3.4/.deps/antlr3rewritestreams.Plo create mode 100644 antlr/libantlr3c-3.4/.deps/antlr3string.Plo create mode 100644 antlr/libantlr3c-3.4/.deps/antlr3tokenstream.Plo create mode 100644 antlr/libantlr3c-3.4/.deps/antlr3treeparser.Plo create mode 100644 antlr/libantlr3c-3.4/AUTHORS create mode 100644 antlr/libantlr3c-3.4/C.sln create mode 100644 antlr/libantlr3c-3.4/C.vcproj create mode 100644 antlr/libantlr3c-3.4/C.vcproj.vspscc create mode 100644 antlr/libantlr3c-3.4/C.vssscc create mode 100644 antlr/libantlr3c-3.4/COPYING create mode 100644 antlr/libantlr3c-3.4/ChangeLog create mode 100644 antlr/libantlr3c-3.4/INSTALL create mode 100644 antlr/libantlr3c-3.4/Makefile create mode 100644 antlr/libantlr3c-3.4/Makefile.am create mode 100644 antlr/libantlr3c-3.4/Makefile.in create mode 100644 antlr/libantlr3c-3.4/NEWS create mode 100644 antlr/libantlr3c-3.4/README create mode 100644 antlr/libantlr3c-3.4/aclocal.m4 create mode 100644 antlr/libantlr3c-3.4/antlr3config.h create mode 100644 antlr/libantlr3c-3.4/antlr3config.h.in create mode 100755 antlr/libantlr3c-3.4/config.guess create mode 100644 antlr/libantlr3c-3.4/config.log create mode 100755 antlr/libantlr3c-3.4/config.status create mode 100755 antlr/libantlr3c-3.4/config.sub create mode 100755 antlr/libantlr3c-3.4/configure create mode 100644 antlr/libantlr3c-3.4/configure.ac create mode 100755 antlr/libantlr3c-3.4/depcomp create mode 100644 antlr/libantlr3c-3.4/doxyfile create mode 100644 antlr/libantlr3c-3.4/doxygen/atsections.dox create mode 100644 antlr/libantlr3c-3.4/doxygen/build.dox create mode 100644 antlr/libantlr3c-3.4/doxygen/buildrec.dox create mode 100644 antlr/libantlr3c-3.4/doxygen/changes31.dox create mode 100644 antlr/libantlr3c-3.4/doxygen/doxygengroups.dox create mode 100644 antlr/libantlr3c-3.4/doxygen/generate.dox create mode 100644 antlr/libantlr3c-3.4/doxygen/interop.dox create mode 100644 antlr/libantlr3c-3.4/doxygen/knownissues.dox create mode 100644 antlr/libantlr3c-3.4/doxygen/mainpage.dox create mode 100644 antlr/libantlr3c-3.4/doxygen/runtime.dox create mode 100644 antlr/libantlr3c-3.4/doxygen/using.dox create mode 100644 antlr/libantlr3c-3.4/include/antlr3.h create mode 100644 antlr/libantlr3c-3.4/include/antlr3baserecognizer.h create mode 100644 antlr/libantlr3c-3.4/include/antlr3basetree.h create mode 100644 antlr/libantlr3c-3.4/include/antlr3basetreeadaptor.h create mode 100644 antlr/libantlr3c-3.4/include/antlr3bitset.h create mode 100644 antlr/libantlr3c-3.4/include/antlr3collections.h create mode 100644 antlr/libantlr3c-3.4/include/antlr3commontoken.h create mode 100644 antlr/libantlr3c-3.4/include/antlr3commontree.h create mode 100644 antlr/libantlr3c-3.4/include/antlr3commontreeadaptor.h create mode 100644 antlr/libantlr3c-3.4/include/antlr3commontreenodestream.h create mode 100644 antlr/libantlr3c-3.4/include/antlr3convertutf.h create mode 100644 antlr/libantlr3c-3.4/include/antlr3cyclicdfa.h create mode 100644 antlr/libantlr3c-3.4/include/antlr3debugeventlistener.h create mode 100644 antlr/libantlr3c-3.4/include/antlr3defs.h create mode 100644 antlr/libantlr3c-3.4/include/antlr3encodings.h create mode 100644 antlr/libantlr3c-3.4/include/antlr3errors.h create mode 100644 antlr/libantlr3c-3.4/include/antlr3exception.h create mode 100644 antlr/libantlr3c-3.4/include/antlr3filestream.h create mode 100644 antlr/libantlr3c-3.4/include/antlr3input.h create mode 100644 antlr/libantlr3c-3.4/include/antlr3interfaces.h create mode 100644 antlr/libantlr3c-3.4/include/antlr3intstream.h create mode 100644 antlr/libantlr3c-3.4/include/antlr3lexer.h create mode 100644 antlr/libantlr3c-3.4/include/antlr3memory.h create mode 100644 antlr/libantlr3c-3.4/include/antlr3parser.h create mode 100644 antlr/libantlr3c-3.4/include/antlr3parsetree.h create mode 100644 antlr/libantlr3c-3.4/include/antlr3recognizersharedstate.h create mode 100644 antlr/libantlr3c-3.4/include/antlr3rewritestreams.h create mode 100644 antlr/libantlr3c-3.4/include/antlr3string.h create mode 100644 antlr/libantlr3c-3.4/include/antlr3tokenstream.h create mode 100644 antlr/libantlr3c-3.4/include/antlr3treeparser.h create mode 100755 antlr/libantlr3c-3.4/install-sh create mode 100755 antlr/libantlr3c-3.4/libtool create mode 100755 antlr/libantlr3c-3.4/ltmain.sh create mode 100644 antlr/libantlr3c-3.4/m4/libtool.m4 create mode 100644 antlr/libantlr3c-3.4/m4/ltoptions.m4 create mode 100644 antlr/libantlr3c-3.4/m4/ltsugar.m4 create mode 100644 antlr/libantlr3c-3.4/m4/ltversion.m4 create mode 100644 antlr/libantlr3c-3.4/m4/lt~obsolete.m4 create mode 100755 antlr/libantlr3c-3.4/missing create mode 100644 antlr/libantlr3c-3.4/src/antlr3baserecognizer.c create mode 100644 antlr/libantlr3c-3.4/src/antlr3basetree.c create mode 100644 antlr/libantlr3c-3.4/src/antlr3basetreeadaptor.c create mode 100644 antlr/libantlr3c-3.4/src/antlr3bitset.c create mode 100644 antlr/libantlr3c-3.4/src/antlr3collections.c create mode 100644 antlr/libantlr3c-3.4/src/antlr3commontoken.c create mode 100644 antlr/libantlr3c-3.4/src/antlr3commontree.c create mode 100644 antlr/libantlr3c-3.4/src/antlr3commontreeadaptor.c create mode 100644 antlr/libantlr3c-3.4/src/antlr3commontreenodestream.c create mode 100644 antlr/libantlr3c-3.4/src/antlr3convertutf.c create mode 100644 antlr/libantlr3c-3.4/src/antlr3cyclicdfa.c create mode 100644 antlr/libantlr3c-3.4/src/antlr3debughandlers.c create mode 100644 antlr/libantlr3c-3.4/src/antlr3encodings.c create mode 100644 antlr/libantlr3c-3.4/src/antlr3exception.c create mode 100644 antlr/libantlr3c-3.4/src/antlr3filestream.c create mode 100644 antlr/libantlr3c-3.4/src/antlr3inputstream.c create mode 100644 antlr/libantlr3c-3.4/src/antlr3intstream.c create mode 100644 antlr/libantlr3c-3.4/src/antlr3lexer.c create mode 100644 antlr/libantlr3c-3.4/src/antlr3parser.c create mode 100644 antlr/libantlr3c-3.4/src/antlr3rewritestreams.c create mode 100644 antlr/libantlr3c-3.4/src/antlr3string.c create mode 100644 antlr/libantlr3c-3.4/src/antlr3tokenstream.c create mode 100644 antlr/libantlr3c-3.4/src/antlr3treeparser.c create mode 100644 antlr/libantlr3c-3.4/stamp-h1 create mode 100644 antlr/libantlr3c-3.4/vsrulefiles/antlr3lexer.rules create mode 100644 antlr/libantlr3c-3.4/vsrulefiles/antlr3lexerandparser.rules create mode 100644 antlr/libantlr3c-3.4/vsrulefiles/antlr3parser.rules create mode 100644 antlr/libantlr3c-3.4/vsrulefiles/antlr3treeparser.rules create mode 100644 antlr/test-file create mode 100644 antlr/test-system delete mode 100644 impl/antlr/antlr-3.4-complete.jar delete mode 100644 impl/antlr/libantlr3c-3.4/.deps/antlr3baserecognizer.Plo delete mode 100644 impl/antlr/libantlr3c-3.4/.deps/antlr3basetree.Plo delete mode 100644 impl/antlr/libantlr3c-3.4/.deps/antlr3basetreeadaptor.Plo delete mode 100644 impl/antlr/libantlr3c-3.4/.deps/antlr3bitset.Plo delete mode 100644 impl/antlr/libantlr3c-3.4/.deps/antlr3collections.Plo delete mode 100644 impl/antlr/libantlr3c-3.4/.deps/antlr3commontoken.Plo delete mode 100644 impl/antlr/libantlr3c-3.4/.deps/antlr3commontree.Plo delete mode 100644 impl/antlr/libantlr3c-3.4/.deps/antlr3commontreeadaptor.Plo delete mode 100644 impl/antlr/libantlr3c-3.4/.deps/antlr3commontreenodestream.Plo delete mode 100644 impl/antlr/libantlr3c-3.4/.deps/antlr3convertutf.Plo delete mode 100644 impl/antlr/libantlr3c-3.4/.deps/antlr3cyclicdfa.Plo delete mode 100644 impl/antlr/libantlr3c-3.4/.deps/antlr3debughandlers.Plo delete mode 100644 impl/antlr/libantlr3c-3.4/.deps/antlr3encodings.Plo delete mode 100644 impl/antlr/libantlr3c-3.4/.deps/antlr3exception.Plo delete mode 100644 impl/antlr/libantlr3c-3.4/.deps/antlr3filestream.Plo delete mode 100644 impl/antlr/libantlr3c-3.4/.deps/antlr3inputstream.Plo delete mode 100644 impl/antlr/libantlr3c-3.4/.deps/antlr3intstream.Plo delete mode 100644 impl/antlr/libantlr3c-3.4/.deps/antlr3lexer.Plo delete mode 100644 impl/antlr/libantlr3c-3.4/.deps/antlr3parser.Plo delete mode 100644 impl/antlr/libantlr3c-3.4/.deps/antlr3rewritestreams.Plo delete mode 100644 impl/antlr/libantlr3c-3.4/.deps/antlr3string.Plo delete mode 100644 impl/antlr/libantlr3c-3.4/.deps/antlr3tokenstream.Plo delete mode 100644 impl/antlr/libantlr3c-3.4/.deps/antlr3treeparser.Plo delete mode 100644 impl/antlr/libantlr3c-3.4/AUTHORS delete mode 100644 impl/antlr/libantlr3c-3.4/C.sln delete mode 100644 impl/antlr/libantlr3c-3.4/C.vcproj delete mode 100644 impl/antlr/libantlr3c-3.4/C.vcproj.vspscc delete mode 100644 impl/antlr/libantlr3c-3.4/C.vssscc delete mode 100644 impl/antlr/libantlr3c-3.4/COPYING delete mode 100644 impl/antlr/libantlr3c-3.4/ChangeLog delete mode 100644 impl/antlr/libantlr3c-3.4/INSTALL delete mode 100644 impl/antlr/libantlr3c-3.4/Makefile delete mode 100644 impl/antlr/libantlr3c-3.4/Makefile.am delete mode 100644 impl/antlr/libantlr3c-3.4/Makefile.in delete mode 100644 impl/antlr/libantlr3c-3.4/NEWS delete mode 100644 impl/antlr/libantlr3c-3.4/README delete mode 100644 impl/antlr/libantlr3c-3.4/aclocal.m4 delete mode 100644 impl/antlr/libantlr3c-3.4/antlr3config.h delete mode 100644 impl/antlr/libantlr3c-3.4/antlr3config.h.in delete mode 100755 impl/antlr/libantlr3c-3.4/config.guess delete mode 100644 impl/antlr/libantlr3c-3.4/config.log delete mode 100755 impl/antlr/libantlr3c-3.4/config.status delete mode 100755 impl/antlr/libantlr3c-3.4/config.sub delete mode 100755 impl/antlr/libantlr3c-3.4/configure delete mode 100644 impl/antlr/libantlr3c-3.4/configure.ac delete mode 100755 impl/antlr/libantlr3c-3.4/depcomp delete mode 100644 impl/antlr/libantlr3c-3.4/doxyfile delete mode 100644 impl/antlr/libantlr3c-3.4/doxygen/atsections.dox delete mode 100644 impl/antlr/libantlr3c-3.4/doxygen/build.dox delete mode 100644 impl/antlr/libantlr3c-3.4/doxygen/buildrec.dox delete mode 100644 impl/antlr/libantlr3c-3.4/doxygen/changes31.dox delete mode 100644 impl/antlr/libantlr3c-3.4/doxygen/doxygengroups.dox delete mode 100644 impl/antlr/libantlr3c-3.4/doxygen/generate.dox delete mode 100644 impl/antlr/libantlr3c-3.4/doxygen/interop.dox delete mode 100644 impl/antlr/libantlr3c-3.4/doxygen/knownissues.dox delete mode 100644 impl/antlr/libantlr3c-3.4/doxygen/mainpage.dox delete mode 100644 impl/antlr/libantlr3c-3.4/doxygen/runtime.dox delete mode 100644 impl/antlr/libantlr3c-3.4/doxygen/using.dox delete mode 100644 impl/antlr/libantlr3c-3.4/include/antlr3.h delete mode 100644 impl/antlr/libantlr3c-3.4/include/antlr3baserecognizer.h delete mode 100644 impl/antlr/libantlr3c-3.4/include/antlr3basetree.h delete mode 100644 impl/antlr/libantlr3c-3.4/include/antlr3basetreeadaptor.h delete mode 100644 impl/antlr/libantlr3c-3.4/include/antlr3bitset.h delete mode 100644 impl/antlr/libantlr3c-3.4/include/antlr3collections.h delete mode 100644 impl/antlr/libantlr3c-3.4/include/antlr3commontoken.h delete mode 100644 impl/antlr/libantlr3c-3.4/include/antlr3commontree.h delete mode 100644 impl/antlr/libantlr3c-3.4/include/antlr3commontreeadaptor.h delete mode 100644 impl/antlr/libantlr3c-3.4/include/antlr3commontreenodestream.h delete mode 100644 impl/antlr/libantlr3c-3.4/include/antlr3convertutf.h delete mode 100644 impl/antlr/libantlr3c-3.4/include/antlr3cyclicdfa.h delete mode 100644 impl/antlr/libantlr3c-3.4/include/antlr3debugeventlistener.h delete mode 100644 impl/antlr/libantlr3c-3.4/include/antlr3defs.h delete mode 100644 impl/antlr/libantlr3c-3.4/include/antlr3encodings.h delete mode 100644 impl/antlr/libantlr3c-3.4/include/antlr3errors.h delete mode 100644 impl/antlr/libantlr3c-3.4/include/antlr3exception.h delete mode 100644 impl/antlr/libantlr3c-3.4/include/antlr3filestream.h delete mode 100644 impl/antlr/libantlr3c-3.4/include/antlr3input.h delete mode 100644 impl/antlr/libantlr3c-3.4/include/antlr3interfaces.h delete mode 100644 impl/antlr/libantlr3c-3.4/include/antlr3intstream.h delete mode 100644 impl/antlr/libantlr3c-3.4/include/antlr3lexer.h delete mode 100644 impl/antlr/libantlr3c-3.4/include/antlr3memory.h delete mode 100644 impl/antlr/libantlr3c-3.4/include/antlr3parser.h delete mode 100644 impl/antlr/libantlr3c-3.4/include/antlr3parsetree.h delete mode 100644 impl/antlr/libantlr3c-3.4/include/antlr3recognizersharedstate.h delete mode 100644 impl/antlr/libantlr3c-3.4/include/antlr3rewritestreams.h delete mode 100644 impl/antlr/libantlr3c-3.4/include/antlr3string.h delete mode 100644 impl/antlr/libantlr3c-3.4/include/antlr3tokenstream.h delete mode 100644 impl/antlr/libantlr3c-3.4/include/antlr3treeparser.h delete mode 100755 impl/antlr/libantlr3c-3.4/install-sh delete mode 100755 impl/antlr/libantlr3c-3.4/libtool delete mode 100755 impl/antlr/libantlr3c-3.4/ltmain.sh delete mode 100644 impl/antlr/libantlr3c-3.4/m4/libtool.m4 delete mode 100644 impl/antlr/libantlr3c-3.4/m4/ltoptions.m4 delete mode 100644 impl/antlr/libantlr3c-3.4/m4/ltsugar.m4 delete mode 100644 impl/antlr/libantlr3c-3.4/m4/ltversion.m4 delete mode 100644 impl/antlr/libantlr3c-3.4/m4/lt~obsolete.m4 delete mode 100755 impl/antlr/libantlr3c-3.4/missing delete mode 100644 impl/antlr/libantlr3c-3.4/src/antlr3baserecognizer.c delete mode 100644 impl/antlr/libantlr3c-3.4/src/antlr3basetree.c delete mode 100644 impl/antlr/libantlr3c-3.4/src/antlr3basetreeadaptor.c delete mode 100644 impl/antlr/libantlr3c-3.4/src/antlr3bitset.c delete mode 100644 impl/antlr/libantlr3c-3.4/src/antlr3collections.c delete mode 100644 impl/antlr/libantlr3c-3.4/src/antlr3commontoken.c delete mode 100644 impl/antlr/libantlr3c-3.4/src/antlr3commontree.c delete mode 100644 impl/antlr/libantlr3c-3.4/src/antlr3commontreeadaptor.c delete mode 100644 impl/antlr/libantlr3c-3.4/src/antlr3commontreenodestream.c delete mode 100644 impl/antlr/libantlr3c-3.4/src/antlr3convertutf.c delete mode 100644 impl/antlr/libantlr3c-3.4/src/antlr3cyclicdfa.c delete mode 100644 impl/antlr/libantlr3c-3.4/src/antlr3debughandlers.c delete mode 100644 impl/antlr/libantlr3c-3.4/src/antlr3encodings.c delete mode 100644 impl/antlr/libantlr3c-3.4/src/antlr3exception.c delete mode 100644 impl/antlr/libantlr3c-3.4/src/antlr3filestream.c delete mode 100644 impl/antlr/libantlr3c-3.4/src/antlr3inputstream.c delete mode 100644 impl/antlr/libantlr3c-3.4/src/antlr3intstream.c delete mode 100644 impl/antlr/libantlr3c-3.4/src/antlr3lexer.c delete mode 100644 impl/antlr/libantlr3c-3.4/src/antlr3parser.c delete mode 100644 impl/antlr/libantlr3c-3.4/src/antlr3rewritestreams.c delete mode 100644 impl/antlr/libantlr3c-3.4/src/antlr3string.c delete mode 100644 impl/antlr/libantlr3c-3.4/src/antlr3tokenstream.c delete mode 100644 impl/antlr/libantlr3c-3.4/src/antlr3treeparser.c delete mode 100644 impl/antlr/libantlr3c-3.4/stamp-h1 delete mode 100644 impl/antlr/libantlr3c-3.4/vsrulefiles/antlr3lexer.rules delete mode 100644 impl/antlr/libantlr3c-3.4/vsrulefiles/antlr3lexerandparser.rules delete mode 100644 impl/antlr/libantlr3c-3.4/vsrulefiles/antlr3parser.rules delete mode 100644 impl/antlr/libantlr3c-3.4/vsrulefiles/antlr3treeparser.rules delete mode 100644 impl/antlr/test-file delete mode 100644 impl/antlr/test-system diff --git a/antlr/antlr-3.4-complete.jar b/antlr/antlr-3.4-complete.jar new file mode 100644 index 0000000..9c985c7 Binary files /dev/null and b/antlr/antlr-3.4-complete.jar differ diff --git a/antlr/libantlr3c-3.4/.deps/antlr3baserecognizer.Plo b/antlr/libantlr3c-3.4/.deps/antlr3baserecognizer.Plo new file mode 100644 index 0000000..1c74dc3 --- /dev/null +++ b/antlr/libantlr3c-3.4/.deps/antlr3baserecognizer.Plo @@ -0,0 +1,274 @@ +antlr3baserecognizer.lo: src/antlr3baserecognizer.c \ + include/antlr3baserecognizer.h include/antlr3defs.h \ + include/antlr3errors.h antlr3config.h /usr/include/stdio.h \ + /usr/include/features.h /usr/include/i386-linux-gnu/bits/predefs.h \ + /usr/include/i386-linux-gnu/sys/cdefs.h \ + /usr/include/i386-linux-gnu/bits/wordsize.h \ + /usr/include/i386-linux-gnu/gnu/stubs.h \ + /usr/include/i386-linux-gnu/gnu/stubs-32.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include/stddef.h \ + /usr/include/i386-linux-gnu/bits/types.h \ + /usr/include/i386-linux-gnu/bits/typesizes.h /usr/include/libio.h \ + /usr/include/_G_config.h /usr/include/wchar.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include/stdarg.h \ + /usr/include/i386-linux-gnu/bits/stdio_lim.h \ + /usr/include/i386-linux-gnu/bits/sys_errlist.h \ + /usr/include/i386-linux-gnu/bits/stdio.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include/stdint.h /usr/include/stdint.h \ + /usr/include/i386-linux-gnu/bits/wchar.h \ + /usr/include/i386-linux-gnu/sys/types.h /usr/include/time.h \ + /usr/include/endian.h /usr/include/i386-linux-gnu/bits/endian.h \ + /usr/include/i386-linux-gnu/bits/byteswap.h \ + /usr/include/i386-linux-gnu/sys/select.h \ + /usr/include/i386-linux-gnu/bits/select.h \ + /usr/include/i386-linux-gnu/bits/sigset.h \ + /usr/include/i386-linux-gnu/bits/time.h \ + /usr/include/i386-linux-gnu/sys/sysmacros.h \ + /usr/include/i386-linux-gnu/bits/pthreadtypes.h \ + /usr/include/i386-linux-gnu/sys/stat.h \ + /usr/include/i386-linux-gnu/bits/stat.h /usr/include/stdlib.h \ + /usr/include/i386-linux-gnu/bits/waitflags.h \ + /usr/include/i386-linux-gnu/bits/waitstatus.h /usr/include/alloca.h \ + /usr/include/string.h /usr/include/xlocale.h \ + /usr/include/i386-linux-gnu/bits/string.h \ + /usr/include/i386-linux-gnu/bits/string2.h /usr/include/strings.h \ + /usr/include/inttypes.h /usr/include/unistd.h \ + /usr/include/i386-linux-gnu/bits/posix_opt.h \ + /usr/include/i386-linux-gnu/bits/environments.h \ + /usr/include/i386-linux-gnu/bits/confname.h /usr/include/getopt.h \ + /usr/include/netinet/in.h /usr/include/i386-linux-gnu/sys/socket.h \ + /usr/include/i386-linux-gnu/sys/uio.h \ + /usr/include/i386-linux-gnu/bits/uio.h \ + /usr/include/i386-linux-gnu/bits/socket.h \ + /usr/include/i386-linux-gnu/bits/sockaddr.h \ + /usr/include/i386-linux-gnu/asm/socket.h \ + /usr/include/asm-generic/socket.h \ + /usr/include/i386-linux-gnu/asm/sockios.h \ + /usr/include/asm-generic/sockios.h /usr/include/i386-linux-gnu/bits/in.h \ + /usr/include/netinet/tcp.h /usr/include/arpa/nameser.h \ + /usr/include/i386-linux-gnu/sys/param.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/limits.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/syslimits.h \ + /usr/include/limits.h /usr/include/i386-linux-gnu/bits/posix1_lim.h \ + /usr/include/i386-linux-gnu/bits/local_lim.h /usr/include/linux/limits.h \ + /usr/include/i386-linux-gnu/bits/posix2_lim.h /usr/include/linux/param.h \ + /usr/include/i386-linux-gnu/asm/param.h /usr/include/asm-generic/param.h \ + /usr/include/i386-linux-gnu/sys/bitypes.h \ + /usr/include/arpa/nameser_compat.h /usr/include/netdb.h \ + /usr/include/rpc/netdb.h /usr/include/i386-linux-gnu/bits/netdb.h \ + /usr/include/malloc.h /usr/include/ctype.h include/antlr3interfaces.h \ + include/antlr3convertutf.h include/antlr3exception.h \ + include/antlr3input.h include/antlr3string.h include/antlr3collections.h \ + include/antlr3bitset.h include/antlr3commontoken.h \ + include/antlr3intstream.h include/antlr3tokenstream.h \ + include/antlr3debugeventlistener.h include/antlr3basetree.h \ + include/antlr3commontreenodestream.h include/antlr3commontreeadaptor.h \ + include/antlr3basetreeadaptor.h include/antlr3commontree.h \ + include/antlr3recognizersharedstate.h include/antlr3lexer.h \ + include/antlr3parser.h include/antlr3treeparser.h + +include/antlr3baserecognizer.h: + +include/antlr3defs.h: + +include/antlr3errors.h: + +antlr3config.h: + +/usr/include/stdio.h: + +/usr/include/features.h: + +/usr/include/i386-linux-gnu/bits/predefs.h: + +/usr/include/i386-linux-gnu/sys/cdefs.h: + +/usr/include/i386-linux-gnu/bits/wordsize.h: + +/usr/include/i386-linux-gnu/gnu/stubs.h: + +/usr/include/i386-linux-gnu/gnu/stubs-32.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include/stddef.h: + +/usr/include/i386-linux-gnu/bits/types.h: + +/usr/include/i386-linux-gnu/bits/typesizes.h: + +/usr/include/libio.h: + +/usr/include/_G_config.h: + +/usr/include/wchar.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include/stdarg.h: + +/usr/include/i386-linux-gnu/bits/stdio_lim.h: + +/usr/include/i386-linux-gnu/bits/sys_errlist.h: + +/usr/include/i386-linux-gnu/bits/stdio.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include/stdint.h: + +/usr/include/stdint.h: + +/usr/include/i386-linux-gnu/bits/wchar.h: + +/usr/include/i386-linux-gnu/sys/types.h: + +/usr/include/time.h: + +/usr/include/endian.h: + +/usr/include/i386-linux-gnu/bits/endian.h: + +/usr/include/i386-linux-gnu/bits/byteswap.h: + +/usr/include/i386-linux-gnu/sys/select.h: + +/usr/include/i386-linux-gnu/bits/select.h: + +/usr/include/i386-linux-gnu/bits/sigset.h: + +/usr/include/i386-linux-gnu/bits/time.h: + +/usr/include/i386-linux-gnu/sys/sysmacros.h: + +/usr/include/i386-linux-gnu/bits/pthreadtypes.h: + +/usr/include/i386-linux-gnu/sys/stat.h: + +/usr/include/i386-linux-gnu/bits/stat.h: + +/usr/include/stdlib.h: + +/usr/include/i386-linux-gnu/bits/waitflags.h: + +/usr/include/i386-linux-gnu/bits/waitstatus.h: + +/usr/include/alloca.h: + +/usr/include/string.h: + +/usr/include/xlocale.h: + +/usr/include/i386-linux-gnu/bits/string.h: + +/usr/include/i386-linux-gnu/bits/string2.h: + +/usr/include/strings.h: + +/usr/include/inttypes.h: + +/usr/include/unistd.h: + +/usr/include/i386-linux-gnu/bits/posix_opt.h: + +/usr/include/i386-linux-gnu/bits/environments.h: + +/usr/include/i386-linux-gnu/bits/confname.h: + +/usr/include/getopt.h: + +/usr/include/netinet/in.h: + +/usr/include/i386-linux-gnu/sys/socket.h: + +/usr/include/i386-linux-gnu/sys/uio.h: + +/usr/include/i386-linux-gnu/bits/uio.h: + +/usr/include/i386-linux-gnu/bits/socket.h: + +/usr/include/i386-linux-gnu/bits/sockaddr.h: + +/usr/include/i386-linux-gnu/asm/socket.h: + +/usr/include/asm-generic/socket.h: + +/usr/include/i386-linux-gnu/asm/sockios.h: + +/usr/include/asm-generic/sockios.h: + +/usr/include/i386-linux-gnu/bits/in.h: + +/usr/include/netinet/tcp.h: + +/usr/include/arpa/nameser.h: + +/usr/include/i386-linux-gnu/sys/param.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/limits.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/syslimits.h: + +/usr/include/limits.h: + +/usr/include/i386-linux-gnu/bits/posix1_lim.h: + +/usr/include/i386-linux-gnu/bits/local_lim.h: + +/usr/include/linux/limits.h: + +/usr/include/i386-linux-gnu/bits/posix2_lim.h: + +/usr/include/linux/param.h: + +/usr/include/i386-linux-gnu/asm/param.h: + +/usr/include/asm-generic/param.h: + +/usr/include/i386-linux-gnu/sys/bitypes.h: + +/usr/include/arpa/nameser_compat.h: + +/usr/include/netdb.h: + +/usr/include/rpc/netdb.h: + +/usr/include/i386-linux-gnu/bits/netdb.h: + +/usr/include/malloc.h: + +/usr/include/ctype.h: + +include/antlr3interfaces.h: + +include/antlr3convertutf.h: + +include/antlr3exception.h: + +include/antlr3input.h: + +include/antlr3string.h: + +include/antlr3collections.h: + +include/antlr3bitset.h: + +include/antlr3commontoken.h: + +include/antlr3intstream.h: + +include/antlr3tokenstream.h: + +include/antlr3debugeventlistener.h: + +include/antlr3basetree.h: + +include/antlr3commontreenodestream.h: + +include/antlr3commontreeadaptor.h: + +include/antlr3basetreeadaptor.h: + +include/antlr3commontree.h: + +include/antlr3recognizersharedstate.h: + +include/antlr3lexer.h: + +include/antlr3parser.h: + +include/antlr3treeparser.h: diff --git a/antlr/libantlr3c-3.4/.deps/antlr3basetree.Plo b/antlr/libantlr3c-3.4/.deps/antlr3basetree.Plo new file mode 100644 index 0000000..b95ef6a --- /dev/null +++ b/antlr/libantlr3c-3.4/.deps/antlr3basetree.Plo @@ -0,0 +1,237 @@ +antlr3basetree.lo: src/antlr3basetree.c include/antlr3basetree.h \ + include/antlr3defs.h include/antlr3errors.h antlr3config.h \ + /usr/include/stdio.h /usr/include/features.h \ + /usr/include/i386-linux-gnu/bits/predefs.h \ + /usr/include/i386-linux-gnu/sys/cdefs.h \ + /usr/include/i386-linux-gnu/bits/wordsize.h \ + /usr/include/i386-linux-gnu/gnu/stubs.h \ + /usr/include/i386-linux-gnu/gnu/stubs-32.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include/stddef.h \ + /usr/include/i386-linux-gnu/bits/types.h \ + /usr/include/i386-linux-gnu/bits/typesizes.h /usr/include/libio.h \ + /usr/include/_G_config.h /usr/include/wchar.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include/stdarg.h \ + /usr/include/i386-linux-gnu/bits/stdio_lim.h \ + /usr/include/i386-linux-gnu/bits/sys_errlist.h \ + /usr/include/i386-linux-gnu/bits/stdio.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include/stdint.h /usr/include/stdint.h \ + /usr/include/i386-linux-gnu/bits/wchar.h \ + /usr/include/i386-linux-gnu/sys/types.h /usr/include/time.h \ + /usr/include/endian.h /usr/include/i386-linux-gnu/bits/endian.h \ + /usr/include/i386-linux-gnu/bits/byteswap.h \ + /usr/include/i386-linux-gnu/sys/select.h \ + /usr/include/i386-linux-gnu/bits/select.h \ + /usr/include/i386-linux-gnu/bits/sigset.h \ + /usr/include/i386-linux-gnu/bits/time.h \ + /usr/include/i386-linux-gnu/sys/sysmacros.h \ + /usr/include/i386-linux-gnu/bits/pthreadtypes.h \ + /usr/include/i386-linux-gnu/sys/stat.h \ + /usr/include/i386-linux-gnu/bits/stat.h /usr/include/stdlib.h \ + /usr/include/i386-linux-gnu/bits/waitflags.h \ + /usr/include/i386-linux-gnu/bits/waitstatus.h /usr/include/alloca.h \ + /usr/include/string.h /usr/include/xlocale.h \ + /usr/include/i386-linux-gnu/bits/string.h \ + /usr/include/i386-linux-gnu/bits/string2.h /usr/include/strings.h \ + /usr/include/inttypes.h /usr/include/unistd.h \ + /usr/include/i386-linux-gnu/bits/posix_opt.h \ + /usr/include/i386-linux-gnu/bits/environments.h \ + /usr/include/i386-linux-gnu/bits/confname.h /usr/include/getopt.h \ + /usr/include/netinet/in.h /usr/include/i386-linux-gnu/sys/socket.h \ + /usr/include/i386-linux-gnu/sys/uio.h \ + /usr/include/i386-linux-gnu/bits/uio.h \ + /usr/include/i386-linux-gnu/bits/socket.h \ + /usr/include/i386-linux-gnu/bits/sockaddr.h \ + /usr/include/i386-linux-gnu/asm/socket.h \ + /usr/include/asm-generic/socket.h \ + /usr/include/i386-linux-gnu/asm/sockios.h \ + /usr/include/asm-generic/sockios.h /usr/include/i386-linux-gnu/bits/in.h \ + /usr/include/netinet/tcp.h /usr/include/arpa/nameser.h \ + /usr/include/i386-linux-gnu/sys/param.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/limits.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/syslimits.h \ + /usr/include/limits.h /usr/include/i386-linux-gnu/bits/posix1_lim.h \ + /usr/include/i386-linux-gnu/bits/local_lim.h /usr/include/linux/limits.h \ + /usr/include/i386-linux-gnu/bits/posix2_lim.h /usr/include/linux/param.h \ + /usr/include/i386-linux-gnu/asm/param.h /usr/include/asm-generic/param.h \ + /usr/include/i386-linux-gnu/sys/bitypes.h \ + /usr/include/arpa/nameser_compat.h /usr/include/netdb.h \ + /usr/include/rpc/netdb.h /usr/include/i386-linux-gnu/bits/netdb.h \ + /usr/include/malloc.h /usr/include/ctype.h include/antlr3interfaces.h \ + include/antlr3convertutf.h include/antlr3collections.h \ + include/antlr3bitset.h include/antlr3string.h + +include/antlr3basetree.h: + +include/antlr3defs.h: + +include/antlr3errors.h: + +antlr3config.h: + +/usr/include/stdio.h: + +/usr/include/features.h: + +/usr/include/i386-linux-gnu/bits/predefs.h: + +/usr/include/i386-linux-gnu/sys/cdefs.h: + +/usr/include/i386-linux-gnu/bits/wordsize.h: + +/usr/include/i386-linux-gnu/gnu/stubs.h: + +/usr/include/i386-linux-gnu/gnu/stubs-32.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include/stddef.h: + +/usr/include/i386-linux-gnu/bits/types.h: + +/usr/include/i386-linux-gnu/bits/typesizes.h: + +/usr/include/libio.h: + +/usr/include/_G_config.h: + +/usr/include/wchar.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include/stdarg.h: + +/usr/include/i386-linux-gnu/bits/stdio_lim.h: + +/usr/include/i386-linux-gnu/bits/sys_errlist.h: + +/usr/include/i386-linux-gnu/bits/stdio.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include/stdint.h: + +/usr/include/stdint.h: + +/usr/include/i386-linux-gnu/bits/wchar.h: + +/usr/include/i386-linux-gnu/sys/types.h: + +/usr/include/time.h: + +/usr/include/endian.h: + +/usr/include/i386-linux-gnu/bits/endian.h: + +/usr/include/i386-linux-gnu/bits/byteswap.h: + +/usr/include/i386-linux-gnu/sys/select.h: + +/usr/include/i386-linux-gnu/bits/select.h: + +/usr/include/i386-linux-gnu/bits/sigset.h: + +/usr/include/i386-linux-gnu/bits/time.h: + +/usr/include/i386-linux-gnu/sys/sysmacros.h: + +/usr/include/i386-linux-gnu/bits/pthreadtypes.h: + +/usr/include/i386-linux-gnu/sys/stat.h: + +/usr/include/i386-linux-gnu/bits/stat.h: + +/usr/include/stdlib.h: + +/usr/include/i386-linux-gnu/bits/waitflags.h: + +/usr/include/i386-linux-gnu/bits/waitstatus.h: + +/usr/include/alloca.h: + +/usr/include/string.h: + +/usr/include/xlocale.h: + +/usr/include/i386-linux-gnu/bits/string.h: + +/usr/include/i386-linux-gnu/bits/string2.h: + +/usr/include/strings.h: + +/usr/include/inttypes.h: + +/usr/include/unistd.h: + +/usr/include/i386-linux-gnu/bits/posix_opt.h: + +/usr/include/i386-linux-gnu/bits/environments.h: + +/usr/include/i386-linux-gnu/bits/confname.h: + +/usr/include/getopt.h: + +/usr/include/netinet/in.h: + +/usr/include/i386-linux-gnu/sys/socket.h: + +/usr/include/i386-linux-gnu/sys/uio.h: + +/usr/include/i386-linux-gnu/bits/uio.h: + +/usr/include/i386-linux-gnu/bits/socket.h: + +/usr/include/i386-linux-gnu/bits/sockaddr.h: + +/usr/include/i386-linux-gnu/asm/socket.h: + +/usr/include/asm-generic/socket.h: + +/usr/include/i386-linux-gnu/asm/sockios.h: + +/usr/include/asm-generic/sockios.h: + +/usr/include/i386-linux-gnu/bits/in.h: + +/usr/include/netinet/tcp.h: + +/usr/include/arpa/nameser.h: + +/usr/include/i386-linux-gnu/sys/param.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/limits.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/syslimits.h: + +/usr/include/limits.h: + +/usr/include/i386-linux-gnu/bits/posix1_lim.h: + +/usr/include/i386-linux-gnu/bits/local_lim.h: + +/usr/include/linux/limits.h: + +/usr/include/i386-linux-gnu/bits/posix2_lim.h: + +/usr/include/linux/param.h: + +/usr/include/i386-linux-gnu/asm/param.h: + +/usr/include/asm-generic/param.h: + +/usr/include/i386-linux-gnu/sys/bitypes.h: + +/usr/include/arpa/nameser_compat.h: + +/usr/include/netdb.h: + +/usr/include/rpc/netdb.h: + +/usr/include/i386-linux-gnu/bits/netdb.h: + +/usr/include/malloc.h: + +/usr/include/ctype.h: + +include/antlr3interfaces.h: + +include/antlr3convertutf.h: + +include/antlr3collections.h: + +include/antlr3bitset.h: + +include/antlr3string.h: diff --git a/antlr/libantlr3c-3.4/.deps/antlr3basetreeadaptor.Plo b/antlr/libantlr3c-3.4/.deps/antlr3basetreeadaptor.Plo new file mode 100644 index 0000000..f420b67 --- /dev/null +++ b/antlr/libantlr3c-3.4/.deps/antlr3basetreeadaptor.Plo @@ -0,0 +1,244 @@ +antlr3basetreeadaptor.lo: src/antlr3basetreeadaptor.c \ + include/antlr3basetreeadaptor.h include/antlr3defs.h \ + include/antlr3errors.h antlr3config.h /usr/include/stdio.h \ + /usr/include/features.h /usr/include/i386-linux-gnu/bits/predefs.h \ + /usr/include/i386-linux-gnu/sys/cdefs.h \ + /usr/include/i386-linux-gnu/bits/wordsize.h \ + /usr/include/i386-linux-gnu/gnu/stubs.h \ + /usr/include/i386-linux-gnu/gnu/stubs-32.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include/stddef.h \ + /usr/include/i386-linux-gnu/bits/types.h \ + /usr/include/i386-linux-gnu/bits/typesizes.h /usr/include/libio.h \ + /usr/include/_G_config.h /usr/include/wchar.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include/stdarg.h \ + /usr/include/i386-linux-gnu/bits/stdio_lim.h \ + /usr/include/i386-linux-gnu/bits/sys_errlist.h \ + /usr/include/i386-linux-gnu/bits/stdio.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include/stdint.h /usr/include/stdint.h \ + /usr/include/i386-linux-gnu/bits/wchar.h \ + /usr/include/i386-linux-gnu/sys/types.h /usr/include/time.h \ + /usr/include/endian.h /usr/include/i386-linux-gnu/bits/endian.h \ + /usr/include/i386-linux-gnu/bits/byteswap.h \ + /usr/include/i386-linux-gnu/sys/select.h \ + /usr/include/i386-linux-gnu/bits/select.h \ + /usr/include/i386-linux-gnu/bits/sigset.h \ + /usr/include/i386-linux-gnu/bits/time.h \ + /usr/include/i386-linux-gnu/sys/sysmacros.h \ + /usr/include/i386-linux-gnu/bits/pthreadtypes.h \ + /usr/include/i386-linux-gnu/sys/stat.h \ + /usr/include/i386-linux-gnu/bits/stat.h /usr/include/stdlib.h \ + /usr/include/i386-linux-gnu/bits/waitflags.h \ + /usr/include/i386-linux-gnu/bits/waitstatus.h /usr/include/alloca.h \ + /usr/include/string.h /usr/include/xlocale.h \ + /usr/include/i386-linux-gnu/bits/string.h \ + /usr/include/i386-linux-gnu/bits/string2.h /usr/include/strings.h \ + /usr/include/inttypes.h /usr/include/unistd.h \ + /usr/include/i386-linux-gnu/bits/posix_opt.h \ + /usr/include/i386-linux-gnu/bits/environments.h \ + /usr/include/i386-linux-gnu/bits/confname.h /usr/include/getopt.h \ + /usr/include/netinet/in.h /usr/include/i386-linux-gnu/sys/socket.h \ + /usr/include/i386-linux-gnu/sys/uio.h \ + /usr/include/i386-linux-gnu/bits/uio.h \ + /usr/include/i386-linux-gnu/bits/socket.h \ + /usr/include/i386-linux-gnu/bits/sockaddr.h \ + /usr/include/i386-linux-gnu/asm/socket.h \ + /usr/include/asm-generic/socket.h \ + /usr/include/i386-linux-gnu/asm/sockios.h \ + /usr/include/asm-generic/sockios.h /usr/include/i386-linux-gnu/bits/in.h \ + /usr/include/netinet/tcp.h /usr/include/arpa/nameser.h \ + /usr/include/i386-linux-gnu/sys/param.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/limits.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/syslimits.h \ + /usr/include/limits.h /usr/include/i386-linux-gnu/bits/posix1_lim.h \ + /usr/include/i386-linux-gnu/bits/local_lim.h /usr/include/linux/limits.h \ + /usr/include/i386-linux-gnu/bits/posix2_lim.h /usr/include/linux/param.h \ + /usr/include/i386-linux-gnu/asm/param.h /usr/include/asm-generic/param.h \ + /usr/include/i386-linux-gnu/sys/bitypes.h \ + /usr/include/arpa/nameser_compat.h /usr/include/netdb.h \ + /usr/include/rpc/netdb.h /usr/include/i386-linux-gnu/bits/netdb.h \ + /usr/include/malloc.h /usr/include/ctype.h include/antlr3interfaces.h \ + include/antlr3convertutf.h include/antlr3collections.h \ + include/antlr3bitset.h include/antlr3string.h include/antlr3basetree.h \ + include/antlr3commontoken.h include/antlr3debugeventlistener.h + +include/antlr3basetreeadaptor.h: + +include/antlr3defs.h: + +include/antlr3errors.h: + +antlr3config.h: + +/usr/include/stdio.h: + +/usr/include/features.h: + +/usr/include/i386-linux-gnu/bits/predefs.h: + +/usr/include/i386-linux-gnu/sys/cdefs.h: + +/usr/include/i386-linux-gnu/bits/wordsize.h: + +/usr/include/i386-linux-gnu/gnu/stubs.h: + +/usr/include/i386-linux-gnu/gnu/stubs-32.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include/stddef.h: + +/usr/include/i386-linux-gnu/bits/types.h: + +/usr/include/i386-linux-gnu/bits/typesizes.h: + +/usr/include/libio.h: + +/usr/include/_G_config.h: + +/usr/include/wchar.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include/stdarg.h: + +/usr/include/i386-linux-gnu/bits/stdio_lim.h: + +/usr/include/i386-linux-gnu/bits/sys_errlist.h: + +/usr/include/i386-linux-gnu/bits/stdio.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include/stdint.h: + +/usr/include/stdint.h: + +/usr/include/i386-linux-gnu/bits/wchar.h: + +/usr/include/i386-linux-gnu/sys/types.h: + +/usr/include/time.h: + +/usr/include/endian.h: + +/usr/include/i386-linux-gnu/bits/endian.h: + +/usr/include/i386-linux-gnu/bits/byteswap.h: + +/usr/include/i386-linux-gnu/sys/select.h: + +/usr/include/i386-linux-gnu/bits/select.h: + +/usr/include/i386-linux-gnu/bits/sigset.h: + +/usr/include/i386-linux-gnu/bits/time.h: + +/usr/include/i386-linux-gnu/sys/sysmacros.h: + +/usr/include/i386-linux-gnu/bits/pthreadtypes.h: + +/usr/include/i386-linux-gnu/sys/stat.h: + +/usr/include/i386-linux-gnu/bits/stat.h: + +/usr/include/stdlib.h: + +/usr/include/i386-linux-gnu/bits/waitflags.h: + +/usr/include/i386-linux-gnu/bits/waitstatus.h: + +/usr/include/alloca.h: + +/usr/include/string.h: + +/usr/include/xlocale.h: + +/usr/include/i386-linux-gnu/bits/string.h: + +/usr/include/i386-linux-gnu/bits/string2.h: + +/usr/include/strings.h: + +/usr/include/inttypes.h: + +/usr/include/unistd.h: + +/usr/include/i386-linux-gnu/bits/posix_opt.h: + +/usr/include/i386-linux-gnu/bits/environments.h: + +/usr/include/i386-linux-gnu/bits/confname.h: + +/usr/include/getopt.h: + +/usr/include/netinet/in.h: + +/usr/include/i386-linux-gnu/sys/socket.h: + +/usr/include/i386-linux-gnu/sys/uio.h: + +/usr/include/i386-linux-gnu/bits/uio.h: + +/usr/include/i386-linux-gnu/bits/socket.h: + +/usr/include/i386-linux-gnu/bits/sockaddr.h: + +/usr/include/i386-linux-gnu/asm/socket.h: + +/usr/include/asm-generic/socket.h: + +/usr/include/i386-linux-gnu/asm/sockios.h: + +/usr/include/asm-generic/sockios.h: + +/usr/include/i386-linux-gnu/bits/in.h: + +/usr/include/netinet/tcp.h: + +/usr/include/arpa/nameser.h: + +/usr/include/i386-linux-gnu/sys/param.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/limits.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/syslimits.h: + +/usr/include/limits.h: + +/usr/include/i386-linux-gnu/bits/posix1_lim.h: + +/usr/include/i386-linux-gnu/bits/local_lim.h: + +/usr/include/linux/limits.h: + +/usr/include/i386-linux-gnu/bits/posix2_lim.h: + +/usr/include/linux/param.h: + +/usr/include/i386-linux-gnu/asm/param.h: + +/usr/include/asm-generic/param.h: + +/usr/include/i386-linux-gnu/sys/bitypes.h: + +/usr/include/arpa/nameser_compat.h: + +/usr/include/netdb.h: + +/usr/include/rpc/netdb.h: + +/usr/include/i386-linux-gnu/bits/netdb.h: + +/usr/include/malloc.h: + +/usr/include/ctype.h: + +include/antlr3interfaces.h: + +include/antlr3convertutf.h: + +include/antlr3collections.h: + +include/antlr3bitset.h: + +include/antlr3string.h: + +include/antlr3basetree.h: + +include/antlr3commontoken.h: + +include/antlr3debugeventlistener.h: diff --git a/antlr/libantlr3c-3.4/.deps/antlr3bitset.Plo b/antlr/libantlr3c-3.4/.deps/antlr3bitset.Plo new file mode 100644 index 0000000..1d657ed --- /dev/null +++ b/antlr/libantlr3c-3.4/.deps/antlr3bitset.Plo @@ -0,0 +1,232 @@ +antlr3bitset.lo: src/antlr3bitset.c include/antlr3bitset.h \ + include/antlr3defs.h include/antlr3errors.h antlr3config.h \ + /usr/include/stdio.h /usr/include/features.h \ + /usr/include/i386-linux-gnu/bits/predefs.h \ + /usr/include/i386-linux-gnu/sys/cdefs.h \ + /usr/include/i386-linux-gnu/bits/wordsize.h \ + /usr/include/i386-linux-gnu/gnu/stubs.h \ + /usr/include/i386-linux-gnu/gnu/stubs-32.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include/stddef.h \ + /usr/include/i386-linux-gnu/bits/types.h \ + /usr/include/i386-linux-gnu/bits/typesizes.h /usr/include/libio.h \ + /usr/include/_G_config.h /usr/include/wchar.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include/stdarg.h \ + /usr/include/i386-linux-gnu/bits/stdio_lim.h \ + /usr/include/i386-linux-gnu/bits/sys_errlist.h \ + /usr/include/i386-linux-gnu/bits/stdio.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include/stdint.h /usr/include/stdint.h \ + /usr/include/i386-linux-gnu/bits/wchar.h \ + /usr/include/i386-linux-gnu/sys/types.h /usr/include/time.h \ + /usr/include/endian.h /usr/include/i386-linux-gnu/bits/endian.h \ + /usr/include/i386-linux-gnu/bits/byteswap.h \ + /usr/include/i386-linux-gnu/sys/select.h \ + /usr/include/i386-linux-gnu/bits/select.h \ + /usr/include/i386-linux-gnu/bits/sigset.h \ + /usr/include/i386-linux-gnu/bits/time.h \ + /usr/include/i386-linux-gnu/sys/sysmacros.h \ + /usr/include/i386-linux-gnu/bits/pthreadtypes.h \ + /usr/include/i386-linux-gnu/sys/stat.h \ + /usr/include/i386-linux-gnu/bits/stat.h /usr/include/stdlib.h \ + /usr/include/i386-linux-gnu/bits/waitflags.h \ + /usr/include/i386-linux-gnu/bits/waitstatus.h /usr/include/alloca.h \ + /usr/include/string.h /usr/include/xlocale.h \ + /usr/include/i386-linux-gnu/bits/string.h \ + /usr/include/i386-linux-gnu/bits/string2.h /usr/include/strings.h \ + /usr/include/inttypes.h /usr/include/unistd.h \ + /usr/include/i386-linux-gnu/bits/posix_opt.h \ + /usr/include/i386-linux-gnu/bits/environments.h \ + /usr/include/i386-linux-gnu/bits/confname.h /usr/include/getopt.h \ + /usr/include/netinet/in.h /usr/include/i386-linux-gnu/sys/socket.h \ + /usr/include/i386-linux-gnu/sys/uio.h \ + /usr/include/i386-linux-gnu/bits/uio.h \ + /usr/include/i386-linux-gnu/bits/socket.h \ + /usr/include/i386-linux-gnu/bits/sockaddr.h \ + /usr/include/i386-linux-gnu/asm/socket.h \ + /usr/include/asm-generic/socket.h \ + /usr/include/i386-linux-gnu/asm/sockios.h \ + /usr/include/asm-generic/sockios.h /usr/include/i386-linux-gnu/bits/in.h \ + /usr/include/netinet/tcp.h /usr/include/arpa/nameser.h \ + /usr/include/i386-linux-gnu/sys/param.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/limits.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/syslimits.h \ + /usr/include/limits.h /usr/include/i386-linux-gnu/bits/posix1_lim.h \ + /usr/include/i386-linux-gnu/bits/local_lim.h /usr/include/linux/limits.h \ + /usr/include/i386-linux-gnu/bits/posix2_lim.h /usr/include/linux/param.h \ + /usr/include/i386-linux-gnu/asm/param.h /usr/include/asm-generic/param.h \ + /usr/include/i386-linux-gnu/sys/bitypes.h \ + /usr/include/arpa/nameser_compat.h /usr/include/netdb.h \ + /usr/include/rpc/netdb.h /usr/include/i386-linux-gnu/bits/netdb.h \ + /usr/include/malloc.h /usr/include/ctype.h include/antlr3interfaces.h \ + include/antlr3convertutf.h include/antlr3collections.h + +include/antlr3bitset.h: + +include/antlr3defs.h: + +include/antlr3errors.h: + +antlr3config.h: + +/usr/include/stdio.h: + +/usr/include/features.h: + +/usr/include/i386-linux-gnu/bits/predefs.h: + +/usr/include/i386-linux-gnu/sys/cdefs.h: + +/usr/include/i386-linux-gnu/bits/wordsize.h: + +/usr/include/i386-linux-gnu/gnu/stubs.h: + +/usr/include/i386-linux-gnu/gnu/stubs-32.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include/stddef.h: + +/usr/include/i386-linux-gnu/bits/types.h: + +/usr/include/i386-linux-gnu/bits/typesizes.h: + +/usr/include/libio.h: + +/usr/include/_G_config.h: + +/usr/include/wchar.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include/stdarg.h: + +/usr/include/i386-linux-gnu/bits/stdio_lim.h: + +/usr/include/i386-linux-gnu/bits/sys_errlist.h: + +/usr/include/i386-linux-gnu/bits/stdio.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include/stdint.h: + +/usr/include/stdint.h: + +/usr/include/i386-linux-gnu/bits/wchar.h: + +/usr/include/i386-linux-gnu/sys/types.h: + +/usr/include/time.h: + +/usr/include/endian.h: + +/usr/include/i386-linux-gnu/bits/endian.h: + +/usr/include/i386-linux-gnu/bits/byteswap.h: + +/usr/include/i386-linux-gnu/sys/select.h: + +/usr/include/i386-linux-gnu/bits/select.h: + +/usr/include/i386-linux-gnu/bits/sigset.h: + +/usr/include/i386-linux-gnu/bits/time.h: + +/usr/include/i386-linux-gnu/sys/sysmacros.h: + +/usr/include/i386-linux-gnu/bits/pthreadtypes.h: + +/usr/include/i386-linux-gnu/sys/stat.h: + +/usr/include/i386-linux-gnu/bits/stat.h: + +/usr/include/stdlib.h: + +/usr/include/i386-linux-gnu/bits/waitflags.h: + +/usr/include/i386-linux-gnu/bits/waitstatus.h: + +/usr/include/alloca.h: + +/usr/include/string.h: + +/usr/include/xlocale.h: + +/usr/include/i386-linux-gnu/bits/string.h: + +/usr/include/i386-linux-gnu/bits/string2.h: + +/usr/include/strings.h: + +/usr/include/inttypes.h: + +/usr/include/unistd.h: + +/usr/include/i386-linux-gnu/bits/posix_opt.h: + +/usr/include/i386-linux-gnu/bits/environments.h: + +/usr/include/i386-linux-gnu/bits/confname.h: + +/usr/include/getopt.h: + +/usr/include/netinet/in.h: + +/usr/include/i386-linux-gnu/sys/socket.h: + +/usr/include/i386-linux-gnu/sys/uio.h: + +/usr/include/i386-linux-gnu/bits/uio.h: + +/usr/include/i386-linux-gnu/bits/socket.h: + +/usr/include/i386-linux-gnu/bits/sockaddr.h: + +/usr/include/i386-linux-gnu/asm/socket.h: + +/usr/include/asm-generic/socket.h: + +/usr/include/i386-linux-gnu/asm/sockios.h: + +/usr/include/asm-generic/sockios.h: + +/usr/include/i386-linux-gnu/bits/in.h: + +/usr/include/netinet/tcp.h: + +/usr/include/arpa/nameser.h: + +/usr/include/i386-linux-gnu/sys/param.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/limits.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/syslimits.h: + +/usr/include/limits.h: + +/usr/include/i386-linux-gnu/bits/posix1_lim.h: + +/usr/include/i386-linux-gnu/bits/local_lim.h: + +/usr/include/linux/limits.h: + +/usr/include/i386-linux-gnu/bits/posix2_lim.h: + +/usr/include/linux/param.h: + +/usr/include/i386-linux-gnu/asm/param.h: + +/usr/include/asm-generic/param.h: + +/usr/include/i386-linux-gnu/sys/bitypes.h: + +/usr/include/arpa/nameser_compat.h: + +/usr/include/netdb.h: + +/usr/include/rpc/netdb.h: + +/usr/include/i386-linux-gnu/bits/netdb.h: + +/usr/include/malloc.h: + +/usr/include/ctype.h: + +include/antlr3interfaces.h: + +include/antlr3convertutf.h: + +include/antlr3collections.h: diff --git a/antlr/libantlr3c-3.4/.deps/antlr3collections.Plo b/antlr/libantlr3c-3.4/.deps/antlr3collections.Plo new file mode 100644 index 0000000..a209893 --- /dev/null +++ b/antlr/libantlr3c-3.4/.deps/antlr3collections.Plo @@ -0,0 +1,286 @@ +antlr3collections.lo: src/antlr3collections.c include/antlr3.h \ + include/antlr3defs.h include/antlr3errors.h antlr3config.h \ + /usr/include/stdio.h /usr/include/features.h \ + /usr/include/i386-linux-gnu/bits/predefs.h \ + /usr/include/i386-linux-gnu/sys/cdefs.h \ + /usr/include/i386-linux-gnu/bits/wordsize.h \ + /usr/include/i386-linux-gnu/gnu/stubs.h \ + /usr/include/i386-linux-gnu/gnu/stubs-32.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include/stddef.h \ + /usr/include/i386-linux-gnu/bits/types.h \ + /usr/include/i386-linux-gnu/bits/typesizes.h /usr/include/libio.h \ + /usr/include/_G_config.h /usr/include/wchar.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include/stdarg.h \ + /usr/include/i386-linux-gnu/bits/stdio_lim.h \ + /usr/include/i386-linux-gnu/bits/sys_errlist.h \ + /usr/include/i386-linux-gnu/bits/stdio.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include/stdint.h /usr/include/stdint.h \ + /usr/include/i386-linux-gnu/bits/wchar.h \ + /usr/include/i386-linux-gnu/sys/types.h /usr/include/time.h \ + /usr/include/endian.h /usr/include/i386-linux-gnu/bits/endian.h \ + /usr/include/i386-linux-gnu/bits/byteswap.h \ + /usr/include/i386-linux-gnu/sys/select.h \ + /usr/include/i386-linux-gnu/bits/select.h \ + /usr/include/i386-linux-gnu/bits/sigset.h \ + /usr/include/i386-linux-gnu/bits/time.h \ + /usr/include/i386-linux-gnu/sys/sysmacros.h \ + /usr/include/i386-linux-gnu/bits/pthreadtypes.h \ + /usr/include/i386-linux-gnu/sys/stat.h \ + /usr/include/i386-linux-gnu/bits/stat.h /usr/include/stdlib.h \ + /usr/include/i386-linux-gnu/bits/waitflags.h \ + /usr/include/i386-linux-gnu/bits/waitstatus.h /usr/include/alloca.h \ + /usr/include/string.h /usr/include/xlocale.h \ + /usr/include/i386-linux-gnu/bits/string.h \ + /usr/include/i386-linux-gnu/bits/string2.h /usr/include/strings.h \ + /usr/include/inttypes.h /usr/include/unistd.h \ + /usr/include/i386-linux-gnu/bits/posix_opt.h \ + /usr/include/i386-linux-gnu/bits/environments.h \ + /usr/include/i386-linux-gnu/bits/confname.h /usr/include/getopt.h \ + /usr/include/netinet/in.h /usr/include/i386-linux-gnu/sys/socket.h \ + /usr/include/i386-linux-gnu/sys/uio.h \ + /usr/include/i386-linux-gnu/bits/uio.h \ + /usr/include/i386-linux-gnu/bits/socket.h \ + /usr/include/i386-linux-gnu/bits/sockaddr.h \ + /usr/include/i386-linux-gnu/asm/socket.h \ + /usr/include/asm-generic/socket.h \ + /usr/include/i386-linux-gnu/asm/sockios.h \ + /usr/include/asm-generic/sockios.h /usr/include/i386-linux-gnu/bits/in.h \ + /usr/include/netinet/tcp.h /usr/include/arpa/nameser.h \ + /usr/include/i386-linux-gnu/sys/param.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/limits.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/syslimits.h \ + /usr/include/limits.h /usr/include/i386-linux-gnu/bits/posix1_lim.h \ + /usr/include/i386-linux-gnu/bits/local_lim.h /usr/include/linux/limits.h \ + /usr/include/i386-linux-gnu/bits/posix2_lim.h /usr/include/linux/param.h \ + /usr/include/i386-linux-gnu/asm/param.h /usr/include/asm-generic/param.h \ + /usr/include/i386-linux-gnu/sys/bitypes.h \ + /usr/include/arpa/nameser_compat.h /usr/include/netdb.h \ + /usr/include/rpc/netdb.h /usr/include/i386-linux-gnu/bits/netdb.h \ + /usr/include/malloc.h /usr/include/ctype.h include/antlr3interfaces.h \ + include/antlr3convertutf.h include/antlr3exception.h \ + include/antlr3encodings.h include/antlr3string.h \ + include/antlr3collections.h include/antlr3bitset.h include/antlr3input.h \ + include/antlr3commontoken.h include/antlr3intstream.h \ + include/antlr3cyclicdfa.h include/antlr3baserecognizer.h \ + include/antlr3tokenstream.h include/antlr3debugeventlistener.h \ + include/antlr3basetree.h include/antlr3commontreenodestream.h \ + include/antlr3commontreeadaptor.h include/antlr3basetreeadaptor.h \ + include/antlr3commontree.h include/antlr3recognizersharedstate.h \ + include/antlr3lexer.h include/antlr3parser.h include/antlr3treeparser.h \ + include/antlr3filestream.h include/antlr3rewritestreams.h + +include/antlr3.h: + +include/antlr3defs.h: + +include/antlr3errors.h: + +antlr3config.h: + +/usr/include/stdio.h: + +/usr/include/features.h: + +/usr/include/i386-linux-gnu/bits/predefs.h: + +/usr/include/i386-linux-gnu/sys/cdefs.h: + +/usr/include/i386-linux-gnu/bits/wordsize.h: + +/usr/include/i386-linux-gnu/gnu/stubs.h: + +/usr/include/i386-linux-gnu/gnu/stubs-32.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include/stddef.h: + +/usr/include/i386-linux-gnu/bits/types.h: + +/usr/include/i386-linux-gnu/bits/typesizes.h: + +/usr/include/libio.h: + +/usr/include/_G_config.h: + +/usr/include/wchar.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include/stdarg.h: + +/usr/include/i386-linux-gnu/bits/stdio_lim.h: + +/usr/include/i386-linux-gnu/bits/sys_errlist.h: + +/usr/include/i386-linux-gnu/bits/stdio.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include/stdint.h: + +/usr/include/stdint.h: + +/usr/include/i386-linux-gnu/bits/wchar.h: + +/usr/include/i386-linux-gnu/sys/types.h: + +/usr/include/time.h: + +/usr/include/endian.h: + +/usr/include/i386-linux-gnu/bits/endian.h: + +/usr/include/i386-linux-gnu/bits/byteswap.h: + +/usr/include/i386-linux-gnu/sys/select.h: + +/usr/include/i386-linux-gnu/bits/select.h: + +/usr/include/i386-linux-gnu/bits/sigset.h: + +/usr/include/i386-linux-gnu/bits/time.h: + +/usr/include/i386-linux-gnu/sys/sysmacros.h: + +/usr/include/i386-linux-gnu/bits/pthreadtypes.h: + +/usr/include/i386-linux-gnu/sys/stat.h: + +/usr/include/i386-linux-gnu/bits/stat.h: + +/usr/include/stdlib.h: + +/usr/include/i386-linux-gnu/bits/waitflags.h: + +/usr/include/i386-linux-gnu/bits/waitstatus.h: + +/usr/include/alloca.h: + +/usr/include/string.h: + +/usr/include/xlocale.h: + +/usr/include/i386-linux-gnu/bits/string.h: + +/usr/include/i386-linux-gnu/bits/string2.h: + +/usr/include/strings.h: + +/usr/include/inttypes.h: + +/usr/include/unistd.h: + +/usr/include/i386-linux-gnu/bits/posix_opt.h: + +/usr/include/i386-linux-gnu/bits/environments.h: + +/usr/include/i386-linux-gnu/bits/confname.h: + +/usr/include/getopt.h: + +/usr/include/netinet/in.h: + +/usr/include/i386-linux-gnu/sys/socket.h: + +/usr/include/i386-linux-gnu/sys/uio.h: + +/usr/include/i386-linux-gnu/bits/uio.h: + +/usr/include/i386-linux-gnu/bits/socket.h: + +/usr/include/i386-linux-gnu/bits/sockaddr.h: + +/usr/include/i386-linux-gnu/asm/socket.h: + +/usr/include/asm-generic/socket.h: + +/usr/include/i386-linux-gnu/asm/sockios.h: + +/usr/include/asm-generic/sockios.h: + +/usr/include/i386-linux-gnu/bits/in.h: + +/usr/include/netinet/tcp.h: + +/usr/include/arpa/nameser.h: + +/usr/include/i386-linux-gnu/sys/param.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/limits.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/syslimits.h: + +/usr/include/limits.h: + +/usr/include/i386-linux-gnu/bits/posix1_lim.h: + +/usr/include/i386-linux-gnu/bits/local_lim.h: + +/usr/include/linux/limits.h: + +/usr/include/i386-linux-gnu/bits/posix2_lim.h: + +/usr/include/linux/param.h: + +/usr/include/i386-linux-gnu/asm/param.h: + +/usr/include/asm-generic/param.h: + +/usr/include/i386-linux-gnu/sys/bitypes.h: + +/usr/include/arpa/nameser_compat.h: + +/usr/include/netdb.h: + +/usr/include/rpc/netdb.h: + +/usr/include/i386-linux-gnu/bits/netdb.h: + +/usr/include/malloc.h: + +/usr/include/ctype.h: + +include/antlr3interfaces.h: + +include/antlr3convertutf.h: + +include/antlr3exception.h: + +include/antlr3encodings.h: + +include/antlr3string.h: + +include/antlr3collections.h: + +include/antlr3bitset.h: + +include/antlr3input.h: + +include/antlr3commontoken.h: + +include/antlr3intstream.h: + +include/antlr3cyclicdfa.h: + +include/antlr3baserecognizer.h: + +include/antlr3tokenstream.h: + +include/antlr3debugeventlistener.h: + +include/antlr3basetree.h: + +include/antlr3commontreenodestream.h: + +include/antlr3commontreeadaptor.h: + +include/antlr3basetreeadaptor.h: + +include/antlr3commontree.h: + +include/antlr3recognizersharedstate.h: + +include/antlr3lexer.h: + +include/antlr3parser.h: + +include/antlr3treeparser.h: + +include/antlr3filestream.h: + +include/antlr3rewritestreams.h: diff --git a/antlr/libantlr3c-3.4/.deps/antlr3commontoken.Plo b/antlr/libantlr3c-3.4/.deps/antlr3commontoken.Plo new file mode 100644 index 0000000..d52c37f --- /dev/null +++ b/antlr/libantlr3c-3.4/.deps/antlr3commontoken.Plo @@ -0,0 +1,286 @@ +antlr3commontoken.lo: src/antlr3commontoken.c include/antlr3.h \ + include/antlr3defs.h include/antlr3errors.h antlr3config.h \ + /usr/include/stdio.h /usr/include/features.h \ + /usr/include/i386-linux-gnu/bits/predefs.h \ + /usr/include/i386-linux-gnu/sys/cdefs.h \ + /usr/include/i386-linux-gnu/bits/wordsize.h \ + /usr/include/i386-linux-gnu/gnu/stubs.h \ + /usr/include/i386-linux-gnu/gnu/stubs-32.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include/stddef.h \ + /usr/include/i386-linux-gnu/bits/types.h \ + /usr/include/i386-linux-gnu/bits/typesizes.h /usr/include/libio.h \ + /usr/include/_G_config.h /usr/include/wchar.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include/stdarg.h \ + /usr/include/i386-linux-gnu/bits/stdio_lim.h \ + /usr/include/i386-linux-gnu/bits/sys_errlist.h \ + /usr/include/i386-linux-gnu/bits/stdio.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include/stdint.h /usr/include/stdint.h \ + /usr/include/i386-linux-gnu/bits/wchar.h \ + /usr/include/i386-linux-gnu/sys/types.h /usr/include/time.h \ + /usr/include/endian.h /usr/include/i386-linux-gnu/bits/endian.h \ + /usr/include/i386-linux-gnu/bits/byteswap.h \ + /usr/include/i386-linux-gnu/sys/select.h \ + /usr/include/i386-linux-gnu/bits/select.h \ + /usr/include/i386-linux-gnu/bits/sigset.h \ + /usr/include/i386-linux-gnu/bits/time.h \ + /usr/include/i386-linux-gnu/sys/sysmacros.h \ + /usr/include/i386-linux-gnu/bits/pthreadtypes.h \ + /usr/include/i386-linux-gnu/sys/stat.h \ + /usr/include/i386-linux-gnu/bits/stat.h /usr/include/stdlib.h \ + /usr/include/i386-linux-gnu/bits/waitflags.h \ + /usr/include/i386-linux-gnu/bits/waitstatus.h /usr/include/alloca.h \ + /usr/include/string.h /usr/include/xlocale.h \ + /usr/include/i386-linux-gnu/bits/string.h \ + /usr/include/i386-linux-gnu/bits/string2.h /usr/include/strings.h \ + /usr/include/inttypes.h /usr/include/unistd.h \ + /usr/include/i386-linux-gnu/bits/posix_opt.h \ + /usr/include/i386-linux-gnu/bits/environments.h \ + /usr/include/i386-linux-gnu/bits/confname.h /usr/include/getopt.h \ + /usr/include/netinet/in.h /usr/include/i386-linux-gnu/sys/socket.h \ + /usr/include/i386-linux-gnu/sys/uio.h \ + /usr/include/i386-linux-gnu/bits/uio.h \ + /usr/include/i386-linux-gnu/bits/socket.h \ + /usr/include/i386-linux-gnu/bits/sockaddr.h \ + /usr/include/i386-linux-gnu/asm/socket.h \ + /usr/include/asm-generic/socket.h \ + /usr/include/i386-linux-gnu/asm/sockios.h \ + /usr/include/asm-generic/sockios.h /usr/include/i386-linux-gnu/bits/in.h \ + /usr/include/netinet/tcp.h /usr/include/arpa/nameser.h \ + /usr/include/i386-linux-gnu/sys/param.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/limits.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/syslimits.h \ + /usr/include/limits.h /usr/include/i386-linux-gnu/bits/posix1_lim.h \ + /usr/include/i386-linux-gnu/bits/local_lim.h /usr/include/linux/limits.h \ + /usr/include/i386-linux-gnu/bits/posix2_lim.h /usr/include/linux/param.h \ + /usr/include/i386-linux-gnu/asm/param.h /usr/include/asm-generic/param.h \ + /usr/include/i386-linux-gnu/sys/bitypes.h \ + /usr/include/arpa/nameser_compat.h /usr/include/netdb.h \ + /usr/include/rpc/netdb.h /usr/include/i386-linux-gnu/bits/netdb.h \ + /usr/include/malloc.h /usr/include/ctype.h include/antlr3interfaces.h \ + include/antlr3convertutf.h include/antlr3exception.h \ + include/antlr3encodings.h include/antlr3string.h \ + include/antlr3collections.h include/antlr3bitset.h include/antlr3input.h \ + include/antlr3commontoken.h include/antlr3intstream.h \ + include/antlr3cyclicdfa.h include/antlr3baserecognizer.h \ + include/antlr3tokenstream.h include/antlr3debugeventlistener.h \ + include/antlr3basetree.h include/antlr3commontreenodestream.h \ + include/antlr3commontreeadaptor.h include/antlr3basetreeadaptor.h \ + include/antlr3commontree.h include/antlr3recognizersharedstate.h \ + include/antlr3lexer.h include/antlr3parser.h include/antlr3treeparser.h \ + include/antlr3filestream.h include/antlr3rewritestreams.h + +include/antlr3.h: + +include/antlr3defs.h: + +include/antlr3errors.h: + +antlr3config.h: + +/usr/include/stdio.h: + +/usr/include/features.h: + +/usr/include/i386-linux-gnu/bits/predefs.h: + +/usr/include/i386-linux-gnu/sys/cdefs.h: + +/usr/include/i386-linux-gnu/bits/wordsize.h: + +/usr/include/i386-linux-gnu/gnu/stubs.h: + +/usr/include/i386-linux-gnu/gnu/stubs-32.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include/stddef.h: + +/usr/include/i386-linux-gnu/bits/types.h: + +/usr/include/i386-linux-gnu/bits/typesizes.h: + +/usr/include/libio.h: + +/usr/include/_G_config.h: + +/usr/include/wchar.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include/stdarg.h: + +/usr/include/i386-linux-gnu/bits/stdio_lim.h: + +/usr/include/i386-linux-gnu/bits/sys_errlist.h: + +/usr/include/i386-linux-gnu/bits/stdio.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include/stdint.h: + +/usr/include/stdint.h: + +/usr/include/i386-linux-gnu/bits/wchar.h: + +/usr/include/i386-linux-gnu/sys/types.h: + +/usr/include/time.h: + +/usr/include/endian.h: + +/usr/include/i386-linux-gnu/bits/endian.h: + +/usr/include/i386-linux-gnu/bits/byteswap.h: + +/usr/include/i386-linux-gnu/sys/select.h: + +/usr/include/i386-linux-gnu/bits/select.h: + +/usr/include/i386-linux-gnu/bits/sigset.h: + +/usr/include/i386-linux-gnu/bits/time.h: + +/usr/include/i386-linux-gnu/sys/sysmacros.h: + +/usr/include/i386-linux-gnu/bits/pthreadtypes.h: + +/usr/include/i386-linux-gnu/sys/stat.h: + +/usr/include/i386-linux-gnu/bits/stat.h: + +/usr/include/stdlib.h: + +/usr/include/i386-linux-gnu/bits/waitflags.h: + +/usr/include/i386-linux-gnu/bits/waitstatus.h: + +/usr/include/alloca.h: + +/usr/include/string.h: + +/usr/include/xlocale.h: + +/usr/include/i386-linux-gnu/bits/string.h: + +/usr/include/i386-linux-gnu/bits/string2.h: + +/usr/include/strings.h: + +/usr/include/inttypes.h: + +/usr/include/unistd.h: + +/usr/include/i386-linux-gnu/bits/posix_opt.h: + +/usr/include/i386-linux-gnu/bits/environments.h: + +/usr/include/i386-linux-gnu/bits/confname.h: + +/usr/include/getopt.h: + +/usr/include/netinet/in.h: + +/usr/include/i386-linux-gnu/sys/socket.h: + +/usr/include/i386-linux-gnu/sys/uio.h: + +/usr/include/i386-linux-gnu/bits/uio.h: + +/usr/include/i386-linux-gnu/bits/socket.h: + +/usr/include/i386-linux-gnu/bits/sockaddr.h: + +/usr/include/i386-linux-gnu/asm/socket.h: + +/usr/include/asm-generic/socket.h: + +/usr/include/i386-linux-gnu/asm/sockios.h: + +/usr/include/asm-generic/sockios.h: + +/usr/include/i386-linux-gnu/bits/in.h: + +/usr/include/netinet/tcp.h: + +/usr/include/arpa/nameser.h: + +/usr/include/i386-linux-gnu/sys/param.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/limits.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/syslimits.h: + +/usr/include/limits.h: + +/usr/include/i386-linux-gnu/bits/posix1_lim.h: + +/usr/include/i386-linux-gnu/bits/local_lim.h: + +/usr/include/linux/limits.h: + +/usr/include/i386-linux-gnu/bits/posix2_lim.h: + +/usr/include/linux/param.h: + +/usr/include/i386-linux-gnu/asm/param.h: + +/usr/include/asm-generic/param.h: + +/usr/include/i386-linux-gnu/sys/bitypes.h: + +/usr/include/arpa/nameser_compat.h: + +/usr/include/netdb.h: + +/usr/include/rpc/netdb.h: + +/usr/include/i386-linux-gnu/bits/netdb.h: + +/usr/include/malloc.h: + +/usr/include/ctype.h: + +include/antlr3interfaces.h: + +include/antlr3convertutf.h: + +include/antlr3exception.h: + +include/antlr3encodings.h: + +include/antlr3string.h: + +include/antlr3collections.h: + +include/antlr3bitset.h: + +include/antlr3input.h: + +include/antlr3commontoken.h: + +include/antlr3intstream.h: + +include/antlr3cyclicdfa.h: + +include/antlr3baserecognizer.h: + +include/antlr3tokenstream.h: + +include/antlr3debugeventlistener.h: + +include/antlr3basetree.h: + +include/antlr3commontreenodestream.h: + +include/antlr3commontreeadaptor.h: + +include/antlr3basetreeadaptor.h: + +include/antlr3commontree.h: + +include/antlr3recognizersharedstate.h: + +include/antlr3lexer.h: + +include/antlr3parser.h: + +include/antlr3treeparser.h: + +include/antlr3filestream.h: + +include/antlr3rewritestreams.h: diff --git a/antlr/libantlr3c-3.4/.deps/antlr3commontree.Plo b/antlr/libantlr3c-3.4/.deps/antlr3commontree.Plo new file mode 100644 index 0000000..eb8ff1b --- /dev/null +++ b/antlr/libantlr3c-3.4/.deps/antlr3commontree.Plo @@ -0,0 +1,242 @@ +antlr3commontree.lo: src/antlr3commontree.c include/antlr3commontree.h \ + include/antlr3defs.h include/antlr3errors.h antlr3config.h \ + /usr/include/stdio.h /usr/include/features.h \ + /usr/include/i386-linux-gnu/bits/predefs.h \ + /usr/include/i386-linux-gnu/sys/cdefs.h \ + /usr/include/i386-linux-gnu/bits/wordsize.h \ + /usr/include/i386-linux-gnu/gnu/stubs.h \ + /usr/include/i386-linux-gnu/gnu/stubs-32.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include/stddef.h \ + /usr/include/i386-linux-gnu/bits/types.h \ + /usr/include/i386-linux-gnu/bits/typesizes.h /usr/include/libio.h \ + /usr/include/_G_config.h /usr/include/wchar.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include/stdarg.h \ + /usr/include/i386-linux-gnu/bits/stdio_lim.h \ + /usr/include/i386-linux-gnu/bits/sys_errlist.h \ + /usr/include/i386-linux-gnu/bits/stdio.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include/stdint.h /usr/include/stdint.h \ + /usr/include/i386-linux-gnu/bits/wchar.h \ + /usr/include/i386-linux-gnu/sys/types.h /usr/include/time.h \ + /usr/include/endian.h /usr/include/i386-linux-gnu/bits/endian.h \ + /usr/include/i386-linux-gnu/bits/byteswap.h \ + /usr/include/i386-linux-gnu/sys/select.h \ + /usr/include/i386-linux-gnu/bits/select.h \ + /usr/include/i386-linux-gnu/bits/sigset.h \ + /usr/include/i386-linux-gnu/bits/time.h \ + /usr/include/i386-linux-gnu/sys/sysmacros.h \ + /usr/include/i386-linux-gnu/bits/pthreadtypes.h \ + /usr/include/i386-linux-gnu/sys/stat.h \ + /usr/include/i386-linux-gnu/bits/stat.h /usr/include/stdlib.h \ + /usr/include/i386-linux-gnu/bits/waitflags.h \ + /usr/include/i386-linux-gnu/bits/waitstatus.h /usr/include/alloca.h \ + /usr/include/string.h /usr/include/xlocale.h \ + /usr/include/i386-linux-gnu/bits/string.h \ + /usr/include/i386-linux-gnu/bits/string2.h /usr/include/strings.h \ + /usr/include/inttypes.h /usr/include/unistd.h \ + /usr/include/i386-linux-gnu/bits/posix_opt.h \ + /usr/include/i386-linux-gnu/bits/environments.h \ + /usr/include/i386-linux-gnu/bits/confname.h /usr/include/getopt.h \ + /usr/include/netinet/in.h /usr/include/i386-linux-gnu/sys/socket.h \ + /usr/include/i386-linux-gnu/sys/uio.h \ + /usr/include/i386-linux-gnu/bits/uio.h \ + /usr/include/i386-linux-gnu/bits/socket.h \ + /usr/include/i386-linux-gnu/bits/sockaddr.h \ + /usr/include/i386-linux-gnu/asm/socket.h \ + /usr/include/asm-generic/socket.h \ + /usr/include/i386-linux-gnu/asm/sockios.h \ + /usr/include/asm-generic/sockios.h /usr/include/i386-linux-gnu/bits/in.h \ + /usr/include/netinet/tcp.h /usr/include/arpa/nameser.h \ + /usr/include/i386-linux-gnu/sys/param.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/limits.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/syslimits.h \ + /usr/include/limits.h /usr/include/i386-linux-gnu/bits/posix1_lim.h \ + /usr/include/i386-linux-gnu/bits/local_lim.h /usr/include/linux/limits.h \ + /usr/include/i386-linux-gnu/bits/posix2_lim.h /usr/include/linux/param.h \ + /usr/include/i386-linux-gnu/asm/param.h /usr/include/asm-generic/param.h \ + /usr/include/i386-linux-gnu/sys/bitypes.h \ + /usr/include/arpa/nameser_compat.h /usr/include/netdb.h \ + /usr/include/rpc/netdb.h /usr/include/i386-linux-gnu/bits/netdb.h \ + /usr/include/malloc.h /usr/include/ctype.h include/antlr3interfaces.h \ + include/antlr3convertutf.h include/antlr3basetree.h \ + include/antlr3collections.h include/antlr3bitset.h \ + include/antlr3string.h include/antlr3commontoken.h + +include/antlr3commontree.h: + +include/antlr3defs.h: + +include/antlr3errors.h: + +antlr3config.h: + +/usr/include/stdio.h: + +/usr/include/features.h: + +/usr/include/i386-linux-gnu/bits/predefs.h: + +/usr/include/i386-linux-gnu/sys/cdefs.h: + +/usr/include/i386-linux-gnu/bits/wordsize.h: + +/usr/include/i386-linux-gnu/gnu/stubs.h: + +/usr/include/i386-linux-gnu/gnu/stubs-32.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include/stddef.h: + +/usr/include/i386-linux-gnu/bits/types.h: + +/usr/include/i386-linux-gnu/bits/typesizes.h: + +/usr/include/libio.h: + +/usr/include/_G_config.h: + +/usr/include/wchar.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include/stdarg.h: + +/usr/include/i386-linux-gnu/bits/stdio_lim.h: + +/usr/include/i386-linux-gnu/bits/sys_errlist.h: + +/usr/include/i386-linux-gnu/bits/stdio.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include/stdint.h: + +/usr/include/stdint.h: + +/usr/include/i386-linux-gnu/bits/wchar.h: + +/usr/include/i386-linux-gnu/sys/types.h: + +/usr/include/time.h: + +/usr/include/endian.h: + +/usr/include/i386-linux-gnu/bits/endian.h: + +/usr/include/i386-linux-gnu/bits/byteswap.h: + +/usr/include/i386-linux-gnu/sys/select.h: + +/usr/include/i386-linux-gnu/bits/select.h: + +/usr/include/i386-linux-gnu/bits/sigset.h: + +/usr/include/i386-linux-gnu/bits/time.h: + +/usr/include/i386-linux-gnu/sys/sysmacros.h: + +/usr/include/i386-linux-gnu/bits/pthreadtypes.h: + +/usr/include/i386-linux-gnu/sys/stat.h: + +/usr/include/i386-linux-gnu/bits/stat.h: + +/usr/include/stdlib.h: + +/usr/include/i386-linux-gnu/bits/waitflags.h: + +/usr/include/i386-linux-gnu/bits/waitstatus.h: + +/usr/include/alloca.h: + +/usr/include/string.h: + +/usr/include/xlocale.h: + +/usr/include/i386-linux-gnu/bits/string.h: + +/usr/include/i386-linux-gnu/bits/string2.h: + +/usr/include/strings.h: + +/usr/include/inttypes.h: + +/usr/include/unistd.h: + +/usr/include/i386-linux-gnu/bits/posix_opt.h: + +/usr/include/i386-linux-gnu/bits/environments.h: + +/usr/include/i386-linux-gnu/bits/confname.h: + +/usr/include/getopt.h: + +/usr/include/netinet/in.h: + +/usr/include/i386-linux-gnu/sys/socket.h: + +/usr/include/i386-linux-gnu/sys/uio.h: + +/usr/include/i386-linux-gnu/bits/uio.h: + +/usr/include/i386-linux-gnu/bits/socket.h: + +/usr/include/i386-linux-gnu/bits/sockaddr.h: + +/usr/include/i386-linux-gnu/asm/socket.h: + +/usr/include/asm-generic/socket.h: + +/usr/include/i386-linux-gnu/asm/sockios.h: + +/usr/include/asm-generic/sockios.h: + +/usr/include/i386-linux-gnu/bits/in.h: + +/usr/include/netinet/tcp.h: + +/usr/include/arpa/nameser.h: + +/usr/include/i386-linux-gnu/sys/param.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/limits.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/syslimits.h: + +/usr/include/limits.h: + +/usr/include/i386-linux-gnu/bits/posix1_lim.h: + +/usr/include/i386-linux-gnu/bits/local_lim.h: + +/usr/include/linux/limits.h: + +/usr/include/i386-linux-gnu/bits/posix2_lim.h: + +/usr/include/linux/param.h: + +/usr/include/i386-linux-gnu/asm/param.h: + +/usr/include/asm-generic/param.h: + +/usr/include/i386-linux-gnu/sys/bitypes.h: + +/usr/include/arpa/nameser_compat.h: + +/usr/include/netdb.h: + +/usr/include/rpc/netdb.h: + +/usr/include/i386-linux-gnu/bits/netdb.h: + +/usr/include/malloc.h: + +/usr/include/ctype.h: + +include/antlr3interfaces.h: + +include/antlr3convertutf.h: + +include/antlr3basetree.h: + +include/antlr3collections.h: + +include/antlr3bitset.h: + +include/antlr3string.h: + +include/antlr3commontoken.h: diff --git a/antlr/libantlr3c-3.4/.deps/antlr3commontreeadaptor.Plo b/antlr/libantlr3c-3.4/.deps/antlr3commontreeadaptor.Plo new file mode 100644 index 0000000..a3defd0 --- /dev/null +++ b/antlr/libantlr3c-3.4/.deps/antlr3commontreeadaptor.Plo @@ -0,0 +1,250 @@ +antlr3commontreeadaptor.lo: src/antlr3commontreeadaptor.c \ + include/antlr3commontreeadaptor.h include/antlr3defs.h \ + include/antlr3errors.h antlr3config.h /usr/include/stdio.h \ + /usr/include/features.h /usr/include/i386-linux-gnu/bits/predefs.h \ + /usr/include/i386-linux-gnu/sys/cdefs.h \ + /usr/include/i386-linux-gnu/bits/wordsize.h \ + /usr/include/i386-linux-gnu/gnu/stubs.h \ + /usr/include/i386-linux-gnu/gnu/stubs-32.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include/stddef.h \ + /usr/include/i386-linux-gnu/bits/types.h \ + /usr/include/i386-linux-gnu/bits/typesizes.h /usr/include/libio.h \ + /usr/include/_G_config.h /usr/include/wchar.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include/stdarg.h \ + /usr/include/i386-linux-gnu/bits/stdio_lim.h \ + /usr/include/i386-linux-gnu/bits/sys_errlist.h \ + /usr/include/i386-linux-gnu/bits/stdio.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include/stdint.h /usr/include/stdint.h \ + /usr/include/i386-linux-gnu/bits/wchar.h \ + /usr/include/i386-linux-gnu/sys/types.h /usr/include/time.h \ + /usr/include/endian.h /usr/include/i386-linux-gnu/bits/endian.h \ + /usr/include/i386-linux-gnu/bits/byteswap.h \ + /usr/include/i386-linux-gnu/sys/select.h \ + /usr/include/i386-linux-gnu/bits/select.h \ + /usr/include/i386-linux-gnu/bits/sigset.h \ + /usr/include/i386-linux-gnu/bits/time.h \ + /usr/include/i386-linux-gnu/sys/sysmacros.h \ + /usr/include/i386-linux-gnu/bits/pthreadtypes.h \ + /usr/include/i386-linux-gnu/sys/stat.h \ + /usr/include/i386-linux-gnu/bits/stat.h /usr/include/stdlib.h \ + /usr/include/i386-linux-gnu/bits/waitflags.h \ + /usr/include/i386-linux-gnu/bits/waitstatus.h /usr/include/alloca.h \ + /usr/include/string.h /usr/include/xlocale.h \ + /usr/include/i386-linux-gnu/bits/string.h \ + /usr/include/i386-linux-gnu/bits/string2.h /usr/include/strings.h \ + /usr/include/inttypes.h /usr/include/unistd.h \ + /usr/include/i386-linux-gnu/bits/posix_opt.h \ + /usr/include/i386-linux-gnu/bits/environments.h \ + /usr/include/i386-linux-gnu/bits/confname.h /usr/include/getopt.h \ + /usr/include/netinet/in.h /usr/include/i386-linux-gnu/sys/socket.h \ + /usr/include/i386-linux-gnu/sys/uio.h \ + /usr/include/i386-linux-gnu/bits/uio.h \ + /usr/include/i386-linux-gnu/bits/socket.h \ + /usr/include/i386-linux-gnu/bits/sockaddr.h \ + /usr/include/i386-linux-gnu/asm/socket.h \ + /usr/include/asm-generic/socket.h \ + /usr/include/i386-linux-gnu/asm/sockios.h \ + /usr/include/asm-generic/sockios.h /usr/include/i386-linux-gnu/bits/in.h \ + /usr/include/netinet/tcp.h /usr/include/arpa/nameser.h \ + /usr/include/i386-linux-gnu/sys/param.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/limits.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/syslimits.h \ + /usr/include/limits.h /usr/include/i386-linux-gnu/bits/posix1_lim.h \ + /usr/include/i386-linux-gnu/bits/local_lim.h /usr/include/linux/limits.h \ + /usr/include/i386-linux-gnu/bits/posix2_lim.h /usr/include/linux/param.h \ + /usr/include/i386-linux-gnu/asm/param.h /usr/include/asm-generic/param.h \ + /usr/include/i386-linux-gnu/sys/bitypes.h \ + /usr/include/arpa/nameser_compat.h /usr/include/netdb.h \ + /usr/include/rpc/netdb.h /usr/include/i386-linux-gnu/bits/netdb.h \ + /usr/include/malloc.h /usr/include/ctype.h include/antlr3interfaces.h \ + include/antlr3convertutf.h include/antlr3collections.h \ + include/antlr3bitset.h include/antlr3string.h \ + include/antlr3basetreeadaptor.h include/antlr3basetree.h \ + include/antlr3commontoken.h include/antlr3debugeventlistener.h \ + include/antlr3commontree.h + +include/antlr3commontreeadaptor.h: + +include/antlr3defs.h: + +include/antlr3errors.h: + +antlr3config.h: + +/usr/include/stdio.h: + +/usr/include/features.h: + +/usr/include/i386-linux-gnu/bits/predefs.h: + +/usr/include/i386-linux-gnu/sys/cdefs.h: + +/usr/include/i386-linux-gnu/bits/wordsize.h: + +/usr/include/i386-linux-gnu/gnu/stubs.h: + +/usr/include/i386-linux-gnu/gnu/stubs-32.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include/stddef.h: + +/usr/include/i386-linux-gnu/bits/types.h: + +/usr/include/i386-linux-gnu/bits/typesizes.h: + +/usr/include/libio.h: + +/usr/include/_G_config.h: + +/usr/include/wchar.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include/stdarg.h: + +/usr/include/i386-linux-gnu/bits/stdio_lim.h: + +/usr/include/i386-linux-gnu/bits/sys_errlist.h: + +/usr/include/i386-linux-gnu/bits/stdio.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include/stdint.h: + +/usr/include/stdint.h: + +/usr/include/i386-linux-gnu/bits/wchar.h: + +/usr/include/i386-linux-gnu/sys/types.h: + +/usr/include/time.h: + +/usr/include/endian.h: + +/usr/include/i386-linux-gnu/bits/endian.h: + +/usr/include/i386-linux-gnu/bits/byteswap.h: + +/usr/include/i386-linux-gnu/sys/select.h: + +/usr/include/i386-linux-gnu/bits/select.h: + +/usr/include/i386-linux-gnu/bits/sigset.h: + +/usr/include/i386-linux-gnu/bits/time.h: + +/usr/include/i386-linux-gnu/sys/sysmacros.h: + +/usr/include/i386-linux-gnu/bits/pthreadtypes.h: + +/usr/include/i386-linux-gnu/sys/stat.h: + +/usr/include/i386-linux-gnu/bits/stat.h: + +/usr/include/stdlib.h: + +/usr/include/i386-linux-gnu/bits/waitflags.h: + +/usr/include/i386-linux-gnu/bits/waitstatus.h: + +/usr/include/alloca.h: + +/usr/include/string.h: + +/usr/include/xlocale.h: + +/usr/include/i386-linux-gnu/bits/string.h: + +/usr/include/i386-linux-gnu/bits/string2.h: + +/usr/include/strings.h: + +/usr/include/inttypes.h: + +/usr/include/unistd.h: + +/usr/include/i386-linux-gnu/bits/posix_opt.h: + +/usr/include/i386-linux-gnu/bits/environments.h: + +/usr/include/i386-linux-gnu/bits/confname.h: + +/usr/include/getopt.h: + +/usr/include/netinet/in.h: + +/usr/include/i386-linux-gnu/sys/socket.h: + +/usr/include/i386-linux-gnu/sys/uio.h: + +/usr/include/i386-linux-gnu/bits/uio.h: + +/usr/include/i386-linux-gnu/bits/socket.h: + +/usr/include/i386-linux-gnu/bits/sockaddr.h: + +/usr/include/i386-linux-gnu/asm/socket.h: + +/usr/include/asm-generic/socket.h: + +/usr/include/i386-linux-gnu/asm/sockios.h: + +/usr/include/asm-generic/sockios.h: + +/usr/include/i386-linux-gnu/bits/in.h: + +/usr/include/netinet/tcp.h: + +/usr/include/arpa/nameser.h: + +/usr/include/i386-linux-gnu/sys/param.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/limits.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/syslimits.h: + +/usr/include/limits.h: + +/usr/include/i386-linux-gnu/bits/posix1_lim.h: + +/usr/include/i386-linux-gnu/bits/local_lim.h: + +/usr/include/linux/limits.h: + +/usr/include/i386-linux-gnu/bits/posix2_lim.h: + +/usr/include/linux/param.h: + +/usr/include/i386-linux-gnu/asm/param.h: + +/usr/include/asm-generic/param.h: + +/usr/include/i386-linux-gnu/sys/bitypes.h: + +/usr/include/arpa/nameser_compat.h: + +/usr/include/netdb.h: + +/usr/include/rpc/netdb.h: + +/usr/include/i386-linux-gnu/bits/netdb.h: + +/usr/include/malloc.h: + +/usr/include/ctype.h: + +include/antlr3interfaces.h: + +include/antlr3convertutf.h: + +include/antlr3collections.h: + +include/antlr3bitset.h: + +include/antlr3string.h: + +include/antlr3basetreeadaptor.h: + +include/antlr3basetree.h: + +include/antlr3commontoken.h: + +include/antlr3debugeventlistener.h: + +include/antlr3commontree.h: diff --git a/antlr/libantlr3c-3.4/.deps/antlr3commontreenodestream.Plo b/antlr/libantlr3c-3.4/.deps/antlr3commontreenodestream.Plo new file mode 100644 index 0000000..52ee66b --- /dev/null +++ b/antlr/libantlr3c-3.4/.deps/antlr3commontreenodestream.Plo @@ -0,0 +1,255 @@ +antlr3commontreenodestream.lo: src/antlr3commontreenodestream.c \ + include/antlr3commontreenodestream.h include/antlr3defs.h \ + include/antlr3errors.h antlr3config.h /usr/include/stdio.h \ + /usr/include/features.h /usr/include/i386-linux-gnu/bits/predefs.h \ + /usr/include/i386-linux-gnu/sys/cdefs.h \ + /usr/include/i386-linux-gnu/bits/wordsize.h \ + /usr/include/i386-linux-gnu/gnu/stubs.h \ + /usr/include/i386-linux-gnu/gnu/stubs-32.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include/stddef.h \ + /usr/include/i386-linux-gnu/bits/types.h \ + /usr/include/i386-linux-gnu/bits/typesizes.h /usr/include/libio.h \ + /usr/include/_G_config.h /usr/include/wchar.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include/stdarg.h \ + /usr/include/i386-linux-gnu/bits/stdio_lim.h \ + /usr/include/i386-linux-gnu/bits/sys_errlist.h \ + /usr/include/i386-linux-gnu/bits/stdio.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include/stdint.h /usr/include/stdint.h \ + /usr/include/i386-linux-gnu/bits/wchar.h \ + /usr/include/i386-linux-gnu/sys/types.h /usr/include/time.h \ + /usr/include/endian.h /usr/include/i386-linux-gnu/bits/endian.h \ + /usr/include/i386-linux-gnu/bits/byteswap.h \ + /usr/include/i386-linux-gnu/sys/select.h \ + /usr/include/i386-linux-gnu/bits/select.h \ + /usr/include/i386-linux-gnu/bits/sigset.h \ + /usr/include/i386-linux-gnu/bits/time.h \ + /usr/include/i386-linux-gnu/sys/sysmacros.h \ + /usr/include/i386-linux-gnu/bits/pthreadtypes.h \ + /usr/include/i386-linux-gnu/sys/stat.h \ + /usr/include/i386-linux-gnu/bits/stat.h /usr/include/stdlib.h \ + /usr/include/i386-linux-gnu/bits/waitflags.h \ + /usr/include/i386-linux-gnu/bits/waitstatus.h /usr/include/alloca.h \ + /usr/include/string.h /usr/include/xlocale.h \ + /usr/include/i386-linux-gnu/bits/string.h \ + /usr/include/i386-linux-gnu/bits/string2.h /usr/include/strings.h \ + /usr/include/inttypes.h /usr/include/unistd.h \ + /usr/include/i386-linux-gnu/bits/posix_opt.h \ + /usr/include/i386-linux-gnu/bits/environments.h \ + /usr/include/i386-linux-gnu/bits/confname.h /usr/include/getopt.h \ + /usr/include/netinet/in.h /usr/include/i386-linux-gnu/sys/socket.h \ + /usr/include/i386-linux-gnu/sys/uio.h \ + /usr/include/i386-linux-gnu/bits/uio.h \ + /usr/include/i386-linux-gnu/bits/socket.h \ + /usr/include/i386-linux-gnu/bits/sockaddr.h \ + /usr/include/i386-linux-gnu/asm/socket.h \ + /usr/include/asm-generic/socket.h \ + /usr/include/i386-linux-gnu/asm/sockios.h \ + /usr/include/asm-generic/sockios.h /usr/include/i386-linux-gnu/bits/in.h \ + /usr/include/netinet/tcp.h /usr/include/arpa/nameser.h \ + /usr/include/i386-linux-gnu/sys/param.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/limits.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/syslimits.h \ + /usr/include/limits.h /usr/include/i386-linux-gnu/bits/posix1_lim.h \ + /usr/include/i386-linux-gnu/bits/local_lim.h /usr/include/linux/limits.h \ + /usr/include/i386-linux-gnu/bits/posix2_lim.h /usr/include/linux/param.h \ + /usr/include/i386-linux-gnu/asm/param.h /usr/include/asm-generic/param.h \ + /usr/include/i386-linux-gnu/sys/bitypes.h \ + /usr/include/arpa/nameser_compat.h /usr/include/netdb.h \ + /usr/include/rpc/netdb.h /usr/include/i386-linux-gnu/bits/netdb.h \ + /usr/include/malloc.h /usr/include/ctype.h include/antlr3interfaces.h \ + include/antlr3convertutf.h include/antlr3commontreeadaptor.h \ + include/antlr3collections.h include/antlr3bitset.h \ + include/antlr3string.h include/antlr3basetreeadaptor.h \ + include/antlr3basetree.h include/antlr3commontoken.h \ + include/antlr3debugeventlistener.h include/antlr3commontree.h \ + include/antlr3intstream.h + +include/antlr3commontreenodestream.h: + +include/antlr3defs.h: + +include/antlr3errors.h: + +antlr3config.h: + +/usr/include/stdio.h: + +/usr/include/features.h: + +/usr/include/i386-linux-gnu/bits/predefs.h: + +/usr/include/i386-linux-gnu/sys/cdefs.h: + +/usr/include/i386-linux-gnu/bits/wordsize.h: + +/usr/include/i386-linux-gnu/gnu/stubs.h: + +/usr/include/i386-linux-gnu/gnu/stubs-32.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include/stddef.h: + +/usr/include/i386-linux-gnu/bits/types.h: + +/usr/include/i386-linux-gnu/bits/typesizes.h: + +/usr/include/libio.h: + +/usr/include/_G_config.h: + +/usr/include/wchar.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include/stdarg.h: + +/usr/include/i386-linux-gnu/bits/stdio_lim.h: + +/usr/include/i386-linux-gnu/bits/sys_errlist.h: + +/usr/include/i386-linux-gnu/bits/stdio.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include/stdint.h: + +/usr/include/stdint.h: + +/usr/include/i386-linux-gnu/bits/wchar.h: + +/usr/include/i386-linux-gnu/sys/types.h: + +/usr/include/time.h: + +/usr/include/endian.h: + +/usr/include/i386-linux-gnu/bits/endian.h: + +/usr/include/i386-linux-gnu/bits/byteswap.h: + +/usr/include/i386-linux-gnu/sys/select.h: + +/usr/include/i386-linux-gnu/bits/select.h: + +/usr/include/i386-linux-gnu/bits/sigset.h: + +/usr/include/i386-linux-gnu/bits/time.h: + +/usr/include/i386-linux-gnu/sys/sysmacros.h: + +/usr/include/i386-linux-gnu/bits/pthreadtypes.h: + +/usr/include/i386-linux-gnu/sys/stat.h: + +/usr/include/i386-linux-gnu/bits/stat.h: + +/usr/include/stdlib.h: + +/usr/include/i386-linux-gnu/bits/waitflags.h: + +/usr/include/i386-linux-gnu/bits/waitstatus.h: + +/usr/include/alloca.h: + +/usr/include/string.h: + +/usr/include/xlocale.h: + +/usr/include/i386-linux-gnu/bits/string.h: + +/usr/include/i386-linux-gnu/bits/string2.h: + +/usr/include/strings.h: + +/usr/include/inttypes.h: + +/usr/include/unistd.h: + +/usr/include/i386-linux-gnu/bits/posix_opt.h: + +/usr/include/i386-linux-gnu/bits/environments.h: + +/usr/include/i386-linux-gnu/bits/confname.h: + +/usr/include/getopt.h: + +/usr/include/netinet/in.h: + +/usr/include/i386-linux-gnu/sys/socket.h: + +/usr/include/i386-linux-gnu/sys/uio.h: + +/usr/include/i386-linux-gnu/bits/uio.h: + +/usr/include/i386-linux-gnu/bits/socket.h: + +/usr/include/i386-linux-gnu/bits/sockaddr.h: + +/usr/include/i386-linux-gnu/asm/socket.h: + +/usr/include/asm-generic/socket.h: + +/usr/include/i386-linux-gnu/asm/sockios.h: + +/usr/include/asm-generic/sockios.h: + +/usr/include/i386-linux-gnu/bits/in.h: + +/usr/include/netinet/tcp.h: + +/usr/include/arpa/nameser.h: + +/usr/include/i386-linux-gnu/sys/param.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/limits.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/syslimits.h: + +/usr/include/limits.h: + +/usr/include/i386-linux-gnu/bits/posix1_lim.h: + +/usr/include/i386-linux-gnu/bits/local_lim.h: + +/usr/include/linux/limits.h: + +/usr/include/i386-linux-gnu/bits/posix2_lim.h: + +/usr/include/linux/param.h: + +/usr/include/i386-linux-gnu/asm/param.h: + +/usr/include/asm-generic/param.h: + +/usr/include/i386-linux-gnu/sys/bitypes.h: + +/usr/include/arpa/nameser_compat.h: + +/usr/include/netdb.h: + +/usr/include/rpc/netdb.h: + +/usr/include/i386-linux-gnu/bits/netdb.h: + +/usr/include/malloc.h: + +/usr/include/ctype.h: + +include/antlr3interfaces.h: + +include/antlr3convertutf.h: + +include/antlr3commontreeadaptor.h: + +include/antlr3collections.h: + +include/antlr3bitset.h: + +include/antlr3string.h: + +include/antlr3basetreeadaptor.h: + +include/antlr3basetree.h: + +include/antlr3commontoken.h: + +include/antlr3debugeventlistener.h: + +include/antlr3commontree.h: + +include/antlr3intstream.h: diff --git a/antlr/libantlr3c-3.4/.deps/antlr3convertutf.Plo b/antlr/libantlr3c-3.4/.deps/antlr3convertutf.Plo new file mode 100644 index 0000000..e04a0b5 --- /dev/null +++ b/antlr/libantlr3c-3.4/.deps/antlr3convertutf.Plo @@ -0,0 +1,227 @@ +antlr3convertutf.lo: src/antlr3convertutf.c include/antlr3convertutf.h \ + include/antlr3defs.h include/antlr3errors.h antlr3config.h \ + /usr/include/stdio.h /usr/include/features.h \ + /usr/include/i386-linux-gnu/bits/predefs.h \ + /usr/include/i386-linux-gnu/sys/cdefs.h \ + /usr/include/i386-linux-gnu/bits/wordsize.h \ + /usr/include/i386-linux-gnu/gnu/stubs.h \ + /usr/include/i386-linux-gnu/gnu/stubs-32.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include/stddef.h \ + /usr/include/i386-linux-gnu/bits/types.h \ + /usr/include/i386-linux-gnu/bits/typesizes.h /usr/include/libio.h \ + /usr/include/_G_config.h /usr/include/wchar.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include/stdarg.h \ + /usr/include/i386-linux-gnu/bits/stdio_lim.h \ + /usr/include/i386-linux-gnu/bits/sys_errlist.h \ + /usr/include/i386-linux-gnu/bits/stdio.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include/stdint.h /usr/include/stdint.h \ + /usr/include/i386-linux-gnu/bits/wchar.h \ + /usr/include/i386-linux-gnu/sys/types.h /usr/include/time.h \ + /usr/include/endian.h /usr/include/i386-linux-gnu/bits/endian.h \ + /usr/include/i386-linux-gnu/bits/byteswap.h \ + /usr/include/i386-linux-gnu/sys/select.h \ + /usr/include/i386-linux-gnu/bits/select.h \ + /usr/include/i386-linux-gnu/bits/sigset.h \ + /usr/include/i386-linux-gnu/bits/time.h \ + /usr/include/i386-linux-gnu/sys/sysmacros.h \ + /usr/include/i386-linux-gnu/bits/pthreadtypes.h \ + /usr/include/i386-linux-gnu/sys/stat.h \ + /usr/include/i386-linux-gnu/bits/stat.h /usr/include/stdlib.h \ + /usr/include/i386-linux-gnu/bits/waitflags.h \ + /usr/include/i386-linux-gnu/bits/waitstatus.h /usr/include/alloca.h \ + /usr/include/string.h /usr/include/xlocale.h \ + /usr/include/i386-linux-gnu/bits/string.h \ + /usr/include/i386-linux-gnu/bits/string2.h /usr/include/strings.h \ + /usr/include/inttypes.h /usr/include/unistd.h \ + /usr/include/i386-linux-gnu/bits/posix_opt.h \ + /usr/include/i386-linux-gnu/bits/environments.h \ + /usr/include/i386-linux-gnu/bits/confname.h /usr/include/getopt.h \ + /usr/include/netinet/in.h /usr/include/i386-linux-gnu/sys/socket.h \ + /usr/include/i386-linux-gnu/sys/uio.h \ + /usr/include/i386-linux-gnu/bits/uio.h \ + /usr/include/i386-linux-gnu/bits/socket.h \ + /usr/include/i386-linux-gnu/bits/sockaddr.h \ + /usr/include/i386-linux-gnu/asm/socket.h \ + /usr/include/asm-generic/socket.h \ + /usr/include/i386-linux-gnu/asm/sockios.h \ + /usr/include/asm-generic/sockios.h /usr/include/i386-linux-gnu/bits/in.h \ + /usr/include/netinet/tcp.h /usr/include/arpa/nameser.h \ + /usr/include/i386-linux-gnu/sys/param.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/limits.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/syslimits.h \ + /usr/include/limits.h /usr/include/i386-linux-gnu/bits/posix1_lim.h \ + /usr/include/i386-linux-gnu/bits/local_lim.h /usr/include/linux/limits.h \ + /usr/include/i386-linux-gnu/bits/posix2_lim.h /usr/include/linux/param.h \ + /usr/include/i386-linux-gnu/asm/param.h /usr/include/asm-generic/param.h \ + /usr/include/i386-linux-gnu/sys/bitypes.h \ + /usr/include/arpa/nameser_compat.h /usr/include/netdb.h \ + /usr/include/rpc/netdb.h /usr/include/i386-linux-gnu/bits/netdb.h \ + /usr/include/malloc.h /usr/include/ctype.h include/antlr3interfaces.h + +include/antlr3convertutf.h: + +include/antlr3defs.h: + +include/antlr3errors.h: + +antlr3config.h: + +/usr/include/stdio.h: + +/usr/include/features.h: + +/usr/include/i386-linux-gnu/bits/predefs.h: + +/usr/include/i386-linux-gnu/sys/cdefs.h: + +/usr/include/i386-linux-gnu/bits/wordsize.h: + +/usr/include/i386-linux-gnu/gnu/stubs.h: + +/usr/include/i386-linux-gnu/gnu/stubs-32.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include/stddef.h: + +/usr/include/i386-linux-gnu/bits/types.h: + +/usr/include/i386-linux-gnu/bits/typesizes.h: + +/usr/include/libio.h: + +/usr/include/_G_config.h: + +/usr/include/wchar.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include/stdarg.h: + +/usr/include/i386-linux-gnu/bits/stdio_lim.h: + +/usr/include/i386-linux-gnu/bits/sys_errlist.h: + +/usr/include/i386-linux-gnu/bits/stdio.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include/stdint.h: + +/usr/include/stdint.h: + +/usr/include/i386-linux-gnu/bits/wchar.h: + +/usr/include/i386-linux-gnu/sys/types.h: + +/usr/include/time.h: + +/usr/include/endian.h: + +/usr/include/i386-linux-gnu/bits/endian.h: + +/usr/include/i386-linux-gnu/bits/byteswap.h: + +/usr/include/i386-linux-gnu/sys/select.h: + +/usr/include/i386-linux-gnu/bits/select.h: + +/usr/include/i386-linux-gnu/bits/sigset.h: + +/usr/include/i386-linux-gnu/bits/time.h: + +/usr/include/i386-linux-gnu/sys/sysmacros.h: + +/usr/include/i386-linux-gnu/bits/pthreadtypes.h: + +/usr/include/i386-linux-gnu/sys/stat.h: + +/usr/include/i386-linux-gnu/bits/stat.h: + +/usr/include/stdlib.h: + +/usr/include/i386-linux-gnu/bits/waitflags.h: + +/usr/include/i386-linux-gnu/bits/waitstatus.h: + +/usr/include/alloca.h: + +/usr/include/string.h: + +/usr/include/xlocale.h: + +/usr/include/i386-linux-gnu/bits/string.h: + +/usr/include/i386-linux-gnu/bits/string2.h: + +/usr/include/strings.h: + +/usr/include/inttypes.h: + +/usr/include/unistd.h: + +/usr/include/i386-linux-gnu/bits/posix_opt.h: + +/usr/include/i386-linux-gnu/bits/environments.h: + +/usr/include/i386-linux-gnu/bits/confname.h: + +/usr/include/getopt.h: + +/usr/include/netinet/in.h: + +/usr/include/i386-linux-gnu/sys/socket.h: + +/usr/include/i386-linux-gnu/sys/uio.h: + +/usr/include/i386-linux-gnu/bits/uio.h: + +/usr/include/i386-linux-gnu/bits/socket.h: + +/usr/include/i386-linux-gnu/bits/sockaddr.h: + +/usr/include/i386-linux-gnu/asm/socket.h: + +/usr/include/asm-generic/socket.h: + +/usr/include/i386-linux-gnu/asm/sockios.h: + +/usr/include/asm-generic/sockios.h: + +/usr/include/i386-linux-gnu/bits/in.h: + +/usr/include/netinet/tcp.h: + +/usr/include/arpa/nameser.h: + +/usr/include/i386-linux-gnu/sys/param.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/limits.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/syslimits.h: + +/usr/include/limits.h: + +/usr/include/i386-linux-gnu/bits/posix1_lim.h: + +/usr/include/i386-linux-gnu/bits/local_lim.h: + +/usr/include/linux/limits.h: + +/usr/include/i386-linux-gnu/bits/posix2_lim.h: + +/usr/include/linux/param.h: + +/usr/include/i386-linux-gnu/asm/param.h: + +/usr/include/asm-generic/param.h: + +/usr/include/i386-linux-gnu/sys/bitypes.h: + +/usr/include/arpa/nameser_compat.h: + +/usr/include/netdb.h: + +/usr/include/rpc/netdb.h: + +/usr/include/i386-linux-gnu/bits/netdb.h: + +/usr/include/malloc.h: + +/usr/include/ctype.h: + +include/antlr3interfaces.h: diff --git a/antlr/libantlr3c-3.4/.deps/antlr3cyclicdfa.Plo b/antlr/libantlr3c-3.4/.deps/antlr3cyclicdfa.Plo new file mode 100644 index 0000000..4e7be8d --- /dev/null +++ b/antlr/libantlr3c-3.4/.deps/antlr3cyclicdfa.Plo @@ -0,0 +1,276 @@ +antlr3cyclicdfa.lo: src/antlr3cyclicdfa.c include/antlr3defs.h \ + include/antlr3errors.h antlr3config.h /usr/include/stdio.h \ + /usr/include/features.h /usr/include/i386-linux-gnu/bits/predefs.h \ + /usr/include/i386-linux-gnu/sys/cdefs.h \ + /usr/include/i386-linux-gnu/bits/wordsize.h \ + /usr/include/i386-linux-gnu/gnu/stubs.h \ + /usr/include/i386-linux-gnu/gnu/stubs-32.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include/stddef.h \ + /usr/include/i386-linux-gnu/bits/types.h \ + /usr/include/i386-linux-gnu/bits/typesizes.h /usr/include/libio.h \ + /usr/include/_G_config.h /usr/include/wchar.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include/stdarg.h \ + /usr/include/i386-linux-gnu/bits/stdio_lim.h \ + /usr/include/i386-linux-gnu/bits/sys_errlist.h \ + /usr/include/i386-linux-gnu/bits/stdio.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include/stdint.h /usr/include/stdint.h \ + /usr/include/i386-linux-gnu/bits/wchar.h \ + /usr/include/i386-linux-gnu/sys/types.h /usr/include/time.h \ + /usr/include/endian.h /usr/include/i386-linux-gnu/bits/endian.h \ + /usr/include/i386-linux-gnu/bits/byteswap.h \ + /usr/include/i386-linux-gnu/sys/select.h \ + /usr/include/i386-linux-gnu/bits/select.h \ + /usr/include/i386-linux-gnu/bits/sigset.h \ + /usr/include/i386-linux-gnu/bits/time.h \ + /usr/include/i386-linux-gnu/sys/sysmacros.h \ + /usr/include/i386-linux-gnu/bits/pthreadtypes.h \ + /usr/include/i386-linux-gnu/sys/stat.h \ + /usr/include/i386-linux-gnu/bits/stat.h /usr/include/stdlib.h \ + /usr/include/i386-linux-gnu/bits/waitflags.h \ + /usr/include/i386-linux-gnu/bits/waitstatus.h /usr/include/alloca.h \ + /usr/include/string.h /usr/include/xlocale.h \ + /usr/include/i386-linux-gnu/bits/string.h \ + /usr/include/i386-linux-gnu/bits/string2.h /usr/include/strings.h \ + /usr/include/inttypes.h /usr/include/unistd.h \ + /usr/include/i386-linux-gnu/bits/posix_opt.h \ + /usr/include/i386-linux-gnu/bits/environments.h \ + /usr/include/i386-linux-gnu/bits/confname.h /usr/include/getopt.h \ + /usr/include/netinet/in.h /usr/include/i386-linux-gnu/sys/socket.h \ + /usr/include/i386-linux-gnu/sys/uio.h \ + /usr/include/i386-linux-gnu/bits/uio.h \ + /usr/include/i386-linux-gnu/bits/socket.h \ + /usr/include/i386-linux-gnu/bits/sockaddr.h \ + /usr/include/i386-linux-gnu/asm/socket.h \ + /usr/include/asm-generic/socket.h \ + /usr/include/i386-linux-gnu/asm/sockios.h \ + /usr/include/asm-generic/sockios.h /usr/include/i386-linux-gnu/bits/in.h \ + /usr/include/netinet/tcp.h /usr/include/arpa/nameser.h \ + /usr/include/i386-linux-gnu/sys/param.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/limits.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/syslimits.h \ + /usr/include/limits.h /usr/include/i386-linux-gnu/bits/posix1_lim.h \ + /usr/include/i386-linux-gnu/bits/local_lim.h /usr/include/linux/limits.h \ + /usr/include/i386-linux-gnu/bits/posix2_lim.h /usr/include/linux/param.h \ + /usr/include/i386-linux-gnu/asm/param.h /usr/include/asm-generic/param.h \ + /usr/include/i386-linux-gnu/sys/bitypes.h \ + /usr/include/arpa/nameser_compat.h /usr/include/netdb.h \ + /usr/include/rpc/netdb.h /usr/include/i386-linux-gnu/bits/netdb.h \ + /usr/include/malloc.h /usr/include/ctype.h include/antlr3interfaces.h \ + include/antlr3convertutf.h include/antlr3cyclicdfa.h \ + include/antlr3baserecognizer.h include/antlr3exception.h \ + include/antlr3input.h include/antlr3string.h include/antlr3collections.h \ + include/antlr3bitset.h include/antlr3commontoken.h \ + include/antlr3intstream.h include/antlr3tokenstream.h \ + include/antlr3debugeventlistener.h include/antlr3basetree.h \ + include/antlr3commontreenodestream.h include/antlr3commontreeadaptor.h \ + include/antlr3basetreeadaptor.h include/antlr3commontree.h \ + include/antlr3recognizersharedstate.h include/antlr3lexer.h \ + include/antlr3parser.h include/antlr3treeparser.h + +include/antlr3defs.h: + +include/antlr3errors.h: + +antlr3config.h: + +/usr/include/stdio.h: + +/usr/include/features.h: + +/usr/include/i386-linux-gnu/bits/predefs.h: + +/usr/include/i386-linux-gnu/sys/cdefs.h: + +/usr/include/i386-linux-gnu/bits/wordsize.h: + +/usr/include/i386-linux-gnu/gnu/stubs.h: + +/usr/include/i386-linux-gnu/gnu/stubs-32.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include/stddef.h: + +/usr/include/i386-linux-gnu/bits/types.h: + +/usr/include/i386-linux-gnu/bits/typesizes.h: + +/usr/include/libio.h: + +/usr/include/_G_config.h: + +/usr/include/wchar.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include/stdarg.h: + +/usr/include/i386-linux-gnu/bits/stdio_lim.h: + +/usr/include/i386-linux-gnu/bits/sys_errlist.h: + +/usr/include/i386-linux-gnu/bits/stdio.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include/stdint.h: + +/usr/include/stdint.h: + +/usr/include/i386-linux-gnu/bits/wchar.h: + +/usr/include/i386-linux-gnu/sys/types.h: + +/usr/include/time.h: + +/usr/include/endian.h: + +/usr/include/i386-linux-gnu/bits/endian.h: + +/usr/include/i386-linux-gnu/bits/byteswap.h: + +/usr/include/i386-linux-gnu/sys/select.h: + +/usr/include/i386-linux-gnu/bits/select.h: + +/usr/include/i386-linux-gnu/bits/sigset.h: + +/usr/include/i386-linux-gnu/bits/time.h: + +/usr/include/i386-linux-gnu/sys/sysmacros.h: + +/usr/include/i386-linux-gnu/bits/pthreadtypes.h: + +/usr/include/i386-linux-gnu/sys/stat.h: + +/usr/include/i386-linux-gnu/bits/stat.h: + +/usr/include/stdlib.h: + +/usr/include/i386-linux-gnu/bits/waitflags.h: + +/usr/include/i386-linux-gnu/bits/waitstatus.h: + +/usr/include/alloca.h: + +/usr/include/string.h: + +/usr/include/xlocale.h: + +/usr/include/i386-linux-gnu/bits/string.h: + +/usr/include/i386-linux-gnu/bits/string2.h: + +/usr/include/strings.h: + +/usr/include/inttypes.h: + +/usr/include/unistd.h: + +/usr/include/i386-linux-gnu/bits/posix_opt.h: + +/usr/include/i386-linux-gnu/bits/environments.h: + +/usr/include/i386-linux-gnu/bits/confname.h: + +/usr/include/getopt.h: + +/usr/include/netinet/in.h: + +/usr/include/i386-linux-gnu/sys/socket.h: + +/usr/include/i386-linux-gnu/sys/uio.h: + +/usr/include/i386-linux-gnu/bits/uio.h: + +/usr/include/i386-linux-gnu/bits/socket.h: + +/usr/include/i386-linux-gnu/bits/sockaddr.h: + +/usr/include/i386-linux-gnu/asm/socket.h: + +/usr/include/asm-generic/socket.h: + +/usr/include/i386-linux-gnu/asm/sockios.h: + +/usr/include/asm-generic/sockios.h: + +/usr/include/i386-linux-gnu/bits/in.h: + +/usr/include/netinet/tcp.h: + +/usr/include/arpa/nameser.h: + +/usr/include/i386-linux-gnu/sys/param.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/limits.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/syslimits.h: + +/usr/include/limits.h: + +/usr/include/i386-linux-gnu/bits/posix1_lim.h: + +/usr/include/i386-linux-gnu/bits/local_lim.h: + +/usr/include/linux/limits.h: + +/usr/include/i386-linux-gnu/bits/posix2_lim.h: + +/usr/include/linux/param.h: + +/usr/include/i386-linux-gnu/asm/param.h: + +/usr/include/asm-generic/param.h: + +/usr/include/i386-linux-gnu/sys/bitypes.h: + +/usr/include/arpa/nameser_compat.h: + +/usr/include/netdb.h: + +/usr/include/rpc/netdb.h: + +/usr/include/i386-linux-gnu/bits/netdb.h: + +/usr/include/malloc.h: + +/usr/include/ctype.h: + +include/antlr3interfaces.h: + +include/antlr3convertutf.h: + +include/antlr3cyclicdfa.h: + +include/antlr3baserecognizer.h: + +include/antlr3exception.h: + +include/antlr3input.h: + +include/antlr3string.h: + +include/antlr3collections.h: + +include/antlr3bitset.h: + +include/antlr3commontoken.h: + +include/antlr3intstream.h: + +include/antlr3tokenstream.h: + +include/antlr3debugeventlistener.h: + +include/antlr3basetree.h: + +include/antlr3commontreenodestream.h: + +include/antlr3commontreeadaptor.h: + +include/antlr3basetreeadaptor.h: + +include/antlr3commontree.h: + +include/antlr3recognizersharedstate.h: + +include/antlr3lexer.h: + +include/antlr3parser.h: + +include/antlr3treeparser.h: diff --git a/antlr/libantlr3c-3.4/.deps/antlr3debughandlers.Plo b/antlr/libantlr3c-3.4/.deps/antlr3debughandlers.Plo new file mode 100644 index 0000000..6568abc --- /dev/null +++ b/antlr/libantlr3c-3.4/.deps/antlr3debughandlers.Plo @@ -0,0 +1,286 @@ +antlr3debughandlers.lo: src/antlr3debughandlers.c include/antlr3.h \ + include/antlr3defs.h include/antlr3errors.h antlr3config.h \ + /usr/include/stdio.h /usr/include/features.h \ + /usr/include/i386-linux-gnu/bits/predefs.h \ + /usr/include/i386-linux-gnu/sys/cdefs.h \ + /usr/include/i386-linux-gnu/bits/wordsize.h \ + /usr/include/i386-linux-gnu/gnu/stubs.h \ + /usr/include/i386-linux-gnu/gnu/stubs-32.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include/stddef.h \ + /usr/include/i386-linux-gnu/bits/types.h \ + /usr/include/i386-linux-gnu/bits/typesizes.h /usr/include/libio.h \ + /usr/include/_G_config.h /usr/include/wchar.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include/stdarg.h \ + /usr/include/i386-linux-gnu/bits/stdio_lim.h \ + /usr/include/i386-linux-gnu/bits/sys_errlist.h \ + /usr/include/i386-linux-gnu/bits/stdio.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include/stdint.h /usr/include/stdint.h \ + /usr/include/i386-linux-gnu/bits/wchar.h \ + /usr/include/i386-linux-gnu/sys/types.h /usr/include/time.h \ + /usr/include/endian.h /usr/include/i386-linux-gnu/bits/endian.h \ + /usr/include/i386-linux-gnu/bits/byteswap.h \ + /usr/include/i386-linux-gnu/sys/select.h \ + /usr/include/i386-linux-gnu/bits/select.h \ + /usr/include/i386-linux-gnu/bits/sigset.h \ + /usr/include/i386-linux-gnu/bits/time.h \ + /usr/include/i386-linux-gnu/sys/sysmacros.h \ + /usr/include/i386-linux-gnu/bits/pthreadtypes.h \ + /usr/include/i386-linux-gnu/sys/stat.h \ + /usr/include/i386-linux-gnu/bits/stat.h /usr/include/stdlib.h \ + /usr/include/i386-linux-gnu/bits/waitflags.h \ + /usr/include/i386-linux-gnu/bits/waitstatus.h /usr/include/alloca.h \ + /usr/include/string.h /usr/include/xlocale.h \ + /usr/include/i386-linux-gnu/bits/string.h \ + /usr/include/i386-linux-gnu/bits/string2.h /usr/include/strings.h \ + /usr/include/inttypes.h /usr/include/unistd.h \ + /usr/include/i386-linux-gnu/bits/posix_opt.h \ + /usr/include/i386-linux-gnu/bits/environments.h \ + /usr/include/i386-linux-gnu/bits/confname.h /usr/include/getopt.h \ + /usr/include/netinet/in.h /usr/include/i386-linux-gnu/sys/socket.h \ + /usr/include/i386-linux-gnu/sys/uio.h \ + /usr/include/i386-linux-gnu/bits/uio.h \ + /usr/include/i386-linux-gnu/bits/socket.h \ + /usr/include/i386-linux-gnu/bits/sockaddr.h \ + /usr/include/i386-linux-gnu/asm/socket.h \ + /usr/include/asm-generic/socket.h \ + /usr/include/i386-linux-gnu/asm/sockios.h \ + /usr/include/asm-generic/sockios.h /usr/include/i386-linux-gnu/bits/in.h \ + /usr/include/netinet/tcp.h /usr/include/arpa/nameser.h \ + /usr/include/i386-linux-gnu/sys/param.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/limits.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/syslimits.h \ + /usr/include/limits.h /usr/include/i386-linux-gnu/bits/posix1_lim.h \ + /usr/include/i386-linux-gnu/bits/local_lim.h /usr/include/linux/limits.h \ + /usr/include/i386-linux-gnu/bits/posix2_lim.h /usr/include/linux/param.h \ + /usr/include/i386-linux-gnu/asm/param.h /usr/include/asm-generic/param.h \ + /usr/include/i386-linux-gnu/sys/bitypes.h \ + /usr/include/arpa/nameser_compat.h /usr/include/netdb.h \ + /usr/include/rpc/netdb.h /usr/include/i386-linux-gnu/bits/netdb.h \ + /usr/include/malloc.h /usr/include/ctype.h include/antlr3interfaces.h \ + include/antlr3convertutf.h include/antlr3exception.h \ + include/antlr3encodings.h include/antlr3string.h \ + include/antlr3collections.h include/antlr3bitset.h include/antlr3input.h \ + include/antlr3commontoken.h include/antlr3intstream.h \ + include/antlr3cyclicdfa.h include/antlr3baserecognizer.h \ + include/antlr3tokenstream.h include/antlr3debugeventlistener.h \ + include/antlr3basetree.h include/antlr3commontreenodestream.h \ + include/antlr3commontreeadaptor.h include/antlr3basetreeadaptor.h \ + include/antlr3commontree.h include/antlr3recognizersharedstate.h \ + include/antlr3lexer.h include/antlr3parser.h include/antlr3treeparser.h \ + include/antlr3filestream.h include/antlr3rewritestreams.h + +include/antlr3.h: + +include/antlr3defs.h: + +include/antlr3errors.h: + +antlr3config.h: + +/usr/include/stdio.h: + +/usr/include/features.h: + +/usr/include/i386-linux-gnu/bits/predefs.h: + +/usr/include/i386-linux-gnu/sys/cdefs.h: + +/usr/include/i386-linux-gnu/bits/wordsize.h: + +/usr/include/i386-linux-gnu/gnu/stubs.h: + +/usr/include/i386-linux-gnu/gnu/stubs-32.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include/stddef.h: + +/usr/include/i386-linux-gnu/bits/types.h: + +/usr/include/i386-linux-gnu/bits/typesizes.h: + +/usr/include/libio.h: + +/usr/include/_G_config.h: + +/usr/include/wchar.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include/stdarg.h: + +/usr/include/i386-linux-gnu/bits/stdio_lim.h: + +/usr/include/i386-linux-gnu/bits/sys_errlist.h: + +/usr/include/i386-linux-gnu/bits/stdio.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include/stdint.h: + +/usr/include/stdint.h: + +/usr/include/i386-linux-gnu/bits/wchar.h: + +/usr/include/i386-linux-gnu/sys/types.h: + +/usr/include/time.h: + +/usr/include/endian.h: + +/usr/include/i386-linux-gnu/bits/endian.h: + +/usr/include/i386-linux-gnu/bits/byteswap.h: + +/usr/include/i386-linux-gnu/sys/select.h: + +/usr/include/i386-linux-gnu/bits/select.h: + +/usr/include/i386-linux-gnu/bits/sigset.h: + +/usr/include/i386-linux-gnu/bits/time.h: + +/usr/include/i386-linux-gnu/sys/sysmacros.h: + +/usr/include/i386-linux-gnu/bits/pthreadtypes.h: + +/usr/include/i386-linux-gnu/sys/stat.h: + +/usr/include/i386-linux-gnu/bits/stat.h: + +/usr/include/stdlib.h: + +/usr/include/i386-linux-gnu/bits/waitflags.h: + +/usr/include/i386-linux-gnu/bits/waitstatus.h: + +/usr/include/alloca.h: + +/usr/include/string.h: + +/usr/include/xlocale.h: + +/usr/include/i386-linux-gnu/bits/string.h: + +/usr/include/i386-linux-gnu/bits/string2.h: + +/usr/include/strings.h: + +/usr/include/inttypes.h: + +/usr/include/unistd.h: + +/usr/include/i386-linux-gnu/bits/posix_opt.h: + +/usr/include/i386-linux-gnu/bits/environments.h: + +/usr/include/i386-linux-gnu/bits/confname.h: + +/usr/include/getopt.h: + +/usr/include/netinet/in.h: + +/usr/include/i386-linux-gnu/sys/socket.h: + +/usr/include/i386-linux-gnu/sys/uio.h: + +/usr/include/i386-linux-gnu/bits/uio.h: + +/usr/include/i386-linux-gnu/bits/socket.h: + +/usr/include/i386-linux-gnu/bits/sockaddr.h: + +/usr/include/i386-linux-gnu/asm/socket.h: + +/usr/include/asm-generic/socket.h: + +/usr/include/i386-linux-gnu/asm/sockios.h: + +/usr/include/asm-generic/sockios.h: + +/usr/include/i386-linux-gnu/bits/in.h: + +/usr/include/netinet/tcp.h: + +/usr/include/arpa/nameser.h: + +/usr/include/i386-linux-gnu/sys/param.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/limits.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/syslimits.h: + +/usr/include/limits.h: + +/usr/include/i386-linux-gnu/bits/posix1_lim.h: + +/usr/include/i386-linux-gnu/bits/local_lim.h: + +/usr/include/linux/limits.h: + +/usr/include/i386-linux-gnu/bits/posix2_lim.h: + +/usr/include/linux/param.h: + +/usr/include/i386-linux-gnu/asm/param.h: + +/usr/include/asm-generic/param.h: + +/usr/include/i386-linux-gnu/sys/bitypes.h: + +/usr/include/arpa/nameser_compat.h: + +/usr/include/netdb.h: + +/usr/include/rpc/netdb.h: + +/usr/include/i386-linux-gnu/bits/netdb.h: + +/usr/include/malloc.h: + +/usr/include/ctype.h: + +include/antlr3interfaces.h: + +include/antlr3convertutf.h: + +include/antlr3exception.h: + +include/antlr3encodings.h: + +include/antlr3string.h: + +include/antlr3collections.h: + +include/antlr3bitset.h: + +include/antlr3input.h: + +include/antlr3commontoken.h: + +include/antlr3intstream.h: + +include/antlr3cyclicdfa.h: + +include/antlr3baserecognizer.h: + +include/antlr3tokenstream.h: + +include/antlr3debugeventlistener.h: + +include/antlr3basetree.h: + +include/antlr3commontreenodestream.h: + +include/antlr3commontreeadaptor.h: + +include/antlr3basetreeadaptor.h: + +include/antlr3commontree.h: + +include/antlr3recognizersharedstate.h: + +include/antlr3lexer.h: + +include/antlr3parser.h: + +include/antlr3treeparser.h: + +include/antlr3filestream.h: + +include/antlr3rewritestreams.h: diff --git a/antlr/libantlr3c-3.4/.deps/antlr3encodings.Plo b/antlr/libantlr3c-3.4/.deps/antlr3encodings.Plo new file mode 100644 index 0000000..7261a24 --- /dev/null +++ b/antlr/libantlr3c-3.4/.deps/antlr3encodings.Plo @@ -0,0 +1,286 @@ +antlr3encodings.lo: src/antlr3encodings.c include/antlr3.h \ + include/antlr3defs.h include/antlr3errors.h antlr3config.h \ + /usr/include/stdio.h /usr/include/features.h \ + /usr/include/i386-linux-gnu/bits/predefs.h \ + /usr/include/i386-linux-gnu/sys/cdefs.h \ + /usr/include/i386-linux-gnu/bits/wordsize.h \ + /usr/include/i386-linux-gnu/gnu/stubs.h \ + /usr/include/i386-linux-gnu/gnu/stubs-32.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include/stddef.h \ + /usr/include/i386-linux-gnu/bits/types.h \ + /usr/include/i386-linux-gnu/bits/typesizes.h /usr/include/libio.h \ + /usr/include/_G_config.h /usr/include/wchar.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include/stdarg.h \ + /usr/include/i386-linux-gnu/bits/stdio_lim.h \ + /usr/include/i386-linux-gnu/bits/sys_errlist.h \ + /usr/include/i386-linux-gnu/bits/stdio.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include/stdint.h /usr/include/stdint.h \ + /usr/include/i386-linux-gnu/bits/wchar.h \ + /usr/include/i386-linux-gnu/sys/types.h /usr/include/time.h \ + /usr/include/endian.h /usr/include/i386-linux-gnu/bits/endian.h \ + /usr/include/i386-linux-gnu/bits/byteswap.h \ + /usr/include/i386-linux-gnu/sys/select.h \ + /usr/include/i386-linux-gnu/bits/select.h \ + /usr/include/i386-linux-gnu/bits/sigset.h \ + /usr/include/i386-linux-gnu/bits/time.h \ + /usr/include/i386-linux-gnu/sys/sysmacros.h \ + /usr/include/i386-linux-gnu/bits/pthreadtypes.h \ + /usr/include/i386-linux-gnu/sys/stat.h \ + /usr/include/i386-linux-gnu/bits/stat.h /usr/include/stdlib.h \ + /usr/include/i386-linux-gnu/bits/waitflags.h \ + /usr/include/i386-linux-gnu/bits/waitstatus.h /usr/include/alloca.h \ + /usr/include/string.h /usr/include/xlocale.h \ + /usr/include/i386-linux-gnu/bits/string.h \ + /usr/include/i386-linux-gnu/bits/string2.h /usr/include/strings.h \ + /usr/include/inttypes.h /usr/include/unistd.h \ + /usr/include/i386-linux-gnu/bits/posix_opt.h \ + /usr/include/i386-linux-gnu/bits/environments.h \ + /usr/include/i386-linux-gnu/bits/confname.h /usr/include/getopt.h \ + /usr/include/netinet/in.h /usr/include/i386-linux-gnu/sys/socket.h \ + /usr/include/i386-linux-gnu/sys/uio.h \ + /usr/include/i386-linux-gnu/bits/uio.h \ + /usr/include/i386-linux-gnu/bits/socket.h \ + /usr/include/i386-linux-gnu/bits/sockaddr.h \ + /usr/include/i386-linux-gnu/asm/socket.h \ + /usr/include/asm-generic/socket.h \ + /usr/include/i386-linux-gnu/asm/sockios.h \ + /usr/include/asm-generic/sockios.h /usr/include/i386-linux-gnu/bits/in.h \ + /usr/include/netinet/tcp.h /usr/include/arpa/nameser.h \ + /usr/include/i386-linux-gnu/sys/param.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/limits.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/syslimits.h \ + /usr/include/limits.h /usr/include/i386-linux-gnu/bits/posix1_lim.h \ + /usr/include/i386-linux-gnu/bits/local_lim.h /usr/include/linux/limits.h \ + /usr/include/i386-linux-gnu/bits/posix2_lim.h /usr/include/linux/param.h \ + /usr/include/i386-linux-gnu/asm/param.h /usr/include/asm-generic/param.h \ + /usr/include/i386-linux-gnu/sys/bitypes.h \ + /usr/include/arpa/nameser_compat.h /usr/include/netdb.h \ + /usr/include/rpc/netdb.h /usr/include/i386-linux-gnu/bits/netdb.h \ + /usr/include/malloc.h /usr/include/ctype.h include/antlr3interfaces.h \ + include/antlr3convertutf.h include/antlr3exception.h \ + include/antlr3encodings.h include/antlr3string.h \ + include/antlr3collections.h include/antlr3bitset.h include/antlr3input.h \ + include/antlr3commontoken.h include/antlr3intstream.h \ + include/antlr3cyclicdfa.h include/antlr3baserecognizer.h \ + include/antlr3tokenstream.h include/antlr3debugeventlistener.h \ + include/antlr3basetree.h include/antlr3commontreenodestream.h \ + include/antlr3commontreeadaptor.h include/antlr3basetreeadaptor.h \ + include/antlr3commontree.h include/antlr3recognizersharedstate.h \ + include/antlr3lexer.h include/antlr3parser.h include/antlr3treeparser.h \ + include/antlr3filestream.h include/antlr3rewritestreams.h + +include/antlr3.h: + +include/antlr3defs.h: + +include/antlr3errors.h: + +antlr3config.h: + +/usr/include/stdio.h: + +/usr/include/features.h: + +/usr/include/i386-linux-gnu/bits/predefs.h: + +/usr/include/i386-linux-gnu/sys/cdefs.h: + +/usr/include/i386-linux-gnu/bits/wordsize.h: + +/usr/include/i386-linux-gnu/gnu/stubs.h: + +/usr/include/i386-linux-gnu/gnu/stubs-32.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include/stddef.h: + +/usr/include/i386-linux-gnu/bits/types.h: + +/usr/include/i386-linux-gnu/bits/typesizes.h: + +/usr/include/libio.h: + +/usr/include/_G_config.h: + +/usr/include/wchar.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include/stdarg.h: + +/usr/include/i386-linux-gnu/bits/stdio_lim.h: + +/usr/include/i386-linux-gnu/bits/sys_errlist.h: + +/usr/include/i386-linux-gnu/bits/stdio.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include/stdint.h: + +/usr/include/stdint.h: + +/usr/include/i386-linux-gnu/bits/wchar.h: + +/usr/include/i386-linux-gnu/sys/types.h: + +/usr/include/time.h: + +/usr/include/endian.h: + +/usr/include/i386-linux-gnu/bits/endian.h: + +/usr/include/i386-linux-gnu/bits/byteswap.h: + +/usr/include/i386-linux-gnu/sys/select.h: + +/usr/include/i386-linux-gnu/bits/select.h: + +/usr/include/i386-linux-gnu/bits/sigset.h: + +/usr/include/i386-linux-gnu/bits/time.h: + +/usr/include/i386-linux-gnu/sys/sysmacros.h: + +/usr/include/i386-linux-gnu/bits/pthreadtypes.h: + +/usr/include/i386-linux-gnu/sys/stat.h: + +/usr/include/i386-linux-gnu/bits/stat.h: + +/usr/include/stdlib.h: + +/usr/include/i386-linux-gnu/bits/waitflags.h: + +/usr/include/i386-linux-gnu/bits/waitstatus.h: + +/usr/include/alloca.h: + +/usr/include/string.h: + +/usr/include/xlocale.h: + +/usr/include/i386-linux-gnu/bits/string.h: + +/usr/include/i386-linux-gnu/bits/string2.h: + +/usr/include/strings.h: + +/usr/include/inttypes.h: + +/usr/include/unistd.h: + +/usr/include/i386-linux-gnu/bits/posix_opt.h: + +/usr/include/i386-linux-gnu/bits/environments.h: + +/usr/include/i386-linux-gnu/bits/confname.h: + +/usr/include/getopt.h: + +/usr/include/netinet/in.h: + +/usr/include/i386-linux-gnu/sys/socket.h: + +/usr/include/i386-linux-gnu/sys/uio.h: + +/usr/include/i386-linux-gnu/bits/uio.h: + +/usr/include/i386-linux-gnu/bits/socket.h: + +/usr/include/i386-linux-gnu/bits/sockaddr.h: + +/usr/include/i386-linux-gnu/asm/socket.h: + +/usr/include/asm-generic/socket.h: + +/usr/include/i386-linux-gnu/asm/sockios.h: + +/usr/include/asm-generic/sockios.h: + +/usr/include/i386-linux-gnu/bits/in.h: + +/usr/include/netinet/tcp.h: + +/usr/include/arpa/nameser.h: + +/usr/include/i386-linux-gnu/sys/param.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/limits.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/syslimits.h: + +/usr/include/limits.h: + +/usr/include/i386-linux-gnu/bits/posix1_lim.h: + +/usr/include/i386-linux-gnu/bits/local_lim.h: + +/usr/include/linux/limits.h: + +/usr/include/i386-linux-gnu/bits/posix2_lim.h: + +/usr/include/linux/param.h: + +/usr/include/i386-linux-gnu/asm/param.h: + +/usr/include/asm-generic/param.h: + +/usr/include/i386-linux-gnu/sys/bitypes.h: + +/usr/include/arpa/nameser_compat.h: + +/usr/include/netdb.h: + +/usr/include/rpc/netdb.h: + +/usr/include/i386-linux-gnu/bits/netdb.h: + +/usr/include/malloc.h: + +/usr/include/ctype.h: + +include/antlr3interfaces.h: + +include/antlr3convertutf.h: + +include/antlr3exception.h: + +include/antlr3encodings.h: + +include/antlr3string.h: + +include/antlr3collections.h: + +include/antlr3bitset.h: + +include/antlr3input.h: + +include/antlr3commontoken.h: + +include/antlr3intstream.h: + +include/antlr3cyclicdfa.h: + +include/antlr3baserecognizer.h: + +include/antlr3tokenstream.h: + +include/antlr3debugeventlistener.h: + +include/antlr3basetree.h: + +include/antlr3commontreenodestream.h: + +include/antlr3commontreeadaptor.h: + +include/antlr3basetreeadaptor.h: + +include/antlr3commontree.h: + +include/antlr3recognizersharedstate.h: + +include/antlr3lexer.h: + +include/antlr3parser.h: + +include/antlr3treeparser.h: + +include/antlr3filestream.h: + +include/antlr3rewritestreams.h: diff --git a/antlr/libantlr3c-3.4/.deps/antlr3exception.Plo b/antlr/libantlr3c-3.4/.deps/antlr3exception.Plo new file mode 100644 index 0000000..2b768a8 --- /dev/null +++ b/antlr/libantlr3c-3.4/.deps/antlr3exception.Plo @@ -0,0 +1,230 @@ +antlr3exception.lo: src/antlr3exception.c include/antlr3exception.h \ + include/antlr3defs.h include/antlr3errors.h antlr3config.h \ + /usr/include/stdio.h /usr/include/features.h \ + /usr/include/i386-linux-gnu/bits/predefs.h \ + /usr/include/i386-linux-gnu/sys/cdefs.h \ + /usr/include/i386-linux-gnu/bits/wordsize.h \ + /usr/include/i386-linux-gnu/gnu/stubs.h \ + /usr/include/i386-linux-gnu/gnu/stubs-32.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include/stddef.h \ + /usr/include/i386-linux-gnu/bits/types.h \ + /usr/include/i386-linux-gnu/bits/typesizes.h /usr/include/libio.h \ + /usr/include/_G_config.h /usr/include/wchar.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include/stdarg.h \ + /usr/include/i386-linux-gnu/bits/stdio_lim.h \ + /usr/include/i386-linux-gnu/bits/sys_errlist.h \ + /usr/include/i386-linux-gnu/bits/stdio.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include/stdint.h /usr/include/stdint.h \ + /usr/include/i386-linux-gnu/bits/wchar.h \ + /usr/include/i386-linux-gnu/sys/types.h /usr/include/time.h \ + /usr/include/endian.h /usr/include/i386-linux-gnu/bits/endian.h \ + /usr/include/i386-linux-gnu/bits/byteswap.h \ + /usr/include/i386-linux-gnu/sys/select.h \ + /usr/include/i386-linux-gnu/bits/select.h \ + /usr/include/i386-linux-gnu/bits/sigset.h \ + /usr/include/i386-linux-gnu/bits/time.h \ + /usr/include/i386-linux-gnu/sys/sysmacros.h \ + /usr/include/i386-linux-gnu/bits/pthreadtypes.h \ + /usr/include/i386-linux-gnu/sys/stat.h \ + /usr/include/i386-linux-gnu/bits/stat.h /usr/include/stdlib.h \ + /usr/include/i386-linux-gnu/bits/waitflags.h \ + /usr/include/i386-linux-gnu/bits/waitstatus.h /usr/include/alloca.h \ + /usr/include/string.h /usr/include/xlocale.h \ + /usr/include/i386-linux-gnu/bits/string.h \ + /usr/include/i386-linux-gnu/bits/string2.h /usr/include/strings.h \ + /usr/include/inttypes.h /usr/include/unistd.h \ + /usr/include/i386-linux-gnu/bits/posix_opt.h \ + /usr/include/i386-linux-gnu/bits/environments.h \ + /usr/include/i386-linux-gnu/bits/confname.h /usr/include/getopt.h \ + /usr/include/netinet/in.h /usr/include/i386-linux-gnu/sys/socket.h \ + /usr/include/i386-linux-gnu/sys/uio.h \ + /usr/include/i386-linux-gnu/bits/uio.h \ + /usr/include/i386-linux-gnu/bits/socket.h \ + /usr/include/i386-linux-gnu/bits/sockaddr.h \ + /usr/include/i386-linux-gnu/asm/socket.h \ + /usr/include/asm-generic/socket.h \ + /usr/include/i386-linux-gnu/asm/sockios.h \ + /usr/include/asm-generic/sockios.h /usr/include/i386-linux-gnu/bits/in.h \ + /usr/include/netinet/tcp.h /usr/include/arpa/nameser.h \ + /usr/include/i386-linux-gnu/sys/param.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/limits.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/syslimits.h \ + /usr/include/limits.h /usr/include/i386-linux-gnu/bits/posix1_lim.h \ + /usr/include/i386-linux-gnu/bits/local_lim.h /usr/include/linux/limits.h \ + /usr/include/i386-linux-gnu/bits/posix2_lim.h /usr/include/linux/param.h \ + /usr/include/i386-linux-gnu/asm/param.h /usr/include/asm-generic/param.h \ + /usr/include/i386-linux-gnu/sys/bitypes.h \ + /usr/include/arpa/nameser_compat.h /usr/include/netdb.h \ + /usr/include/rpc/netdb.h /usr/include/i386-linux-gnu/bits/netdb.h \ + /usr/include/malloc.h /usr/include/ctype.h include/antlr3interfaces.h \ + include/antlr3convertutf.h + +include/antlr3exception.h: + +include/antlr3defs.h: + +include/antlr3errors.h: + +antlr3config.h: + +/usr/include/stdio.h: + +/usr/include/features.h: + +/usr/include/i386-linux-gnu/bits/predefs.h: + +/usr/include/i386-linux-gnu/sys/cdefs.h: + +/usr/include/i386-linux-gnu/bits/wordsize.h: + +/usr/include/i386-linux-gnu/gnu/stubs.h: + +/usr/include/i386-linux-gnu/gnu/stubs-32.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include/stddef.h: + +/usr/include/i386-linux-gnu/bits/types.h: + +/usr/include/i386-linux-gnu/bits/typesizes.h: + +/usr/include/libio.h: + +/usr/include/_G_config.h: + +/usr/include/wchar.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include/stdarg.h: + +/usr/include/i386-linux-gnu/bits/stdio_lim.h: + +/usr/include/i386-linux-gnu/bits/sys_errlist.h: + +/usr/include/i386-linux-gnu/bits/stdio.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include/stdint.h: + +/usr/include/stdint.h: + +/usr/include/i386-linux-gnu/bits/wchar.h: + +/usr/include/i386-linux-gnu/sys/types.h: + +/usr/include/time.h: + +/usr/include/endian.h: + +/usr/include/i386-linux-gnu/bits/endian.h: + +/usr/include/i386-linux-gnu/bits/byteswap.h: + +/usr/include/i386-linux-gnu/sys/select.h: + +/usr/include/i386-linux-gnu/bits/select.h: + +/usr/include/i386-linux-gnu/bits/sigset.h: + +/usr/include/i386-linux-gnu/bits/time.h: + +/usr/include/i386-linux-gnu/sys/sysmacros.h: + +/usr/include/i386-linux-gnu/bits/pthreadtypes.h: + +/usr/include/i386-linux-gnu/sys/stat.h: + +/usr/include/i386-linux-gnu/bits/stat.h: + +/usr/include/stdlib.h: + +/usr/include/i386-linux-gnu/bits/waitflags.h: + +/usr/include/i386-linux-gnu/bits/waitstatus.h: + +/usr/include/alloca.h: + +/usr/include/string.h: + +/usr/include/xlocale.h: + +/usr/include/i386-linux-gnu/bits/string.h: + +/usr/include/i386-linux-gnu/bits/string2.h: + +/usr/include/strings.h: + +/usr/include/inttypes.h: + +/usr/include/unistd.h: + +/usr/include/i386-linux-gnu/bits/posix_opt.h: + +/usr/include/i386-linux-gnu/bits/environments.h: + +/usr/include/i386-linux-gnu/bits/confname.h: + +/usr/include/getopt.h: + +/usr/include/netinet/in.h: + +/usr/include/i386-linux-gnu/sys/socket.h: + +/usr/include/i386-linux-gnu/sys/uio.h: + +/usr/include/i386-linux-gnu/bits/uio.h: + +/usr/include/i386-linux-gnu/bits/socket.h: + +/usr/include/i386-linux-gnu/bits/sockaddr.h: + +/usr/include/i386-linux-gnu/asm/socket.h: + +/usr/include/asm-generic/socket.h: + +/usr/include/i386-linux-gnu/asm/sockios.h: + +/usr/include/asm-generic/sockios.h: + +/usr/include/i386-linux-gnu/bits/in.h: + +/usr/include/netinet/tcp.h: + +/usr/include/arpa/nameser.h: + +/usr/include/i386-linux-gnu/sys/param.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/limits.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/syslimits.h: + +/usr/include/limits.h: + +/usr/include/i386-linux-gnu/bits/posix1_lim.h: + +/usr/include/i386-linux-gnu/bits/local_lim.h: + +/usr/include/linux/limits.h: + +/usr/include/i386-linux-gnu/bits/posix2_lim.h: + +/usr/include/linux/param.h: + +/usr/include/i386-linux-gnu/asm/param.h: + +/usr/include/asm-generic/param.h: + +/usr/include/i386-linux-gnu/sys/bitypes.h: + +/usr/include/arpa/nameser_compat.h: + +/usr/include/netdb.h: + +/usr/include/rpc/netdb.h: + +/usr/include/i386-linux-gnu/bits/netdb.h: + +/usr/include/malloc.h: + +/usr/include/ctype.h: + +include/antlr3interfaces.h: + +include/antlr3convertutf.h: diff --git a/antlr/libantlr3c-3.4/.deps/antlr3filestream.Plo b/antlr/libantlr3c-3.4/.deps/antlr3filestream.Plo new file mode 100644 index 0000000..61a223c --- /dev/null +++ b/antlr/libantlr3c-3.4/.deps/antlr3filestream.Plo @@ -0,0 +1,286 @@ +antlr3filestream.lo: src/antlr3filestream.c include/antlr3.h \ + include/antlr3defs.h include/antlr3errors.h antlr3config.h \ + /usr/include/stdio.h /usr/include/features.h \ + /usr/include/i386-linux-gnu/bits/predefs.h \ + /usr/include/i386-linux-gnu/sys/cdefs.h \ + /usr/include/i386-linux-gnu/bits/wordsize.h \ + /usr/include/i386-linux-gnu/gnu/stubs.h \ + /usr/include/i386-linux-gnu/gnu/stubs-32.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include/stddef.h \ + /usr/include/i386-linux-gnu/bits/types.h \ + /usr/include/i386-linux-gnu/bits/typesizes.h /usr/include/libio.h \ + /usr/include/_G_config.h /usr/include/wchar.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include/stdarg.h \ + /usr/include/i386-linux-gnu/bits/stdio_lim.h \ + /usr/include/i386-linux-gnu/bits/sys_errlist.h \ + /usr/include/i386-linux-gnu/bits/stdio.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include/stdint.h /usr/include/stdint.h \ + /usr/include/i386-linux-gnu/bits/wchar.h \ + /usr/include/i386-linux-gnu/sys/types.h /usr/include/time.h \ + /usr/include/endian.h /usr/include/i386-linux-gnu/bits/endian.h \ + /usr/include/i386-linux-gnu/bits/byteswap.h \ + /usr/include/i386-linux-gnu/sys/select.h \ + /usr/include/i386-linux-gnu/bits/select.h \ + /usr/include/i386-linux-gnu/bits/sigset.h \ + /usr/include/i386-linux-gnu/bits/time.h \ + /usr/include/i386-linux-gnu/sys/sysmacros.h \ + /usr/include/i386-linux-gnu/bits/pthreadtypes.h \ + /usr/include/i386-linux-gnu/sys/stat.h \ + /usr/include/i386-linux-gnu/bits/stat.h /usr/include/stdlib.h \ + /usr/include/i386-linux-gnu/bits/waitflags.h \ + /usr/include/i386-linux-gnu/bits/waitstatus.h /usr/include/alloca.h \ + /usr/include/string.h /usr/include/xlocale.h \ + /usr/include/i386-linux-gnu/bits/string.h \ + /usr/include/i386-linux-gnu/bits/string2.h /usr/include/strings.h \ + /usr/include/inttypes.h /usr/include/unistd.h \ + /usr/include/i386-linux-gnu/bits/posix_opt.h \ + /usr/include/i386-linux-gnu/bits/environments.h \ + /usr/include/i386-linux-gnu/bits/confname.h /usr/include/getopt.h \ + /usr/include/netinet/in.h /usr/include/i386-linux-gnu/sys/socket.h \ + /usr/include/i386-linux-gnu/sys/uio.h \ + /usr/include/i386-linux-gnu/bits/uio.h \ + /usr/include/i386-linux-gnu/bits/socket.h \ + /usr/include/i386-linux-gnu/bits/sockaddr.h \ + /usr/include/i386-linux-gnu/asm/socket.h \ + /usr/include/asm-generic/socket.h \ + /usr/include/i386-linux-gnu/asm/sockios.h \ + /usr/include/asm-generic/sockios.h /usr/include/i386-linux-gnu/bits/in.h \ + /usr/include/netinet/tcp.h /usr/include/arpa/nameser.h \ + /usr/include/i386-linux-gnu/sys/param.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/limits.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/syslimits.h \ + /usr/include/limits.h /usr/include/i386-linux-gnu/bits/posix1_lim.h \ + /usr/include/i386-linux-gnu/bits/local_lim.h /usr/include/linux/limits.h \ + /usr/include/i386-linux-gnu/bits/posix2_lim.h /usr/include/linux/param.h \ + /usr/include/i386-linux-gnu/asm/param.h /usr/include/asm-generic/param.h \ + /usr/include/i386-linux-gnu/sys/bitypes.h \ + /usr/include/arpa/nameser_compat.h /usr/include/netdb.h \ + /usr/include/rpc/netdb.h /usr/include/i386-linux-gnu/bits/netdb.h \ + /usr/include/malloc.h /usr/include/ctype.h include/antlr3interfaces.h \ + include/antlr3convertutf.h include/antlr3exception.h \ + include/antlr3encodings.h include/antlr3string.h \ + include/antlr3collections.h include/antlr3bitset.h include/antlr3input.h \ + include/antlr3commontoken.h include/antlr3intstream.h \ + include/antlr3cyclicdfa.h include/antlr3baserecognizer.h \ + include/antlr3tokenstream.h include/antlr3debugeventlistener.h \ + include/antlr3basetree.h include/antlr3commontreenodestream.h \ + include/antlr3commontreeadaptor.h include/antlr3basetreeadaptor.h \ + include/antlr3commontree.h include/antlr3recognizersharedstate.h \ + include/antlr3lexer.h include/antlr3parser.h include/antlr3treeparser.h \ + include/antlr3filestream.h include/antlr3rewritestreams.h + +include/antlr3.h: + +include/antlr3defs.h: + +include/antlr3errors.h: + +antlr3config.h: + +/usr/include/stdio.h: + +/usr/include/features.h: + +/usr/include/i386-linux-gnu/bits/predefs.h: + +/usr/include/i386-linux-gnu/sys/cdefs.h: + +/usr/include/i386-linux-gnu/bits/wordsize.h: + +/usr/include/i386-linux-gnu/gnu/stubs.h: + +/usr/include/i386-linux-gnu/gnu/stubs-32.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include/stddef.h: + +/usr/include/i386-linux-gnu/bits/types.h: + +/usr/include/i386-linux-gnu/bits/typesizes.h: + +/usr/include/libio.h: + +/usr/include/_G_config.h: + +/usr/include/wchar.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include/stdarg.h: + +/usr/include/i386-linux-gnu/bits/stdio_lim.h: + +/usr/include/i386-linux-gnu/bits/sys_errlist.h: + +/usr/include/i386-linux-gnu/bits/stdio.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include/stdint.h: + +/usr/include/stdint.h: + +/usr/include/i386-linux-gnu/bits/wchar.h: + +/usr/include/i386-linux-gnu/sys/types.h: + +/usr/include/time.h: + +/usr/include/endian.h: + +/usr/include/i386-linux-gnu/bits/endian.h: + +/usr/include/i386-linux-gnu/bits/byteswap.h: + +/usr/include/i386-linux-gnu/sys/select.h: + +/usr/include/i386-linux-gnu/bits/select.h: + +/usr/include/i386-linux-gnu/bits/sigset.h: + +/usr/include/i386-linux-gnu/bits/time.h: + +/usr/include/i386-linux-gnu/sys/sysmacros.h: + +/usr/include/i386-linux-gnu/bits/pthreadtypes.h: + +/usr/include/i386-linux-gnu/sys/stat.h: + +/usr/include/i386-linux-gnu/bits/stat.h: + +/usr/include/stdlib.h: + +/usr/include/i386-linux-gnu/bits/waitflags.h: + +/usr/include/i386-linux-gnu/bits/waitstatus.h: + +/usr/include/alloca.h: + +/usr/include/string.h: + +/usr/include/xlocale.h: + +/usr/include/i386-linux-gnu/bits/string.h: + +/usr/include/i386-linux-gnu/bits/string2.h: + +/usr/include/strings.h: + +/usr/include/inttypes.h: + +/usr/include/unistd.h: + +/usr/include/i386-linux-gnu/bits/posix_opt.h: + +/usr/include/i386-linux-gnu/bits/environments.h: + +/usr/include/i386-linux-gnu/bits/confname.h: + +/usr/include/getopt.h: + +/usr/include/netinet/in.h: + +/usr/include/i386-linux-gnu/sys/socket.h: + +/usr/include/i386-linux-gnu/sys/uio.h: + +/usr/include/i386-linux-gnu/bits/uio.h: + +/usr/include/i386-linux-gnu/bits/socket.h: + +/usr/include/i386-linux-gnu/bits/sockaddr.h: + +/usr/include/i386-linux-gnu/asm/socket.h: + +/usr/include/asm-generic/socket.h: + +/usr/include/i386-linux-gnu/asm/sockios.h: + +/usr/include/asm-generic/sockios.h: + +/usr/include/i386-linux-gnu/bits/in.h: + +/usr/include/netinet/tcp.h: + +/usr/include/arpa/nameser.h: + +/usr/include/i386-linux-gnu/sys/param.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/limits.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/syslimits.h: + +/usr/include/limits.h: + +/usr/include/i386-linux-gnu/bits/posix1_lim.h: + +/usr/include/i386-linux-gnu/bits/local_lim.h: + +/usr/include/linux/limits.h: + +/usr/include/i386-linux-gnu/bits/posix2_lim.h: + +/usr/include/linux/param.h: + +/usr/include/i386-linux-gnu/asm/param.h: + +/usr/include/asm-generic/param.h: + +/usr/include/i386-linux-gnu/sys/bitypes.h: + +/usr/include/arpa/nameser_compat.h: + +/usr/include/netdb.h: + +/usr/include/rpc/netdb.h: + +/usr/include/i386-linux-gnu/bits/netdb.h: + +/usr/include/malloc.h: + +/usr/include/ctype.h: + +include/antlr3interfaces.h: + +include/antlr3convertutf.h: + +include/antlr3exception.h: + +include/antlr3encodings.h: + +include/antlr3string.h: + +include/antlr3collections.h: + +include/antlr3bitset.h: + +include/antlr3input.h: + +include/antlr3commontoken.h: + +include/antlr3intstream.h: + +include/antlr3cyclicdfa.h: + +include/antlr3baserecognizer.h: + +include/antlr3tokenstream.h: + +include/antlr3debugeventlistener.h: + +include/antlr3basetree.h: + +include/antlr3commontreenodestream.h: + +include/antlr3commontreeadaptor.h: + +include/antlr3basetreeadaptor.h: + +include/antlr3commontree.h: + +include/antlr3recognizersharedstate.h: + +include/antlr3lexer.h: + +include/antlr3parser.h: + +include/antlr3treeparser.h: + +include/antlr3filestream.h: + +include/antlr3rewritestreams.h: diff --git a/antlr/libantlr3c-3.4/.deps/antlr3inputstream.Plo b/antlr/libantlr3c-3.4/.deps/antlr3inputstream.Plo new file mode 100644 index 0000000..cbe47f8 --- /dev/null +++ b/antlr/libantlr3c-3.4/.deps/antlr3inputstream.Plo @@ -0,0 +1,242 @@ +antlr3inputstream.lo: src/antlr3inputstream.c include/antlr3input.h \ + include/antlr3defs.h include/antlr3errors.h antlr3config.h \ + /usr/include/stdio.h /usr/include/features.h \ + /usr/include/i386-linux-gnu/bits/predefs.h \ + /usr/include/i386-linux-gnu/sys/cdefs.h \ + /usr/include/i386-linux-gnu/bits/wordsize.h \ + /usr/include/i386-linux-gnu/gnu/stubs.h \ + /usr/include/i386-linux-gnu/gnu/stubs-32.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include/stddef.h \ + /usr/include/i386-linux-gnu/bits/types.h \ + /usr/include/i386-linux-gnu/bits/typesizes.h /usr/include/libio.h \ + /usr/include/_G_config.h /usr/include/wchar.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include/stdarg.h \ + /usr/include/i386-linux-gnu/bits/stdio_lim.h \ + /usr/include/i386-linux-gnu/bits/sys_errlist.h \ + /usr/include/i386-linux-gnu/bits/stdio.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include/stdint.h /usr/include/stdint.h \ + /usr/include/i386-linux-gnu/bits/wchar.h \ + /usr/include/i386-linux-gnu/sys/types.h /usr/include/time.h \ + /usr/include/endian.h /usr/include/i386-linux-gnu/bits/endian.h \ + /usr/include/i386-linux-gnu/bits/byteswap.h \ + /usr/include/i386-linux-gnu/sys/select.h \ + /usr/include/i386-linux-gnu/bits/select.h \ + /usr/include/i386-linux-gnu/bits/sigset.h \ + /usr/include/i386-linux-gnu/bits/time.h \ + /usr/include/i386-linux-gnu/sys/sysmacros.h \ + /usr/include/i386-linux-gnu/bits/pthreadtypes.h \ + /usr/include/i386-linux-gnu/sys/stat.h \ + /usr/include/i386-linux-gnu/bits/stat.h /usr/include/stdlib.h \ + /usr/include/i386-linux-gnu/bits/waitflags.h \ + /usr/include/i386-linux-gnu/bits/waitstatus.h /usr/include/alloca.h \ + /usr/include/string.h /usr/include/xlocale.h \ + /usr/include/i386-linux-gnu/bits/string.h \ + /usr/include/i386-linux-gnu/bits/string2.h /usr/include/strings.h \ + /usr/include/inttypes.h /usr/include/unistd.h \ + /usr/include/i386-linux-gnu/bits/posix_opt.h \ + /usr/include/i386-linux-gnu/bits/environments.h \ + /usr/include/i386-linux-gnu/bits/confname.h /usr/include/getopt.h \ + /usr/include/netinet/in.h /usr/include/i386-linux-gnu/sys/socket.h \ + /usr/include/i386-linux-gnu/sys/uio.h \ + /usr/include/i386-linux-gnu/bits/uio.h \ + /usr/include/i386-linux-gnu/bits/socket.h \ + /usr/include/i386-linux-gnu/bits/sockaddr.h \ + /usr/include/i386-linux-gnu/asm/socket.h \ + /usr/include/asm-generic/socket.h \ + /usr/include/i386-linux-gnu/asm/sockios.h \ + /usr/include/asm-generic/sockios.h /usr/include/i386-linux-gnu/bits/in.h \ + /usr/include/netinet/tcp.h /usr/include/arpa/nameser.h \ + /usr/include/i386-linux-gnu/sys/param.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/limits.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/syslimits.h \ + /usr/include/limits.h /usr/include/i386-linux-gnu/bits/posix1_lim.h \ + /usr/include/i386-linux-gnu/bits/local_lim.h /usr/include/linux/limits.h \ + /usr/include/i386-linux-gnu/bits/posix2_lim.h /usr/include/linux/param.h \ + /usr/include/i386-linux-gnu/asm/param.h /usr/include/asm-generic/param.h \ + /usr/include/i386-linux-gnu/sys/bitypes.h \ + /usr/include/arpa/nameser_compat.h /usr/include/netdb.h \ + /usr/include/rpc/netdb.h /usr/include/i386-linux-gnu/bits/netdb.h \ + /usr/include/malloc.h /usr/include/ctype.h include/antlr3interfaces.h \ + include/antlr3convertutf.h include/antlr3string.h \ + include/antlr3collections.h include/antlr3bitset.h \ + include/antlr3commontoken.h include/antlr3intstream.h + +include/antlr3input.h: + +include/antlr3defs.h: + +include/antlr3errors.h: + +antlr3config.h: + +/usr/include/stdio.h: + +/usr/include/features.h: + +/usr/include/i386-linux-gnu/bits/predefs.h: + +/usr/include/i386-linux-gnu/sys/cdefs.h: + +/usr/include/i386-linux-gnu/bits/wordsize.h: + +/usr/include/i386-linux-gnu/gnu/stubs.h: + +/usr/include/i386-linux-gnu/gnu/stubs-32.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include/stddef.h: + +/usr/include/i386-linux-gnu/bits/types.h: + +/usr/include/i386-linux-gnu/bits/typesizes.h: + +/usr/include/libio.h: + +/usr/include/_G_config.h: + +/usr/include/wchar.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include/stdarg.h: + +/usr/include/i386-linux-gnu/bits/stdio_lim.h: + +/usr/include/i386-linux-gnu/bits/sys_errlist.h: + +/usr/include/i386-linux-gnu/bits/stdio.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include/stdint.h: + +/usr/include/stdint.h: + +/usr/include/i386-linux-gnu/bits/wchar.h: + +/usr/include/i386-linux-gnu/sys/types.h: + +/usr/include/time.h: + +/usr/include/endian.h: + +/usr/include/i386-linux-gnu/bits/endian.h: + +/usr/include/i386-linux-gnu/bits/byteswap.h: + +/usr/include/i386-linux-gnu/sys/select.h: + +/usr/include/i386-linux-gnu/bits/select.h: + +/usr/include/i386-linux-gnu/bits/sigset.h: + +/usr/include/i386-linux-gnu/bits/time.h: + +/usr/include/i386-linux-gnu/sys/sysmacros.h: + +/usr/include/i386-linux-gnu/bits/pthreadtypes.h: + +/usr/include/i386-linux-gnu/sys/stat.h: + +/usr/include/i386-linux-gnu/bits/stat.h: + +/usr/include/stdlib.h: + +/usr/include/i386-linux-gnu/bits/waitflags.h: + +/usr/include/i386-linux-gnu/bits/waitstatus.h: + +/usr/include/alloca.h: + +/usr/include/string.h: + +/usr/include/xlocale.h: + +/usr/include/i386-linux-gnu/bits/string.h: + +/usr/include/i386-linux-gnu/bits/string2.h: + +/usr/include/strings.h: + +/usr/include/inttypes.h: + +/usr/include/unistd.h: + +/usr/include/i386-linux-gnu/bits/posix_opt.h: + +/usr/include/i386-linux-gnu/bits/environments.h: + +/usr/include/i386-linux-gnu/bits/confname.h: + +/usr/include/getopt.h: + +/usr/include/netinet/in.h: + +/usr/include/i386-linux-gnu/sys/socket.h: + +/usr/include/i386-linux-gnu/sys/uio.h: + +/usr/include/i386-linux-gnu/bits/uio.h: + +/usr/include/i386-linux-gnu/bits/socket.h: + +/usr/include/i386-linux-gnu/bits/sockaddr.h: + +/usr/include/i386-linux-gnu/asm/socket.h: + +/usr/include/asm-generic/socket.h: + +/usr/include/i386-linux-gnu/asm/sockios.h: + +/usr/include/asm-generic/sockios.h: + +/usr/include/i386-linux-gnu/bits/in.h: + +/usr/include/netinet/tcp.h: + +/usr/include/arpa/nameser.h: + +/usr/include/i386-linux-gnu/sys/param.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/limits.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/syslimits.h: + +/usr/include/limits.h: + +/usr/include/i386-linux-gnu/bits/posix1_lim.h: + +/usr/include/i386-linux-gnu/bits/local_lim.h: + +/usr/include/linux/limits.h: + +/usr/include/i386-linux-gnu/bits/posix2_lim.h: + +/usr/include/linux/param.h: + +/usr/include/i386-linux-gnu/asm/param.h: + +/usr/include/asm-generic/param.h: + +/usr/include/i386-linux-gnu/sys/bitypes.h: + +/usr/include/arpa/nameser_compat.h: + +/usr/include/netdb.h: + +/usr/include/rpc/netdb.h: + +/usr/include/i386-linux-gnu/bits/netdb.h: + +/usr/include/malloc.h: + +/usr/include/ctype.h: + +include/antlr3interfaces.h: + +include/antlr3convertutf.h: + +include/antlr3string.h: + +include/antlr3collections.h: + +include/antlr3bitset.h: + +include/antlr3commontoken.h: + +include/antlr3intstream.h: diff --git a/antlr/libantlr3c-3.4/.deps/antlr3intstream.Plo b/antlr/libantlr3c-3.4/.deps/antlr3intstream.Plo new file mode 100644 index 0000000..3d39d20 --- /dev/null +++ b/antlr/libantlr3c-3.4/.deps/antlr3intstream.Plo @@ -0,0 +1,232 @@ +antlr3intstream.lo: src/antlr3intstream.c include/antlr3intstream.h \ + include/antlr3defs.h include/antlr3errors.h antlr3config.h \ + /usr/include/stdio.h /usr/include/features.h \ + /usr/include/i386-linux-gnu/bits/predefs.h \ + /usr/include/i386-linux-gnu/sys/cdefs.h \ + /usr/include/i386-linux-gnu/bits/wordsize.h \ + /usr/include/i386-linux-gnu/gnu/stubs.h \ + /usr/include/i386-linux-gnu/gnu/stubs-32.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include/stddef.h \ + /usr/include/i386-linux-gnu/bits/types.h \ + /usr/include/i386-linux-gnu/bits/typesizes.h /usr/include/libio.h \ + /usr/include/_G_config.h /usr/include/wchar.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include/stdarg.h \ + /usr/include/i386-linux-gnu/bits/stdio_lim.h \ + /usr/include/i386-linux-gnu/bits/sys_errlist.h \ + /usr/include/i386-linux-gnu/bits/stdio.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include/stdint.h /usr/include/stdint.h \ + /usr/include/i386-linux-gnu/bits/wchar.h \ + /usr/include/i386-linux-gnu/sys/types.h /usr/include/time.h \ + /usr/include/endian.h /usr/include/i386-linux-gnu/bits/endian.h \ + /usr/include/i386-linux-gnu/bits/byteswap.h \ + /usr/include/i386-linux-gnu/sys/select.h \ + /usr/include/i386-linux-gnu/bits/select.h \ + /usr/include/i386-linux-gnu/bits/sigset.h \ + /usr/include/i386-linux-gnu/bits/time.h \ + /usr/include/i386-linux-gnu/sys/sysmacros.h \ + /usr/include/i386-linux-gnu/bits/pthreadtypes.h \ + /usr/include/i386-linux-gnu/sys/stat.h \ + /usr/include/i386-linux-gnu/bits/stat.h /usr/include/stdlib.h \ + /usr/include/i386-linux-gnu/bits/waitflags.h \ + /usr/include/i386-linux-gnu/bits/waitstatus.h /usr/include/alloca.h \ + /usr/include/string.h /usr/include/xlocale.h \ + /usr/include/i386-linux-gnu/bits/string.h \ + /usr/include/i386-linux-gnu/bits/string2.h /usr/include/strings.h \ + /usr/include/inttypes.h /usr/include/unistd.h \ + /usr/include/i386-linux-gnu/bits/posix_opt.h \ + /usr/include/i386-linux-gnu/bits/environments.h \ + /usr/include/i386-linux-gnu/bits/confname.h /usr/include/getopt.h \ + /usr/include/netinet/in.h /usr/include/i386-linux-gnu/sys/socket.h \ + /usr/include/i386-linux-gnu/sys/uio.h \ + /usr/include/i386-linux-gnu/bits/uio.h \ + /usr/include/i386-linux-gnu/bits/socket.h \ + /usr/include/i386-linux-gnu/bits/sockaddr.h \ + /usr/include/i386-linux-gnu/asm/socket.h \ + /usr/include/asm-generic/socket.h \ + /usr/include/i386-linux-gnu/asm/sockios.h \ + /usr/include/asm-generic/sockios.h /usr/include/i386-linux-gnu/bits/in.h \ + /usr/include/netinet/tcp.h /usr/include/arpa/nameser.h \ + /usr/include/i386-linux-gnu/sys/param.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/limits.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/syslimits.h \ + /usr/include/limits.h /usr/include/i386-linux-gnu/bits/posix1_lim.h \ + /usr/include/i386-linux-gnu/bits/local_lim.h /usr/include/linux/limits.h \ + /usr/include/i386-linux-gnu/bits/posix2_lim.h /usr/include/linux/param.h \ + /usr/include/i386-linux-gnu/asm/param.h /usr/include/asm-generic/param.h \ + /usr/include/i386-linux-gnu/sys/bitypes.h \ + /usr/include/arpa/nameser_compat.h /usr/include/netdb.h \ + /usr/include/rpc/netdb.h /usr/include/i386-linux-gnu/bits/netdb.h \ + /usr/include/malloc.h /usr/include/ctype.h include/antlr3interfaces.h \ + include/antlr3convertutf.h include/antlr3commontoken.h + +include/antlr3intstream.h: + +include/antlr3defs.h: + +include/antlr3errors.h: + +antlr3config.h: + +/usr/include/stdio.h: + +/usr/include/features.h: + +/usr/include/i386-linux-gnu/bits/predefs.h: + +/usr/include/i386-linux-gnu/sys/cdefs.h: + +/usr/include/i386-linux-gnu/bits/wordsize.h: + +/usr/include/i386-linux-gnu/gnu/stubs.h: + +/usr/include/i386-linux-gnu/gnu/stubs-32.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include/stddef.h: + +/usr/include/i386-linux-gnu/bits/types.h: + +/usr/include/i386-linux-gnu/bits/typesizes.h: + +/usr/include/libio.h: + +/usr/include/_G_config.h: + +/usr/include/wchar.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include/stdarg.h: + +/usr/include/i386-linux-gnu/bits/stdio_lim.h: + +/usr/include/i386-linux-gnu/bits/sys_errlist.h: + +/usr/include/i386-linux-gnu/bits/stdio.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include/stdint.h: + +/usr/include/stdint.h: + +/usr/include/i386-linux-gnu/bits/wchar.h: + +/usr/include/i386-linux-gnu/sys/types.h: + +/usr/include/time.h: + +/usr/include/endian.h: + +/usr/include/i386-linux-gnu/bits/endian.h: + +/usr/include/i386-linux-gnu/bits/byteswap.h: + +/usr/include/i386-linux-gnu/sys/select.h: + +/usr/include/i386-linux-gnu/bits/select.h: + +/usr/include/i386-linux-gnu/bits/sigset.h: + +/usr/include/i386-linux-gnu/bits/time.h: + +/usr/include/i386-linux-gnu/sys/sysmacros.h: + +/usr/include/i386-linux-gnu/bits/pthreadtypes.h: + +/usr/include/i386-linux-gnu/sys/stat.h: + +/usr/include/i386-linux-gnu/bits/stat.h: + +/usr/include/stdlib.h: + +/usr/include/i386-linux-gnu/bits/waitflags.h: + +/usr/include/i386-linux-gnu/bits/waitstatus.h: + +/usr/include/alloca.h: + +/usr/include/string.h: + +/usr/include/xlocale.h: + +/usr/include/i386-linux-gnu/bits/string.h: + +/usr/include/i386-linux-gnu/bits/string2.h: + +/usr/include/strings.h: + +/usr/include/inttypes.h: + +/usr/include/unistd.h: + +/usr/include/i386-linux-gnu/bits/posix_opt.h: + +/usr/include/i386-linux-gnu/bits/environments.h: + +/usr/include/i386-linux-gnu/bits/confname.h: + +/usr/include/getopt.h: + +/usr/include/netinet/in.h: + +/usr/include/i386-linux-gnu/sys/socket.h: + +/usr/include/i386-linux-gnu/sys/uio.h: + +/usr/include/i386-linux-gnu/bits/uio.h: + +/usr/include/i386-linux-gnu/bits/socket.h: + +/usr/include/i386-linux-gnu/bits/sockaddr.h: + +/usr/include/i386-linux-gnu/asm/socket.h: + +/usr/include/asm-generic/socket.h: + +/usr/include/i386-linux-gnu/asm/sockios.h: + +/usr/include/asm-generic/sockios.h: + +/usr/include/i386-linux-gnu/bits/in.h: + +/usr/include/netinet/tcp.h: + +/usr/include/arpa/nameser.h: + +/usr/include/i386-linux-gnu/sys/param.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/limits.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/syslimits.h: + +/usr/include/limits.h: + +/usr/include/i386-linux-gnu/bits/posix1_lim.h: + +/usr/include/i386-linux-gnu/bits/local_lim.h: + +/usr/include/linux/limits.h: + +/usr/include/i386-linux-gnu/bits/posix2_lim.h: + +/usr/include/linux/param.h: + +/usr/include/i386-linux-gnu/asm/param.h: + +/usr/include/asm-generic/param.h: + +/usr/include/i386-linux-gnu/sys/bitypes.h: + +/usr/include/arpa/nameser_compat.h: + +/usr/include/netdb.h: + +/usr/include/rpc/netdb.h: + +/usr/include/i386-linux-gnu/bits/netdb.h: + +/usr/include/malloc.h: + +/usr/include/ctype.h: + +include/antlr3interfaces.h: + +include/antlr3convertutf.h: + +include/antlr3commontoken.h: diff --git a/antlr/libantlr3c-3.4/.deps/antlr3lexer.Plo b/antlr/libantlr3c-3.4/.deps/antlr3lexer.Plo new file mode 100644 index 0000000..6ae4d9f --- /dev/null +++ b/antlr/libantlr3c-3.4/.deps/antlr3lexer.Plo @@ -0,0 +1,274 @@ +antlr3lexer.lo: src/antlr3lexer.c include/antlr3lexer.h \ + include/antlr3defs.h include/antlr3errors.h antlr3config.h \ + /usr/include/stdio.h /usr/include/features.h \ + /usr/include/i386-linux-gnu/bits/predefs.h \ + /usr/include/i386-linux-gnu/sys/cdefs.h \ + /usr/include/i386-linux-gnu/bits/wordsize.h \ + /usr/include/i386-linux-gnu/gnu/stubs.h \ + /usr/include/i386-linux-gnu/gnu/stubs-32.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include/stddef.h \ + /usr/include/i386-linux-gnu/bits/types.h \ + /usr/include/i386-linux-gnu/bits/typesizes.h /usr/include/libio.h \ + /usr/include/_G_config.h /usr/include/wchar.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include/stdarg.h \ + /usr/include/i386-linux-gnu/bits/stdio_lim.h \ + /usr/include/i386-linux-gnu/bits/sys_errlist.h \ + /usr/include/i386-linux-gnu/bits/stdio.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include/stdint.h /usr/include/stdint.h \ + /usr/include/i386-linux-gnu/bits/wchar.h \ + /usr/include/i386-linux-gnu/sys/types.h /usr/include/time.h \ + /usr/include/endian.h /usr/include/i386-linux-gnu/bits/endian.h \ + /usr/include/i386-linux-gnu/bits/byteswap.h \ + /usr/include/i386-linux-gnu/sys/select.h \ + /usr/include/i386-linux-gnu/bits/select.h \ + /usr/include/i386-linux-gnu/bits/sigset.h \ + /usr/include/i386-linux-gnu/bits/time.h \ + /usr/include/i386-linux-gnu/sys/sysmacros.h \ + /usr/include/i386-linux-gnu/bits/pthreadtypes.h \ + /usr/include/i386-linux-gnu/sys/stat.h \ + /usr/include/i386-linux-gnu/bits/stat.h /usr/include/stdlib.h \ + /usr/include/i386-linux-gnu/bits/waitflags.h \ + /usr/include/i386-linux-gnu/bits/waitstatus.h /usr/include/alloca.h \ + /usr/include/string.h /usr/include/xlocale.h \ + /usr/include/i386-linux-gnu/bits/string.h \ + /usr/include/i386-linux-gnu/bits/string2.h /usr/include/strings.h \ + /usr/include/inttypes.h /usr/include/unistd.h \ + /usr/include/i386-linux-gnu/bits/posix_opt.h \ + /usr/include/i386-linux-gnu/bits/environments.h \ + /usr/include/i386-linux-gnu/bits/confname.h /usr/include/getopt.h \ + /usr/include/netinet/in.h /usr/include/i386-linux-gnu/sys/socket.h \ + /usr/include/i386-linux-gnu/sys/uio.h \ + /usr/include/i386-linux-gnu/bits/uio.h \ + /usr/include/i386-linux-gnu/bits/socket.h \ + /usr/include/i386-linux-gnu/bits/sockaddr.h \ + /usr/include/i386-linux-gnu/asm/socket.h \ + /usr/include/asm-generic/socket.h \ + /usr/include/i386-linux-gnu/asm/sockios.h \ + /usr/include/asm-generic/sockios.h /usr/include/i386-linux-gnu/bits/in.h \ + /usr/include/netinet/tcp.h /usr/include/arpa/nameser.h \ + /usr/include/i386-linux-gnu/sys/param.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/limits.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/syslimits.h \ + /usr/include/limits.h /usr/include/i386-linux-gnu/bits/posix1_lim.h \ + /usr/include/i386-linux-gnu/bits/local_lim.h /usr/include/linux/limits.h \ + /usr/include/i386-linux-gnu/bits/posix2_lim.h /usr/include/linux/param.h \ + /usr/include/i386-linux-gnu/asm/param.h /usr/include/asm-generic/param.h \ + /usr/include/i386-linux-gnu/sys/bitypes.h \ + /usr/include/arpa/nameser_compat.h /usr/include/netdb.h \ + /usr/include/rpc/netdb.h /usr/include/i386-linux-gnu/bits/netdb.h \ + /usr/include/malloc.h /usr/include/ctype.h include/antlr3interfaces.h \ + include/antlr3convertutf.h include/antlr3input.h include/antlr3string.h \ + include/antlr3collections.h include/antlr3bitset.h \ + include/antlr3commontoken.h include/antlr3intstream.h \ + include/antlr3tokenstream.h include/antlr3debugeventlistener.h \ + include/antlr3basetree.h include/antlr3baserecognizer.h \ + include/antlr3exception.h include/antlr3commontreenodestream.h \ + include/antlr3commontreeadaptor.h include/antlr3basetreeadaptor.h \ + include/antlr3commontree.h include/antlr3recognizersharedstate.h \ + include/antlr3parser.h include/antlr3treeparser.h + +include/antlr3lexer.h: + +include/antlr3defs.h: + +include/antlr3errors.h: + +antlr3config.h: + +/usr/include/stdio.h: + +/usr/include/features.h: + +/usr/include/i386-linux-gnu/bits/predefs.h: + +/usr/include/i386-linux-gnu/sys/cdefs.h: + +/usr/include/i386-linux-gnu/bits/wordsize.h: + +/usr/include/i386-linux-gnu/gnu/stubs.h: + +/usr/include/i386-linux-gnu/gnu/stubs-32.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include/stddef.h: + +/usr/include/i386-linux-gnu/bits/types.h: + +/usr/include/i386-linux-gnu/bits/typesizes.h: + +/usr/include/libio.h: + +/usr/include/_G_config.h: + +/usr/include/wchar.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include/stdarg.h: + +/usr/include/i386-linux-gnu/bits/stdio_lim.h: + +/usr/include/i386-linux-gnu/bits/sys_errlist.h: + +/usr/include/i386-linux-gnu/bits/stdio.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include/stdint.h: + +/usr/include/stdint.h: + +/usr/include/i386-linux-gnu/bits/wchar.h: + +/usr/include/i386-linux-gnu/sys/types.h: + +/usr/include/time.h: + +/usr/include/endian.h: + +/usr/include/i386-linux-gnu/bits/endian.h: + +/usr/include/i386-linux-gnu/bits/byteswap.h: + +/usr/include/i386-linux-gnu/sys/select.h: + +/usr/include/i386-linux-gnu/bits/select.h: + +/usr/include/i386-linux-gnu/bits/sigset.h: + +/usr/include/i386-linux-gnu/bits/time.h: + +/usr/include/i386-linux-gnu/sys/sysmacros.h: + +/usr/include/i386-linux-gnu/bits/pthreadtypes.h: + +/usr/include/i386-linux-gnu/sys/stat.h: + +/usr/include/i386-linux-gnu/bits/stat.h: + +/usr/include/stdlib.h: + +/usr/include/i386-linux-gnu/bits/waitflags.h: + +/usr/include/i386-linux-gnu/bits/waitstatus.h: + +/usr/include/alloca.h: + +/usr/include/string.h: + +/usr/include/xlocale.h: + +/usr/include/i386-linux-gnu/bits/string.h: + +/usr/include/i386-linux-gnu/bits/string2.h: + +/usr/include/strings.h: + +/usr/include/inttypes.h: + +/usr/include/unistd.h: + +/usr/include/i386-linux-gnu/bits/posix_opt.h: + +/usr/include/i386-linux-gnu/bits/environments.h: + +/usr/include/i386-linux-gnu/bits/confname.h: + +/usr/include/getopt.h: + +/usr/include/netinet/in.h: + +/usr/include/i386-linux-gnu/sys/socket.h: + +/usr/include/i386-linux-gnu/sys/uio.h: + +/usr/include/i386-linux-gnu/bits/uio.h: + +/usr/include/i386-linux-gnu/bits/socket.h: + +/usr/include/i386-linux-gnu/bits/sockaddr.h: + +/usr/include/i386-linux-gnu/asm/socket.h: + +/usr/include/asm-generic/socket.h: + +/usr/include/i386-linux-gnu/asm/sockios.h: + +/usr/include/asm-generic/sockios.h: + +/usr/include/i386-linux-gnu/bits/in.h: + +/usr/include/netinet/tcp.h: + +/usr/include/arpa/nameser.h: + +/usr/include/i386-linux-gnu/sys/param.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/limits.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/syslimits.h: + +/usr/include/limits.h: + +/usr/include/i386-linux-gnu/bits/posix1_lim.h: + +/usr/include/i386-linux-gnu/bits/local_lim.h: + +/usr/include/linux/limits.h: + +/usr/include/i386-linux-gnu/bits/posix2_lim.h: + +/usr/include/linux/param.h: + +/usr/include/i386-linux-gnu/asm/param.h: + +/usr/include/asm-generic/param.h: + +/usr/include/i386-linux-gnu/sys/bitypes.h: + +/usr/include/arpa/nameser_compat.h: + +/usr/include/netdb.h: + +/usr/include/rpc/netdb.h: + +/usr/include/i386-linux-gnu/bits/netdb.h: + +/usr/include/malloc.h: + +/usr/include/ctype.h: + +include/antlr3interfaces.h: + +include/antlr3convertutf.h: + +include/antlr3input.h: + +include/antlr3string.h: + +include/antlr3collections.h: + +include/antlr3bitset.h: + +include/antlr3commontoken.h: + +include/antlr3intstream.h: + +include/antlr3tokenstream.h: + +include/antlr3debugeventlistener.h: + +include/antlr3basetree.h: + +include/antlr3baserecognizer.h: + +include/antlr3exception.h: + +include/antlr3commontreenodestream.h: + +include/antlr3commontreeadaptor.h: + +include/antlr3basetreeadaptor.h: + +include/antlr3commontree.h: + +include/antlr3recognizersharedstate.h: + +include/antlr3parser.h: + +include/antlr3treeparser.h: diff --git a/antlr/libantlr3c-3.4/.deps/antlr3parser.Plo b/antlr/libantlr3c-3.4/.deps/antlr3parser.Plo new file mode 100644 index 0000000..9700032 --- /dev/null +++ b/antlr/libantlr3c-3.4/.deps/antlr3parser.Plo @@ -0,0 +1,274 @@ +antlr3parser.lo: src/antlr3parser.c include/antlr3parser.h \ + include/antlr3defs.h include/antlr3errors.h antlr3config.h \ + /usr/include/stdio.h /usr/include/features.h \ + /usr/include/i386-linux-gnu/bits/predefs.h \ + /usr/include/i386-linux-gnu/sys/cdefs.h \ + /usr/include/i386-linux-gnu/bits/wordsize.h \ + /usr/include/i386-linux-gnu/gnu/stubs.h \ + /usr/include/i386-linux-gnu/gnu/stubs-32.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include/stddef.h \ + /usr/include/i386-linux-gnu/bits/types.h \ + /usr/include/i386-linux-gnu/bits/typesizes.h /usr/include/libio.h \ + /usr/include/_G_config.h /usr/include/wchar.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include/stdarg.h \ + /usr/include/i386-linux-gnu/bits/stdio_lim.h \ + /usr/include/i386-linux-gnu/bits/sys_errlist.h \ + /usr/include/i386-linux-gnu/bits/stdio.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include/stdint.h /usr/include/stdint.h \ + /usr/include/i386-linux-gnu/bits/wchar.h \ + /usr/include/i386-linux-gnu/sys/types.h /usr/include/time.h \ + /usr/include/endian.h /usr/include/i386-linux-gnu/bits/endian.h \ + /usr/include/i386-linux-gnu/bits/byteswap.h \ + /usr/include/i386-linux-gnu/sys/select.h \ + /usr/include/i386-linux-gnu/bits/select.h \ + /usr/include/i386-linux-gnu/bits/sigset.h \ + /usr/include/i386-linux-gnu/bits/time.h \ + /usr/include/i386-linux-gnu/sys/sysmacros.h \ + /usr/include/i386-linux-gnu/bits/pthreadtypes.h \ + /usr/include/i386-linux-gnu/sys/stat.h \ + /usr/include/i386-linux-gnu/bits/stat.h /usr/include/stdlib.h \ + /usr/include/i386-linux-gnu/bits/waitflags.h \ + /usr/include/i386-linux-gnu/bits/waitstatus.h /usr/include/alloca.h \ + /usr/include/string.h /usr/include/xlocale.h \ + /usr/include/i386-linux-gnu/bits/string.h \ + /usr/include/i386-linux-gnu/bits/string2.h /usr/include/strings.h \ + /usr/include/inttypes.h /usr/include/unistd.h \ + /usr/include/i386-linux-gnu/bits/posix_opt.h \ + /usr/include/i386-linux-gnu/bits/environments.h \ + /usr/include/i386-linux-gnu/bits/confname.h /usr/include/getopt.h \ + /usr/include/netinet/in.h /usr/include/i386-linux-gnu/sys/socket.h \ + /usr/include/i386-linux-gnu/sys/uio.h \ + /usr/include/i386-linux-gnu/bits/uio.h \ + /usr/include/i386-linux-gnu/bits/socket.h \ + /usr/include/i386-linux-gnu/bits/sockaddr.h \ + /usr/include/i386-linux-gnu/asm/socket.h \ + /usr/include/asm-generic/socket.h \ + /usr/include/i386-linux-gnu/asm/sockios.h \ + /usr/include/asm-generic/sockios.h /usr/include/i386-linux-gnu/bits/in.h \ + /usr/include/netinet/tcp.h /usr/include/arpa/nameser.h \ + /usr/include/i386-linux-gnu/sys/param.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/limits.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/syslimits.h \ + /usr/include/limits.h /usr/include/i386-linux-gnu/bits/posix1_lim.h \ + /usr/include/i386-linux-gnu/bits/local_lim.h /usr/include/linux/limits.h \ + /usr/include/i386-linux-gnu/bits/posix2_lim.h /usr/include/linux/param.h \ + /usr/include/i386-linux-gnu/asm/param.h /usr/include/asm-generic/param.h \ + /usr/include/i386-linux-gnu/sys/bitypes.h \ + /usr/include/arpa/nameser_compat.h /usr/include/netdb.h \ + /usr/include/rpc/netdb.h /usr/include/i386-linux-gnu/bits/netdb.h \ + /usr/include/malloc.h /usr/include/ctype.h include/antlr3interfaces.h \ + include/antlr3convertutf.h include/antlr3baserecognizer.h \ + include/antlr3exception.h include/antlr3input.h include/antlr3string.h \ + include/antlr3collections.h include/antlr3bitset.h \ + include/antlr3commontoken.h include/antlr3intstream.h \ + include/antlr3tokenstream.h include/antlr3debugeventlistener.h \ + include/antlr3basetree.h include/antlr3commontreenodestream.h \ + include/antlr3commontreeadaptor.h include/antlr3basetreeadaptor.h \ + include/antlr3commontree.h include/antlr3recognizersharedstate.h \ + include/antlr3lexer.h include/antlr3treeparser.h + +include/antlr3parser.h: + +include/antlr3defs.h: + +include/antlr3errors.h: + +antlr3config.h: + +/usr/include/stdio.h: + +/usr/include/features.h: + +/usr/include/i386-linux-gnu/bits/predefs.h: + +/usr/include/i386-linux-gnu/sys/cdefs.h: + +/usr/include/i386-linux-gnu/bits/wordsize.h: + +/usr/include/i386-linux-gnu/gnu/stubs.h: + +/usr/include/i386-linux-gnu/gnu/stubs-32.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include/stddef.h: + +/usr/include/i386-linux-gnu/bits/types.h: + +/usr/include/i386-linux-gnu/bits/typesizes.h: + +/usr/include/libio.h: + +/usr/include/_G_config.h: + +/usr/include/wchar.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include/stdarg.h: + +/usr/include/i386-linux-gnu/bits/stdio_lim.h: + +/usr/include/i386-linux-gnu/bits/sys_errlist.h: + +/usr/include/i386-linux-gnu/bits/stdio.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include/stdint.h: + +/usr/include/stdint.h: + +/usr/include/i386-linux-gnu/bits/wchar.h: + +/usr/include/i386-linux-gnu/sys/types.h: + +/usr/include/time.h: + +/usr/include/endian.h: + +/usr/include/i386-linux-gnu/bits/endian.h: + +/usr/include/i386-linux-gnu/bits/byteswap.h: + +/usr/include/i386-linux-gnu/sys/select.h: + +/usr/include/i386-linux-gnu/bits/select.h: + +/usr/include/i386-linux-gnu/bits/sigset.h: + +/usr/include/i386-linux-gnu/bits/time.h: + +/usr/include/i386-linux-gnu/sys/sysmacros.h: + +/usr/include/i386-linux-gnu/bits/pthreadtypes.h: + +/usr/include/i386-linux-gnu/sys/stat.h: + +/usr/include/i386-linux-gnu/bits/stat.h: + +/usr/include/stdlib.h: + +/usr/include/i386-linux-gnu/bits/waitflags.h: + +/usr/include/i386-linux-gnu/bits/waitstatus.h: + +/usr/include/alloca.h: + +/usr/include/string.h: + +/usr/include/xlocale.h: + +/usr/include/i386-linux-gnu/bits/string.h: + +/usr/include/i386-linux-gnu/bits/string2.h: + +/usr/include/strings.h: + +/usr/include/inttypes.h: + +/usr/include/unistd.h: + +/usr/include/i386-linux-gnu/bits/posix_opt.h: + +/usr/include/i386-linux-gnu/bits/environments.h: + +/usr/include/i386-linux-gnu/bits/confname.h: + +/usr/include/getopt.h: + +/usr/include/netinet/in.h: + +/usr/include/i386-linux-gnu/sys/socket.h: + +/usr/include/i386-linux-gnu/sys/uio.h: + +/usr/include/i386-linux-gnu/bits/uio.h: + +/usr/include/i386-linux-gnu/bits/socket.h: + +/usr/include/i386-linux-gnu/bits/sockaddr.h: + +/usr/include/i386-linux-gnu/asm/socket.h: + +/usr/include/asm-generic/socket.h: + +/usr/include/i386-linux-gnu/asm/sockios.h: + +/usr/include/asm-generic/sockios.h: + +/usr/include/i386-linux-gnu/bits/in.h: + +/usr/include/netinet/tcp.h: + +/usr/include/arpa/nameser.h: + +/usr/include/i386-linux-gnu/sys/param.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/limits.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/syslimits.h: + +/usr/include/limits.h: + +/usr/include/i386-linux-gnu/bits/posix1_lim.h: + +/usr/include/i386-linux-gnu/bits/local_lim.h: + +/usr/include/linux/limits.h: + +/usr/include/i386-linux-gnu/bits/posix2_lim.h: + +/usr/include/linux/param.h: + +/usr/include/i386-linux-gnu/asm/param.h: + +/usr/include/asm-generic/param.h: + +/usr/include/i386-linux-gnu/sys/bitypes.h: + +/usr/include/arpa/nameser_compat.h: + +/usr/include/netdb.h: + +/usr/include/rpc/netdb.h: + +/usr/include/i386-linux-gnu/bits/netdb.h: + +/usr/include/malloc.h: + +/usr/include/ctype.h: + +include/antlr3interfaces.h: + +include/antlr3convertutf.h: + +include/antlr3baserecognizer.h: + +include/antlr3exception.h: + +include/antlr3input.h: + +include/antlr3string.h: + +include/antlr3collections.h: + +include/antlr3bitset.h: + +include/antlr3commontoken.h: + +include/antlr3intstream.h: + +include/antlr3tokenstream.h: + +include/antlr3debugeventlistener.h: + +include/antlr3basetree.h: + +include/antlr3commontreenodestream.h: + +include/antlr3commontreeadaptor.h: + +include/antlr3basetreeadaptor.h: + +include/antlr3commontree.h: + +include/antlr3recognizersharedstate.h: + +include/antlr3lexer.h: + +include/antlr3treeparser.h: diff --git a/antlr/libantlr3c-3.4/.deps/antlr3rewritestreams.Plo b/antlr/libantlr3c-3.4/.deps/antlr3rewritestreams.Plo new file mode 100644 index 0000000..879dd91 --- /dev/null +++ b/antlr/libantlr3c-3.4/.deps/antlr3rewritestreams.Plo @@ -0,0 +1,277 @@ +antlr3rewritestreams.lo: src/antlr3rewritestreams.c \ + include/antlr3rewritestreams.h include/antlr3defs.h \ + include/antlr3errors.h antlr3config.h /usr/include/stdio.h \ + /usr/include/features.h /usr/include/i386-linux-gnu/bits/predefs.h \ + /usr/include/i386-linux-gnu/sys/cdefs.h \ + /usr/include/i386-linux-gnu/bits/wordsize.h \ + /usr/include/i386-linux-gnu/gnu/stubs.h \ + /usr/include/i386-linux-gnu/gnu/stubs-32.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include/stddef.h \ + /usr/include/i386-linux-gnu/bits/types.h \ + /usr/include/i386-linux-gnu/bits/typesizes.h /usr/include/libio.h \ + /usr/include/_G_config.h /usr/include/wchar.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include/stdarg.h \ + /usr/include/i386-linux-gnu/bits/stdio_lim.h \ + /usr/include/i386-linux-gnu/bits/sys_errlist.h \ + /usr/include/i386-linux-gnu/bits/stdio.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include/stdint.h /usr/include/stdint.h \ + /usr/include/i386-linux-gnu/bits/wchar.h \ + /usr/include/i386-linux-gnu/sys/types.h /usr/include/time.h \ + /usr/include/endian.h /usr/include/i386-linux-gnu/bits/endian.h \ + /usr/include/i386-linux-gnu/bits/byteswap.h \ + /usr/include/i386-linux-gnu/sys/select.h \ + /usr/include/i386-linux-gnu/bits/select.h \ + /usr/include/i386-linux-gnu/bits/sigset.h \ + /usr/include/i386-linux-gnu/bits/time.h \ + /usr/include/i386-linux-gnu/sys/sysmacros.h \ + /usr/include/i386-linux-gnu/bits/pthreadtypes.h \ + /usr/include/i386-linux-gnu/sys/stat.h \ + /usr/include/i386-linux-gnu/bits/stat.h /usr/include/stdlib.h \ + /usr/include/i386-linux-gnu/bits/waitflags.h \ + /usr/include/i386-linux-gnu/bits/waitstatus.h /usr/include/alloca.h \ + /usr/include/string.h /usr/include/xlocale.h \ + /usr/include/i386-linux-gnu/bits/string.h \ + /usr/include/i386-linux-gnu/bits/string2.h /usr/include/strings.h \ + /usr/include/inttypes.h /usr/include/unistd.h \ + /usr/include/i386-linux-gnu/bits/posix_opt.h \ + /usr/include/i386-linux-gnu/bits/environments.h \ + /usr/include/i386-linux-gnu/bits/confname.h /usr/include/getopt.h \ + /usr/include/netinet/in.h /usr/include/i386-linux-gnu/sys/socket.h \ + /usr/include/i386-linux-gnu/sys/uio.h \ + /usr/include/i386-linux-gnu/bits/uio.h \ + /usr/include/i386-linux-gnu/bits/socket.h \ + /usr/include/i386-linux-gnu/bits/sockaddr.h \ + /usr/include/i386-linux-gnu/asm/socket.h \ + /usr/include/asm-generic/socket.h \ + /usr/include/i386-linux-gnu/asm/sockios.h \ + /usr/include/asm-generic/sockios.h /usr/include/i386-linux-gnu/bits/in.h \ + /usr/include/netinet/tcp.h /usr/include/arpa/nameser.h \ + /usr/include/i386-linux-gnu/sys/param.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/limits.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/syslimits.h \ + /usr/include/limits.h /usr/include/i386-linux-gnu/bits/posix1_lim.h \ + /usr/include/i386-linux-gnu/bits/local_lim.h /usr/include/linux/limits.h \ + /usr/include/i386-linux-gnu/bits/posix2_lim.h /usr/include/linux/param.h \ + /usr/include/i386-linux-gnu/asm/param.h /usr/include/asm-generic/param.h \ + /usr/include/i386-linux-gnu/sys/bitypes.h \ + /usr/include/arpa/nameser_compat.h /usr/include/netdb.h \ + /usr/include/rpc/netdb.h /usr/include/i386-linux-gnu/bits/netdb.h \ + /usr/include/malloc.h /usr/include/ctype.h include/antlr3interfaces.h \ + include/antlr3convertutf.h include/antlr3collections.h \ + include/antlr3bitset.h include/antlr3commontreeadaptor.h \ + include/antlr3string.h include/antlr3basetreeadaptor.h \ + include/antlr3basetree.h include/antlr3commontoken.h \ + include/antlr3debugeventlistener.h include/antlr3commontree.h \ + include/antlr3baserecognizer.h include/antlr3exception.h \ + include/antlr3input.h include/antlr3intstream.h \ + include/antlr3tokenstream.h include/antlr3commontreenodestream.h \ + include/antlr3recognizersharedstate.h include/antlr3lexer.h \ + include/antlr3parser.h include/antlr3treeparser.h + +include/antlr3rewritestreams.h: + +include/antlr3defs.h: + +include/antlr3errors.h: + +antlr3config.h: + +/usr/include/stdio.h: + +/usr/include/features.h: + +/usr/include/i386-linux-gnu/bits/predefs.h: + +/usr/include/i386-linux-gnu/sys/cdefs.h: + +/usr/include/i386-linux-gnu/bits/wordsize.h: + +/usr/include/i386-linux-gnu/gnu/stubs.h: + +/usr/include/i386-linux-gnu/gnu/stubs-32.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include/stddef.h: + +/usr/include/i386-linux-gnu/bits/types.h: + +/usr/include/i386-linux-gnu/bits/typesizes.h: + +/usr/include/libio.h: + +/usr/include/_G_config.h: + +/usr/include/wchar.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include/stdarg.h: + +/usr/include/i386-linux-gnu/bits/stdio_lim.h: + +/usr/include/i386-linux-gnu/bits/sys_errlist.h: + +/usr/include/i386-linux-gnu/bits/stdio.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include/stdint.h: + +/usr/include/stdint.h: + +/usr/include/i386-linux-gnu/bits/wchar.h: + +/usr/include/i386-linux-gnu/sys/types.h: + +/usr/include/time.h: + +/usr/include/endian.h: + +/usr/include/i386-linux-gnu/bits/endian.h: + +/usr/include/i386-linux-gnu/bits/byteswap.h: + +/usr/include/i386-linux-gnu/sys/select.h: + +/usr/include/i386-linux-gnu/bits/select.h: + +/usr/include/i386-linux-gnu/bits/sigset.h: + +/usr/include/i386-linux-gnu/bits/time.h: + +/usr/include/i386-linux-gnu/sys/sysmacros.h: + +/usr/include/i386-linux-gnu/bits/pthreadtypes.h: + +/usr/include/i386-linux-gnu/sys/stat.h: + +/usr/include/i386-linux-gnu/bits/stat.h: + +/usr/include/stdlib.h: + +/usr/include/i386-linux-gnu/bits/waitflags.h: + +/usr/include/i386-linux-gnu/bits/waitstatus.h: + +/usr/include/alloca.h: + +/usr/include/string.h: + +/usr/include/xlocale.h: + +/usr/include/i386-linux-gnu/bits/string.h: + +/usr/include/i386-linux-gnu/bits/string2.h: + +/usr/include/strings.h: + +/usr/include/inttypes.h: + +/usr/include/unistd.h: + +/usr/include/i386-linux-gnu/bits/posix_opt.h: + +/usr/include/i386-linux-gnu/bits/environments.h: + +/usr/include/i386-linux-gnu/bits/confname.h: + +/usr/include/getopt.h: + +/usr/include/netinet/in.h: + +/usr/include/i386-linux-gnu/sys/socket.h: + +/usr/include/i386-linux-gnu/sys/uio.h: + +/usr/include/i386-linux-gnu/bits/uio.h: + +/usr/include/i386-linux-gnu/bits/socket.h: + +/usr/include/i386-linux-gnu/bits/sockaddr.h: + +/usr/include/i386-linux-gnu/asm/socket.h: + +/usr/include/asm-generic/socket.h: + +/usr/include/i386-linux-gnu/asm/sockios.h: + +/usr/include/asm-generic/sockios.h: + +/usr/include/i386-linux-gnu/bits/in.h: + +/usr/include/netinet/tcp.h: + +/usr/include/arpa/nameser.h: + +/usr/include/i386-linux-gnu/sys/param.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/limits.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/syslimits.h: + +/usr/include/limits.h: + +/usr/include/i386-linux-gnu/bits/posix1_lim.h: + +/usr/include/i386-linux-gnu/bits/local_lim.h: + +/usr/include/linux/limits.h: + +/usr/include/i386-linux-gnu/bits/posix2_lim.h: + +/usr/include/linux/param.h: + +/usr/include/i386-linux-gnu/asm/param.h: + +/usr/include/asm-generic/param.h: + +/usr/include/i386-linux-gnu/sys/bitypes.h: + +/usr/include/arpa/nameser_compat.h: + +/usr/include/netdb.h: + +/usr/include/rpc/netdb.h: + +/usr/include/i386-linux-gnu/bits/netdb.h: + +/usr/include/malloc.h: + +/usr/include/ctype.h: + +include/antlr3interfaces.h: + +include/antlr3convertutf.h: + +include/antlr3collections.h: + +include/antlr3bitset.h: + +include/antlr3commontreeadaptor.h: + +include/antlr3string.h: + +include/antlr3basetreeadaptor.h: + +include/antlr3basetree.h: + +include/antlr3commontoken.h: + +include/antlr3debugeventlistener.h: + +include/antlr3commontree.h: + +include/antlr3baserecognizer.h: + +include/antlr3exception.h: + +include/antlr3input.h: + +include/antlr3intstream.h: + +include/antlr3tokenstream.h: + +include/antlr3commontreenodestream.h: + +include/antlr3recognizersharedstate.h: + +include/antlr3lexer.h: + +include/antlr3parser.h: + +include/antlr3treeparser.h: diff --git a/antlr/libantlr3c-3.4/.deps/antlr3string.Plo b/antlr/libantlr3c-3.4/.deps/antlr3string.Plo new file mode 100644 index 0000000..15b3d1c --- /dev/null +++ b/antlr/libantlr3c-3.4/.deps/antlr3string.Plo @@ -0,0 +1,235 @@ +antlr3string.lo: src/antlr3string.c include/antlr3string.h \ + include/antlr3defs.h include/antlr3errors.h antlr3config.h \ + /usr/include/stdio.h /usr/include/features.h \ + /usr/include/i386-linux-gnu/bits/predefs.h \ + /usr/include/i386-linux-gnu/sys/cdefs.h \ + /usr/include/i386-linux-gnu/bits/wordsize.h \ + /usr/include/i386-linux-gnu/gnu/stubs.h \ + /usr/include/i386-linux-gnu/gnu/stubs-32.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include/stddef.h \ + /usr/include/i386-linux-gnu/bits/types.h \ + /usr/include/i386-linux-gnu/bits/typesizes.h /usr/include/libio.h \ + /usr/include/_G_config.h /usr/include/wchar.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include/stdarg.h \ + /usr/include/i386-linux-gnu/bits/stdio_lim.h \ + /usr/include/i386-linux-gnu/bits/sys_errlist.h \ + /usr/include/i386-linux-gnu/bits/stdio.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include/stdint.h /usr/include/stdint.h \ + /usr/include/i386-linux-gnu/bits/wchar.h \ + /usr/include/i386-linux-gnu/sys/types.h /usr/include/time.h \ + /usr/include/endian.h /usr/include/i386-linux-gnu/bits/endian.h \ + /usr/include/i386-linux-gnu/bits/byteswap.h \ + /usr/include/i386-linux-gnu/sys/select.h \ + /usr/include/i386-linux-gnu/bits/select.h \ + /usr/include/i386-linux-gnu/bits/sigset.h \ + /usr/include/i386-linux-gnu/bits/time.h \ + /usr/include/i386-linux-gnu/sys/sysmacros.h \ + /usr/include/i386-linux-gnu/bits/pthreadtypes.h \ + /usr/include/i386-linux-gnu/sys/stat.h \ + /usr/include/i386-linux-gnu/bits/stat.h /usr/include/stdlib.h \ + /usr/include/i386-linux-gnu/bits/waitflags.h \ + /usr/include/i386-linux-gnu/bits/waitstatus.h /usr/include/alloca.h \ + /usr/include/string.h /usr/include/xlocale.h \ + /usr/include/i386-linux-gnu/bits/string.h \ + /usr/include/i386-linux-gnu/bits/string2.h /usr/include/strings.h \ + /usr/include/inttypes.h /usr/include/unistd.h \ + /usr/include/i386-linux-gnu/bits/posix_opt.h \ + /usr/include/i386-linux-gnu/bits/environments.h \ + /usr/include/i386-linux-gnu/bits/confname.h /usr/include/getopt.h \ + /usr/include/netinet/in.h /usr/include/i386-linux-gnu/sys/socket.h \ + /usr/include/i386-linux-gnu/sys/uio.h \ + /usr/include/i386-linux-gnu/bits/uio.h \ + /usr/include/i386-linux-gnu/bits/socket.h \ + /usr/include/i386-linux-gnu/bits/sockaddr.h \ + /usr/include/i386-linux-gnu/asm/socket.h \ + /usr/include/asm-generic/socket.h \ + /usr/include/i386-linux-gnu/asm/sockios.h \ + /usr/include/asm-generic/sockios.h /usr/include/i386-linux-gnu/bits/in.h \ + /usr/include/netinet/tcp.h /usr/include/arpa/nameser.h \ + /usr/include/i386-linux-gnu/sys/param.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/limits.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/syslimits.h \ + /usr/include/limits.h /usr/include/i386-linux-gnu/bits/posix1_lim.h \ + /usr/include/i386-linux-gnu/bits/local_lim.h /usr/include/linux/limits.h \ + /usr/include/i386-linux-gnu/bits/posix2_lim.h /usr/include/linux/param.h \ + /usr/include/i386-linux-gnu/asm/param.h /usr/include/asm-generic/param.h \ + /usr/include/i386-linux-gnu/sys/bitypes.h \ + /usr/include/arpa/nameser_compat.h /usr/include/netdb.h \ + /usr/include/rpc/netdb.h /usr/include/i386-linux-gnu/bits/netdb.h \ + /usr/include/malloc.h /usr/include/ctype.h include/antlr3interfaces.h \ + include/antlr3convertutf.h include/antlr3collections.h \ + include/antlr3bitset.h + +include/antlr3string.h: + +include/antlr3defs.h: + +include/antlr3errors.h: + +antlr3config.h: + +/usr/include/stdio.h: + +/usr/include/features.h: + +/usr/include/i386-linux-gnu/bits/predefs.h: + +/usr/include/i386-linux-gnu/sys/cdefs.h: + +/usr/include/i386-linux-gnu/bits/wordsize.h: + +/usr/include/i386-linux-gnu/gnu/stubs.h: + +/usr/include/i386-linux-gnu/gnu/stubs-32.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include/stddef.h: + +/usr/include/i386-linux-gnu/bits/types.h: + +/usr/include/i386-linux-gnu/bits/typesizes.h: + +/usr/include/libio.h: + +/usr/include/_G_config.h: + +/usr/include/wchar.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include/stdarg.h: + +/usr/include/i386-linux-gnu/bits/stdio_lim.h: + +/usr/include/i386-linux-gnu/bits/sys_errlist.h: + +/usr/include/i386-linux-gnu/bits/stdio.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include/stdint.h: + +/usr/include/stdint.h: + +/usr/include/i386-linux-gnu/bits/wchar.h: + +/usr/include/i386-linux-gnu/sys/types.h: + +/usr/include/time.h: + +/usr/include/endian.h: + +/usr/include/i386-linux-gnu/bits/endian.h: + +/usr/include/i386-linux-gnu/bits/byteswap.h: + +/usr/include/i386-linux-gnu/sys/select.h: + +/usr/include/i386-linux-gnu/bits/select.h: + +/usr/include/i386-linux-gnu/bits/sigset.h: + +/usr/include/i386-linux-gnu/bits/time.h: + +/usr/include/i386-linux-gnu/sys/sysmacros.h: + +/usr/include/i386-linux-gnu/bits/pthreadtypes.h: + +/usr/include/i386-linux-gnu/sys/stat.h: + +/usr/include/i386-linux-gnu/bits/stat.h: + +/usr/include/stdlib.h: + +/usr/include/i386-linux-gnu/bits/waitflags.h: + +/usr/include/i386-linux-gnu/bits/waitstatus.h: + +/usr/include/alloca.h: + +/usr/include/string.h: + +/usr/include/xlocale.h: + +/usr/include/i386-linux-gnu/bits/string.h: + +/usr/include/i386-linux-gnu/bits/string2.h: + +/usr/include/strings.h: + +/usr/include/inttypes.h: + +/usr/include/unistd.h: + +/usr/include/i386-linux-gnu/bits/posix_opt.h: + +/usr/include/i386-linux-gnu/bits/environments.h: + +/usr/include/i386-linux-gnu/bits/confname.h: + +/usr/include/getopt.h: + +/usr/include/netinet/in.h: + +/usr/include/i386-linux-gnu/sys/socket.h: + +/usr/include/i386-linux-gnu/sys/uio.h: + +/usr/include/i386-linux-gnu/bits/uio.h: + +/usr/include/i386-linux-gnu/bits/socket.h: + +/usr/include/i386-linux-gnu/bits/sockaddr.h: + +/usr/include/i386-linux-gnu/asm/socket.h: + +/usr/include/asm-generic/socket.h: + +/usr/include/i386-linux-gnu/asm/sockios.h: + +/usr/include/asm-generic/sockios.h: + +/usr/include/i386-linux-gnu/bits/in.h: + +/usr/include/netinet/tcp.h: + +/usr/include/arpa/nameser.h: + +/usr/include/i386-linux-gnu/sys/param.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/limits.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/syslimits.h: + +/usr/include/limits.h: + +/usr/include/i386-linux-gnu/bits/posix1_lim.h: + +/usr/include/i386-linux-gnu/bits/local_lim.h: + +/usr/include/linux/limits.h: + +/usr/include/i386-linux-gnu/bits/posix2_lim.h: + +/usr/include/linux/param.h: + +/usr/include/i386-linux-gnu/asm/param.h: + +/usr/include/asm-generic/param.h: + +/usr/include/i386-linux-gnu/sys/bitypes.h: + +/usr/include/arpa/nameser_compat.h: + +/usr/include/netdb.h: + +/usr/include/rpc/netdb.h: + +/usr/include/i386-linux-gnu/bits/netdb.h: + +/usr/include/malloc.h: + +/usr/include/ctype.h: + +include/antlr3interfaces.h: + +include/antlr3convertutf.h: + +include/antlr3collections.h: + +include/antlr3bitset.h: diff --git a/antlr/libantlr3c-3.4/.deps/antlr3tokenstream.Plo b/antlr/libantlr3c-3.4/.deps/antlr3tokenstream.Plo new file mode 100644 index 0000000..d97c475 --- /dev/null +++ b/antlr/libantlr3c-3.4/.deps/antlr3tokenstream.Plo @@ -0,0 +1,249 @@ +antlr3tokenstream.lo: src/antlr3tokenstream.c include/antlr3tokenstream.h \ + include/antlr3defs.h include/antlr3errors.h antlr3config.h \ + /usr/include/stdio.h /usr/include/features.h \ + /usr/include/i386-linux-gnu/bits/predefs.h \ + /usr/include/i386-linux-gnu/sys/cdefs.h \ + /usr/include/i386-linux-gnu/bits/wordsize.h \ + /usr/include/i386-linux-gnu/gnu/stubs.h \ + /usr/include/i386-linux-gnu/gnu/stubs-32.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include/stddef.h \ + /usr/include/i386-linux-gnu/bits/types.h \ + /usr/include/i386-linux-gnu/bits/typesizes.h /usr/include/libio.h \ + /usr/include/_G_config.h /usr/include/wchar.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include/stdarg.h \ + /usr/include/i386-linux-gnu/bits/stdio_lim.h \ + /usr/include/i386-linux-gnu/bits/sys_errlist.h \ + /usr/include/i386-linux-gnu/bits/stdio.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include/stdint.h /usr/include/stdint.h \ + /usr/include/i386-linux-gnu/bits/wchar.h \ + /usr/include/i386-linux-gnu/sys/types.h /usr/include/time.h \ + /usr/include/endian.h /usr/include/i386-linux-gnu/bits/endian.h \ + /usr/include/i386-linux-gnu/bits/byteswap.h \ + /usr/include/i386-linux-gnu/sys/select.h \ + /usr/include/i386-linux-gnu/bits/select.h \ + /usr/include/i386-linux-gnu/bits/sigset.h \ + /usr/include/i386-linux-gnu/bits/time.h \ + /usr/include/i386-linux-gnu/sys/sysmacros.h \ + /usr/include/i386-linux-gnu/bits/pthreadtypes.h \ + /usr/include/i386-linux-gnu/sys/stat.h \ + /usr/include/i386-linux-gnu/bits/stat.h /usr/include/stdlib.h \ + /usr/include/i386-linux-gnu/bits/waitflags.h \ + /usr/include/i386-linux-gnu/bits/waitstatus.h /usr/include/alloca.h \ + /usr/include/string.h /usr/include/xlocale.h \ + /usr/include/i386-linux-gnu/bits/string.h \ + /usr/include/i386-linux-gnu/bits/string2.h /usr/include/strings.h \ + /usr/include/inttypes.h /usr/include/unistd.h \ + /usr/include/i386-linux-gnu/bits/posix_opt.h \ + /usr/include/i386-linux-gnu/bits/environments.h \ + /usr/include/i386-linux-gnu/bits/confname.h /usr/include/getopt.h \ + /usr/include/netinet/in.h /usr/include/i386-linux-gnu/sys/socket.h \ + /usr/include/i386-linux-gnu/sys/uio.h \ + /usr/include/i386-linux-gnu/bits/uio.h \ + /usr/include/i386-linux-gnu/bits/socket.h \ + /usr/include/i386-linux-gnu/bits/sockaddr.h \ + /usr/include/i386-linux-gnu/asm/socket.h \ + /usr/include/asm-generic/socket.h \ + /usr/include/i386-linux-gnu/asm/sockios.h \ + /usr/include/asm-generic/sockios.h /usr/include/i386-linux-gnu/bits/in.h \ + /usr/include/netinet/tcp.h /usr/include/arpa/nameser.h \ + /usr/include/i386-linux-gnu/sys/param.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/limits.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/syslimits.h \ + /usr/include/limits.h /usr/include/i386-linux-gnu/bits/posix1_lim.h \ + /usr/include/i386-linux-gnu/bits/local_lim.h /usr/include/linux/limits.h \ + /usr/include/i386-linux-gnu/bits/posix2_lim.h /usr/include/linux/param.h \ + /usr/include/i386-linux-gnu/asm/param.h /usr/include/asm-generic/param.h \ + /usr/include/i386-linux-gnu/sys/bitypes.h \ + /usr/include/arpa/nameser_compat.h /usr/include/netdb.h \ + /usr/include/rpc/netdb.h /usr/include/i386-linux-gnu/bits/netdb.h \ + /usr/include/malloc.h /usr/include/ctype.h include/antlr3interfaces.h \ + include/antlr3convertutf.h include/antlr3string.h \ + include/antlr3collections.h include/antlr3bitset.h include/antlr3input.h \ + include/antlr3commontoken.h include/antlr3intstream.h \ + include/antlr3debugeventlistener.h include/antlr3basetree.h + +include/antlr3tokenstream.h: + +include/antlr3defs.h: + +include/antlr3errors.h: + +antlr3config.h: + +/usr/include/stdio.h: + +/usr/include/features.h: + +/usr/include/i386-linux-gnu/bits/predefs.h: + +/usr/include/i386-linux-gnu/sys/cdefs.h: + +/usr/include/i386-linux-gnu/bits/wordsize.h: + +/usr/include/i386-linux-gnu/gnu/stubs.h: + +/usr/include/i386-linux-gnu/gnu/stubs-32.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include/stddef.h: + +/usr/include/i386-linux-gnu/bits/types.h: + +/usr/include/i386-linux-gnu/bits/typesizes.h: + +/usr/include/libio.h: + +/usr/include/_G_config.h: + +/usr/include/wchar.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include/stdarg.h: + +/usr/include/i386-linux-gnu/bits/stdio_lim.h: + +/usr/include/i386-linux-gnu/bits/sys_errlist.h: + +/usr/include/i386-linux-gnu/bits/stdio.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include/stdint.h: + +/usr/include/stdint.h: + +/usr/include/i386-linux-gnu/bits/wchar.h: + +/usr/include/i386-linux-gnu/sys/types.h: + +/usr/include/time.h: + +/usr/include/endian.h: + +/usr/include/i386-linux-gnu/bits/endian.h: + +/usr/include/i386-linux-gnu/bits/byteswap.h: + +/usr/include/i386-linux-gnu/sys/select.h: + +/usr/include/i386-linux-gnu/bits/select.h: + +/usr/include/i386-linux-gnu/bits/sigset.h: + +/usr/include/i386-linux-gnu/bits/time.h: + +/usr/include/i386-linux-gnu/sys/sysmacros.h: + +/usr/include/i386-linux-gnu/bits/pthreadtypes.h: + +/usr/include/i386-linux-gnu/sys/stat.h: + +/usr/include/i386-linux-gnu/bits/stat.h: + +/usr/include/stdlib.h: + +/usr/include/i386-linux-gnu/bits/waitflags.h: + +/usr/include/i386-linux-gnu/bits/waitstatus.h: + +/usr/include/alloca.h: + +/usr/include/string.h: + +/usr/include/xlocale.h: + +/usr/include/i386-linux-gnu/bits/string.h: + +/usr/include/i386-linux-gnu/bits/string2.h: + +/usr/include/strings.h: + +/usr/include/inttypes.h: + +/usr/include/unistd.h: + +/usr/include/i386-linux-gnu/bits/posix_opt.h: + +/usr/include/i386-linux-gnu/bits/environments.h: + +/usr/include/i386-linux-gnu/bits/confname.h: + +/usr/include/getopt.h: + +/usr/include/netinet/in.h: + +/usr/include/i386-linux-gnu/sys/socket.h: + +/usr/include/i386-linux-gnu/sys/uio.h: + +/usr/include/i386-linux-gnu/bits/uio.h: + +/usr/include/i386-linux-gnu/bits/socket.h: + +/usr/include/i386-linux-gnu/bits/sockaddr.h: + +/usr/include/i386-linux-gnu/asm/socket.h: + +/usr/include/asm-generic/socket.h: + +/usr/include/i386-linux-gnu/asm/sockios.h: + +/usr/include/asm-generic/sockios.h: + +/usr/include/i386-linux-gnu/bits/in.h: + +/usr/include/netinet/tcp.h: + +/usr/include/arpa/nameser.h: + +/usr/include/i386-linux-gnu/sys/param.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/limits.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/syslimits.h: + +/usr/include/limits.h: + +/usr/include/i386-linux-gnu/bits/posix1_lim.h: + +/usr/include/i386-linux-gnu/bits/local_lim.h: + +/usr/include/linux/limits.h: + +/usr/include/i386-linux-gnu/bits/posix2_lim.h: + +/usr/include/linux/param.h: + +/usr/include/i386-linux-gnu/asm/param.h: + +/usr/include/asm-generic/param.h: + +/usr/include/i386-linux-gnu/sys/bitypes.h: + +/usr/include/arpa/nameser_compat.h: + +/usr/include/netdb.h: + +/usr/include/rpc/netdb.h: + +/usr/include/i386-linux-gnu/bits/netdb.h: + +/usr/include/malloc.h: + +/usr/include/ctype.h: + +include/antlr3interfaces.h: + +include/antlr3convertutf.h: + +include/antlr3string.h: + +include/antlr3collections.h: + +include/antlr3bitset.h: + +include/antlr3input.h: + +include/antlr3commontoken.h: + +include/antlr3intstream.h: + +include/antlr3debugeventlistener.h: + +include/antlr3basetree.h: diff --git a/antlr/libantlr3c-3.4/.deps/antlr3treeparser.Plo b/antlr/libantlr3c-3.4/.deps/antlr3treeparser.Plo new file mode 100644 index 0000000..4b4a2e8 --- /dev/null +++ b/antlr/libantlr3c-3.4/.deps/antlr3treeparser.Plo @@ -0,0 +1,274 @@ +antlr3treeparser.lo: src/antlr3treeparser.c include/antlr3treeparser.h \ + include/antlr3defs.h include/antlr3errors.h antlr3config.h \ + /usr/include/stdio.h /usr/include/features.h \ + /usr/include/i386-linux-gnu/bits/predefs.h \ + /usr/include/i386-linux-gnu/sys/cdefs.h \ + /usr/include/i386-linux-gnu/bits/wordsize.h \ + /usr/include/i386-linux-gnu/gnu/stubs.h \ + /usr/include/i386-linux-gnu/gnu/stubs-32.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include/stddef.h \ + /usr/include/i386-linux-gnu/bits/types.h \ + /usr/include/i386-linux-gnu/bits/typesizes.h /usr/include/libio.h \ + /usr/include/_G_config.h /usr/include/wchar.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include/stdarg.h \ + /usr/include/i386-linux-gnu/bits/stdio_lim.h \ + /usr/include/i386-linux-gnu/bits/sys_errlist.h \ + /usr/include/i386-linux-gnu/bits/stdio.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include/stdint.h /usr/include/stdint.h \ + /usr/include/i386-linux-gnu/bits/wchar.h \ + /usr/include/i386-linux-gnu/sys/types.h /usr/include/time.h \ + /usr/include/endian.h /usr/include/i386-linux-gnu/bits/endian.h \ + /usr/include/i386-linux-gnu/bits/byteswap.h \ + /usr/include/i386-linux-gnu/sys/select.h \ + /usr/include/i386-linux-gnu/bits/select.h \ + /usr/include/i386-linux-gnu/bits/sigset.h \ + /usr/include/i386-linux-gnu/bits/time.h \ + /usr/include/i386-linux-gnu/sys/sysmacros.h \ + /usr/include/i386-linux-gnu/bits/pthreadtypes.h \ + /usr/include/i386-linux-gnu/sys/stat.h \ + /usr/include/i386-linux-gnu/bits/stat.h /usr/include/stdlib.h \ + /usr/include/i386-linux-gnu/bits/waitflags.h \ + /usr/include/i386-linux-gnu/bits/waitstatus.h /usr/include/alloca.h \ + /usr/include/string.h /usr/include/xlocale.h \ + /usr/include/i386-linux-gnu/bits/string.h \ + /usr/include/i386-linux-gnu/bits/string2.h /usr/include/strings.h \ + /usr/include/inttypes.h /usr/include/unistd.h \ + /usr/include/i386-linux-gnu/bits/posix_opt.h \ + /usr/include/i386-linux-gnu/bits/environments.h \ + /usr/include/i386-linux-gnu/bits/confname.h /usr/include/getopt.h \ + /usr/include/netinet/in.h /usr/include/i386-linux-gnu/sys/socket.h \ + /usr/include/i386-linux-gnu/sys/uio.h \ + /usr/include/i386-linux-gnu/bits/uio.h \ + /usr/include/i386-linux-gnu/bits/socket.h \ + /usr/include/i386-linux-gnu/bits/sockaddr.h \ + /usr/include/i386-linux-gnu/asm/socket.h \ + /usr/include/asm-generic/socket.h \ + /usr/include/i386-linux-gnu/asm/sockios.h \ + /usr/include/asm-generic/sockios.h /usr/include/i386-linux-gnu/bits/in.h \ + /usr/include/netinet/tcp.h /usr/include/arpa/nameser.h \ + /usr/include/i386-linux-gnu/sys/param.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/limits.h \ + /usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/syslimits.h \ + /usr/include/limits.h /usr/include/i386-linux-gnu/bits/posix1_lim.h \ + /usr/include/i386-linux-gnu/bits/local_lim.h /usr/include/linux/limits.h \ + /usr/include/i386-linux-gnu/bits/posix2_lim.h /usr/include/linux/param.h \ + /usr/include/i386-linux-gnu/asm/param.h /usr/include/asm-generic/param.h \ + /usr/include/i386-linux-gnu/sys/bitypes.h \ + /usr/include/arpa/nameser_compat.h /usr/include/netdb.h \ + /usr/include/rpc/netdb.h /usr/include/i386-linux-gnu/bits/netdb.h \ + /usr/include/malloc.h /usr/include/ctype.h include/antlr3interfaces.h \ + include/antlr3convertutf.h include/antlr3baserecognizer.h \ + include/antlr3exception.h include/antlr3input.h include/antlr3string.h \ + include/antlr3collections.h include/antlr3bitset.h \ + include/antlr3commontoken.h include/antlr3intstream.h \ + include/antlr3tokenstream.h include/antlr3debugeventlistener.h \ + include/antlr3basetree.h include/antlr3commontreenodestream.h \ + include/antlr3commontreeadaptor.h include/antlr3basetreeadaptor.h \ + include/antlr3commontree.h include/antlr3recognizersharedstate.h \ + include/antlr3lexer.h include/antlr3parser.h + +include/antlr3treeparser.h: + +include/antlr3defs.h: + +include/antlr3errors.h: + +antlr3config.h: + +/usr/include/stdio.h: + +/usr/include/features.h: + +/usr/include/i386-linux-gnu/bits/predefs.h: + +/usr/include/i386-linux-gnu/sys/cdefs.h: + +/usr/include/i386-linux-gnu/bits/wordsize.h: + +/usr/include/i386-linux-gnu/gnu/stubs.h: + +/usr/include/i386-linux-gnu/gnu/stubs-32.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include/stddef.h: + +/usr/include/i386-linux-gnu/bits/types.h: + +/usr/include/i386-linux-gnu/bits/typesizes.h: + +/usr/include/libio.h: + +/usr/include/_G_config.h: + +/usr/include/wchar.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include/stdarg.h: + +/usr/include/i386-linux-gnu/bits/stdio_lim.h: + +/usr/include/i386-linux-gnu/bits/sys_errlist.h: + +/usr/include/i386-linux-gnu/bits/stdio.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include/stdint.h: + +/usr/include/stdint.h: + +/usr/include/i386-linux-gnu/bits/wchar.h: + +/usr/include/i386-linux-gnu/sys/types.h: + +/usr/include/time.h: + +/usr/include/endian.h: + +/usr/include/i386-linux-gnu/bits/endian.h: + +/usr/include/i386-linux-gnu/bits/byteswap.h: + +/usr/include/i386-linux-gnu/sys/select.h: + +/usr/include/i386-linux-gnu/bits/select.h: + +/usr/include/i386-linux-gnu/bits/sigset.h: + +/usr/include/i386-linux-gnu/bits/time.h: + +/usr/include/i386-linux-gnu/sys/sysmacros.h: + +/usr/include/i386-linux-gnu/bits/pthreadtypes.h: + +/usr/include/i386-linux-gnu/sys/stat.h: + +/usr/include/i386-linux-gnu/bits/stat.h: + +/usr/include/stdlib.h: + +/usr/include/i386-linux-gnu/bits/waitflags.h: + +/usr/include/i386-linux-gnu/bits/waitstatus.h: + +/usr/include/alloca.h: + +/usr/include/string.h: + +/usr/include/xlocale.h: + +/usr/include/i386-linux-gnu/bits/string.h: + +/usr/include/i386-linux-gnu/bits/string2.h: + +/usr/include/strings.h: + +/usr/include/inttypes.h: + +/usr/include/unistd.h: + +/usr/include/i386-linux-gnu/bits/posix_opt.h: + +/usr/include/i386-linux-gnu/bits/environments.h: + +/usr/include/i386-linux-gnu/bits/confname.h: + +/usr/include/getopt.h: + +/usr/include/netinet/in.h: + +/usr/include/i386-linux-gnu/sys/socket.h: + +/usr/include/i386-linux-gnu/sys/uio.h: + +/usr/include/i386-linux-gnu/bits/uio.h: + +/usr/include/i386-linux-gnu/bits/socket.h: + +/usr/include/i386-linux-gnu/bits/sockaddr.h: + +/usr/include/i386-linux-gnu/asm/socket.h: + +/usr/include/asm-generic/socket.h: + +/usr/include/i386-linux-gnu/asm/sockios.h: + +/usr/include/asm-generic/sockios.h: + +/usr/include/i386-linux-gnu/bits/in.h: + +/usr/include/netinet/tcp.h: + +/usr/include/arpa/nameser.h: + +/usr/include/i386-linux-gnu/sys/param.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/limits.h: + +/usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/syslimits.h: + +/usr/include/limits.h: + +/usr/include/i386-linux-gnu/bits/posix1_lim.h: + +/usr/include/i386-linux-gnu/bits/local_lim.h: + +/usr/include/linux/limits.h: + +/usr/include/i386-linux-gnu/bits/posix2_lim.h: + +/usr/include/linux/param.h: + +/usr/include/i386-linux-gnu/asm/param.h: + +/usr/include/asm-generic/param.h: + +/usr/include/i386-linux-gnu/sys/bitypes.h: + +/usr/include/arpa/nameser_compat.h: + +/usr/include/netdb.h: + +/usr/include/rpc/netdb.h: + +/usr/include/i386-linux-gnu/bits/netdb.h: + +/usr/include/malloc.h: + +/usr/include/ctype.h: + +include/antlr3interfaces.h: + +include/antlr3convertutf.h: + +include/antlr3baserecognizer.h: + +include/antlr3exception.h: + +include/antlr3input.h: + +include/antlr3string.h: + +include/antlr3collections.h: + +include/antlr3bitset.h: + +include/antlr3commontoken.h: + +include/antlr3intstream.h: + +include/antlr3tokenstream.h: + +include/antlr3debugeventlistener.h: + +include/antlr3basetree.h: + +include/antlr3commontreenodestream.h: + +include/antlr3commontreeadaptor.h: + +include/antlr3basetreeadaptor.h: + +include/antlr3commontree.h: + +include/antlr3recognizersharedstate.h: + +include/antlr3lexer.h: + +include/antlr3parser.h: diff --git a/antlr/libantlr3c-3.4/AUTHORS b/antlr/libantlr3c-3.4/AUTHORS new file mode 100644 index 0000000..9195a9d --- /dev/null +++ b/antlr/libantlr3c-3.4/AUTHORS @@ -0,0 +1,41 @@ +The ANTLR recognizer generator tool was written by (with many contributions) + + Prof. Terence Parr at USF + +The C runtime and related C code generation elements were written by + + Jim Idle (jimi idle ws s/ /./g) with no contributions at all because + nobody else was crazy enough to do it. + +The C runtime and the ANLTR tool itself are distributed under the BSD license +which basically gives the right to so anythign with it, so long as you +recognize the authors. See here: + + [The "BSD licence"] + Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC + http://www.temporal-wave.com + http://www.linkedin.com/in/jimidle + + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + 3. The name of the author may not be used to endorse or promote products + derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/antlr/libantlr3c-3.4/C.sln b/antlr/libantlr3c-3.4/C.sln new file mode 100644 index 0000000..f841177 --- /dev/null +++ b/antlr/libantlr3c-3.4/C.sln @@ -0,0 +1,53 @@ +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "C", "C.vcproj", "{0F0FE03A-78F3-4B34-9DCE-0CDFF1FB5C40}" +EndProject +Global + GlobalSection(SourceCodeControl) = preSolution + SccNumberOfProjects = 2 + SccProjectName0 = Perforce\u0020Project + SccLocalPath0 = ..\\.. + SccProvider0 = MSSCCI:Perforce\u0020SCM + SccProjectFilePathRelativizedFromConnection0 = runtime\\C\\ + SccProjectUniqueName1 = C.vcproj + SccLocalPath1 = ..\\.. + SccProjectFilePathRelativizedFromConnection1 = runtime\\C\\ + EndGlobalSection + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 + DebugDLL|Win32 = DebugDLL|Win32 + DebugDLL|x64 = DebugDLL|x64 + Deployment|Win32 = Deployment|Win32 + Deployment|x64 = Deployment|x64 + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 + ReleaseDLL|Win32 = ReleaseDLL|Win32 + ReleaseDLL|x64 = ReleaseDLL|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {0F0FE03A-78F3-4B34-9DCE-0CDFF1FB5C40}.Debug|Win32.ActiveCfg = Debug|Win32 + {0F0FE03A-78F3-4B34-9DCE-0CDFF1FB5C40}.Debug|Win32.Build.0 = Debug|Win32 + {0F0FE03A-78F3-4B34-9DCE-0CDFF1FB5C40}.Debug|x64.ActiveCfg = Debug|x64 + {0F0FE03A-78F3-4B34-9DCE-0CDFF1FB5C40}.Debug|x64.Build.0 = Debug|x64 + {0F0FE03A-78F3-4B34-9DCE-0CDFF1FB5C40}.DebugDLL|Win32.ActiveCfg = DebugDLL|Win32 + {0F0FE03A-78F3-4B34-9DCE-0CDFF1FB5C40}.DebugDLL|Win32.Build.0 = DebugDLL|Win32 + {0F0FE03A-78F3-4B34-9DCE-0CDFF1FB5C40}.DebugDLL|x64.ActiveCfg = DebugDLL|x64 + {0F0FE03A-78F3-4B34-9DCE-0CDFF1FB5C40}.DebugDLL|x64.Build.0 = DebugDLL|x64 + {0F0FE03A-78F3-4B34-9DCE-0CDFF1FB5C40}.Deployment|Win32.ActiveCfg = DebugDLL|Win32 + {0F0FE03A-78F3-4B34-9DCE-0CDFF1FB5C40}.Deployment|Win32.Build.0 = DebugDLL|Win32 + {0F0FE03A-78F3-4B34-9DCE-0CDFF1FB5C40}.Deployment|x64.ActiveCfg = DebugDLL|x64 + {0F0FE03A-78F3-4B34-9DCE-0CDFF1FB5C40}.Deployment|x64.Build.0 = DebugDLL|x64 + {0F0FE03A-78F3-4B34-9DCE-0CDFF1FB5C40}.Release|Win32.ActiveCfg = Release|Win32 + {0F0FE03A-78F3-4B34-9DCE-0CDFF1FB5C40}.Release|Win32.Build.0 = Release|Win32 + {0F0FE03A-78F3-4B34-9DCE-0CDFF1FB5C40}.Release|x64.ActiveCfg = Release|x64 + {0F0FE03A-78F3-4B34-9DCE-0CDFF1FB5C40}.Release|x64.Build.0 = Release|x64 + {0F0FE03A-78F3-4B34-9DCE-0CDFF1FB5C40}.ReleaseDLL|Win32.ActiveCfg = ReleaseDLL|Win32 + {0F0FE03A-78F3-4B34-9DCE-0CDFF1FB5C40}.ReleaseDLL|Win32.Build.0 = ReleaseDLL|Win32 + {0F0FE03A-78F3-4B34-9DCE-0CDFF1FB5C40}.ReleaseDLL|x64.ActiveCfg = ReleaseDLL|x64 + {0F0FE03A-78F3-4B34-9DCE-0CDFF1FB5C40}.ReleaseDLL|x64.Build.0 = ReleaseDLL|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/antlr/libantlr3c-3.4/C.vcproj b/antlr/libantlr3c-3.4/C.vcproj new file mode 100644 index 0000000..16d9c2b --- /dev/null +++ b/antlr/libantlr3c-3.4/C.vcproj @@ -0,0 +1,1043 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/antlr/libantlr3c-3.4/C.vcproj.vspscc b/antlr/libantlr3c-3.4/C.vcproj.vspscc new file mode 100644 index 0000000..953a1b9 --- /dev/null +++ b/antlr/libantlr3c-3.4/C.vcproj.vspscc @@ -0,0 +1,14 @@ +"" +{ +"FILE_VERSION" = "9237" +"ENLISTMENT_CHOICE" = "NEVER" +"PROJECT_FILE_RELATIVE_PATH" = "" +"NUMBER_OF_EXCLUDED_FILES" = "4" +"EXCLUDED_FILE0" = "debugdll\\antlr3cd_dll.lib" +"EXCLUDED_FILE1" = "releasedll\\antlr3c_dll.lib" +"EXCLUDED_FILE2" = "debugdll\\antlr3cd_dll.exp" +"EXCLUDED_FILE3" = "releasedll\\antlr3c_dll.exp" +"ORIGINAL_PROJECT_FILE_PATH" = "" +"NUMBER_OF_NESTED_PROJECTS" = "0" +"SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER" +} diff --git a/antlr/libantlr3c-3.4/C.vssscc b/antlr/libantlr3c-3.4/C.vssscc new file mode 100644 index 0000000..6cb031b --- /dev/null +++ b/antlr/libantlr3c-3.4/C.vssscc @@ -0,0 +1,10 @@ +"" +{ +"FILE_VERSION" = "9237" +"ENLISTMENT_CHOICE" = "NEVER" +"PROJECT_FILE_RELATIVE_PATH" = "" +"NUMBER_OF_EXCLUDED_FILES" = "0" +"ORIGINAL_PROJECT_FILE_PATH" = "" +"NUMBER_OF_NESTED_PROJECTS" = "0" +"SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROJECT" +} diff --git a/antlr/libantlr3c-3.4/COPYING b/antlr/libantlr3c-3.4/COPYING new file mode 100644 index 0000000..f62f896 --- /dev/null +++ b/antlr/libantlr3c-3.4/COPYING @@ -0,0 +1,29 @@ +// [The "BSD licence"] +// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC +// http://www.temporal-wave.com +// http://www.linkedin.com/in/jimidle +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. The name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + diff --git a/antlr/libantlr3c-3.4/ChangeLog b/antlr/libantlr3c-3.4/ChangeLog new file mode 100644 index 0000000..c5540d9 --- /dev/null +++ b/antlr/libantlr3c-3.4/ChangeLog @@ -0,0 +1,550 @@ +The following changes (change numbers refer to perforce) were +made from version 3.1.1 to 3.1.2 + +Runtime +------- + +Change 5641 on 2009/02/20 by jimi@jimi.jimi.antlr3 + + Release version 3.1.2 of the ANTLR C runtime. + + Updated documents and release notes will have to follow later. + +Change 5639 on 2009/02/20 by jimi@jimi.jimi.antlr3 + + Fixed: ANTLR-356 + + Ensure that code generation for C++ does not require casts + +Change 5577 on 2009/02/12 by jimi@jimi.jimi.antlr3 + + C Runtime - Bug fixes. + + o Having moved to use an extract directly from a vector for returning + tokens, it exposed a + bug whereby the EOF boudary calculation in tokLT was incorrectly + checking > rather than >=. + o Changing to API initialization of tokens rather than memcmp() + incorrectly forgot to set teh input stream pointer for the + manufactured tokens in the token factory; + o Rewrite streams for rewriting tree parsers did not check whether the + rewrite stream was ever assigned before trying to free it, it is now + in line with the ordinary parser code. + +Change 5576 on 2009/02/11 by jimi@jimi.jimi.antlr3 + + C Runtime: Ensure that when we manufacture a new token for a missing + token, that the user suplied custom information (if any) is copied + from the current token. + +Change 5575 on 2009/02/08 by jimi@jimi.jimi.antlr3 + + C Runtime - Vastly improve the reuse of allocated memory for nodes in + tree rewriting. + + A problem for all targets at the moment si that the rewrite logic + generated by ANTLR makes no attempt + to reuse any resources, it merely gurantees that the tree shape at the + end is correct. To some extent this is mitigated by the garbage + collection systems of Java and .Net, even thoguh it is still an overhead to + keep creating so many modes. + + This change implements the first of two C runtime changes that make + best efforst to track when a node has become orphaned and will never + be reused, based on inherent knowledge of the rewrite logic (which in + the long term is not a great soloution). + + Much of the rewrite logic consists of creating a niilnode into which + child nodes are appended. At: rulePost processing time; when a rewrite + stream is closed; and when becomeRoot is called, there are many situations + where the root of the tree that will be manipulted, or is finished with + (in the case of rewrtie streams), where the nilNode was just a temporary + creation for the sake of the rewrite itself. + + In these cases we can see that the nilNode would just be left ot rot in + the node factory that tracks all the tree nodes. + Rather than leave these in the factory to rot, we now keep a resuse + stck and always reuse any node on this + stack before claimin a new node from the factory pool. + + This single change alone reduces memory usage in the test case (20,604 + line C program and a GNU C parser) + from nearly a GB, to 276MB. This is still way more memory than we + shoudl need to do this operation, even on such a large input file, + but the reduction results in a huge performance increase and greatly + reduced system time spent on allocations. + + After this optimizatoin, comparison with gcc yeilds: + + time gcc -S a.c + a.c:1026: warning: conflicting types for built-in function ‘vsprintf’ + a.c:1030: warning: conflicting types for built-in function ‘vsnprintf’ + a.c:1041: warning: conflicting types for built-in function ‘vsscanf’ + 0.21user 0.01system 0:00.22elapsed 97%CPU (0avgtext+0avgdata 0maxresident)k + 0inputs+240outputs (0major+8345minor)pagefaults 0swaps + + and + + time ./jimi + Reading a.c + 0.28user 0.11system 0:00.39elapsed 98%CPU (0avgtext+0avgdata 0maxresident)k + 0inputs+0outputs (0major+66609minor)pagefaults 0swaps + + And we can now interpolate the fact that the only major differnce is + now the huge disparity in memory allocations. A + future optimization of vector pooling, to sepate node resue from vector + reuse, currently looks promising for further reuse of memory. + + Finally, a static analysis of the rewrte code, plus a realtime analysis + of the heap at runtime, may well give us a reasonable memory usage + pattern. In reality though, it is the generated rewrite logic + that must becom optional at not continuously rewriting things that it + need not, as it ascends the rule chain. + +Change 5563 on 2009/01/28 by jimi@jimi.jimi.antlr3 + + Allow rewrite streams to use the base adaptors vector factory and not + try to malloc new vectors themselves. + +Change 5562 on 2009/01/28 by jimi@jimi.jimi.antlr3 + + Don't use CALLOC to allocate tree pools, use malloc as there is no need + for calloc. + +Change 5561 on 2009/01/28 by jimi@jimi.jimi.antlr3 + + Prevent warnigsn about retval.stop not being initialized when a rule + returns eraly because it is in backtracking mode + +Change 5558 on 2009/01/28 by jimi@jimi.jimi.antlr3 + + Lots of optimizations (though the next one to be checked in is the huge + win) for AST building and vector factories. + + A large part of tree rewriting was the creation of vectors to hold AST + nodes. Although I had created a vector factory, for some reason I never got + around to creating a proper one, that pre-allocated the vectors in chunks and + so on. I guess I just forgot to. Hence a big win here is prevention of calling + malloc lots and lots of times to create vectors. + + A second inprovement was to change teh vector definition such that it + holds a certain number of elements wihtin the vector structure itself, rather + than malloc and freeing these. Currently this is set to 8, but may increase. + For AST construction, this is generally a big win because AST nodes don't often + have many individual children unless there has not been any shaping going on in + the parser. But if you are not shaping, then you don't really need a tree. + + Other perforamnce inprovements here include not calling functions + indirectly within token stream and common token stream. Hence tokens are + claimed directly from the vectors. Users can override these funcitons of course + and all this means is that if you override tokenstreams then you pretty much + have to provide all the mehtods, but then I think you woudl have to anyway (and + I don't know of anyone that has wanted to do this as you can carry your own + structure around with the tokens anyway and that is much easier). + +Change 5555 on 2009/01/26 by jimi@jimi.jimi.antlr3 + + Fixed: ANTLR-288 + Correct the interpretation of the skip token such that channel, start + index, char pos in lie, start line and text are correctly reset to the start of + the new token when the one that we just traversed was marked as being skipped. + + This correctly excludes the text that was matched as part of the + SKIP()ed token from the next token in the token stream and so has the side + effect that asking for $text of a rule no longer includes the text that shuodl + be skipped, but DOES include the text of tokens that were merely placed off the + default channel. + +Change 5551 on 2009/01/25 by jimi@jimi.jimi.antlr3 + + Fixed: ANTLR-287 + Most of the source files did not include the BSD license. THis might + not be that big a deal given that I don't care what people do with it + other than take my name off it, but having the license reproduced + everywhere + at least makes things perfectly clear. Hence this mass change of + sources and templates + to include the license. + +Change 5550 on 2009/01/25 by jimi@jimi.jimi.antlr3 + + Fixed: ANTLR-365 + Ensure that as soon as we known about an input stream on the lexer that + we borrow its string factroy adn use it in our EOF token in case + anyone tries to make it a string, such as in error messages for + instance. + +Change 5548 on 2009/01/25 by jimi@jimi.jimi.antlr3 + + Fixed: ANTLR-363 + At some point the Java runtime default changed from discarding offchannel + tokens to preserving them. The fix is to make the C runtime also + default to preserving off-channel tokens. + +Change 5544 on 2009/01/24 by jimi@jimi.jimi.antlr3 + + Fixed: ANTLR-360 + Ensure that the fillBuffer funtiion does not call any methods + that require the cached buffer size to be recorded before we + have actually recorded it. + +Change 5543 on 2009/01/24 by jimi@jimi.jimi.antlr3 + + Fixed: ANTLR-362 + Some users have started using string factories themselves and + exposed a flaw in the destroy method, that is intended to remove + a strng htat was created by the factory and is no longer needed. + The string was correctly removed from the vector that tracks them + but after the first one, all the remaining strings are then numbered + incorrectly. Hence the destroy method has been recoded to reindex + the strings in the factory after one is removed and everythig is once + more hunky dory. + User suggested fix rejected. + +Change 5542 on 2009/01/24 by jimi@jimi.jimi.antlr3 + + Fixed ANTLR-366 + The recognizer state now ensures that all fields are set to NULL upon +creation + and the reset does not overwrite the tokenname array + +Change 5527 on 2009/01/15 by jimi@jimi.jimi.antlr3 + + Add the C runtime for 3.1.2 beta2 to perforce + +Change 5526 on 2009/01/15 by jimi@jimi.jimivista.antlr3 + + Correctly define the MEMMOVE macro which was inadvertently left to be + memcpy. + +Change 5503 on 2008/12/12 by jimi@jimi.jimi.antlr3 + + Change C runtime release number to 3.1.2 beta + +Change 5473 on 2008/12/01 by jimi@jimi.jimivista.antlr3 + + Fixed: ANTLR-350 - C runtime use of memcpy + Prior change to use memcpy instead of memmove in all cases missed the + fact that the string factory can be in a situation where overlaps occur. We now + have ANTLR3_MEMCPY and ANTLR3_MEMMOVE and use the two appropriately. + +Change 5471 on 2008/12/01 by jimi@jimi.jimivista.antlr3 + + Fixed ANTLR-361 + - Ensure that ANTLR3_BOOLEAN is typedef'ed correctly when building for + MingW + +Templates +--------- + +Change 5637 on 2009/02/20 by jimi@jimi.jimi.antlr3 + + C rtunime - make sure that ADAPTOR results are cast to the tree type on + a rewrite + +Change 5620 on 2009/02/18 by jimi@jimi.jimi.antlr3 + + Rename/Move: + From: //depot/code/antlr/main/src/org/antlr/codegen/templates/... + To: //depot/code/antlr/main/src/main/resources/org/antlr/codegen/templates/... + + Relocate the code generating templates to exist in the directory set + that maven expects. + + When checking in your templates, you may find it easiest to make a copy + of what you have, revert the change in perforce, then just check out the + template in the new location, and copy the changes back over. Nobody has oore + than two files open at the moment. + +Change 5578 on 2009/02/12 by jimi@jimi.jimi.antlr3 + + Correct the string template escape sequences for generating scope + code in the C templates. + +Change 5577 on 2009/02/12 by jimi@jimi.jimi.antlr3 + + C Runtime - Bug fixes. + + o Having moved to use an extract directly from a vector for returning + tokens, it exposed a + bug whereby the EOF boudary calculation in tokLT was incorrectly + checking > rather than + >=. + o Changing to API initialization of tokens rather than memcmp() + incorrectly forgot to + set teh input stream pointer for the manufactured tokens in the + token factory; + o Rewrite streams for rewriting tree parsers did not check whether the + rewrite stream + was ever assigned before trying to free it, it is now in line with + the ordinary parser code. + +Change 5567 on 2009/01/29 by jimi@jimi.jimi.antlr3 + + C Runtime - Further Optimizations + + Within grammars that used scopes and were intended to parse large + inputs with many rule nests, + the creation anf deletion of the scopes themselves became significant. + Careful analysis shows that + for most grammars, while a parse could create and delete 20,000 scopes, + the maxium depth of + any scope was only 8. + + This change therefore changes the scope implementation so that it does + not free scope memory when + it is popped but just tracks it in a C runtime stack, eventually + freeing it when the stack is freed. This change + caused the allocation of only 12 scope structures instead of 20,000 for + the extreme example case. + + This change means that scope users must be carefule (as ever in C) to + initializae their scope elements + correctly as: + + 1) If not you may inherit values from a prior use of the scope + structure; + 2) SCope structure are now allocated with malloc and not calloc; + + Also, when using a custom free function to clean a scope when it is + popped, it is probably a good idea + to set any free'd pointers to NULL (this is generally good C programmig + practice in any case) + +Change 5566 on 2009/01/29 by jimi@jimi.jimi.antlr3 + + Remove redundant BACKTRACK checking so that MSVC9 does not get confused + about possibly uninitialized variables + +Change 5565 on 2009/01/28 by jimi@jimi.jimi.antlr3 + + Use malloc rather than calloc to allocate memory for new scopes. Note + that this means users will have to be careful to initialize any values in their + scopes that they expect to be 0 or NULL and I must document this. + +Change 5564 on 2009/01/28 by jimi@jimi.jimi.antlr3 + + Use malloc rather than calloc for copying list lable tokens for + rewrites. + +Change 5561 on 2009/01/28 by jimi@jimi.jimi.antlr3 + + Prevent warnigsn about retval.stop not being initialized when a rule + returns eraly because it is in backtracking mode + +Change 5560 on 2009/01/28 by jimi@jimi.jimi.antlr3 + + Add a NULL check before freeing rewrite streams used in AST rewrites + rather than auto-rewrites. + + While the NULL check is redundant as the free cannot be called unless + it is assigned, Visual Studio C 2008 + gets it wrong and thinks that there is a PATH than can arrive at the + free wihtout it being assigned and that is too annoying to ignore. + +Change 5559 on 2009/01/28 by jimi@jimi.jimi.antlr3 + + C target Tree rewrite optimization + + There is only one optimization in this change, but it is a huge one. + + The code generation templates were set up so that at the start of a rule, + any rewrite streams mentioned in the rule wer pre-created. However, this + is a massive overhead for rules where only one or two of the streams are + actually used, as we create them then free them without ever using them. + This was copied from the Java templates basically. + This caused literally millions of extra calls and vector allocations + in the case of the GNU C parser given to me for testing with a 20,000 + line program. + + After this change, the following comparison is avaiable against the gcc + compiler: + + Before (different machines here so use the relative difference for + comparison): + + gcc: + + real 0m0.425s + user 0m0.384s + sys 0m0.036s + + ANTLR C + real 0m1.958s + user 0m1.284s + sys 0m0.656s + + After the previous optimizations for vector pooling via a factory, + plus this huge win in removing redundant code, we have the following + (different machine to the one above): + + gcc: + 0.21user 0.01system 0:00.23elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k + 0inputs+328outputs (0major+9922minor)pagefaults 0swaps + + ANTLR C: + + 0.37user 0.26system 0:00.64elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k + 0inputs+0outputs (0major+130944minor)pagefaults 0swaps + + The extra system time coming from the fact that although the tree + rewriting is now optimal in terms of not allocating things it does + not need, there is still a lot more overhead in a parser that is generated + for generic use, including much more use of structures for tokens and extra + copying and so on. I will + continue to work on improviing things where I can, but the next big + improvement will come from Ter's optimization of the actual code structures we + generate including not doing things with rewrite streams that we do not need to + do at all. + + The second machine I used is about twice as fast CPU wise as the system + that was used originally by the user that asked about this performance. + +Change 5558 on 2009/01/28 by jimi@jimi.jimi.antlr3 + + Lots of optimizations (though the next one to be checked in is the huge + win) for AST building and vector factories. + + A large part of tree rewriting was the creation of vectors to hold AST + nodes. Although I had created a vector factory, for some reason I never got + around to creating a proper one, that pre-allocated the vectors in chunks and + so on. I guess I just forgot to. Hence a big win here is prevention of calling + malloc lots and lots of times to create vectors. + + A second inprovement was to change teh vector definition such that it + holds a certain number of elements wihtin the vector structure itself, rather + than malloc and freeing these. Currently this is set to 8, but may increase. + For AST construction, this is generally a big win because AST nodes don't often + have many individual children unless there has not been any shaping going on in + the parser. But if you are not shaping, then you don't really need a tree. + + Other perforamnce inprovements here include not calling functions + indirectly within token stream and common token stream. Hence tokens are + claimed directly from the vectors. Users can override these funcitons of course + and all this means is that if you override tokenstreams then you pretty much + have to provide all the mehtods, but then I think you woudl have to anyway (and + I don't know of anyone that has wanted to do this as you can carry your own + structure around with the tokens anyway and that is much easier). + +Change 5554 on 2009/01/26 by jimi@jimi.jimi.antlr3 + + Fixed: ANTLR-379 + For some reason in the past, the ruleMemozation() template had required + that the name parameter be set to the rule name. This does not seem to be a + requirement any more. The name=xxx override when invoking the template was + causing all the scope names derived when cleaning up in memoization to be + called after the rule name, which was not correct. Howver, this only affected + the output when in output=AST mode. + + This template invocation is now corrected. + +Change 5553 on 2009/01/26 by jimi@jimi.jimi.antlr3 + + Fixed: ANTLR-330 + Managed to get the one rule that could not see the ASTLabelType to call + back in to the super template C.stg and ask it to construct hte name. I am not + 100% sure that this fixes all cases, but I cannot find any that fail. PLease + let me know if you find any exampoles of being unable to default the + ASTLabelType option in the C target. + +Change 5552 on 2009/01/25 by jimi@jimi.jimi.antlr3 + + Progress: ANTLR-327 + Fix debug code generation templates when output=AST such that code + can at least be generated and I can debug the output code correctly. + Note that this checkin does not implement the debugging requirements + for tree generating parsers. + +Change 5551 on 2009/01/25 by jimi@jimi.jimi.antlr3 + + Fixed: ANTLR-287 + Most of the source files did not include the BSD license. THis might + not be that big a deal given that I don't care what people do with it + other than take my name off it, but having the license reproduced + everywhere at least makes things perfectly clear. Hence this mass change of + sources and templates to include the license. + +Change 5549 on 2009/01/25 by jimi@jimi.jimi.antlr3 + + Fixed: ANTLR-354 + Using 0.0D as the default initialize value for a double caused + VS 2003 C compiler to bomb out. There seesm to be no reason other + than force of habit to set this to 0.0D so I have dropped the D so + that older compilers do not complain. + +Change 5547 on 2009/01/25 by jimi@jimi.jimi.antlr3 + + Fixed: ANTLR-282 + All references are now unadorned with any type of NULL check for the + following reasons: + + 1) A NULL reference means that there is a problem with the + grammar and we need the program to fail immediately so + that the programmer can work out where the problem occured; + 2) Most of the time, the only sensible value that can be + returned is NULL or 0 which + obviates the NULL check in the first place; + 3) If we replace a NULL reference with some value such as 0, + then the program may blithely continue but just do something + logically wrong, which will be very difficult for the + grammar programmer to detect and correct. + +Change 5545 on 2009/01/24 by jimi@jimi.jimi.antlr3 + + Fixed: ANTLR-357 + The bug report was correct in that the types of references to things + like $start were being incorrectly cast as they wer not changed from + Java style casts (and the casts are unneccessary). this is now fixed + and references are referencing the correct, uncast, types. + However, the bug report was wrong in that the reference in the bok to + $start.pos will only work for Java and really, it is incorrect in the + book because it shoudl not access the .pos member directly but shudl + be using $start.getCharPositionInLine(). + Because there is no access qualification in C, one could use + $start.charPosition, however + really this should be $start->getCharPositionInLine($start); + +Change 5541 on 2009/01/24 by jimi@jimi.jimi.antlr3 + + Fixed - ANTLR-367 + The code generation for the free method of a recognizer was not + distinguishing tree parsers from parsers when it came to calling delegate free + functions. + This is now corrected. + +Change 5540 on 2009/01/24 by jimi@jimi.jimi.antlr3 + + Fixed ANTLR-355 + Ensure that we do not attempt to free any memory that we did not + actually allocate because the parser rule was being executed in + backtracking mode. + +Change 5539 on 2009/01/24 by jimi@jimi.jimivista.antlr3 + + Fixed: ANTLR-355 + When a C targetted parser is producing in backtracking mode, then the + creation of new stream rewrite structures shoudl not happen if the rule is + currently backtracking + +Change 5502 on 2008/12/11 by jimi@jimi.jimi.antlr3 + + Fixed: ANTLR-349 Ensure that all marker labels in the lexer are 64 bit + compatible + +Change 5473 on 2008/12/01 by jimi@jimi.jimivista.antlr3 + + Fixed: ANTLR-350 - C runtime use of memcpy + Prior change to use memcpy instead of memmove in all cases missed the + fact that the string factory can be in a situation where overlaps occur. We now + have ANTLR3_MEMCPY and ANTLR3_MEMMOVE and use the two appropriately. + +Change 5387 on 2008/11/05 by parrt@parrt.spork + + Fixed x+=. issue with tree grammars; added unit test + +Change 5325 on 2008/10/23 by parrt@parrt.spork + + We were all ref'ing backtracking==0 hardcoded instead checking the + @synpredgate action. + + diff --git a/antlr/libantlr3c-3.4/INSTALL b/antlr/libantlr3c-3.4/INSTALL new file mode 100644 index 0000000..7d1c323 --- /dev/null +++ b/antlr/libantlr3c-3.4/INSTALL @@ -0,0 +1,365 @@ +Installation Instructions +************************* + +Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005, +2006, 2007, 2008, 2009 Free Software Foundation, Inc. + + Copying and distribution of this file, with or without modification, +are permitted in any medium without royalty provided the copyright +notice and this notice are preserved. This file is offered as-is, +without warranty of any kind. + +Basic Installation +================== + + Briefly, the shell commands `./configure; make; make install' should +configure, build, and install this package. The following +more-detailed instructions are generic; see the `README' file for +instructions specific to this package. Some packages provide this +`INSTALL' file but do not implement all of the features documented +below. The lack of an optional feature in a given package is not +necessarily a bug. More recommendations for GNU packages can be found +in *note Makefile Conventions: (standards)Makefile Conventions. + + The `configure' shell script attempts to guess correct values for +various system-dependent variables used during compilation. It uses +those values to create a `Makefile' in each directory of the package. +It may also create one or more `.h' files containing system-dependent +definitions. Finally, it creates a shell script `config.status' that +you can run in the future to recreate the current configuration, and a +file `config.log' containing compiler output (useful mainly for +debugging `configure'). + + It can also use an optional file (typically called `config.cache' +and enabled with `--cache-file=config.cache' or simply `-C') that saves +the results of its tests to speed up reconfiguring. Caching is +disabled by default to prevent problems with accidental use of stale +cache files. + + If you need to do unusual things to compile the package, please try +to figure out how `configure' could check whether to do them, and mail +diffs or instructions to the address given in the `README' so they can +be considered for the next release. If you are using the cache, and at +some point `config.cache' contains results you don't want to keep, you +may remove or edit it. + + The file `configure.ac' (or `configure.in') is used to create +`configure' by a program called `autoconf'. You need `configure.ac' if +you want to change it or regenerate `configure' using a newer version +of `autoconf'. + + The simplest way to compile this package is: + + 1. `cd' to the directory containing the package's source code and type + `./configure' to configure the package for your system. + + Running `configure' might take a while. While running, it prints + some messages telling which features it is checking for. + + 2. Type `make' to compile the package. + + 3. Optionally, type `make check' to run any self-tests that come with + the package, generally using the just-built uninstalled binaries. + + 4. Type `make install' to install the programs and any data files and + documentation. When installing into a prefix owned by root, it is + recommended that the package be configured and built as a regular + user, and only the `make install' phase executed with root + privileges. + + 5. Optionally, type `make installcheck' to repeat any self-tests, but + this time using the binaries in their final installed location. + This target does not install anything. Running this target as a + regular user, particularly if the prior `make install' required + root privileges, verifies that the installation completed + correctly. + + 6. 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. + + 7. Often, you can also type `make uninstall' to remove the installed + files again. In practice, not all packages have tested that + uninstallation works correctly, even though it is required by the + GNU Coding Standards. + + 8. Some packages, particularly those that use Automake, provide `make + distcheck', which can by used by developers to test that all other + targets like `make install' and `make uninstall' work correctly. + This target is generally not run by end users. + +Compilers and Options +===================== + + Some systems require unusual options for compilation or linking that +the `configure' script does not know about. Run `./configure --help' +for details on some of the pertinent environment variables. + + You can give `configure' initial values for configuration parameters +by setting variables in the command line or in the environment. Here +is an example: + + ./configure CC=c99 CFLAGS=-g LIBS=-lposix + + *Note Defining Variables::, for more details. + +Compiling For Multiple Architectures +==================================== + + You can compile the package for more than one kind of computer at the +same time, by placing the object files for each architecture in their +own directory. To do this, you can use GNU `make'. `cd' to the +directory where you want the object files and executables to go and run +the `configure' script. `configure' automatically checks for the +source code in the directory that `configure' is in and in `..'. This +is known as a "VPATH" build. + + With a non-GNU `make', it is safer to compile the package for one +architecture at a time in the source code directory. After you have +installed the package for one architecture, use `make distclean' before +reconfiguring for another architecture. + + On MacOS X 10.5 and later systems, you can create libraries and +executables that work on multiple system types--known as "fat" or +"universal" binaries--by specifying multiple `-arch' options to the +compiler but only a single `-arch' option to the preprocessor. Like +this: + + ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ + CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ + CPP="gcc -E" CXXCPP="g++ -E" + + This is not guaranteed to produce working output in all cases, you +may have to build one architecture at a time and combine the results +using the `lipo' tool if you have problems. + +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', where PREFIX must be an +absolute file name. + + 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. In general, the +default for these options is expressed in terms of `${prefix}', so that +specifying just `--prefix' will affect all of the other directory +specifications that were not explicitly provided. + + The most portable way to affect installation locations is to pass the +correct locations to `configure'; however, many packages provide one or +both of the following shortcuts of passing variable assignments to the +`make install' command line to change installation locations without +having to reconfigure or recompile. + + The first method involves providing an override variable for each +affected directory. For example, `make install +prefix=/alternate/directory' will choose an alternate location for all +directory configuration variables that were expressed in terms of +`${prefix}'. Any directories that were specified during `configure', +but not in terms of `${prefix}', must each be overridden at install +time for the entire installation to be relocated. The approach of +makefile variable overrides for each directory variable is required by +the GNU Coding Standards, and ideally causes no recompilation. +However, some platforms have known limitations with the semantics of +shared libraries that end up requiring recompilation when using this +method, particularly noticeable in packages that use GNU Libtool. + + The second method involves providing the `DESTDIR' variable. For +example, `make install DESTDIR=/alternate/directory' will prepend +`/alternate/directory' before all installation names. The approach of +`DESTDIR' overrides is not required by the GNU Coding Standards, and +does not work on platforms that have drive letters. On the other hand, +it does better at avoiding recompilation issues, and works well even +when some directory options were not specified in terms of `${prefix}' +at `configure' time. + +Optional Features +================= + + 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'. + + 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. + + Some packages offer the ability to configure how verbose the +execution of `make' will be. For these packages, running `./configure +--enable-silent-rules' sets the default to minimal output, which can be +overridden with `make V=1'; while running `./configure +--disable-silent-rules' sets the default to verbose, which can be +overridden with `make V=0'. + +Particular systems +================== + + On HP-UX, the default C compiler is not ANSI C compatible. If GNU +CC is not installed, it is recommended to use the following options in +order to use an ANSI C compiler: + + ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" + +and if that doesn't work, install pre-built binaries of GCC for HP-UX. + + On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot +parse its `' header file. The option `-nodtk' can be used as +a workaround. If GNU CC is not installed, it is therefore recommended +to try + + ./configure CC="cc" + +and if that doesn't work, try + + ./configure CC="cc -nodtk" + + On Solaris, don't put `/usr/ucb' early in your `PATH'. This +directory contains several dysfunctional programs; working variants of +these programs are available in `/usr/bin'. So, if you need `/usr/ucb' +in your `PATH', put it _after_ `/usr/bin'. + + On Haiku, software installed for all users goes in `/boot/common', +not `/usr/local'. It is recommended to use the following options: + + ./configure --prefix=/boot/common + +Specifying the System Type +========================== + + There may be some features `configure' cannot figure out +automatically, but needs to determine by the type of machine the package +will run on. Usually, assuming the package is built to be run on the +_same_ architectures, `configure' can figure that out, but if it prints +a message saying it cannot guess the machine type, give it the +`--build=TYPE' option. TYPE can either be a short name for the system +type, such as `sun4', or a canonical name which has the form: + + CPU-COMPANY-SYSTEM + +where SYSTEM can have one of these forms: + + OS + KERNEL-OS + + See the file `config.sub' for the possible values of each field. If +`config.sub' isn't included in this package, then this package doesn't +need to know the machine type. + + If you are _building_ compiler tools for cross-compiling, you should +use the option `--target=TYPE' to select the type of system they will +produce code for. + + If you want to _use_ a cross compiler, that generates code for a +platform different from the build platform, you should specify the +"host" platform (i.e., that on which the generated programs will +eventually be run) with `--host=TYPE'. + +Sharing Defaults +================ + + If you want to set default values for `configure' scripts to share, +you can create a site shell script called `config.site' that gives +default values for variables like `CC', `cache_file', and `prefix'. +`configure' looks for `PREFIX/share/config.site' if it exists, then +`PREFIX/etc/config.site' if it exists. Or, you can set the +`CONFIG_SITE' environment variable to the location of the site script. +A warning: not all `configure' scripts look for a site script. + +Defining Variables +================== + + Variables not defined in a site shell script can be set in the +environment passed to `configure'. However, some packages may run +configure again during the build, and the customized values of these +variables may be lost. In order to avoid this problem, you should set +them in the `configure' command line, using `VAR=value'. For example: + + ./configure CC=/usr/local2/bin/gcc + +causes the specified `gcc' to be used as the C compiler (unless it is +overridden in the site shell script). + +Unfortunately, this technique does not work for `CONFIG_SHELL' due to +an Autoconf bug. Until the bug is fixed you can use this workaround: + + CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash + +`configure' Invocation +====================== + + `configure' recognizes the following options to control how it +operates. + +`--help' +`-h' + Print a summary of all of the options to `configure', and exit. + +`--help=short' +`--help=recursive' + Print a summary of the options unique to this package's + `configure', and exit. The `short' variant lists options used + only in the top level, while the `recursive' variant lists options + also present in any nested packages. + +`--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. + +`--prefix=DIR' + Use DIR as the installation prefix. *note Installation Names:: + for more details, including other options available for fine-tuning + the installation locations. + +`--no-create' +`-n' + Run the configure checks, but stop before creating any output + files. + +`configure' also accepts some other, not widely useful, options. Run +`configure --help' for more details. + diff --git a/antlr/libantlr3c-3.4/Makefile b/antlr/libantlr3c-3.4/Makefile new file mode 100644 index 0000000..1f6a077 --- /dev/null +++ b/antlr/libantlr3c-3.4/Makefile @@ -0,0 +1,968 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile. Generated from Makefile.in by configure. + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 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. + + + + + +pkgdatadir = $(datadir)/libantlr3c +pkgincludedir = $(includedir)/libantlr3c +pkglibdir = $(libdir)/libantlr3c +pkglibexecdir = $(libexecdir)/libantlr3c +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = x86_64-unknown-linux-gnu +host_triplet = x86_64-unknown-linux-gnu +subdir = . +DIST_COMMON = README $(am__configure_deps) $(include_HEADERS) \ + $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(srcdir)/antlr3config.h.in $(top_srcdir)/configure AUTHORS \ + COPYING ChangeLog INSTALL NEWS config.guess config.sub depcomp \ + install-sh ltmain.sh missing +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(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 = antlr3config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)" +LTLIBRARIES = $(lib_LTLIBRARIES) +libantlr3c_la_LIBADD = +am__objects_1 = antlr3baserecognizer.lo antlr3basetree.lo \ + antlr3basetreeadaptor.lo antlr3bitset.lo antlr3collections.lo \ + antlr3commontoken.lo antlr3commontree.lo \ + antlr3commontreeadaptor.lo antlr3commontreenodestream.lo \ + antlr3convertutf.lo antlr3cyclicdfa.lo antlr3debughandlers.lo \ + antlr3encodings.lo antlr3exception.lo antlr3filestream.lo \ + antlr3inputstream.lo antlr3intstream.lo antlr3lexer.lo \ + antlr3parser.lo antlr3rewritestreams.lo antlr3string.lo \ + antlr3tokenstream.lo antlr3treeparser.lo +am_libantlr3c_la_OBJECTS = $(am__objects_1) +libantlr3c_la_OBJECTS = $(am_libantlr3c_la_OBJECTS) +libantlr3c_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(libantlr3c_la_LDFLAGS) $(LDFLAGS) -o $@ +DEFAULT_INCLUDES = -I. +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(libantlr3c_la_SOURCES) +DIST_SOURCES = $(libantlr3c_la_SOURCES) +HEADERS = $(include_HEADERS) +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 +GZIP_ENV = --best +distuninstallcheck_listfiles = find . -type f -print +distcleancheck_listfiles = find . -type f -print +ACLOCAL = ${SHELL} /home/carlo/laptop-repository/impl/antlr/libantlr3c-3.4/missing --run aclocal-1.11 +AMTAR = ${SHELL} /home/carlo/laptop-repository/impl/antlr/libantlr3c-3.4/missing --run tar +AR = ar +AUTOCONF = ${SHELL} /home/carlo/laptop-repository/impl/antlr/libantlr3c-3.4/missing --run autoconf +AUTOHEADER = ${SHELL} /home/carlo/laptop-repository/impl/antlr/libantlr3c-3.4/missing --run autoheader +AUTOMAKE = ${SHELL} /home/carlo/laptop-repository/impl/antlr/libantlr3c-3.4/missing --run automake-1.11 +AWK = mawk +CC = gcc +CCDEPMODE = depmode=gcc3 +CFLAGS = -m32 -O2 -Wall +CPP = gcc -E +CPPFLAGS = +CYGPATH_W = echo +DEFS = -DHAVE_CONFIG_H +DEPDIR = .deps +DSYMUTIL = +DUMPBIN = +ECHO_C = +ECHO_N = -n +ECHO_T = +EGREP = /bin/grep -E +EXEEXT = +FGREP = /bin/grep -F +GREP = /bin/grep +INSTALL = /usr/bin/install -c +INSTALL_DATA = ${INSTALL} -m 644 +INSTALL_PROGRAM = ${INSTALL} +INSTALL_SCRIPT = ${INSTALL} +INSTALL_STRIP_PROGRAM = $(install_sh) -c -s +LD = /usr/bin/ld -m elf_x86_64 +LDFLAGS = +LIBOBJS = +LIBS = +LIBTOOL = $(SHELL) $(top_builddir)/libtool +LIPO = +LN_S = ln -s +LTLIBOBJS = +MAINT = # +MAKEINFO = ${SHELL} /home/carlo/laptop-repository/impl/antlr/libantlr3c-3.4/missing --run makeinfo +MKDIR_P = /bin/mkdir -p +NM = /usr/bin/nm -B +NMEDIT = +OBJDUMP = objdump +OBJECT_MODE = +OBJEXT = o +OTOOL = +OTOOL64 = +PACKAGE = libantlr3c +PACKAGE_BUGREPORT = jimi@temporal-wave.com +PACKAGE_NAME = libantlr3c +PACKAGE_STRING = libantlr3c 3.4 +PACKAGE_TARNAME = libantlr3c +PACKAGE_URL = +PACKAGE_VERSION = 3.4 +PATH_SEPARATOR = : +RANLIB = ranlib +SED = /bin/sed +SET_MAKE = +SHELL = /bin/bash +STRIP = strip +VERSION = 3.4 +abs_builddir = /home/carlo/laptop-repository/impl/antlr/libantlr3c-3.4 +abs_srcdir = /home/carlo/laptop-repository/impl/antlr/libantlr3c-3.4 +abs_top_builddir = /home/carlo/laptop-repository/impl/antlr/libantlr3c-3.4 +abs_top_srcdir = /home/carlo/laptop-repository/impl/antlr/libantlr3c-3.4 +ac_ct_CC = gcc +ac_ct_DUMPBIN = +am__include = include +am__leading_dot = . +am__quote = +am__tar = ${AMTAR} chof - "$$tardir" +am__untar = ${AMTAR} xf - +bindir = ${exec_prefix}/bin +build = x86_64-unknown-linux-gnu +build_alias = +build_cpu = x86_64 +build_os = linux-gnu +build_vendor = unknown +builddir = . +datadir = ${datarootdir} +datarootdir = ${prefix}/share +docdir = ${datarootdir}/doc/${PACKAGE_TARNAME} +dvidir = ${docdir} +exec_prefix = ${prefix} +host = x86_64-unknown-linux-gnu +host_alias = +host_cpu = x86_64 +host_os = linux-gnu +host_vendor = unknown +htmldir = ${docdir} +includedir = ${prefix}/include +infodir = ${datarootdir}/info +install_sh = ${SHELL} /home/carlo/laptop-repository/impl/antlr/libantlr3c-3.4/install-sh +libdir = ${exec_prefix}/lib +libexecdir = ${exec_prefix}/libexec +localedir = ${datarootdir}/locale +localstatedir = ${prefix}/var +mandir = ${datarootdir}/man +mkdir_p = /bin/mkdir -p +oldincludedir = /usr/include +pdfdir = ${docdir} +prefix = /usr/local +program_transform_name = s,x,x, +psdir = ${docdir} +sbindir = ${exec_prefix}/sbin +sharedstatedir = ${prefix}/com +srcdir = . +sysconfdir = ${prefix}/etc +target_alias = +top_build_prefix = +top_builddir = . +top_srcdir = . +AUTOMAKE_OPTIONS = gnu +AM_LIBTOOLFLAGS = +ACLOCAL_AMFLAGS = -I m4 +lib_LTLIBRARIES = libantlr3c.la +LIBSOURCES = src/antlr3baserecognizer.c \ + src/antlr3basetree.c \ + src/antlr3basetreeadaptor.c \ + src/antlr3bitset.c \ + src/antlr3collections.c \ + src/antlr3commontoken.c \ + src/antlr3commontree.c \ + src/antlr3commontreeadaptor.c \ + src/antlr3commontreenodestream.c \ + src/antlr3convertutf.c \ + src/antlr3cyclicdfa.c \ + src/antlr3debughandlers.c \ + src/antlr3encodings.c \ + src/antlr3exception.c \ + src/antlr3filestream.c \ + src/antlr3inputstream.c \ + src/antlr3intstream.c \ + src/antlr3lexer.c \ + src/antlr3parser.c \ + src/antlr3rewritestreams.c \ + src/antlr3string.c \ + src/antlr3tokenstream.c \ + src/antlr3treeparser.c + +libantlr3c_la_SOURCES = $(LIBSOURCES) +include_HEADERS = include/antlr3.h \ + include/antlr3baserecognizer.h \ + include/antlr3basetree.h \ + include/antlr3basetreeadaptor.h \ + include/antlr3bitset.h \ + include/antlr3collections.h \ + include/antlr3commontoken.h \ + include/antlr3commontree.h \ + include/antlr3commontreeadaptor.h \ + include/antlr3commontreenodestream.h \ + include/antlr3convertutf.h \ + include/antlr3cyclicdfa.h \ + include/antlr3debugeventlistener.h \ + include/antlr3defs.h \ + include/antlr3encodings.h \ + include/antlr3errors.h \ + include/antlr3exception.h \ + include/antlr3filestream.h \ + include/antlr3input.h \ + include/antlr3interfaces.h \ + include/antlr3intstream.h \ + include/antlr3lexer.h \ + include/antlr3memory.h \ + include/antlr3parser.h \ + include/antlr3parsetree.h \ + include/antlr3recognizersharedstate.h \ + include/antlr3rewritestreams.h \ + include/antlr3string.h \ + include/antlr3tokenstream.h \ + include/antlr3treeparser.h \ + antlr3config.h + +libantlr3c_la_LDFLAGS = -avoid-version +INCLUDES = -Iinclude +EXTRA_DIST = \ + vsrulefiles/antlr3lexerandparser.rules \ + vsrulefiles/antlr3lexer.rules \ + vsrulefiles/antlr3parser.rules \ + vsrulefiles/antlr3treeparser.rules \ + C.sln C.vcproj C.vcproj.vspscc \ + C.vssscc doxyfile doxygen + +all: antlr3config.h + $(MAKE) $(AM_MAKEFLAGS) all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +am--refresh: + @: +$(srcdir)/Makefile.in: # $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \ + $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ + $(am__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: # $(am__configure_deps) + $(am__cd) $(srcdir) && $(AUTOCONF) +$(ACLOCAL_M4): # $(am__aclocal_m4_deps) + $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) +$(am__aclocal_m4_deps): + +antlr3config.h: stamp-h1 + @if test ! -f $@; then \ + rm -f stamp-h1; \ + $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \ + else :; fi + +stamp-h1: $(srcdir)/antlr3config.h.in $(top_builddir)/config.status + @rm -f stamp-h1 + cd $(top_builddir) && $(SHELL) ./config.status antlr3config.h +$(srcdir)/antlr3config.h.in: # $(am__configure_deps) + ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) + rm -f stamp-h1 + touch $@ + +distclean-hdr: + -rm -f antlr3config.h stamp-h1 +install-libLTLIBRARIES: $(lib_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + list2=; for p in $$list; do \ + if test -f $$p; then \ + list2="$$list2 $$p"; \ + else :; fi; \ + done; \ + test -z "$$list2" || { \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ + } + +uninstall-libLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ + 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 +libantlr3c.la: $(libantlr3c_la_OBJECTS) $(libantlr3c_la_DEPENDENCIES) + $(libantlr3c_la_LINK) -rpath $(libdir) $(libantlr3c_la_OBJECTS) $(libantlr3c_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +include ./$(DEPDIR)/antlr3baserecognizer.Plo +include ./$(DEPDIR)/antlr3basetree.Plo +include ./$(DEPDIR)/antlr3basetreeadaptor.Plo +include ./$(DEPDIR)/antlr3bitset.Plo +include ./$(DEPDIR)/antlr3collections.Plo +include ./$(DEPDIR)/antlr3commontoken.Plo +include ./$(DEPDIR)/antlr3commontree.Plo +include ./$(DEPDIR)/antlr3commontreeadaptor.Plo +include ./$(DEPDIR)/antlr3commontreenodestream.Plo +include ./$(DEPDIR)/antlr3convertutf.Plo +include ./$(DEPDIR)/antlr3cyclicdfa.Plo +include ./$(DEPDIR)/antlr3debughandlers.Plo +include ./$(DEPDIR)/antlr3encodings.Plo +include ./$(DEPDIR)/antlr3exception.Plo +include ./$(DEPDIR)/antlr3filestream.Plo +include ./$(DEPDIR)/antlr3inputstream.Plo +include ./$(DEPDIR)/antlr3intstream.Plo +include ./$(DEPDIR)/antlr3lexer.Plo +include ./$(DEPDIR)/antlr3parser.Plo +include ./$(DEPDIR)/antlr3rewritestreams.Plo +include ./$(DEPDIR)/antlr3string.Plo +include ./$(DEPDIR)/antlr3tokenstream.Plo +include ./$(DEPDIR)/antlr3treeparser.Plo + +.c.o: + $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< + $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +# source='$<' object='$@' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(COMPILE) -c $< + +.c.obj: + $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` + $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +# source='$<' object='$@' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: + $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< + $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +# source='$<' object='$@' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LTCOMPILE) -c -o $@ $< + +antlr3baserecognizer.lo: src/antlr3baserecognizer.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT antlr3baserecognizer.lo -MD -MP -MF $(DEPDIR)/antlr3baserecognizer.Tpo -c -o antlr3baserecognizer.lo `test -f 'src/antlr3baserecognizer.c' || echo '$(srcdir)/'`src/antlr3baserecognizer.c + $(am__mv) $(DEPDIR)/antlr3baserecognizer.Tpo $(DEPDIR)/antlr3baserecognizer.Plo +# source='src/antlr3baserecognizer.c' object='antlr3baserecognizer.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o antlr3baserecognizer.lo `test -f 'src/antlr3baserecognizer.c' || echo '$(srcdir)/'`src/antlr3baserecognizer.c + +antlr3basetree.lo: src/antlr3basetree.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT antlr3basetree.lo -MD -MP -MF $(DEPDIR)/antlr3basetree.Tpo -c -o antlr3basetree.lo `test -f 'src/antlr3basetree.c' || echo '$(srcdir)/'`src/antlr3basetree.c + $(am__mv) $(DEPDIR)/antlr3basetree.Tpo $(DEPDIR)/antlr3basetree.Plo +# source='src/antlr3basetree.c' object='antlr3basetree.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o antlr3basetree.lo `test -f 'src/antlr3basetree.c' || echo '$(srcdir)/'`src/antlr3basetree.c + +antlr3basetreeadaptor.lo: src/antlr3basetreeadaptor.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT antlr3basetreeadaptor.lo -MD -MP -MF $(DEPDIR)/antlr3basetreeadaptor.Tpo -c -o antlr3basetreeadaptor.lo `test -f 'src/antlr3basetreeadaptor.c' || echo '$(srcdir)/'`src/antlr3basetreeadaptor.c + $(am__mv) $(DEPDIR)/antlr3basetreeadaptor.Tpo $(DEPDIR)/antlr3basetreeadaptor.Plo +# source='src/antlr3basetreeadaptor.c' object='antlr3basetreeadaptor.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o antlr3basetreeadaptor.lo `test -f 'src/antlr3basetreeadaptor.c' || echo '$(srcdir)/'`src/antlr3basetreeadaptor.c + +antlr3bitset.lo: src/antlr3bitset.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT antlr3bitset.lo -MD -MP -MF $(DEPDIR)/antlr3bitset.Tpo -c -o antlr3bitset.lo `test -f 'src/antlr3bitset.c' || echo '$(srcdir)/'`src/antlr3bitset.c + $(am__mv) $(DEPDIR)/antlr3bitset.Tpo $(DEPDIR)/antlr3bitset.Plo +# source='src/antlr3bitset.c' object='antlr3bitset.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o antlr3bitset.lo `test -f 'src/antlr3bitset.c' || echo '$(srcdir)/'`src/antlr3bitset.c + +antlr3collections.lo: src/antlr3collections.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT antlr3collections.lo -MD -MP -MF $(DEPDIR)/antlr3collections.Tpo -c -o antlr3collections.lo `test -f 'src/antlr3collections.c' || echo '$(srcdir)/'`src/antlr3collections.c + $(am__mv) $(DEPDIR)/antlr3collections.Tpo $(DEPDIR)/antlr3collections.Plo +# source='src/antlr3collections.c' object='antlr3collections.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o antlr3collections.lo `test -f 'src/antlr3collections.c' || echo '$(srcdir)/'`src/antlr3collections.c + +antlr3commontoken.lo: src/antlr3commontoken.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT antlr3commontoken.lo -MD -MP -MF $(DEPDIR)/antlr3commontoken.Tpo -c -o antlr3commontoken.lo `test -f 'src/antlr3commontoken.c' || echo '$(srcdir)/'`src/antlr3commontoken.c + $(am__mv) $(DEPDIR)/antlr3commontoken.Tpo $(DEPDIR)/antlr3commontoken.Plo +# source='src/antlr3commontoken.c' object='antlr3commontoken.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o antlr3commontoken.lo `test -f 'src/antlr3commontoken.c' || echo '$(srcdir)/'`src/antlr3commontoken.c + +antlr3commontree.lo: src/antlr3commontree.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT antlr3commontree.lo -MD -MP -MF $(DEPDIR)/antlr3commontree.Tpo -c -o antlr3commontree.lo `test -f 'src/antlr3commontree.c' || echo '$(srcdir)/'`src/antlr3commontree.c + $(am__mv) $(DEPDIR)/antlr3commontree.Tpo $(DEPDIR)/antlr3commontree.Plo +# source='src/antlr3commontree.c' object='antlr3commontree.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o antlr3commontree.lo `test -f 'src/antlr3commontree.c' || echo '$(srcdir)/'`src/antlr3commontree.c + +antlr3commontreeadaptor.lo: src/antlr3commontreeadaptor.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT antlr3commontreeadaptor.lo -MD -MP -MF $(DEPDIR)/antlr3commontreeadaptor.Tpo -c -o antlr3commontreeadaptor.lo `test -f 'src/antlr3commontreeadaptor.c' || echo '$(srcdir)/'`src/antlr3commontreeadaptor.c + $(am__mv) $(DEPDIR)/antlr3commontreeadaptor.Tpo $(DEPDIR)/antlr3commontreeadaptor.Plo +# source='src/antlr3commontreeadaptor.c' object='antlr3commontreeadaptor.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o antlr3commontreeadaptor.lo `test -f 'src/antlr3commontreeadaptor.c' || echo '$(srcdir)/'`src/antlr3commontreeadaptor.c + +antlr3commontreenodestream.lo: src/antlr3commontreenodestream.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT antlr3commontreenodestream.lo -MD -MP -MF $(DEPDIR)/antlr3commontreenodestream.Tpo -c -o antlr3commontreenodestream.lo `test -f 'src/antlr3commontreenodestream.c' || echo '$(srcdir)/'`src/antlr3commontreenodestream.c + $(am__mv) $(DEPDIR)/antlr3commontreenodestream.Tpo $(DEPDIR)/antlr3commontreenodestream.Plo +# source='src/antlr3commontreenodestream.c' object='antlr3commontreenodestream.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o antlr3commontreenodestream.lo `test -f 'src/antlr3commontreenodestream.c' || echo '$(srcdir)/'`src/antlr3commontreenodestream.c + +antlr3convertutf.lo: src/antlr3convertutf.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT antlr3convertutf.lo -MD -MP -MF $(DEPDIR)/antlr3convertutf.Tpo -c -o antlr3convertutf.lo `test -f 'src/antlr3convertutf.c' || echo '$(srcdir)/'`src/antlr3convertutf.c + $(am__mv) $(DEPDIR)/antlr3convertutf.Tpo $(DEPDIR)/antlr3convertutf.Plo +# source='src/antlr3convertutf.c' object='antlr3convertutf.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o antlr3convertutf.lo `test -f 'src/antlr3convertutf.c' || echo '$(srcdir)/'`src/antlr3convertutf.c + +antlr3cyclicdfa.lo: src/antlr3cyclicdfa.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT antlr3cyclicdfa.lo -MD -MP -MF $(DEPDIR)/antlr3cyclicdfa.Tpo -c -o antlr3cyclicdfa.lo `test -f 'src/antlr3cyclicdfa.c' || echo '$(srcdir)/'`src/antlr3cyclicdfa.c + $(am__mv) $(DEPDIR)/antlr3cyclicdfa.Tpo $(DEPDIR)/antlr3cyclicdfa.Plo +# source='src/antlr3cyclicdfa.c' object='antlr3cyclicdfa.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o antlr3cyclicdfa.lo `test -f 'src/antlr3cyclicdfa.c' || echo '$(srcdir)/'`src/antlr3cyclicdfa.c + +antlr3debughandlers.lo: src/antlr3debughandlers.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT antlr3debughandlers.lo -MD -MP -MF $(DEPDIR)/antlr3debughandlers.Tpo -c -o antlr3debughandlers.lo `test -f 'src/antlr3debughandlers.c' || echo '$(srcdir)/'`src/antlr3debughandlers.c + $(am__mv) $(DEPDIR)/antlr3debughandlers.Tpo $(DEPDIR)/antlr3debughandlers.Plo +# source='src/antlr3debughandlers.c' object='antlr3debughandlers.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o antlr3debughandlers.lo `test -f 'src/antlr3debughandlers.c' || echo '$(srcdir)/'`src/antlr3debughandlers.c + +antlr3encodings.lo: src/antlr3encodings.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT antlr3encodings.lo -MD -MP -MF $(DEPDIR)/antlr3encodings.Tpo -c -o antlr3encodings.lo `test -f 'src/antlr3encodings.c' || echo '$(srcdir)/'`src/antlr3encodings.c + $(am__mv) $(DEPDIR)/antlr3encodings.Tpo $(DEPDIR)/antlr3encodings.Plo +# source='src/antlr3encodings.c' object='antlr3encodings.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o antlr3encodings.lo `test -f 'src/antlr3encodings.c' || echo '$(srcdir)/'`src/antlr3encodings.c + +antlr3exception.lo: src/antlr3exception.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT antlr3exception.lo -MD -MP -MF $(DEPDIR)/antlr3exception.Tpo -c -o antlr3exception.lo `test -f 'src/antlr3exception.c' || echo '$(srcdir)/'`src/antlr3exception.c + $(am__mv) $(DEPDIR)/antlr3exception.Tpo $(DEPDIR)/antlr3exception.Plo +# source='src/antlr3exception.c' object='antlr3exception.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o antlr3exception.lo `test -f 'src/antlr3exception.c' || echo '$(srcdir)/'`src/antlr3exception.c + +antlr3filestream.lo: src/antlr3filestream.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT antlr3filestream.lo -MD -MP -MF $(DEPDIR)/antlr3filestream.Tpo -c -o antlr3filestream.lo `test -f 'src/antlr3filestream.c' || echo '$(srcdir)/'`src/antlr3filestream.c + $(am__mv) $(DEPDIR)/antlr3filestream.Tpo $(DEPDIR)/antlr3filestream.Plo +# source='src/antlr3filestream.c' object='antlr3filestream.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o antlr3filestream.lo `test -f 'src/antlr3filestream.c' || echo '$(srcdir)/'`src/antlr3filestream.c + +antlr3inputstream.lo: src/antlr3inputstream.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT antlr3inputstream.lo -MD -MP -MF $(DEPDIR)/antlr3inputstream.Tpo -c -o antlr3inputstream.lo `test -f 'src/antlr3inputstream.c' || echo '$(srcdir)/'`src/antlr3inputstream.c + $(am__mv) $(DEPDIR)/antlr3inputstream.Tpo $(DEPDIR)/antlr3inputstream.Plo +# source='src/antlr3inputstream.c' object='antlr3inputstream.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o antlr3inputstream.lo `test -f 'src/antlr3inputstream.c' || echo '$(srcdir)/'`src/antlr3inputstream.c + +antlr3intstream.lo: src/antlr3intstream.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT antlr3intstream.lo -MD -MP -MF $(DEPDIR)/antlr3intstream.Tpo -c -o antlr3intstream.lo `test -f 'src/antlr3intstream.c' || echo '$(srcdir)/'`src/antlr3intstream.c + $(am__mv) $(DEPDIR)/antlr3intstream.Tpo $(DEPDIR)/antlr3intstream.Plo +# source='src/antlr3intstream.c' object='antlr3intstream.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o antlr3intstream.lo `test -f 'src/antlr3intstream.c' || echo '$(srcdir)/'`src/antlr3intstream.c + +antlr3lexer.lo: src/antlr3lexer.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT antlr3lexer.lo -MD -MP -MF $(DEPDIR)/antlr3lexer.Tpo -c -o antlr3lexer.lo `test -f 'src/antlr3lexer.c' || echo '$(srcdir)/'`src/antlr3lexer.c + $(am__mv) $(DEPDIR)/antlr3lexer.Tpo $(DEPDIR)/antlr3lexer.Plo +# source='src/antlr3lexer.c' object='antlr3lexer.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o antlr3lexer.lo `test -f 'src/antlr3lexer.c' || echo '$(srcdir)/'`src/antlr3lexer.c + +antlr3parser.lo: src/antlr3parser.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT antlr3parser.lo -MD -MP -MF $(DEPDIR)/antlr3parser.Tpo -c -o antlr3parser.lo `test -f 'src/antlr3parser.c' || echo '$(srcdir)/'`src/antlr3parser.c + $(am__mv) $(DEPDIR)/antlr3parser.Tpo $(DEPDIR)/antlr3parser.Plo +# source='src/antlr3parser.c' object='antlr3parser.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o antlr3parser.lo `test -f 'src/antlr3parser.c' || echo '$(srcdir)/'`src/antlr3parser.c + +antlr3rewritestreams.lo: src/antlr3rewritestreams.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT antlr3rewritestreams.lo -MD -MP -MF $(DEPDIR)/antlr3rewritestreams.Tpo -c -o antlr3rewritestreams.lo `test -f 'src/antlr3rewritestreams.c' || echo '$(srcdir)/'`src/antlr3rewritestreams.c + $(am__mv) $(DEPDIR)/antlr3rewritestreams.Tpo $(DEPDIR)/antlr3rewritestreams.Plo +# source='src/antlr3rewritestreams.c' object='antlr3rewritestreams.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o antlr3rewritestreams.lo `test -f 'src/antlr3rewritestreams.c' || echo '$(srcdir)/'`src/antlr3rewritestreams.c + +antlr3string.lo: src/antlr3string.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT antlr3string.lo -MD -MP -MF $(DEPDIR)/antlr3string.Tpo -c -o antlr3string.lo `test -f 'src/antlr3string.c' || echo '$(srcdir)/'`src/antlr3string.c + $(am__mv) $(DEPDIR)/antlr3string.Tpo $(DEPDIR)/antlr3string.Plo +# source='src/antlr3string.c' object='antlr3string.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o antlr3string.lo `test -f 'src/antlr3string.c' || echo '$(srcdir)/'`src/antlr3string.c + +antlr3tokenstream.lo: src/antlr3tokenstream.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT antlr3tokenstream.lo -MD -MP -MF $(DEPDIR)/antlr3tokenstream.Tpo -c -o antlr3tokenstream.lo `test -f 'src/antlr3tokenstream.c' || echo '$(srcdir)/'`src/antlr3tokenstream.c + $(am__mv) $(DEPDIR)/antlr3tokenstream.Tpo $(DEPDIR)/antlr3tokenstream.Plo +# source='src/antlr3tokenstream.c' object='antlr3tokenstream.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o antlr3tokenstream.lo `test -f 'src/antlr3tokenstream.c' || echo '$(srcdir)/'`src/antlr3tokenstream.c + +antlr3treeparser.lo: src/antlr3treeparser.c + $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT antlr3treeparser.lo -MD -MP -MF $(DEPDIR)/antlr3treeparser.Tpo -c -o antlr3treeparser.lo `test -f 'src/antlr3treeparser.c' || echo '$(srcdir)/'`src/antlr3treeparser.c + $(am__mv) $(DEPDIR)/antlr3treeparser.Tpo $(DEPDIR)/antlr3treeparser.Plo +# source='src/antlr3treeparser.c' object='antlr3treeparser.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o antlr3treeparser.lo `test -f 'src/antlr3treeparser.c' || echo '$(srcdir)/'`src/antlr3treeparser.c + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool config.lt +install-includeHEADERS: $(include_HEADERS) + @$(NORMAL_INSTALL) + test -z "$(includedir)" || $(MKDIR_P) "$(DESTDIR)$(includedir)" + @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includedir)'"; \ + $(INSTALL_HEADER) $$files "$(DESTDIR)$(includedir)" || exit $$?; \ + done + +uninstall-includeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + test -n "$$files" || exit 0; \ + echo " ( cd '$(DESTDIR)$(includedir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(includedir)" && rm -f $$files + +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) antlr3config.h.in $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) antlr3config.h.in $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) antlr3config.h.in $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) antlr3config.h.in $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + $(am__remove_distdir) + test -d "$(distdir)" || mkdir "$(distdir)" + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + -test -n "$(am__skip_mode_fix)" \ + || find "$(distdir)" -type d ! -perm -755 \ + -exec chmod u+rwx,go+rx {} \; -o \ + ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ + || chmod -R a+r "$(distdir)" +dist-gzip: distdir + tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + $(am__remove_distdir) + +dist-bzip2: distdir + tardir=$(distdir) && $(am__tar) | bzip2 -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-xz: distdir + tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz + $(am__remove_distdir) + +dist-tarZ: distdir + tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z + $(am__remove_distdir) + +dist-shar: distdir + shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz + $(am__remove_distdir) + +dist-zip: distdir + -rm -f $(distdir).zip + zip -rq $(distdir).zip $(distdir) + $(am__remove_distdir) + +dist dist-all: distdir + tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + $(am__remove_distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + case '$(DIST_ARCHIVES)' in \ + *.tar.gz*) \ + GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ + *.tar.bz2*) \ + bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ + *.tar.lzma*) \ + lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\ + *.tar.xz*) \ + xz -dc $(distdir).tar.xz | $(am__untar) ;;\ + *.tar.Z*) \ + uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ + *.shar.gz*) \ + GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ + *.zip*) \ + unzip $(distdir).zip ;;\ + esac + chmod -R a-w $(distdir); chmod a+w $(distdir) + mkdir $(distdir)/_build + mkdir $(distdir)/_inst + chmod a-w $(distdir) + test -d $(distdir)/_build || exit 0; \ + dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ + && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ + && am__cwd=`pwd` \ + && $(am__cd) $(distdir)/_build \ + && ../configure --srcdir=.. --prefix="$$dc_install_base" \ + $(DISTCHECK_CONFIGURE_FLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ + distuninstallcheck \ + && chmod -R a-w "$$dc_install_base" \ + && ({ \ + (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ + distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ + } || { rm -rf "$$dc_destdir"; exit 1; }) \ + && rm -rf "$$dc_destdir" \ + && $(MAKE) $(AM_MAKEFLAGS) dist \ + && rm -rf $(DIST_ARCHIVES) \ + && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ + && cd "$$am__cwd" \ + || exit 1 + $(am__remove_distdir) + @(echo "$(distdir) archives ready for distribution: "; \ + list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ + sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' +distuninstallcheck: + @$(am__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 $(LTLIBRARIES) $(HEADERS) antlr3config.h +installdirs: + for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)"; 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) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libLTLIBRARIES 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 + +html-am: + +info: info-am + +info-am: + +install-data-am: install-includeHEADERS + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: install-libLTLIBRARIES + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f $(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-includeHEADERS uninstall-libLTLIBRARIES + +.MAKE: all install-am install-strip + +.PHONY: CTAGS GTAGS all all-am am--refresh check check-am clean \ + clean-generic clean-libLTLIBRARIES clean-libtool ctags dist \ + dist-all dist-bzip2 dist-gzip dist-lzma dist-shar dist-tarZ \ + dist-xz dist-zip distcheck distclean distclean-compile \ + distclean-generic distclean-hdr distclean-libtool \ + distclean-tags distcleancheck distdir distuninstallcheck dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-includeHEADERS install-info install-info-am \ + install-libLTLIBRARIES 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-includeHEADERS \ + uninstall-libLTLIBRARIES + + +export OBJECT_MODE + +# 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/antlr/libantlr3c-3.4/Makefile.am b/antlr/libantlr3c-3.4/Makefile.am new file mode 100644 index 0000000..9867f7e --- /dev/null +++ b/antlr/libantlr3c-3.4/Makefile.am @@ -0,0 +1,78 @@ +AUTOMAKE_OPTIONS = gnu +AM_LIBTOOLFLAGS = +## --silent +ACLOCAL_AMFLAGS = -I m4 +lib_LTLIBRARIES = libantlr3c.la + +LIBSOURCES = src/antlr3baserecognizer.c \ + src/antlr3basetree.c \ + src/antlr3basetreeadaptor.c \ + src/antlr3bitset.c \ + src/antlr3collections.c \ + src/antlr3commontoken.c \ + src/antlr3commontree.c \ + src/antlr3commontreeadaptor.c \ + src/antlr3commontreenodestream.c \ + src/antlr3convertutf.c \ + src/antlr3cyclicdfa.c \ + src/antlr3debughandlers.c \ + src/antlr3encodings.c \ + src/antlr3exception.c \ + src/antlr3filestream.c \ + src/antlr3inputstream.c \ + src/antlr3intstream.c \ + src/antlr3lexer.c \ + src/antlr3parser.c \ + src/antlr3rewritestreams.c \ + src/antlr3string.c \ + src/antlr3tokenstream.c \ + src/antlr3treeparser.c + +libantlr3c_la_SOURCES = $(LIBSOURCES) + +include_HEADERS = include/antlr3.h \ + include/antlr3baserecognizer.h \ + include/antlr3basetree.h \ + include/antlr3basetreeadaptor.h \ + include/antlr3bitset.h \ + include/antlr3collections.h \ + include/antlr3commontoken.h \ + include/antlr3commontree.h \ + include/antlr3commontreeadaptor.h \ + include/antlr3commontreenodestream.h \ + include/antlr3convertutf.h \ + include/antlr3cyclicdfa.h \ + include/antlr3debugeventlistener.h \ + include/antlr3defs.h \ + include/antlr3encodings.h \ + include/antlr3errors.h \ + include/antlr3exception.h \ + include/antlr3filestream.h \ + include/antlr3input.h \ + include/antlr3interfaces.h \ + include/antlr3intstream.h \ + include/antlr3lexer.h \ + include/antlr3memory.h \ + include/antlr3parser.h \ + include/antlr3parsetree.h \ + include/antlr3recognizersharedstate.h \ + include/antlr3rewritestreams.h \ + include/antlr3string.h \ + include/antlr3tokenstream.h \ + include/antlr3treeparser.h \ + antlr3config.h + +libantlr3c_la_LDFLAGS = -avoid-version + +INCLUDES = -Iinclude + +EXTRA_DIST = \ + vsrulefiles/antlr3lexerandparser.rules \ + vsrulefiles/antlr3lexer.rules \ + vsrulefiles/antlr3parser.rules \ + vsrulefiles/antlr3treeparser.rules \ + C.sln C.vcproj C.vcproj.vspscc \ + C.vssscc doxyfile doxygen + +export OBJECT_MODE + diff --git a/antlr/libantlr3c-3.4/Makefile.in b/antlr/libantlr3c-3.4/Makefile.in new file mode 100644 index 0000000..e48d2ae --- /dev/null +++ b/antlr/libantlr3c-3.4/Makefile.in @@ -0,0 +1,968 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +subdir = . +DIST_COMMON = README $(am__configure_deps) $(include_HEADERS) \ + $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(srcdir)/antlr3config.h.in $(top_srcdir)/configure AUTHORS \ + COPYING ChangeLog INSTALL NEWS config.guess config.sub depcomp \ + install-sh ltmain.sh missing +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(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 = antlr3config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)" +LTLIBRARIES = $(lib_LTLIBRARIES) +libantlr3c_la_LIBADD = +am__objects_1 = antlr3baserecognizer.lo antlr3basetree.lo \ + antlr3basetreeadaptor.lo antlr3bitset.lo antlr3collections.lo \ + antlr3commontoken.lo antlr3commontree.lo \ + antlr3commontreeadaptor.lo antlr3commontreenodestream.lo \ + antlr3convertutf.lo antlr3cyclicdfa.lo antlr3debughandlers.lo \ + antlr3encodings.lo antlr3exception.lo antlr3filestream.lo \ + antlr3inputstream.lo antlr3intstream.lo antlr3lexer.lo \ + antlr3parser.lo antlr3rewritestreams.lo antlr3string.lo \ + antlr3tokenstream.lo antlr3treeparser.lo +am_libantlr3c_la_OBJECTS = $(am__objects_1) +libantlr3c_la_OBJECTS = $(am_libantlr3c_la_OBJECTS) +libantlr3c_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(libantlr3c_la_LDFLAGS) $(LDFLAGS) -o $@ +DEFAULT_INCLUDES = -I.@am__isrc@ +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(libantlr3c_la_SOURCES) +DIST_SOURCES = $(libantlr3c_la_SOURCES) +HEADERS = $(include_HEADERS) +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 +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@ +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@ +LIBS = @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@ +OBJECT_MODE = @OBJECT_MODE@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +RANLIB = @RANLIB@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_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@ +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@ +AUTOMAKE_OPTIONS = gnu +AM_LIBTOOLFLAGS = +ACLOCAL_AMFLAGS = -I m4 +lib_LTLIBRARIES = libantlr3c.la +LIBSOURCES = src/antlr3baserecognizer.c \ + src/antlr3basetree.c \ + src/antlr3basetreeadaptor.c \ + src/antlr3bitset.c \ + src/antlr3collections.c \ + src/antlr3commontoken.c \ + src/antlr3commontree.c \ + src/antlr3commontreeadaptor.c \ + src/antlr3commontreenodestream.c \ + src/antlr3convertutf.c \ + src/antlr3cyclicdfa.c \ + src/antlr3debughandlers.c \ + src/antlr3encodings.c \ + src/antlr3exception.c \ + src/antlr3filestream.c \ + src/antlr3inputstream.c \ + src/antlr3intstream.c \ + src/antlr3lexer.c \ + src/antlr3parser.c \ + src/antlr3rewritestreams.c \ + src/antlr3string.c \ + src/antlr3tokenstream.c \ + src/antlr3treeparser.c + +libantlr3c_la_SOURCES = $(LIBSOURCES) +include_HEADERS = include/antlr3.h \ + include/antlr3baserecognizer.h \ + include/antlr3basetree.h \ + include/antlr3basetreeadaptor.h \ + include/antlr3bitset.h \ + include/antlr3collections.h \ + include/antlr3commontoken.h \ + include/antlr3commontree.h \ + include/antlr3commontreeadaptor.h \ + include/antlr3commontreenodestream.h \ + include/antlr3convertutf.h \ + include/antlr3cyclicdfa.h \ + include/antlr3debugeventlistener.h \ + include/antlr3defs.h \ + include/antlr3encodings.h \ + include/antlr3errors.h \ + include/antlr3exception.h \ + include/antlr3filestream.h \ + include/antlr3input.h \ + include/antlr3interfaces.h \ + include/antlr3intstream.h \ + include/antlr3lexer.h \ + include/antlr3memory.h \ + include/antlr3parser.h \ + include/antlr3parsetree.h \ + include/antlr3recognizersharedstate.h \ + include/antlr3rewritestreams.h \ + include/antlr3string.h \ + include/antlr3tokenstream.h \ + include/antlr3treeparser.h \ + antlr3config.h + +libantlr3c_la_LDFLAGS = -avoid-version +INCLUDES = -Iinclude +EXTRA_DIST = \ + vsrulefiles/antlr3lexerandparser.rules \ + vsrulefiles/antlr3lexer.rules \ + vsrulefiles/antlr3parser.rules \ + vsrulefiles/antlr3treeparser.rules \ + C.sln C.vcproj C.vcproj.vspscc \ + C.vssscc doxyfile doxygen + +all: antlr3config.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) --gnu'; \ + $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ + $(am__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) + $(am__cd) $(srcdir) && $(AUTOCONF) +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) +$(am__aclocal_m4_deps): + +antlr3config.h: stamp-h1 + @if test ! -f $@; then \ + rm -f stamp-h1; \ + $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \ + else :; fi + +stamp-h1: $(srcdir)/antlr3config.h.in $(top_builddir)/config.status + @rm -f stamp-h1 + cd $(top_builddir) && $(SHELL) ./config.status antlr3config.h +$(srcdir)/antlr3config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) + rm -f stamp-h1 + touch $@ + +distclean-hdr: + -rm -f antlr3config.h stamp-h1 +install-libLTLIBRARIES: $(lib_LTLIBRARIES) + @$(NORMAL_INSTALL) + test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + list2=; for p in $$list; do \ + if test -f $$p; then \ + list2="$$list2 $$p"; \ + else :; fi; \ + done; \ + test -z "$$list2" || { \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ + } + +uninstall-libLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ + 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 +libantlr3c.la: $(libantlr3c_la_OBJECTS) $(libantlr3c_la_DEPENDENCIES) + $(libantlr3c_la_LINK) -rpath $(libdir) $(libantlr3c_la_OBJECTS) $(libantlr3c_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/antlr3baserecognizer.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/antlr3basetree.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/antlr3basetreeadaptor.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/antlr3bitset.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/antlr3collections.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/antlr3commontoken.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/antlr3commontree.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/antlr3commontreeadaptor.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/antlr3commontreenodestream.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/antlr3convertutf.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/antlr3cyclicdfa.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/antlr3debughandlers.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/antlr3encodings.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/antlr3exception.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/antlr3filestream.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/antlr3inputstream.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/antlr3intstream.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/antlr3lexer.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/antlr3parser.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/antlr3rewritestreams.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/antlr3string.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/antlr3tokenstream.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/antlr3treeparser.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +antlr3baserecognizer.lo: src/antlr3baserecognizer.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT antlr3baserecognizer.lo -MD -MP -MF $(DEPDIR)/antlr3baserecognizer.Tpo -c -o antlr3baserecognizer.lo `test -f 'src/antlr3baserecognizer.c' || echo '$(srcdir)/'`src/antlr3baserecognizer.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/antlr3baserecognizer.Tpo $(DEPDIR)/antlr3baserecognizer.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='src/antlr3baserecognizer.c' object='antlr3baserecognizer.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o antlr3baserecognizer.lo `test -f 'src/antlr3baserecognizer.c' || echo '$(srcdir)/'`src/antlr3baserecognizer.c + +antlr3basetree.lo: src/antlr3basetree.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT antlr3basetree.lo -MD -MP -MF $(DEPDIR)/antlr3basetree.Tpo -c -o antlr3basetree.lo `test -f 'src/antlr3basetree.c' || echo '$(srcdir)/'`src/antlr3basetree.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/antlr3basetree.Tpo $(DEPDIR)/antlr3basetree.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='src/antlr3basetree.c' object='antlr3basetree.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o antlr3basetree.lo `test -f 'src/antlr3basetree.c' || echo '$(srcdir)/'`src/antlr3basetree.c + +antlr3basetreeadaptor.lo: src/antlr3basetreeadaptor.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT antlr3basetreeadaptor.lo -MD -MP -MF $(DEPDIR)/antlr3basetreeadaptor.Tpo -c -o antlr3basetreeadaptor.lo `test -f 'src/antlr3basetreeadaptor.c' || echo '$(srcdir)/'`src/antlr3basetreeadaptor.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/antlr3basetreeadaptor.Tpo $(DEPDIR)/antlr3basetreeadaptor.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='src/antlr3basetreeadaptor.c' object='antlr3basetreeadaptor.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o antlr3basetreeadaptor.lo `test -f 'src/antlr3basetreeadaptor.c' || echo '$(srcdir)/'`src/antlr3basetreeadaptor.c + +antlr3bitset.lo: src/antlr3bitset.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT antlr3bitset.lo -MD -MP -MF $(DEPDIR)/antlr3bitset.Tpo -c -o antlr3bitset.lo `test -f 'src/antlr3bitset.c' || echo '$(srcdir)/'`src/antlr3bitset.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/antlr3bitset.Tpo $(DEPDIR)/antlr3bitset.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='src/antlr3bitset.c' object='antlr3bitset.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o antlr3bitset.lo `test -f 'src/antlr3bitset.c' || echo '$(srcdir)/'`src/antlr3bitset.c + +antlr3collections.lo: src/antlr3collections.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT antlr3collections.lo -MD -MP -MF $(DEPDIR)/antlr3collections.Tpo -c -o antlr3collections.lo `test -f 'src/antlr3collections.c' || echo '$(srcdir)/'`src/antlr3collections.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/antlr3collections.Tpo $(DEPDIR)/antlr3collections.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='src/antlr3collections.c' object='antlr3collections.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o antlr3collections.lo `test -f 'src/antlr3collections.c' || echo '$(srcdir)/'`src/antlr3collections.c + +antlr3commontoken.lo: src/antlr3commontoken.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT antlr3commontoken.lo -MD -MP -MF $(DEPDIR)/antlr3commontoken.Tpo -c -o antlr3commontoken.lo `test -f 'src/antlr3commontoken.c' || echo '$(srcdir)/'`src/antlr3commontoken.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/antlr3commontoken.Tpo $(DEPDIR)/antlr3commontoken.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='src/antlr3commontoken.c' object='antlr3commontoken.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o antlr3commontoken.lo `test -f 'src/antlr3commontoken.c' || echo '$(srcdir)/'`src/antlr3commontoken.c + +antlr3commontree.lo: src/antlr3commontree.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT antlr3commontree.lo -MD -MP -MF $(DEPDIR)/antlr3commontree.Tpo -c -o antlr3commontree.lo `test -f 'src/antlr3commontree.c' || echo '$(srcdir)/'`src/antlr3commontree.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/antlr3commontree.Tpo $(DEPDIR)/antlr3commontree.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='src/antlr3commontree.c' object='antlr3commontree.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o antlr3commontree.lo `test -f 'src/antlr3commontree.c' || echo '$(srcdir)/'`src/antlr3commontree.c + +antlr3commontreeadaptor.lo: src/antlr3commontreeadaptor.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT antlr3commontreeadaptor.lo -MD -MP -MF $(DEPDIR)/antlr3commontreeadaptor.Tpo -c -o antlr3commontreeadaptor.lo `test -f 'src/antlr3commontreeadaptor.c' || echo '$(srcdir)/'`src/antlr3commontreeadaptor.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/antlr3commontreeadaptor.Tpo $(DEPDIR)/antlr3commontreeadaptor.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='src/antlr3commontreeadaptor.c' object='antlr3commontreeadaptor.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o antlr3commontreeadaptor.lo `test -f 'src/antlr3commontreeadaptor.c' || echo '$(srcdir)/'`src/antlr3commontreeadaptor.c + +antlr3commontreenodestream.lo: src/antlr3commontreenodestream.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT antlr3commontreenodestream.lo -MD -MP -MF $(DEPDIR)/antlr3commontreenodestream.Tpo -c -o antlr3commontreenodestream.lo `test -f 'src/antlr3commontreenodestream.c' || echo '$(srcdir)/'`src/antlr3commontreenodestream.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/antlr3commontreenodestream.Tpo $(DEPDIR)/antlr3commontreenodestream.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='src/antlr3commontreenodestream.c' object='antlr3commontreenodestream.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o antlr3commontreenodestream.lo `test -f 'src/antlr3commontreenodestream.c' || echo '$(srcdir)/'`src/antlr3commontreenodestream.c + +antlr3convertutf.lo: src/antlr3convertutf.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT antlr3convertutf.lo -MD -MP -MF $(DEPDIR)/antlr3convertutf.Tpo -c -o antlr3convertutf.lo `test -f 'src/antlr3convertutf.c' || echo '$(srcdir)/'`src/antlr3convertutf.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/antlr3convertutf.Tpo $(DEPDIR)/antlr3convertutf.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='src/antlr3convertutf.c' object='antlr3convertutf.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o antlr3convertutf.lo `test -f 'src/antlr3convertutf.c' || echo '$(srcdir)/'`src/antlr3convertutf.c + +antlr3cyclicdfa.lo: src/antlr3cyclicdfa.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT antlr3cyclicdfa.lo -MD -MP -MF $(DEPDIR)/antlr3cyclicdfa.Tpo -c -o antlr3cyclicdfa.lo `test -f 'src/antlr3cyclicdfa.c' || echo '$(srcdir)/'`src/antlr3cyclicdfa.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/antlr3cyclicdfa.Tpo $(DEPDIR)/antlr3cyclicdfa.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='src/antlr3cyclicdfa.c' object='antlr3cyclicdfa.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o antlr3cyclicdfa.lo `test -f 'src/antlr3cyclicdfa.c' || echo '$(srcdir)/'`src/antlr3cyclicdfa.c + +antlr3debughandlers.lo: src/antlr3debughandlers.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT antlr3debughandlers.lo -MD -MP -MF $(DEPDIR)/antlr3debughandlers.Tpo -c -o antlr3debughandlers.lo `test -f 'src/antlr3debughandlers.c' || echo '$(srcdir)/'`src/antlr3debughandlers.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/antlr3debughandlers.Tpo $(DEPDIR)/antlr3debughandlers.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='src/antlr3debughandlers.c' object='antlr3debughandlers.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o antlr3debughandlers.lo `test -f 'src/antlr3debughandlers.c' || echo '$(srcdir)/'`src/antlr3debughandlers.c + +antlr3encodings.lo: src/antlr3encodings.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT antlr3encodings.lo -MD -MP -MF $(DEPDIR)/antlr3encodings.Tpo -c -o antlr3encodings.lo `test -f 'src/antlr3encodings.c' || echo '$(srcdir)/'`src/antlr3encodings.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/antlr3encodings.Tpo $(DEPDIR)/antlr3encodings.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='src/antlr3encodings.c' object='antlr3encodings.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o antlr3encodings.lo `test -f 'src/antlr3encodings.c' || echo '$(srcdir)/'`src/antlr3encodings.c + +antlr3exception.lo: src/antlr3exception.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT antlr3exception.lo -MD -MP -MF $(DEPDIR)/antlr3exception.Tpo -c -o antlr3exception.lo `test -f 'src/antlr3exception.c' || echo '$(srcdir)/'`src/antlr3exception.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/antlr3exception.Tpo $(DEPDIR)/antlr3exception.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='src/antlr3exception.c' object='antlr3exception.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o antlr3exception.lo `test -f 'src/antlr3exception.c' || echo '$(srcdir)/'`src/antlr3exception.c + +antlr3filestream.lo: src/antlr3filestream.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT antlr3filestream.lo -MD -MP -MF $(DEPDIR)/antlr3filestream.Tpo -c -o antlr3filestream.lo `test -f 'src/antlr3filestream.c' || echo '$(srcdir)/'`src/antlr3filestream.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/antlr3filestream.Tpo $(DEPDIR)/antlr3filestream.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='src/antlr3filestream.c' object='antlr3filestream.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o antlr3filestream.lo `test -f 'src/antlr3filestream.c' || echo '$(srcdir)/'`src/antlr3filestream.c + +antlr3inputstream.lo: src/antlr3inputstream.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT antlr3inputstream.lo -MD -MP -MF $(DEPDIR)/antlr3inputstream.Tpo -c -o antlr3inputstream.lo `test -f 'src/antlr3inputstream.c' || echo '$(srcdir)/'`src/antlr3inputstream.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/antlr3inputstream.Tpo $(DEPDIR)/antlr3inputstream.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='src/antlr3inputstream.c' object='antlr3inputstream.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o antlr3inputstream.lo `test -f 'src/antlr3inputstream.c' || echo '$(srcdir)/'`src/antlr3inputstream.c + +antlr3intstream.lo: src/antlr3intstream.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT antlr3intstream.lo -MD -MP -MF $(DEPDIR)/antlr3intstream.Tpo -c -o antlr3intstream.lo `test -f 'src/antlr3intstream.c' || echo '$(srcdir)/'`src/antlr3intstream.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/antlr3intstream.Tpo $(DEPDIR)/antlr3intstream.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='src/antlr3intstream.c' object='antlr3intstream.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o antlr3intstream.lo `test -f 'src/antlr3intstream.c' || echo '$(srcdir)/'`src/antlr3intstream.c + +antlr3lexer.lo: src/antlr3lexer.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT antlr3lexer.lo -MD -MP -MF $(DEPDIR)/antlr3lexer.Tpo -c -o antlr3lexer.lo `test -f 'src/antlr3lexer.c' || echo '$(srcdir)/'`src/antlr3lexer.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/antlr3lexer.Tpo $(DEPDIR)/antlr3lexer.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='src/antlr3lexer.c' object='antlr3lexer.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o antlr3lexer.lo `test -f 'src/antlr3lexer.c' || echo '$(srcdir)/'`src/antlr3lexer.c + +antlr3parser.lo: src/antlr3parser.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT antlr3parser.lo -MD -MP -MF $(DEPDIR)/antlr3parser.Tpo -c -o antlr3parser.lo `test -f 'src/antlr3parser.c' || echo '$(srcdir)/'`src/antlr3parser.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/antlr3parser.Tpo $(DEPDIR)/antlr3parser.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='src/antlr3parser.c' object='antlr3parser.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o antlr3parser.lo `test -f 'src/antlr3parser.c' || echo '$(srcdir)/'`src/antlr3parser.c + +antlr3rewritestreams.lo: src/antlr3rewritestreams.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT antlr3rewritestreams.lo -MD -MP -MF $(DEPDIR)/antlr3rewritestreams.Tpo -c -o antlr3rewritestreams.lo `test -f 'src/antlr3rewritestreams.c' || echo '$(srcdir)/'`src/antlr3rewritestreams.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/antlr3rewritestreams.Tpo $(DEPDIR)/antlr3rewritestreams.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='src/antlr3rewritestreams.c' object='antlr3rewritestreams.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o antlr3rewritestreams.lo `test -f 'src/antlr3rewritestreams.c' || echo '$(srcdir)/'`src/antlr3rewritestreams.c + +antlr3string.lo: src/antlr3string.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT antlr3string.lo -MD -MP -MF $(DEPDIR)/antlr3string.Tpo -c -o antlr3string.lo `test -f 'src/antlr3string.c' || echo '$(srcdir)/'`src/antlr3string.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/antlr3string.Tpo $(DEPDIR)/antlr3string.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='src/antlr3string.c' object='antlr3string.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o antlr3string.lo `test -f 'src/antlr3string.c' || echo '$(srcdir)/'`src/antlr3string.c + +antlr3tokenstream.lo: src/antlr3tokenstream.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT antlr3tokenstream.lo -MD -MP -MF $(DEPDIR)/antlr3tokenstream.Tpo -c -o antlr3tokenstream.lo `test -f 'src/antlr3tokenstream.c' || echo '$(srcdir)/'`src/antlr3tokenstream.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/antlr3tokenstream.Tpo $(DEPDIR)/antlr3tokenstream.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='src/antlr3tokenstream.c' object='antlr3tokenstream.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o antlr3tokenstream.lo `test -f 'src/antlr3tokenstream.c' || echo '$(srcdir)/'`src/antlr3tokenstream.c + +antlr3treeparser.lo: src/antlr3treeparser.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT antlr3treeparser.lo -MD -MP -MF $(DEPDIR)/antlr3treeparser.Tpo -c -o antlr3treeparser.lo `test -f 'src/antlr3treeparser.c' || echo '$(srcdir)/'`src/antlr3treeparser.c +@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/antlr3treeparser.Tpo $(DEPDIR)/antlr3treeparser.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='src/antlr3treeparser.c' object='antlr3treeparser.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o antlr3treeparser.lo `test -f 'src/antlr3treeparser.c' || echo '$(srcdir)/'`src/antlr3treeparser.c + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool config.lt +install-includeHEADERS: $(include_HEADERS) + @$(NORMAL_INSTALL) + test -z "$(includedir)" || $(MKDIR_P) "$(DESTDIR)$(includedir)" + @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includedir)'"; \ + $(INSTALL_HEADER) $$files "$(DESTDIR)$(includedir)" || exit $$?; \ + done + +uninstall-includeHEADERS: + @$(NORMAL_UNINSTALL) + @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + test -n "$$files" || exit 0; \ + echo " ( cd '$(DESTDIR)$(includedir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(includedir)" && rm -f $$files + +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) antlr3config.h.in $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) antlr3config.h.in $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) antlr3config.h.in $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) antlr3config.h.in $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + $(am__remove_distdir) + test -d "$(distdir)" || mkdir "$(distdir)" + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done + -test -n "$(am__skip_mode_fix)" \ + || find "$(distdir)" -type d ! -perm -755 \ + -exec chmod u+rwx,go+rx {} \; -o \ + ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ + || chmod -R a+r "$(distdir)" +dist-gzip: distdir + tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + $(am__remove_distdir) + +dist-bzip2: distdir + tardir=$(distdir) && $(am__tar) | bzip2 -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-xz: distdir + tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz + $(am__remove_distdir) + +dist-tarZ: distdir + tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z + $(am__remove_distdir) + +dist-shar: distdir + shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz + $(am__remove_distdir) + +dist-zip: distdir + -rm -f $(distdir).zip + zip -rq $(distdir).zip $(distdir) + $(am__remove_distdir) + +dist dist-all: distdir + tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + $(am__remove_distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + case '$(DIST_ARCHIVES)' in \ + *.tar.gz*) \ + GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ + *.tar.bz2*) \ + bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ + *.tar.lzma*) \ + lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\ + *.tar.xz*) \ + xz -dc $(distdir).tar.xz | $(am__untar) ;;\ + *.tar.Z*) \ + uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ + *.shar.gz*) \ + GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ + *.zip*) \ + unzip $(distdir).zip ;;\ + esac + chmod -R a-w $(distdir); chmod a+w $(distdir) + mkdir $(distdir)/_build + mkdir $(distdir)/_inst + chmod a-w $(distdir) + test -d $(distdir)/_build || exit 0; \ + dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ + && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ + && am__cwd=`pwd` \ + && $(am__cd) $(distdir)/_build \ + && ../configure --srcdir=.. --prefix="$$dc_install_base" \ + $(DISTCHECK_CONFIGURE_FLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ + distuninstallcheck \ + && chmod -R a-w "$$dc_install_base" \ + && ({ \ + (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ + distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ + } || { rm -rf "$$dc_destdir"; exit 1; }) \ + && rm -rf "$$dc_destdir" \ + && $(MAKE) $(AM_MAKEFLAGS) dist \ + && rm -rf $(DIST_ARCHIVES) \ + && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ + && cd "$$am__cwd" \ + || exit 1 + $(am__remove_distdir) + @(echo "$(distdir) archives ready for distribution: "; \ + list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ + sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' +distuninstallcheck: + @$(am__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 $(LTLIBRARIES) $(HEADERS) antlr3config.h +installdirs: + for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)"; 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) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-libLTLIBRARIES 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 + +html-am: + +info: info-am + +info-am: + +install-data-am: install-includeHEADERS + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: install-libLTLIBRARIES + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f $(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-includeHEADERS uninstall-libLTLIBRARIES + +.MAKE: all install-am install-strip + +.PHONY: CTAGS GTAGS all all-am am--refresh check check-am clean \ + clean-generic clean-libLTLIBRARIES clean-libtool ctags dist \ + dist-all dist-bzip2 dist-gzip dist-lzma dist-shar dist-tarZ \ + dist-xz dist-zip distcheck distclean distclean-compile \ + distclean-generic distclean-hdr distclean-libtool \ + distclean-tags distcleancheck distdir distuninstallcheck dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-includeHEADERS install-info install-info-am \ + install-libLTLIBRARIES 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-includeHEADERS \ + uninstall-libLTLIBRARIES + + +export OBJECT_MODE + +# 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/antlr/libantlr3c-3.4/NEWS b/antlr/libantlr3c-3.4/NEWS new file mode 100644 index 0000000..aea82ff --- /dev/null +++ b/antlr/libantlr3c-3.4/NEWS @@ -0,0 +1,2 @@ +See www.antlr.org and the associated email forums for release dates and +other announcements. diff --git a/antlr/libantlr3c-3.4/README b/antlr/libantlr3c-3.4/README new file mode 100644 index 0000000..a1c0555 --- /dev/null +++ b/antlr/libantlr3c-3.4/README @@ -0,0 +1,1924 @@ +ANTLR v3.0.1 C Runtime +ANTLR 3.0.1 +January 1, 2008 + +At the moment, the use of the C runtime engine for the parser is not generally +for the inexperienced C programmer. However this is mainly because of the lack +of documentation on use, which will be corrected shortly. The C runtime +code itself is however well documented with doxygen style comments and a +reasonably experienced C programmer should be able to piece it together. You +can visit the documentation at: http://www.antlr.org/api/C/index.html + +The general make up is that everything is implemented as a pseudo class/object +initialized with pointers to its 'member' functions and data. All objects are +(usually) created by factories, which auto manage the memory allocation and +release and generally make life easier. If you remember this rule, everything +should fall in to place. + +Jim Idle - Portland Oregon, Jan 2008 +jimi idle ws + +=============================================================================== + +Terence Parr, parrt at cs usfca edu +ANTLR project lead and supreme dictator for life +University of San Francisco + +INTRODUCTION + +Welcome to ANTLR v3! I've been working on this for nearly 4 years and it's +almost ready! I plan no feature additions between this beta and first +3.0 release. I have lots of features to add later, but this will be +the first set. Ultimately, I need to rewrite ANTLR v3 in itself (it's +written in 2.7.7 at the moment and also needs StringTemplate 3.0 or +later). + +You should use v3 in conjunction with ANTLRWorks: + + http://www.antlr.org/works/index.html + +WARNING: We have bits of documentation started, but nothing super-complete +yet. The book will be printed May 2007: + +http://www.pragmaticprogrammer.com/titles/tpantlr/index.html + +but we should have a beta PDF available on that page in Feb 2007. + +You also have the examples plus the source to guide you. + +See the new wiki FAQ: + + http://www.antlr.org/wiki/display/ANTLR3/ANTLR+v3+FAQ + +and general doc root: + + http://www.antlr.org/wiki/display/ANTLR3/ANTLR+3+Wiki+Home + +Please help add/update FAQ entries. + +I have made very little effort at this point to deal well with +erroneous input (e.g., bad syntax might make ANTLR crash). I will clean +this up after I've rewritten v3 in v3. + +Per the license in LICENSE.txt, this software is not guaranteed to +work and might even destroy all life on this planet: + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING +IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. + +EXAMPLES + +ANTLR v3 sample grammars: + + http://www.antlr.org/download/examples-v3.tar.gz + +contains the following examples: LL-star, cminus, dynamic-scope, +fuzzy, hoistedPredicates, island-grammar, java, python, scopes, +simplecTreeParser, treeparser, tweak, xmlLexer. + +Also check out Mantra Programming Language for a prototype (work in +progress) using v3: + + http://www.linguamantra.org/ + +---------------------------------------------------------------------- + +What is ANTLR? + +ANTLR stands for (AN)other (T)ool for (L)anguage (R)ecognition and was +originally known as PCCTS. ANTLR is a language tool that provides a +framework for constructing recognizers, compilers, and translators +from grammatical descriptions containing actions. Target language list: + +http://www.antlr.org/wiki/display/ANTLR3/Code+Generation+Targets + +---------------------------------------------------------------------- + +How is ANTLR v3 different than ANTLR v2? + +See migration guide: + http://www.antlr.org/wiki/display/ANTLR3/Migrating+from+ANTLR+2+to+ANTLR+3 + +ANTLR v3 has a far superior parsing algorithm called LL(*) that +handles many more grammars than v2 does. In practice, it means you +can throw almost any grammar at ANTLR that is non-left-recursive and +unambiguous (same input can be matched by multiple rules); the cost is +perhaps a tiny bit of backtracking, but with a DFA not a full parser. +You can manually set the max lookahead k as an option for any decision +though. The LL(*) algorithm ramps up to use more lookahead when it +needs to and is much more efficient than normal LL backtracking. There +is support for syntactic predicate (full LL backtracking) when LL(*) +fails. + +Lexers are much easier due to the LL(*) algorithm as well. Previously +these two lexer rules would cause trouble because ANTLR couldn't +distinguish between them with finite lookahead to see the decimal +point: + +INT : ('0'..'9')+ ; +FLOAT : INT '.' INT ; + +The syntax is almost identical for features in common, but you should +note that labels are always '=' not ':'. So do id=ID not id:ID. + +You can do combined lexer/parser grammars again (ala PCCTS) both lexer +and parser rules are defined in the same file. See the examples. +Really nice. You can reference strings and characters in the grammar +and ANTLR will generate the lexer for you. + +The attribute structure has been enhanced. Rules may have multiple +return values, for example. Further, there are dynamically scoped +attributes whereby a rule may define a value usable by any rule it +invokes directly or indirectly w/o having to pass a parameter all the +way down. + +ANTLR v3 tree construction is far superior--it provides tree rewrite +rules where the right hand side is simply the tree grammar fragment +describing the tree you want to build: + +formalArgs + : typename declarator (',' typename declarator )* + -> ^(ARG typename declarator)+ + ; + +That builds tree sequences like: + +^(ARG int v1) ^(ARG int v2) + +ANTLR v3 also incorporates StringTemplate: + + http://www.stringtemplate.org + +just like AST support. It is useful for generating output. For +example this rule creates a template called 'import' for each import +definition found in the input stream: + +grammar Java; +options { + output=template; +} +... +importDefinition + : 'import' identifierStar SEMI + -> import(name={$identifierStar.st}, + begin={$identifierStar.start}, + end={$identifierStar.stop}) + ; + +The attributes are set via assignments in the argument list. The +arguments are actions with arbitrary expressions in the target +language. The .st label property is the result template from a rule +reference. There is a nice shorthand in actions too: + + %foo(a={},b={},...) ctor + %({name-expr})(a={},...) indirect template ctor reference + %{string-expr} anonymous template from string expr + %{expr}.y = z; template attribute y of StringTemplate-typed expr to z + %x.y = z; set template attribute y of x (always set never get attr) + to z [languages like python without ';' must still use the + ';' which the code generator is free to remove during code gen] + Same as '(x).setAttribute("y", z);' + +For ANTLR v3 I decided to make the most common tasks easy by default +rather. This means that some of the basic objects are heavier weight +than some speed demons would like, but they are free to pare it down +leaving most programmers the luxury of having it "just work." For +example, to read in some input, tweak it, and write it back out +preserving whitespace, is easy in v3. + +The ANTLR source code is much prettier. You'll also note that the +run-time classes are conveniently encapsulated in the +org.antlr.runtime package. + +---------------------------------------------------------------------- + +How do I install this damn thing? + +Just untar and you'll get: + +antlr-3.0b6/README.txt (this file) +antlr-3.0b6/LICENSE.txt +antlr-3.0b6/src/org/antlr/... +antlr-3.0b6/lib/stringtemplate-3.0.jar (3.0b6 needs 3.0) +antlr-3.0b6/lib/antlr-2.7.7.jar +antlr-3.0b6/lib/antlr-3.0b6.jar + +Then you need to add all the jars in lib to your CLASSPATH. + +---------------------------------------------------------------------- + +How do I use ANTLR v3? + +[I am assuming you are only using the command-line (and not the +ANTLRWorks GUI)]. + +Running ANTLR with no parameters shows you: + +ANTLR Parser Generator Early Access Version 3.0b6 (Jan 31, 2007) 1989-2007 +usage: java org.antlr.Tool [args] file.g [file2.g file3.g ...] + -o outputDir specify output directory where all output is generated + -lib dir specify location of token files + -report print out a report about the grammar(s) processed + -print print out the grammar without actions + -debug generate a parser that emits debugging events + -profile generate a parser that computes profiling information + -nfa generate an NFA for each rule + -dfa generate a DFA for each decision point + -message-format name specify output style for messages + -X display extended argument list + +For example, consider how to make the LL-star example from the examples +tarball you can get at http://www.antlr.org/download/examples-v3.tar.gz + +$ cd examples/java/LL-star +$ java org.antlr.Tool simplec.g +$ jikes *.java + +For input: + +char c; +int x; +void bar(int x); +int foo(int y, char d) { + int i; + for (i=0; i<3; i=i+1) { + x=3; + y=5; + } +} + +you will see output as follows: + +$ java Main input +bar is a declaration +foo is a definition + +What if I want to test my parser without generating code? Easy. Just +run ANTLR in interpreter mode. It can't execute your actions, but it +can create a parse tree from your input to show you how it would be +matched. Use the org.antlr.tool.Interp main class. In the following, +I interpret simplec.g on t.c, which contains "int x;" + +$ java org.antlr.tool.Interp simplec.g WS program t.c +( + ( program + ( declaration + ( variable + ( type [@0,0:2='int',<14>,1:0] ) + ( declarator [@2,4:4='x',<2>,1:4] ) + [@3,5:5=';',<5>,1:5] + ) + ) + ) +) + +where I have formatted the output to make it more readable. I have +told it to ignore all WS tokens. + +---------------------------------------------------------------------- + +How do I rebuild ANTLR v3? + +Make sure the following two jars are in your CLASSPATH + +antlr-3.0b6/lib/stringtemplate-3.0.jar +antlr-3.0b6/lib/antlr-2.7.7.jar +junit.jar [if you want to build the test directories] + +then jump into antlr-3.0b6/src directory and then type: + +$ javac -d . org/antlr/Tool.java org/antlr/*/*.java org/antlr/*/*/*.java + +Takes 9 seconds on my 1Ghz laptop or 4 seconds with jikes. Later I'll +have a real build mechanism, though I must admit the one-liner appeals +to me. I use Intellij so I never type anything actually to build. + +There is also an ANT build.xml file, but I know nothing of ANT; contributed +by others (I'm opposed to any tool with an XML interface for Humans). + +----------------------------------------------------------------------- +C# Target Notes + +1. Auto-generated lexers do not inherit parent parser's @namespace + {...} value. Use @lexer::namespace{...}. + +----------------------------------------------------------------------- + +CHANGES + +March 17, 2007 + +* Jonathan DeKlotz updated C# templates to be 3.0b6 current + +March 14, 2007 + +* Manually-specified (...)=> force backtracking eval of that predicate. + backtracking=true mode does not however. Added unit test. + +March 14, 2007 + +* Fixed bug in lexer where ~T didn't compute the set from rule T. + +* Added -Xnoinlinedfa make all DFA with tables; no inline prediction with IFs + +* Fixed http://www.antlr.org:8888/browse/ANTLR-80. + Sem pred states didn't define lookahead vars. + +* Fixed http://www.antlr.org:8888/browse/ANTLR-91. + When forcing some acyclic DFA to be state tables, they broke. + Forcing all DFA to be state tables should give same results. + +March 12, 2007 + +* setTokenSource in CommonTokenStream didn't clear tokens list. + setCharStream calls reset in Lexer. + +* Altered -depend. No longer printing grammar files for multiple input + files with -depend. Doesn't show T__.g temp file anymore. Added + TLexer.tokens. Added .h files if defined. + +February 11, 2007 + +* Added -depend command-line option that, instead of processing files, + it shows you what files the input grammar(s) depend on and what files + they generate. For combined grammar T.g: + + $ java org.antlr.Tool -depend T.g + + You get: + + TParser.java : T.g + T.tokens : T.g + T__.g : T.g + + Now, assuming U.g is a tree grammar ref'd T's tokens: + + $ java org.antlr.Tool -depend T.g U.g + + TParser.java : T.g + T.tokens : T.g + T__.g : T.g + U.g: T.tokens + U.java : U.g + U.tokens : U.g + + Handles spaces by escaping them. Pays attention to -o, -fo and -lib. + Dir 'x y' is a valid dir in current dir. + + $ java org.antlr.Tool -depend -lib /usr/local/lib -o 'x y' T.g U.g + x\ y/TParser.java : T.g + x\ y/T.tokens : T.g + x\ y/T__.g : T.g + U.g: /usr/local/lib/T.tokens + x\ y/U.java : U.g + x\ y/U.tokens : U.g + + You have API access via org.antlr.tool.BuildDependencyGenerator class: + getGeneratedFileList(), getDependenciesFileList(). You can also access + the output template: getDependencies(). The file + org/antlr/tool/templates/depend.stg contains the template. You can + modify as you want. File objects go in so you can play with path etc... + +February 10, 2007 + +* no more .gl files generated. All .g all the time. + +* changed @finally to be @after and added a finally clause to the + exception stuff. I also removed the superfluous "exception" + keyword. Here's what the new syntax looks like: + + a + @after { System.out.println("ick"); } + : 'a' + ; + catch[RecognitionException e] { System.out.println("foo"); } + catch[IOException e] { System.out.println("io"); } + finally { System.out.println("foobar"); } + + @after executes after bookkeeping to set $rule.stop, $rule.tree but + before scopes pop and any memoization happens. Dynamic scopes and + memoization are still in generated finally block because they must + exec even if error in rule. The @after action and tree setting + stuff can technically be skipped upon syntax error in rule. [Later + we might add something to finally to stick an ERROR token in the + tree and set the return value.] Sequence goes: set $stop, $tree (if + any), @after (if any), pop scopes (if any), memoize (if needed), + grammar finally clause. Last 3 are in generated code's finally + clause. + +3.0b6 - January 31, 2007 + +January 30, 2007 + +* Fixed bug in IntervalSet.and: it returned the same empty set all the time + rather than new empty set. Code altered the same empty set. + +* Made analysis terminate faster upon a decision that takes too long; + it seemed to keep doing work for a while. Refactored some names + and updated comments. Also made it terminate when it realizes it's + non-LL(*) due to recursion. just added terminate conditions to loop + in convert(). + +* Sometimes fatal non-LL(*) messages didn't appear; instead you got + "antlr couldn't analyze", which is actually untrue. I had the + order of some prints wrong in the DecisionProbe. + +* The code generator incorrectly detected when it could use a fixed, + acyclic inline DFA (i.e., using an IF). Upon non-LL(*) decisions + with predicates, analysis made cyclic DFA. But this stops + the computation detecting whether they are cyclic. I just added + a protection in front of the acyclic DFA generator to avoid if + non-LL(*). Updated comments. + +January 23, 2007 + +* Made tree node streams use adaptor to create navigation nodes. + Thanks to Emond Papegaaij. + +January 22, 2007 + +* Added lexer rule properties: start, stop + +January 1, 2007 + +* analysis failsafe is back on; if a decision takes too long, it bails out + and uses k=1 + +January 1, 2007 + +* += labels for rules only work for output option; previously elements + of list were the return value structs, but are now either the tree or + StringTemplate return value. You can label different rules now + x+=a x+=b. + +December 30, 2006 + +* Allow \" to work correctly in "..." template. + +December 28, 2006 + +* errors that are now warnings: missing AST label type in trees. + Also "no start rule detected" is warning. + +* tree grammars also can do rewrite=true for output=template. + Only works for alts with single node or tree as alt elements. + If you are going to use $text in a tree grammar or do rewrite=true + for templates, you must use in your main: + + nodes.setTokenStream(tokens); + +* You get a warning for tree grammars that do rewrite=true and + output=template and have -> for alts that are not simple nodes + or simple trees. new unit tests in TestRewriteTemplates at end. + +December 27, 2006 + +* Error message appears when you use -> in tree grammar with + output=template and rewrite=true for alt that is not simple + node or tree ref. + +* no more $stop attribute for tree parsers; meaningless/useless. + Removed from TreeRuleReturnScope also. + +* rule text attribute in tree parser must pull from token buffer. + Makes no sense otherwise. added getTokenStream to TreeNodeStream + so rule $text attr works. CommonTreeNodeStream etc... now let + you set the token stream so you can access later from tree parser. + $text is not well-defined for rules like + + slist : stat+ ; + + because stat is not a single node nor rooted with a single node. + $slist.text will get only first stat. I need to add a warning about + this... + +* Fixed http://www.antlr.org:8888/browse/ANTLR-76 for Java. + Enhanced TokenRewriteStream so it accepts any object; converts + to string at last second. Allows you to rewrite with StringTemplate + templates now :) + +* added rewrite option that makes -> template rewrites do replace ops for + TokenRewriteStream input stream. In output=template and rewrite=true mode + same as before 'cept that the parser does + + ((TokenRewriteStream)input).replace( + ((Token)retval.start).getTokenIndex(), + input.LT(-1).getTokenIndex(), + retval.st); + + after each rewrite so that the input stream is altered. Later refs to + $text will have rewrites. Here's a sample test program for grammar Rew. + + FileReader groupFileR = new FileReader("Rew.stg"); + StringTemplateGroup templates = new StringTemplateGroup(groupFileR); + ANTLRInputStream input = new ANTLRInputStream(System.in); + RewLexer lexer = new RewLexer(input); + TokenRewriteStream tokens = new TokenRewriteStream(lexer); + RewParser parser = new RewParser(tokens); + parser.setTemplateLib(templates); + parser.program(); + System.out.println(tokens.toString()); + groupFileR.close(); + +December 26, 2006 + +* BaseTree.dupTree didn't dup recursively. + +December 24, 2006 + +* Cleaned up some comments and removed field treeNode + from MismatchedTreeNodeException class. It is "node" in + RecognitionException. + +* Changed type from Object to BitSet for expecting fields in + MismatchedSetException and MismatchedNotSetException + +* Cleaned up error printing in lexers and the messages that it creates. + +* Added this to TreeAdaptor: + /** Return the token object from which this node was created. + * Currently used only for printing an error message. + * The error display routine in BaseRecognizer needs to + * display where the input the error occurred. If your + * tree of limitation does not store information that can + * lead you to the token, you can create a token filled with + * the appropriate information and pass that back. See + * BaseRecognizer.getErrorMessage(). + */ + public Token getToken(Object t); + +December 23, 2006 + +* made BaseRecognizer.displayRecognitionError nonstatic so people can + override it. Not sure why it was static before. + +* Removed state/decision message that comes out of no + viable alternative exceptions, as that was too much. + removed the decision number from the early exit exception + also. During development, you can simply override + displayRecognitionError from BaseRecognizer to add the stuff + back in if you want. + +* made output go to an output method you can override: emitErrorMessage() + +* general cleanup of the error emitting code in BaseRecognizer. Lots + more stuff you can override: getErrorHeader, getTokenErrorDisplay, + emitErrorMessage, getErrorMessage. + +December 22, 2006 + +* Altered Tree.Parser.matchAny() so that it skips entire trees if + node has children otherwise skips one node. Now this works to + skip entire body of function if single-rooted subtree: + ^(FUNC name=ID arg=ID .) + +* Added "reverse index" from node to stream index. Override + fillReverseIndex() in CommonTreeNodeStream if you want to change. + Use getNodeIndex(node) to find stream index for a specific tree node. + See getNodeIndex(), reverseIndex(Set tokenTypes), + reverseIndex(int tokenType), fillReverseIndex(). The indexing + costs time and memory to fill, but pulling stuff out will be lots + faster as it can jump from a node ptr straight to a stream index. + +* Added TreeNodeStream.get(index) to make it easier for interpreters to + jump around in tree node stream. + +* New CommonTreeNodeStream buffers all nodes in stream for fast jumping + around. It now has push/pop methods to invoke other locations in + the stream for building interpreters. + +* Moved CommonTreeNodeStream to UnBufferedTreeNodeStream and removed + Iterator implementation. moved toNodesOnlyString() to TestTreeNodeStream + +* [BREAKS ANY TREE IMPLEMENTATION] + made CommonTreeNodeStream work with any tree node type. TreeAdaptor + now implements isNil so must add; trivial, but does break back + compatibility. + +December 17, 2006 + +* Added traceIn/Out methods to recognizers so that you can override them; + previously they were in-line print statements. The message has also + been slightly improved. + +* Factored BuildParseTree into debug package; cleaned stuff up. Fixed + unit tests. + +December 15, 2006 + +* [BREAKS ANY TREE IMPLEMENTATION] + org.antlr.runtime.tree.Tree; needed to add get/set for token start/stop + index so CommonTreeAdaptor can assume Tree interface not CommonTree + implementation. Otherwise, no way to create your own nodes that satisfy + Tree because CommonTreeAdaptor was doing + + public int getTokenStartIndex(Object t) { + return ((CommonTree)t).startIndex; + } + + Added to Tree: + + /** What is the smallest token index (indexing from 0) for this node + * and its children? + */ + int getTokenStartIndex(); + + void setTokenStartIndex(int index); + + /** What is the largest token index (indexing from 0) for this node + * and its children? + */ + int getTokenStopIndex(); + + void setTokenStopIndex(int index); + +December 13, 2006 + +* Added org.antlr.runtime.tree.DOTTreeGenerator so you can generate DOT + diagrams easily from trees. + + CharStream input = new ANTLRInputStream(System.in); + TLexer lex = new TLexer(input); + CommonTokenStream tokens = new CommonTokenStream(lex); + TParser parser = new TParser(tokens); + TParser.e_return r = parser.e(); + Tree t = (Tree)r.tree; + System.out.println(t.toStringTree()); + DOTTreeGenerator gen = new DOTTreeGenerator(); + StringTemplate st = gen.toDOT(t); + System.out.println(st); + +* Changed the way mark()/rewind() work in CommonTreeNode stream to mirror + more flexible solution in ANTLRStringStream. Forgot to set lastMarker + anyway. Now you can rewind to non-most-recent marker. + +December 12, 2006 + +* Temp lexer now end in .gl (T__.gl, for example) + +* TreeParser suffix no longer generated for tree grammars + +* Defined reset for lexer, parser, tree parser; rewinds the input stream also + +December 10, 2006 + +* Made Grammar.abortNFAToDFAConversion() abort in middle of a DFA. + +December 9, 2006 + +* fixed bug in OrderedHashSet.add(). It didn't track elements correctly. + +December 6, 2006 + +* updated build.xml for future Ant compatibility, thanks to Matt Benson. + +* various tests in TestRewriteTemplate and TestSyntacticPredicateEvaluation + were using the old 'channel' vs. new '$channel' notation. + TestInterpretedParsing didn't pick up an earlier change to CommonToken. + Reported by Matt Benson. + +* fixed platform dependent test failures in TestTemplates, supplied by Matt + Benson. + +November 29, 2006 + +* optimized semantic predicate evaluation so that p||!p yields true. + +November 22, 2006 + +* fixed bug that prevented var = $rule.some_retval from working in anything + but the first alternative of a rule or subrule. + +* attribute names containing digits were not allowed, this is now fixed, + allowing attributes like 'name1' but not '1name1'. + +November 19, 2006 + +* Removed LeftRecursionMessage and apparatus because it seems that I check + for left recursion upfront before analysis and everything gets specified as + recursion cycles at this point. + +November 16, 2006 + +* TokenRewriteStream.replace was not passing programName to next method. + +November 15, 2006 + +* updated DOT files for DFA generation to make smaller circles. + +* made epsilon edges italics in the NFA diagrams. + +3.0b5 - November 15, 2006 + +The biggest thing is that your grammar file names must match the grammar name +inside (your generated class names will also be different) and we use +$channel=HIDDEN now instead of channel=99 inside lexer actions. +Should be compatible other than that. Please look at complete list of +changes. + +November 14, 2006 + +* Force token index to be -1 for CommonIndex in case not set. + +November 11, 2006 + +* getUniqueID for TreeAdaptor now uses identityHashCode instead of hashCode. + +November 10, 2006 + +* No grammar nondeterminism warning now when wildcard '.' is final alt. + Examples: + + a : A | B | . ; + + A : 'a' + | . + ; + + SL_COMMENT + : '//' (options {greedy=false;} : .)* '\r'? '\n' + ; + + SL_COMMENT2 + : '//' (options {greedy=false;} : 'x'|.)* '\r'? '\n' + ; + + +November 8, 2006 + +* Syntactic predicates did not get hoisting properly upon non-LL(*) decision. Other hoisting issues fixed. Cleaned up code. + +* Removed failsafe that check to see if I'm spending too much time on a single DFA; I don't think we need it anymore. + +November 3, 2006 + +* $text, $line, etc... were not working in assignments. Fixed and added + test case. + +* $label.text translated to label.getText in lexer even if label was on a char + +November 2, 2006 + +* Added error if you don't specify what the AST type is; actions in tree + grammar won't work without it. + + $ cat x.g + tree grammar x; + a : ID {String s = $ID.text;} ; + + ANTLR Parser Generator Early Access Version 3.0b5 (??, 2006) 1989-2006 + error: x.g:0:0: (152) tree grammar x has no ASTLabelType option + +November 1, 2006 + +* $text, $line, etc... were not working properly within lexer rule. + +October 32, 2006 + +* Finally actions now execute before dynamic scopes are popped it in the + rule. Previously was not possible to access the rules scoped variables + in a finally action. + +October 29, 2006 + +* Altered ActionTranslator to emit errors on setting read-only attributes + such as $start, $stop, $text in a rule. Also forbid setting any attributes + in rules/tokens referenced by a label or name. + Setting dynamic scopes's attributes and your own parameter attributes + is legal. + +October 27, 2006 + +* Altered how ANTLR figures out what decision is associated with which + block of grammar. Makes ANTLRWorks correctly find DFA for a block. + +October 26, 2006 + +* Fixed bug where EOT transitions led to no NFA configs in a DFA state, + yielding an error in DFA table generation. + +* renamed action.g to ActionTranslator.g + the ActionTranslator class is now called ActionTranslatorLexer, as ANTLR + generates this classname now. Fixed rest of codebase accordingly. + +* added rules recognizing setting of scopes' attributes to ActionTranslator.g + the Objective C target needed access to the right-hand side of the assignment + in order to generate correct code + +* changed ANTLRCore.sti to reflect the new mandatory templates to support the above + namely: scopeSetAttributeRef, returnSetAttributeRef and the ruleSetPropertyRef_* + templates, with the exception of ruleSetPropertyRef_text. we cannot set this attribute + +October 19, 2006 + +* Fixed 2 bugs in DFA conversion that caused exceptions. + altered functionality of getMinElement so it ignores elements<0. + +October 18, 2006 + +* moved resetStateNumbersToBeContiguous() to after issuing of warnings; + an internal error in that routine should make more sense as issues + with decision will appear first. + +* fixed cut/paste bug I introduced when fixed EOF in min/max + bug. Prevented C grammar from working briefly. + +October 17, 2006 + +* Removed a failsafe that seems to be unnecessary that ensure DFA didn't + get too big. It was resulting in some failures in code generation that + led me on quite a strange debugging trip. + +October 16, 2006 + +* Use channel=HIDDEN not channel=99 to put tokens on hidden channel. + +October 12, 2006 + +* ANTLR now has a customizable message format for errors and warnings, + to make it easier to fulfill requirements by IDEs and such. + The format to be used can be specified via the '-message-format name' + command line switch. The default for name is 'antlr', also available + at the moment is 'gnu'. This is done via StringTemplate, for details + on the requirements look in org/antlr/tool/templates/messages/formats/ + +* line numbers for lexers in combined grammars are now reported correctly. + +September 29, 2006 + +* ANTLRReaderStream improperly checked for end of input. + +September 28, 2006 + +* For ANTLRStringStream, LA(-1) was off by one...gave you LA(-2). + +3.0b4 - August 24, 2006 + +* error when no rules in grammar. doesn't crash now. + +* Token is now an interface. + +* remove dependence on non runtime classes in runtime package. + +* filename and grammar name must be same Foo in Foo.g. Generates FooParser, + FooLexer, ... Combined grammar Foo generates Foo$Lexer.g which generates + FooLexer.java. tree grammars generate FooTreeParser.java + +August 24, 2006 + +* added C# target to lib, codegen, templates + +August 11, 2006 + +* added tree arg to navigation methods in treeadaptor + +August 07, 2006 + +* fixed bug related to (a|)+ on end of lexer rules. crashed instead + of warning. + +* added warning that interpreter doesn't do synpreds yet + +* allow different source of classloader: +ClassLoader cl = Thread.currentThread().getContextClassLoader(); +if ( cl==null ) { + cl = this.getClass().getClassLoader(); +} + + +July 26, 2006 + +* compressed DFA edge tables significantly. All edge tables are + unique. The transition table can reuse arrays. Look like this now: + + public static readonly DFA30_transition0 = + new short[] { 46, 46, -1, 46, 46, -1, -1, -1, -1, -1, -1, -1,...}; + public static readonly DFA30_transition1 = + new short[] { 21 }; + public static readonly short[][] DFA30_transition = { + DFA30_transition0, + DFA30_transition0, + DFA30_transition1, + ... + }; + +* If you defined both a label like EQ and '=', sometimes the '=' was + used instead of the EQ label. + +* made headerFile template have same arg list as outputFile for consistency + +* outputFile, lexer, genericParser, parser, treeParser templates + reference cyclicDFAs attribute which was no longer used after I + started the new table-based DFA. I made cyclicDFADescriptors + argument to outputFile and headerFile (only). I think this is + correct as only OO languages will want the DFA in the recognizer. + At the top level, C and friends can use it. Changed name to use + cyclicDFAs again as it's a better name probably. Removed parameter + from the lexer, ... For example, my parser template says this now: + + + +* made all token ref token types go thru code gen's + getTokenTypeAsTargetLabel() + +* no more computing DFA transition tables for acyclic DFA. + +July 25, 2006 + +* fixed a place where I was adding syn predicates into rewrite stuff. + +* turned off invalid token index warning in AW support; had a problem. + +* bad location event generated with -debug for synpreds in autobacktrack mode. + +July 24, 2006 + +* changed runtime.DFA so that it treats all chars and token types as + char (unsigned 16 bit int). -1 becomes '\uFFFF' then or 65535. + +* changed MAX_STATE_TRANSITIONS_FOR_TABLE to be 65534 by default + now. This means that all states can use a table to do transitions. + +* was not making synpreds on (C)* type loops with backtrack=true + +* was copying tree stuff and actions into synpreds with backtrack=true + +* was making synpreds on even single alt rules / blocks with backtrack=true + +3.0b3 - July 21, 2006 + +* ANTLR fails to analyze complex decisions much less frequently. It + turns out that the set of decisions for which ANTLR fails (times + out) is the same set (so far) of non-LL(*) decisions. Morever, I'm + able to detect this situation quickly and report rather than timing + out. Errors look like: + + java.g:468:23: [fatal] rule concreteDimensions has non-LL(*) + decision due to recursive rule invocations in alts 1,2. Resolve + by left-factoring or using syntactic predicates with fixed k + lookahead or use backtrack=true option. + + This message only appears when k=*. + +* Shortened no viable alt messages to not include decision + description: + +[compilationUnit, declaration]: line 8:8 decision=<<67:1: declaration +: ( ( fieldDeclaration )=> fieldDeclaration | ( methodDeclaration )=> +methodDeclaration | ( constructorDeclaration )=> +constructorDeclaration | ( classDeclaration )=> classDeclaration | ( +interfaceDeclaration )=> interfaceDeclaration | ( blockDeclaration )=> +blockDeclaration | emptyDeclaration );>> state 3 (decision=14) no +viable alt; token=[@1,184:187='java',<122>,8:8] + + too long and hard to read. + +July 19, 2006 + +* Code gen bug: states with no emanating edges were ignored by ST. + Now an empty list is used. + +* Added grammar parameter to recognizer templates so they can access + properties like getName(), ... + +July 10, 2006 + +* Fixed the gated pred merged state bug. Added unit test. + +* added new method to Target: getTokenTypeAsTargetLabel() + +July 7, 2006 + +* I was doing an AND instead of OR in the gated predicate stuff. + Thanks to Stephen Kou! + +* Reduce op for combining predicates was insanely slow sometimes and + didn't actually work well. Now it's fast and works. + +* There is a bug in merging of DFA stop states related to gated + preds...turned it off for now. + +3.0b2 - July 5, 2006 + +July 5, 2006 + +* token emission not properly protected in lexer filter mode. + +* EOT, EOT DFA state transition tables should be init'd to -1 (only + was doing this for compressed tables). Fixed. + +* in trace mode, exit method not shown for memoized rules + +* added -Xmaxdfaedges to allow you to increase number of edges allowed + for a single DFA state before it becomes "special" and can't fit in + a simple table. + +* Bug in tables. Short are signed so min/max tables for DFA are now + char[]. Bizarre. + +July 3, 2006 + +* Added a method to reset the tool error state for current thread. + See ErrorManager.java + +* [Got this working properly today] backtrack mode that let's you type + in any old crap and ANTLR will backtrack if it can't figure out what + you meant. No errors are reported by antlr during analysis. It + implicitly adds a syn pred in front of every production, using them + only if static grammar LL(*) analysis fails. Syn pred code is not + generated if the pred is not used in a decision. + + This is essentially a rapid prototyping mode. + +* Added backtracking report to the -report option + +* Added NFA->DFA conversion early termination report to the -report option + +* Added grammar level k and backtrack options to -report + +* Added a dozen unit tests to test autobacktrack NFA construction. + +* If you are using filter mode, you must manually use option + memoize=true now. + +July 2, 2006 + +* Added k=* option so you can set k=2, for example, on whole grammar, + but an individual decision can be LL(*). + +* memoize option for grammars, rules, blocks. Remove -nomemo cmd-line option + +* but in DOT generator for DFA; fixed. + +* runtime.DFA reported errors even when backtracking + +July 1, 2006 + +* Added -X option list to help + +* Syn preds were being hoisted into other rules, causing lots of extra + backtracking. + +June 29, 2006 + +* unnecessary files removed during build. + +* Matt Benson updated build.xml + +* Detecting use of synpreds in analysis now instead of codegen. In + this way, I can avoid analyzing decisions in synpreds for synpreds + not used in a DFA for a real rule. This is used to optimize things + for backtrack option. + +* Code gen must add _fragment or whatever to end of pred name in + template synpredRule to avoid having ANTLR know anything about + method names. + +* Added -IdbgST option to emit ST delimiters at start/stop of all + templates spit out. + +June 28, 2006 + +* Tweaked message when ANTLR cannot handle analysis. + +3.0b1 - June 27, 2006 + +June 24, 2006 + +* syn preds no longer generate little static classes; they also don't + generate a whole bunch of extra crap in the rules built to test syn + preds. Removed GrammarFragmentPointer class from runtime. + +June 23-24, 2006 + +* added output option to -report output. + +* added profiling info: + Number of rule invocations in "guessing" mode + number of rule memoization cache hits + number of rule memoization cache misses + +* made DFA DOT diagrams go left to right not top to bottom + +* I try to recursive overflow states now by resolving these states + with semantic/syntactic predicates if they exist. The DFA is then + deterministic rather than simply resolving by choosing first + nondeterministic alt. I used to generated errors: + +~/tmp $ java org.antlr.Tool -dfa t.g +ANTLR Parser Generator Early Access Version 3.0b2 (July 5, 2006) 1989-2006 +t.g:2:5: Alternative 1: after matching input such as A A A A A decision cannot predict what comes next due to recursion overflow to b from b +t.g:2:5: Alternative 2: after matching input such as A A A A A decision cannot predict what comes next due to recursion overflow to b from b + + Now, I uses predicates if available and emits no warnings. + +* made sem preds share accept states. Previously, multiple preds in a +decision forked new accepts each time for each nondet state. + +June 19, 2006 + +* Need parens around the prediction expressions in templates. + +* Referencing $ID.text in an action forced bad code gen in lexer rule ID. + +* Fixed a bug in how predicates are collected. The definition of + "last predicated alternative" was incorrect in the analysis. Further, + gated predicates incorrectly missed a case where an edge should become + true (a tautology). + +* Removed an unnecessary input.consume() reference in the runtime/DFA class. + +June 14, 2006 + +* -> ($rulelabel)? didn't generate proper code for ASTs. + +* bug in code gen (did not compile) +a : ID -> ID + | ID -> ID + ; +Problem is repeated ref to ID from left side. Juergen pointed this out. + +* use of tokenVocab with missing file yielded exception + +* (A|B)=> foo yielded an exception as (A|B) is a set not a block. Fixed. + +* Didn't set ID1= and INT1= for this alt: + | ^(ID INT+ {System.out.print(\"^(\"+$ID+\" \"+$INT+\")\");}) + +* Fixed so repeated dangling state errors only occur once like: +t.g:4:17: the decision cannot distinguish between alternative(s) 2,1 for at least one input sequence + +* tracking of rule elements was on (making list defs at start of + method) with templates instead of just with ASTs. Turned off. + +* Doesn't crash when you give it a missing file now. + +* -report: add output info: how many LL(1) decisions. + +June 13, 2006 + +* ^(ROOT ID?) Didn't work; nor did any other nullable child list such as + ^(ROOT ID* INT?). Now, I check to see if child list is nullable using + Grammar.LOOK() and, if so, I generate an "IF lookahead is DOWN" gate + around the child list so the whole thing is optional. + +* Fixed a bug in LOOK that made it not look through nullable rules. + +* Using AST suffixes or -> rewrite syntax now gives an error w/o a grammar + output option. Used to crash ;) + +* References to EOF ended up with improper -1 refs instead of EOF in output. + +* didn't warn of ambig ref to $expr in rewrite; fixed. +list + : '[' expr 'for' type ID 'in' expr ']' + -> comprehension(expr={$expr.st},type={},list={},i={}) + ; + +June 12, 2006 + +* EOF works in the parser as a token name. + +* Rule b:(A B?)*; didn't display properly in AW due to the way ANTLR + generated NFA. + +* "scope x;" in a rule for unknown x gives no error. Fixed. Added unit test. + +* Label type for refs to start/stop in tree parser and other parsers were + not used. Lots of casting. Ick. Fixed. + +* couldn't refer to $tokenlabel in isolation; but need so we can test if + something was matched. Fixed. + +* Lots of little bugs fixed in $x.y, %... translation due to new + action translator. + +* Improperly tracking block nesting level; result was that you couldn't + see $ID in action of rule "a : A+ | ID {Token t = $ID;} | C ;" + +* a : ID ID {$ID.text;} ; did not get a warning about ambiguous $ID ref. + +* No error was found on $COMMENT.text: + +COMMENT + : '/*' (options {greedy=false;} : . )* '*/' + {System.out.println("found method "+$COMMENT.text);} + ; + + $enclosinglexerrule scope does not exist. Use text or setText() here. + +June 11, 2006 + +* Single return values are initialized now to default or to your spec. + +* cleaned up input stream stuff. Added ANTLRReaderStream, ANTLRInputStream + and refactored. You can specify encodings now on ANTLRFileStream (and + ANTLRInputStream) now. + +* You can set text local var now in a lexer rule and token gets that text. + start/stop indexes are still set for the token. + +* Changed lexer slightly. Calling a nonfragment rule from a + nonfragment rule does not set the overall token. + +June 10, 2006 + +* Fixed bug where unnecessary escapes yield char==0 like '\{'. + +* Fixed analysis bug. This grammar didn't report a recursion warning: +x : y X + | y Y + ; +y : L y R + | B + ; + The DFAState.equals() method was messed up. + +* Added @synpredgate {...} action so you can tell ANTLR how to gate actions + in/out during syntactic predicate evaluation. + +* Fuzzy parsing should be more efficient. It should backtrack over a rule + and then rewind and do it again "with feeling" to exec actions. It was + actually doing it 3x not 2x. + +June 9, 2006 + +* Gutted and rebuilt the action translator for $x.y, $x::y, ... + Uses ANTLR v3 now for the first time inside v3 source. :) + ActionTranslator.java + +* Fixed a bug where referencing a return value on a rule didn't work + because later a ref to that rule's predefined properties didn't + properly force a return value struct to be built. Added unit test. + +June 6, 2006 + +* New DFA mechanisms. Cyclic DFA are implemented as state tables, + encoded via strings as java cannot handle large static arrays :( + States with edges emanating that have predicates are specially + treated. A method is generated to do these states. The DFA + simulation routine uses the "special" array to figure out if the + state is special. See March 25, 2006 entry for description: + http://www.antlr.org/blog/antlr3/codegen.tml. analysis.DFA now has + all the state tables generated for code gen. CyclicCodeGenerator.java + disappeared as it's unneeded code. :) + +* Internal general clean up of the DFA.states vs uniqueStates thing. + Fixed lookahead decisions no longer fill uniqueStates. Waste of + time. Also noted that when adding sem pred edges, I didn't check + for state reuse. Fixed. + +June 4, 2006 + +* When resolving ambig DFA states predicates, I did not add the new states + to the list of unique DFA states. No observable effect on output except + that DFA state numbers were not always contiguous for predicated decisions. + I needed this fix for new DFA tables. + +3.0ea10 - June 2, 2006 + +June 2, 2006 + +* Improved grammar stats and added syntactic pred tracking. + +June 1, 2006 + +* Due to a type mismatch, the DebugParser.recoverFromMismatchedToken() + method was not called. Debug events for mismatched token error + notification were not sent to ANTLRWorks probably + +* Added getBacktrackingLevel() for any recognizer; needed for profiler. + +* Only writes profiling data for antlr grammar analysis with -profile set + +* Major update and bug fix to (runtime) Profiler. + +May 27, 2006 + +* Added Lexer.skip() to force lexer to ignore current token and look for + another; no token is created for current rule and is not passed on to + parser (or other consumer of the lexer). + +* Parsers are much faster now. I removed use of java.util.Stack for pushing + follow sets and use a hardcoded array stack instead. Dropped from + 5900ms to 3900ms for parse+lex time parsing entire java 1.4.2 source. Lex + time alone was about 1500ms. Just looking at parse time, we get about 2x + speed improvement. :) + +May 26, 2006 + +* Fixed NFA construction so it generates NFA for (A*)* such that ANTLRWorks + can display it properly. + +May 25, 2006 + +* added abort method to Grammar so AW can terminate the conversion if it's + taking too long. + +May 24, 2006 + +* added method to get left recursive rules from grammar without doing full + grammar analysis. + +* analysis, code gen not attempted if serious error (like + left-recursion or missing rule definition) occurred while reading + the grammar in and defining symbols. + +* added amazing optimization; reduces analysis time by 90% for java + grammar; simple IF statement addition! + +3.0ea9 - May 20, 2006 + +* added global k value for grammar to limit lookahead for all decisions unless +overridden in a particular decision. + +* added failsafe so that any decision taking longer than 2 seconds to create +the DFA will fall back on k=1. Use -ImaxtimeforDFA n (in ms) to set the time. + +* added an option (turned off for now) to use multiple threads to +perform grammar analysis. Not much help on a 2-CPU computer as +garbage collection seems to peg the 2nd CPU already. :( Gotta wait for +a 4 CPU box ;) + +* switched from #src to // $ANTLR src directive. + +* CommonTokenStream.getTokens() looked past end of buffer sometimes. fixed. + +* unicode literals didn't really work in DOT output and generated code. fixed. + +* fixed the unit test rig so it compiles nicely with Java 1.5 + +* Added ant build.xml file (reads build.properties file) + +* predicates sometimes failed to compile/eval properly due to missing (...) + in IF expressions. Forced (..) + +* (...)? with only one alt were not optimized. Was: + + // t.g:4:7: ( B )? + int alt1=2; + int LA1_0 = input.LA(1); + if ( LA1_0==B ) { + alt1=1; + } + else if ( LA1_0==-1 ) { + alt1=2; + } + else { + NoViableAltException nvae = + new NoViableAltException("4:7: ( B )?", 1, 0, input); + throw nvae; + } + +is now: + + // t.g:4:7: ( B )? + int alt1=2; + int LA1_0 = input.LA(1); + if ( LA1_0==B ) { + alt1=1; + } + + Smaller, faster and more readable. + +* Allow manual init of return values now: + functionHeader returns [int x=3*4, char (*f)()=null] : ... ; + +* Added optimization for DFAs that fixed a codegen bug with rules in lexer: + EQ : '=' ; + ASSIGNOP : '=' | '+=' ; + EQ is a subset of other rule. It did not given an error which is + correct, but generated bad code. + +* ANTLR was sending column not char position to ANTLRWorks. + +* Bug fix: location 0, 0 emitted for synpreds and empty alts. + +* debugging event handshake how sends grammar file name. Added getGrammarFileName() to recognizers. Java.stg generates it: + + public String getGrammarFileName() { return ""; } + +* tree parsers can do arbitrary lookahead now including backtracking. I + updated CommonTreeNodeStream. + +* added events for debugging tree parsers: + + /** Input for a tree parser is an AST, but we know nothing for sure + * about a node except its type and text (obtained from the adaptor). + * This is the analog of the consumeToken method. Again, the ID is + * the hashCode usually of the node so it only works if hashCode is + * not implemented. + */ + public void consumeNode(int ID, String text, int type); + + /** The tree parser looked ahead */ + public void LT(int i, int ID, String text, int type); + + /** The tree parser has popped back up from the child list to the + * root node. + */ + public void goUp(); + + /** The tree parser has descended to the first child of a the current + * root node. + */ + public void goDown(); + +* Added DebugTreeNodeStream and DebugTreeParser classes + +* Added ctor because the debug tree node stream will need to ask quesitons about nodes and since nodes are just Object, it needs an adaptor to decode the nodes and get text/type info for the debugger. + +public CommonTreeNodeStream(TreeAdaptor adaptor, Tree tree); + +* added getter to TreeNodeStream: + public TreeAdaptor getTreeAdaptor(); + +* Implemented getText/getType in CommonTreeAdaptor. + +* Added TraceDebugEventListener that can dump all events to stdout. + +* I broke down and make Tree implement getText + +* tree rewrites now gen location debug events. + +* added AST debug events to listener; added blank listener for convenience + +* updated debug events to send begin/end backtrack events for debugging + +* with a : (b->b) ('+' b -> ^(PLUS $a b))* ; you get b[0] each time as + there is no loop in rewrite rule itself. Need to know context that + the -> is inside the rule and hence b means last value of b not all + values. + +* Bug in TokenRewriteStream; ops at indexes < start index blocked proper op. + +* Actions in ST rewrites "-> ({$op})()" were not translated + +* Added new action name: + +@rulecatch { +catch (RecognitionException re) { + reportError(re); + recover(input,re); +} +catch (Throwable t) { + System.err.println(t); +} +} +Overrides rule catch stuff. + +* Isolated $ refs caused exception + +3.0ea8 - March 11, 2006 + +* added @finally {...} action like @init for rules. Executes in + finally block (java target) after all other stuff like rule memoization. + No code changes needs; ST just refs a new action: + + +* hideous bug fixed: PLUS='+' didn't result in '+' rule in lexer + +* TokenRewriteStream didn't do toString() right when no rewrites had been done. + +* lexer errors in interpreter were not printed properly + +* bitsets are dumped in hex not decimal now for FOLLOW sets + +* /* epsilon */ is not printed now when printing out grammars with empty alts + +* Fixed another bug in tree rewrite stuff where it was checking that elements + had at least one element. Strange...commented out for now to see if I can remember what's up. + +* Tree rewrites had problems when you didn't have x+=FOO variables. Rules + like this work now: + + a : (x=ID)? y=ID -> ($x $y)?; + +* filter=true for lexers turns on k=1 and backtracking for every token + alternative. Put the rules in priority order. + +* added getLine() etc... to Tree to support better error reporting for + trees. Added MismatchedTreeNodeException. + +* $templates::foo() is gone. added % as special template symbol. + %foo(a={},b={},...) ctor (even shorter than $templates::foo(...)) + %({name-expr})(a={},...) indirect template ctor reference + + The above are parsed by antlr.g and translated by codegen.g + The following are parsed manually here: + + %{string-expr} anonymous template from string expr + %{expr}.y = z; template attribute y of StringTemplate-typed expr to z + %x.y = z; set template attribute y of x (always set never get attr) + to z [languages like python without ';' must still use the + ';' which the code generator is free to remove during code gen] + +* -> ({expr})(a={},...) notation for indirect template rewrite. + expr is the name of the template. + +* $x[i]::y and $x[-i]::y notation for accesssing absolute scope stack + indexes and relative negative scopes. $x[-1]::y is the y attribute + of the previous scope (stack top - 1). + +* filter=true mode for lexers; can do this now...upon mismatch, just + consumes a char and tries again: +lexer grammar FuzzyJava; +options {filter=true;} + +FIELD + : TYPE WS? name=ID WS? (';'|'=') + {System.out.println("found var "+$name.text);} + ; + +* refactored char streams so ANTLRFileStream is now a subclass of + ANTLRStringStream. + +* char streams for lexer now allowed nested backtracking in lexer. + +* added TokenLabelType for lexer/parser for all token labels + +* line numbers for error messages were not updated properly in antlr.g + for strings, char literals and <<...>> + +* init action in lexer rules was before the type,start,line,... decls. + +* Tree grammars can now specify output; I've only tested output=templat + though. + +* You can reference EOF now in the parser and lexer. It's just token type + or char value -1. + +* Bug fix: $ID refs in the *lexer* were all messed up. Cleaned up the + set of properties available... + +* Bug fix: .st not found in rule ref when rule has scope: +field +scope { + StringTemplate funcDef; +} + : ... + {$field::funcDef = $field.st;} + ; +it gets field_stack.st instead + +* return in backtracking must return retval or null if return value. + +* $property within a rule now works like $text, $st, ... + +* AST/Template Rewrites were not gated by backtracking==0 so they + executed even when guessing. Auto AST construction is now gated also. + +* CommonTokenStream was somehow returning tokens not text in toString() + +* added useful methods to runtime.BitSet and also to CommonToken so you can + update the text. Added nice Token stream method: + + /** Given a start and stop index, return a List of all tokens in + * the token type BitSet. Return null if no tokens were found. This + * method looks at both on and off channel tokens. + */ + public List getTokens(int start, int stop, BitSet types); + +* literals are now passed in the .tokens files so you can ref them in + tree parses, for example. + +* added basic exception handling; no labels, just general catches: + +a : {;}A | B ; + exception + catch[RecognitionException re] { + System.out.println("recog error"); + } + catch[Exception e] { + System.out.println("error"); + } + +* Added method to TokenStream: + public String toString(Token start, Token stop); + +* antlr generates #src lines in lexer grammars generated from combined grammars + so error messages refer to original file. + +* lexers generated from combined grammars now use originally formatting. + +* predicates have $x.y stuff translated now. Warning: predicates might be + hoisted out of context. + +* return values in return val structs are now public. + +* output=template with return values on rules was broken. I assume return values with ASTs was broken too. Fixed. + +3.0ea7 - December 14, 2005 + +* Added -print option to print out grammar w/o actions + +* Renamed BaseParser to be BaseRecognizer and even made Lexer derive from + this; nice as it now shares backtracking support code. + +* Added syntactic predicates (...)=>. See December 4, 2005 entry: + + http://www.antlr.org/blog/antlr3/lookahead.tml + + Note that we have a new option for turning off rule memoization during + backtracking: + + -nomemo when backtracking don't generate memoization code + +* Predicates are now tested in order that you specify the alts. If you + leave the last alt "naked" (w/o pred), it will assume a true pred rather + than union of other preds. + +* Added gated predicates "{p}?=>" that literally turn off a production whereas +disambiguating predicates are only hoisted into the predictor when syntax alone +is not sufficient to uniquely predict alternatives. + +A : {p}? => "a" ; +B : {!p}? => ("a"|"b")+ ; + +* bug fixed related to predicates in predictor +lexer grammar w; +A : {p}? "a" ; +B : {!p}? ("a"|"b")+ ; +DFA is correct. A state splits for input "a" on the pred. +Generated code though was hosed. No pred tests in prediction code! +I added testLexerPreds() and others in TestSemanticPredicateEvaluation.java + +* added execAction template in case we want to do something in front of + each action execution or something. + +* left-recursive cycles from rules w/o decisions were not detected. + +* undefined lexer rules were not announced! fixed. + +* unreachable messages for Tokens rule now indicate rule name not alt. E.g., + + Ruby.lexer.g:24:1: The following token definitions are unreachable: IVAR + +* nondeterminism warnings improved for Tokens rule: + +Ruby.lexer.g:10:1: Multiple token rules can match input such as ""0".."9"": INT, FLOAT +As a result, tokens(s) FLOAT were disabled for that input + + +* DOT diagrams didn't show escaped char properly. + +* Char/string literals are now all 'abc' not "abc". + +* action syntax changed "@scope::actionname {action}" where scope defaults + to "parser" if parser grammar or combined grammar, "lexer" if lexer grammar, + and "treeparser" if tree grammar. The code generation targets decide + what scopes are available. Each "scope" yields a hashtable for use in + the output templates. The scopes full of actions are sent to all output + file templates (currently headerFile and outputFile) as attribute actions. + Then you can reference to get the map of actions associated + with scope and to get the parser's header action + for example. This should be very flexible. The target should only have + to define which scopes are valid, but the action names should be variable + so we don't have to recompile ANTLR to add actions to code gen templates. + + grammar T; + options {language=Java;} + @header { package foo; } + @parser::stuff { int i; } // names within scope not checked; target dependent + @members { int i; } + @lexer::header {head} + @lexer::members { int j; } + @headerfile::blort {...} // error: this target doesn't have headerfile + @treeparser::members {...} // error: this is not a tree parser + a + @init {int i;} + : ID + ; + ID : 'a'..'z'; + + For now, the Java target uses members and header as a valid name. Within a + rule, the init action name is valid. + +* changed $dynamicscope.value to $dynamicscope::value even if value is defined + in same rule such as $function::name where rule function defines name. + +* $dynamicscope gets you the stack + +* rule scopes go like this now: + + rule + scope {...} + scope slist,Symbols; + : ... + ; + +* Created RuleReturnScope as a generic rule return value. Makes it easier + to do this: + RuleReturnScope r = parser.program(); + System.out.println(r.getTemplate().toString()); + +* $template, $tree, $start, etc... + +* $r.x in current rule. $r is ignored as fully-qualified name. $r.start works too + +* added warning about $r referring to both return value of rule and dynamic scope of rule + +* integrated StringTemplate in a very simple manner + +Syntax: +-> template(arglist) "..." +-> template(arglist) <<...>> +-> namedTemplate(arglist) +-> {free expression} +-> // empty + +Predicate syntax: +a : A B -> {p1}? foo(a={$A.text}) + -> {p2}? foo(a={$B.text}) + -> // return nothing + +An arg list is just a list of template attribute assignments to actions in curlies. + +There is a setTemplateLib() method for you to use with named template rewrites. + +Use a new option: + +grammar t; +options {output=template;} +... + +This all should work for tree grammars too, but I'm still testing. + +* fixed bugs where strings were improperly escaped in exceptions, comments, etc.. For example, newlines came out as newlines not the escaped version + +3.0ea6 - November 13, 2005 + +* turned off -debug/-profile, which was on by default + +* completely refactored the output templates; added some missing templates. + +* dramatically improved infinite recursion error messages (actually + left-recursion never even was printed out before). + +* wasn't printing dangling state messages when it reanalyzes with k=1. + +* fixed a nasty bug in the analysis engine dealing with infinite recursion. + Spent all day thinking about it and cleaned up the code dramatically. + Bug fixed and software is more powerful and I understand it better! :) + +* improved verbose DFA nodes; organized by alt + +* got much better random phrase generation. For example: + + $ java org.antlr.tool.RandomPhrase simple.g program + int Ktcdn ';' method wh '(' ')' '{' return 5 ';' '}' + +* empty rules like "a : ;" generated code that didn't compile due to + try/catch for RecognitionException. Generated code couldn't possibly + throw that exception. + +* when printing out a grammar, such as in comments in generated code, + ANTLR didn't print ast suffix stuff back out for literals. + +* This never exited loop: + DATA : (options {greedy=false;}: .* '\n' )* '\n' '.' ; + and now it works due to new default nongreedy .* Also this works: + DATA : (options {greedy=false;}: .* '\n' )* '.' ; + +* Dot star ".*" syntax didn't work; in lexer it is nongreedy by + default. In parser it is on greedy but also k=1 by default. Added + unit tests. Added blog entry to describe. + +* ~T where T is the only token yielded an empty set but no error + +* Used to generate unreachable message here: + + parser grammar t; + a : ID a + | ID + ; + + z.g:3:11: The following alternatives are unreachable: 2 + + In fact it should really be an error; now it generates: + + no start rule in grammar t (no rule can obviously be followed by EOF) + + Per next change item, ANTLR cannot know that EOF follows rule 'a'. + +* added error message indicating that ANTLR can't figure out what your + start rule is. Required to properly generate code in some cases. + +* validating semantic predicates now work (if they are false, they + throw a new FailedPredicateException + +* two hideous bug fixes in the IntervalSet, which made analysis go wrong + in a few cases. Thanks to Oliver Zeigermann for finding lots of bugs + and making suggested fixes (including the next two items)! + +* cyclic DFAs are now nonstatic and hence can access instance variables + +* labels are now allowed on lexical elements (in the lexer) + +* added some internal debugging options + +* ~'a'* and ~('a')* were not working properly; refactored antlr.g grammar + +3.0ea5 - July 5, 2005 + +* Using '\n' in a parser grammar resulted in a nonescaped version of '\n' in the token names table making compilation fail. I fixed this by reorganizing/cleaning up portion of ANTLR that deals with literals. See comment org.antlr.codegen.Target. + +* Target.getMaxCharValue() did not use the appropriate max value constant. + +* ALLCHAR was a constant when it should use the Target max value def. set complement for wildcard also didn't use the Target def. Generally cleaned up the max char value stuff. + +* Code gen didn't deal with ASTLabelType properly...I think even the 3.0ea7 example tree parser was broken! :( + +* Added a few more unit tests dealing with escaped literals + +3.0ea4 - June 29, 2005 + +* tree parsers work; added CommonTreeNodeStream. See simplecTreeParser + example in examples-v3 tarball. + +* added superClass and ASTLabelType options + +* refactored Parser to have a BaseParser and added TreeParser + +* bug fix: actions being dumped in description strings; compile errors + resulted + +3.0ea3 - June 23, 2005 + +Enhancements + +* Automatic tree construction operators are in: ! ^ ^^ + +* Tree construction rewrite rules are in + -> {pred1}? rewrite1 + -> {pred2}? rewrite2 + ... + -> rewriteN + + The rewrite rules may be elements like ID, expr, $label, {node expr} + and trees ^( ). You have have (...)?, (...)*, (...)+ + subrules as well. + + You may have rewrites in subrules not just at outer level of rule, but + any -> rewrite forces auto AST construction off for that alternative + of that rule. + + To avoid cycles, copy semantics are used: + + r : INT -> INT INT ; + + means make two new nodes from the same INT token. + + Repeated references to a rule element implies a copy for at least one + tree: + + a : atom -> ^(atom atom) ; // NOT CYCLE! (dup atom tree) + +* $ruleLabel.tree refers to tree created by matching the labeled element. + +* A description of the blocks/alts is generated as a comment in output code + +* A timestamp / signature is put at top of each generated code file + +3.0ea2 - June 12, 2005 + +Bug fixes + +* Some error messages were missing the stackTrace parameter + +* Removed the file locking mechanism as it's not cross platform + +* Some absolute vs relative path name problems with writing output + files. Rules are now more concrete. -o option takes precedence + // -o /tmp /var/lib/t.g => /tmp/T.java + // -o subdir/output /usr/lib/t.g => subdir/output/T.java + // -o . /usr/lib/t.g => ./T.java + // -o /tmp subdir/t.g => /tmp/subdir/t.g + // If they didn't specify a -o dir so just write to location + // where grammar is, absolute or relative + +* does error checking on unknown option names now + +* Using just language code not locale name for error message file. I.e., + the default (and for any English speaking locale) is en.stg not en_US.stg + anymore. + +* The error manager now asks the Tool to panic rather than simply doing + a System.exit(). + +* Lots of refactoring concerning grammar, rule, subrule options. Now + detects invalid options. + +3.0ea1 - June 1, 2005 + +Initial early access release + diff --git a/antlr/libantlr3c-3.4/aclocal.m4 b/antlr/libantlr3c-3.4/aclocal.m4 new file mode 100644 index 0000000..f078e56 --- /dev/null +++ b/antlr/libantlr3c-3.4/aclocal.m4 @@ -0,0 +1,996 @@ +# generated automatically by aclocal 1.11.1 -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +# 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# 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.66],, +[m4_warning([this file was generated for autoconf 2.66. +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.11' +dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to +dnl require some minimum version. Point them to the right macro. +m4_if([$1], [1.11.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 AM_INIT_AUTOMAKE. +AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], +[AM_AUTOMAKE_VERSION([1.11.1])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, 2008 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 9 + +# AM_CONDITIONAL(NAME, SHELL-CONDITION) +# ------------------------------------- +# Define a conditional. +AC_DEFUN([AM_CONDITIONAL], +[AC_PREREQ(2.52)dnl + ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +AC_SUBST([$1_TRUE])dnl +AC_SUBST([$1_FALSE])dnl +_AM_SUBST_NOTMAKE([$1_TRUE])dnl +_AM_SUBST_NOTMAKE([$1_FALSE])dnl +m4_define([_AM_COND_VALUE_$1], [$2])dnl +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi +AC_CONFIG_COMMANDS_PRE( +[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then + AC_MSG_ERROR([[conditional "$1" was never defined. +Usually this means the macro was only invoked conditionally.]]) +fi])]) + +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009 +# 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 10 + +# 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 + am__universal=false + m4_case([$1], [CC], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac], + [CXX], + [case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac]) + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvisualcpp | msvcmsys) + # This compiler won't grok `-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_$1_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_$1_dependencies_compiler_type=none +fi +]) +AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) +AM_CONDITIONAL([am__fastdep$1], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) +]) + + +# AM_SET_DEPDIR +# ------------- +# Choose a directory name for dependency files. +# This macro is AC_REQUIREd in _AM_DEPENDENCIES +AC_DEFUN([AM_SET_DEPDIR], +[AC_REQUIRE([AM_SET_LEADING_DOT])dnl +AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl +]) + + +# AM_DEP_TRACK +# ------------ +AC_DEFUN([AM_DEP_TRACK], +[AC_ARG_ENABLE(dependency-tracking, +[ --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors]) +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' +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 5 + +# _AM_OUTPUT_DEPENDENCY_COMMANDS +# ------------------------------ +AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], +[{ + # Autoconf 2.62 quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac + shift + for mf + do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`AS_DIRNAME("$mf")` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`AS_DIRNAME(["$file"])` + AS_MKDIR_P([$dirpart/$fdir]) + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done + done +} +])# _AM_OUTPUT_DEPENDENCY_COMMANDS + + +# AM_OUTPUT_DEPENDENCY_COMMANDS +# ----------------------------- +# This macro should only be invoked once -- use via AC_REQUIRE. +# +# This code is only required when automatic dependency tracking +# is enabled. FIXME. This creates each `.P' file that we will +# need in order to bootstrap the dependency handling code. +AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], +[AC_CONFIG_COMMANDS([depfiles], + [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], + [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) +]) + +# Do all the work for Automake. -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +# 2005, 2006, 2008, 2009 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 16 + +# This macro actually does too much. Some checks are only needed if +# your package does certain things. But this isn't really a big deal. + +# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) +# AM_INIT_AUTOMAKE([OPTIONS]) +# ----------------------------------------------- +# The call with PACKAGE and VERSION arguments is the old style +# call (pre autoconf-2.50), which is being phased out. PACKAGE +# and VERSION should now be passed to AC_INIT and removed from +# the call to AM_INIT_AUTOMAKE. +# We support both call styles for the transition. After +# the next Automake release, Autoconf can make the AC_INIT +# arguments mandatory, and then we can depend on a new Autoconf +# release and drop the old call support. +AC_DEFUN([AM_INIT_AUTOMAKE], +[AC_PREREQ([2.62])dnl +dnl Autoconf wants to disallow AM_ names. We explicitly allow +dnl the ones we care about. +m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl +AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl +AC_REQUIRE([AC_PROG_INSTALL])dnl +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi +AC_SUBST([CYGPATH_W]) + +# Define the identity of the package. +dnl Distinguish between old-style and new-style calls. +m4_ifval([$2], +[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl + AC_SUBST([PACKAGE], [$1])dnl + AC_SUBST([VERSION], [$2])], +[_AM_SET_OPTIONS([$1])dnl +dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. +m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, + [m4_fatal([AC_INIT should be called with package and version arguments])])dnl + AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl + AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl + +_AM_IF_OPTION([no-define],, +[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) + AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl + +# Some tools Automake needs. +AC_REQUIRE([AM_SANITY_CHECK])dnl +AC_REQUIRE([AC_ARG_PROGRAM])dnl +AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) +AM_MISSING_PROG(AUTOCONF, autoconf) +AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) +AM_MISSING_PROG(AUTOHEADER, autoheader) +AM_MISSING_PROG(MAKEINFO, makeinfo) +AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl +AC_REQUIRE([AM_PROG_MKDIR_P])dnl +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([AC_PROG_MAKE_SET])dnl +AC_REQUIRE([AM_SET_LEADING_DOT])dnl +_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], + [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], + [_AM_PROG_TAR([v7])])]) +_AM_IF_OPTION([no-dependencies],, +[AC_PROVIDE_IFELSE([AC_PROG_CC], + [_AM_DEPENDENCIES(CC)], + [define([AC_PROG_CC], + defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl +AC_PROVIDE_IFELSE([AC_PROG_CXX], + [_AM_DEPENDENCIES(CXX)], + [define([AC_PROG_CXX], + defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJC], + [_AM_DEPENDENCIES(OBJC)], + [define([AC_PROG_OBJC], + defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl +]) +_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl +dnl The `parallel-tests' driver may need to know about EXEEXT, so add the +dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro +dnl is hooked onto _AC_COMPILER_EXEEXT early, see below. +AC_CONFIG_COMMANDS_PRE(dnl +[m4_provide_if([_AM_COMPILER_EXEEXT], + [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl +]) + +dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not +dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further +dnl mangled by Autoconf and run in a shell conditional statement. +m4_define([_AC_COMPILER_EXEEXT], +m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) + + +# When config.status generates a header, we must update the stamp-h file. +# This file resides in the same directory as the config header +# that is generated. The stamp files are numbered to have different names. + +# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the +# loop where config.status creates the headers, so we can generate +# our stamp files there. +AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], +[# Compute $1's index in $config_headers. +_am_arg=$1 +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) + +# Copyright (C) 2001, 2003, 2005, 2008 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_SH +# ------------------ +# Define $install_sh. +AC_DEFUN([AM_PROG_INSTALL_SH], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +if test x"${install_sh}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi +AC_SUBST(install_sh)]) + +# Copyright (C) 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 2 + +# Check whether the underlying file-system supports filenames +# with a leading dot. For instance MS-DOS doesn't. +AC_DEFUN([AM_SET_LEADING_DOT], +[rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null +AC_SUBST([am__leading_dot])]) + +# Add --enable-maintainer-mode option to configure. -*- Autoconf -*- +# From Jim Meyering + +# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 5 + +# AM_MAINTAINER_MODE([DEFAULT-MODE]) +# ---------------------------------- +# Control maintainer-specific portions of Makefiles. +# Default is to disable them, unless `enable' is passed literally. +# For symmetry, `disable' may be passed as well. Anyway, the user +# can override the default with the --enable/--disable switch. +AC_DEFUN([AM_MAINTAINER_MODE], +[m4_case(m4_default([$1], [disable]), + [enable], [m4_define([am_maintainer_other], [disable])], + [disable], [m4_define([am_maintainer_other], [enable])], + [m4_define([am_maintainer_other], [enable]) + m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])]) +AC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles]) + dnl maintainer-mode's default is 'disable' unless 'enable' is passed + AC_ARG_ENABLE([maintainer-mode], +[ --][am_maintainer_other][-maintainer-mode am_maintainer_other make rules and dependencies not useful + (and sometimes confusing) to the casual installer], + [USE_MAINTAINER_MODE=$enableval], + [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes])) + AC_MSG_RESULT([$USE_MAINTAINER_MODE]) + AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes]) + MAINT=$MAINTAINER_MODE_TRUE + AC_SUBST([MAINT])dnl +] +) + +AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE]) + +# Check to see how 'make' treats includes. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 4 + +# AM_MAKE_INCLUDE() +# ----------------- +# Check to see how make treats includes. +AC_DEFUN([AM_MAKE_INCLUDE], +[am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo this is the am__doit target +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +AC_MSG_CHECKING([for style of include used by $am_make]) +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# Ignore all kinds of additional output from `make'. +case `$am_make -s -f confmf 2> /dev/null` in #( +*the\ am__doit\ target*) + am__include=include + am__quote= + _am_result=GNU + ;; +esac +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac +fi +AC_SUBST([am__include]) +AC_SUBST([am__quote]) +AC_MSG_RESULT([$_am_result]) +rm -f confinc confmf +]) + +# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- + +# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 6 + +# AM_MISSING_PROG(NAME, PROGRAM) +# ------------------------------ +AC_DEFUN([AM_MISSING_PROG], +[AC_REQUIRE([AM_MISSING_HAS_RUN]) +$1=${$1-"${am_missing_run}$2"} +AC_SUBST($1)]) + + +# AM_MISSING_HAS_RUN +# ------------------ +# Define MISSING if not defined so far and test if it supports --run. +# If it does, set am_missing_run to use it, otherwise, to nothing. +AC_DEFUN([AM_MISSING_HAS_RUN], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([missing])dnl +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + AC_MSG_WARN([`missing' script is too old or missing]) +fi +]) + +# Copyright (C) 2003, 2004, 2005, 2006 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, 2008 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 5 + +# AM_SANITY_CHECK +# --------------- +AC_DEFUN([AM_SANITY_CHECK], +[AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftest.file +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[[\\\"\#\$\&\'\`$am_lf]]*) + AC_MSG_ERROR([unsafe absolute working directory name]);; +esac +case $srcdir in + *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) + AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);; +esac + +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$[*]" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + rm -f conftest.file + if test "$[*]" != "X $srcdir/configure conftest.file" \ + && test "$[*]" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken +alias in your environment]) + fi + + test "$[2]" = conftest.file + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +AC_MSG_RESULT(yes)]) + +# Copyright (C) 2001, 2003, 2005 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, 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 2 + +# _AM_SUBST_NOTMAKE(VARIABLE) +# --------------------------- +# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. +# This macro is traced by Automake. +AC_DEFUN([_AM_SUBST_NOTMAKE]) + +# AM_SUBST_NOTMAKE(VARIABLE) +# --------------------------- +# Public sister of _AM_SUBST_NOTMAKE. +AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) + +# Check how to create a tarball. -*- Autoconf -*- + +# Copyright (C) 2004, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 2 + +# _AM_PROG_TAR(FORMAT) +# -------------------- +# Check how to create a tarball in format FORMAT. +# FORMAT should be one of `v7', `ustar', or `pax'. +# +# Substitute a variable $(am__tar) that is a command +# writing to stdout a FORMAT-tarball containing the directory +# $tardir. +# tardir=directory && $(am__tar) > result.tar +# +# Substitute a variable $(am__untar) that extract such +# a tarball read from stdin. +# $(am__untar) < result.tar +AC_DEFUN([_AM_PROG_TAR], +[# Always define AMTAR for backward compatibility. +AM_MISSING_PROG([AMTAR], [tar]) +m4_if([$1], [v7], + [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], + [m4_case([$1], [ustar],, [pax],, + [m4_fatal([Unknown tar format])]) +AC_MSG_CHECKING([how to create a $1 tar archive]) +# Loop over all known methods to create a tar archive until one works. +_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' +_am_tools=${am_cv_prog_tar_$1-$_am_tools} +# Do not fold the above two line into one, because Tru64 sh and +# Solaris sh will not grok spaces in the rhs of `-'. +for _am_tool in $_am_tools +do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; + do + AM_RUN_LOG([$_am_tar --version]) && break + done + am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x $1 -w "$$tardir"' + am__tar_='pax -L -x $1 -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H $1 -L' + am__tar_='find "$tardir" -print | cpio -o -H $1 -L' + am__untar='cpio -i -H $1 -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac + + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_$1}" && break + + # tar/untar a dummy directory, and stop if the command works + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) + rm -rf conftest.dir + if test -s conftest.tar; then + AM_RUN_LOG([$am__untar /dev/null 2>&1 && break + fi +done +rm -rf conftest.dir + +AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) +AC_MSG_RESULT([$am_cv_prog_tar_$1])]) +AC_SUBST([am__tar]) +AC_SUBST([am__untar]) +]) # _AM_PROG_TAR + +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/antlr/libantlr3c-3.4/antlr3config.h b/antlr/libantlr3c-3.4/antlr3config.h new file mode 100644 index 0000000..eb5d955 --- /dev/null +++ b/antlr/libantlr3c-3.4/antlr3config.h @@ -0,0 +1,187 @@ +/* antlr3config.h. Generated from antlr3config.h.in by configure. */ +/* antlr3config.h.in. Generated from configure.ac by autoheader. */ + +/* Define if ANTLR debugger not required */ +/* #undef ANTLR3_NODEBUGGER */ + +/* Define if 64 bit mode required */ +/* #undef ANTLR3_USE_64BIT */ + +/* Define to 1 if you have the `accept' function. */ +/* #undef HAVE_ACCEPT */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_ARPA_NAMESER_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_CTYPE_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* Define to 1 if the system has the type `intptr_t'. */ +/* #undef HAVE_INTPTR_T */ + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_MALLOC_H */ + +/* Define to 1 if you have the `memmove' function. */ +/* #undef HAVE_MEMMOVE */ + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Define to 1 if you have the `memset' function. */ +/* #undef HAVE_MEMSET */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_NETDB_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_NETINET_IN_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_NETINET_TCP_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_RESOLV_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SOCKET_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STDARG_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the `strdup' function. */ +/* #undef HAVE_STRDUP */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_MALLOC_H */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_SYS_SOCKET_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if the system has the type `uintptr_t'. */ +/* #undef HAVE_UINTPTR_T */ + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#define LT_OBJDIR ".libs/" + +/* Name of package */ +#define PACKAGE "libantlr3c" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "jimi@temporal-wave.com" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "libantlr3c" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "libantlr3c 3.4" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "libantlr3c" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "3.4" + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Version number of package */ +#define VERSION "3.4" + +/* Define for Solaris 2.5.1 so the uint32_t typedef from , + , or is not used. If the typedef were allowed, the + #define below would cause a syntax error. */ +/* #undef _UINT32_T */ + +/* Define for Solaris 2.5.1 so the uint64_t typedef from , + , or is not used. If the typedef were allowed, the + #define below would cause a syntax error. */ +/* #undef _UINT64_T */ + +/* Define for Solaris 2.5.1 so the uint8_t typedef from , + , or is not used. If the typedef were allowed, the + #define below would cause a syntax error. */ +/* #undef _UINT8_T */ + +/* 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 + +/* Define to the type of a signed integer type of width exactly 16 bits if + such a type exists and the standard includes do not define it. */ +/* #undef int16_t */ + +/* Define to the type of a signed integer type of width exactly 32 bits if + such a type exists and the standard includes do not define it. */ +/* #undef int32_t */ + +/* Define to the type of a signed integer type of width exactly 64 bits if + such a type exists and the standard includes do not define it. */ +/* #undef int64_t */ + +/* Define to the type of a signed integer type of width exactly 8 bits if such + a type exists and the standard includes do not define it. */ +/* #undef int8_t */ + +/* Define to the type of a signed integer type wide enough to hold a pointer, + if such a type exists, and if the system does not define it. */ +/* #undef intptr_t */ + +/* Define to `unsigned int' if does not define. */ +#define size_t unsigned int + +/* Define to the type of an unsigned integer type of width exactly 16 bits if + such a type exists and the standard includes do not define it. */ +/* #undef uint16_t */ + +/* Define to the type of an unsigned integer type of width exactly 32 bits if + such a type exists and the standard includes do not define it. */ +/* #undef uint32_t */ + +/* Define to the type of an unsigned integer type of width exactly 64 bits if + such a type exists and the standard includes do not define it. */ +/* #undef uint64_t */ + +/* Define to the type of an unsigned integer type of width exactly 8 bits if + such a type exists and the standard includes do not define it. */ +/* #undef uint8_t */ + +/* Define to the type of an unsigned integer type wide enough to hold a + pointer, if such a type exists, and if the system does not define it. */ +/* #undef uintptr_t */ diff --git a/antlr/libantlr3c-3.4/antlr3config.h.in b/antlr/libantlr3c-3.4/antlr3config.h.in new file mode 100644 index 0000000..b9525ff --- /dev/null +++ b/antlr/libantlr3c-3.4/antlr3config.h.in @@ -0,0 +1,186 @@ +/* antlr3config.h.in. Generated from configure.ac by autoheader. */ + +/* Define if ANTLR debugger not required */ +#undef ANTLR3_NODEBUGGER + +/* Define if 64 bit mode required */ +#undef ANTLR3_USE_64BIT + +/* Define to 1 if you have the `accept' function. */ +#undef HAVE_ACCEPT + +/* Define to 1 if you have the header file. */ +#undef HAVE_ARPA_NAMESER_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_CTYPE_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_DLFCN_H + +/* Define to 1 if the system has the type `intptr_t'. */ +#undef HAVE_INTPTR_T + +/* Define to 1 if you have the header file. */ +#undef HAVE_INTTYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_MALLOC_H + +/* Define to 1 if you have the `memmove' function. */ +#undef HAVE_MEMMOVE + +/* Define to 1 if you have the header file. */ +#undef HAVE_MEMORY_H + +/* Define to 1 if you have the `memset' function. */ +#undef HAVE_MEMSET + +/* Define to 1 if you have the header file. */ +#undef HAVE_NETDB_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_NETINET_IN_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_NETINET_TCP_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_RESOLV_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SOCKET_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDARG_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDLIB_H + +/* Define to 1 if you have the `strdup' function. */ +#undef HAVE_STRDUP + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRINGS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRING_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_MALLOC_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_SOCKET_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define to 1 if the system has the type `uintptr_t'. */ +#undef HAVE_UINTPTR_T + +/* Define to 1 if you have the 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 home page for this package. */ +#undef PACKAGE_URL + +/* 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 + +/* Define for Solaris 2.5.1 so the uint32_t typedef from , + , or is not used. If the typedef were allowed, the + #define below would cause a syntax error. */ +#undef _UINT32_T + +/* Define for Solaris 2.5.1 so the uint64_t typedef from , + , or is not used. If the typedef were allowed, the + #define below would cause a syntax error. */ +#undef _UINT64_T + +/* Define for Solaris 2.5.1 so the uint8_t typedef from , + , or is not used. If the typedef were allowed, the + #define below would cause a syntax error. */ +#undef _UINT8_T + +/* 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 + +/* Define to the type of a signed integer type of width exactly 16 bits if + such a type exists and the standard includes do not define it. */ +#undef int16_t + +/* Define to the type of a signed integer type of width exactly 32 bits if + such a type exists and the standard includes do not define it. */ +#undef int32_t + +/* Define to the type of a signed integer type of width exactly 64 bits if + such a type exists and the standard includes do not define it. */ +#undef int64_t + +/* Define to the type of a signed integer type of width exactly 8 bits if such + a type exists and the standard includes do not define it. */ +#undef int8_t + +/* Define to the type of a signed integer type wide enough to hold a pointer, + if such a type exists, and if the system does not define it. */ +#undef intptr_t + +/* Define to `unsigned int' if does not define. */ +#undef size_t + +/* Define to the type of an unsigned integer type of width exactly 16 bits if + such a type exists and the standard includes do not define it. */ +#undef uint16_t + +/* Define to the type of an unsigned integer type of width exactly 32 bits if + such a type exists and the standard includes do not define it. */ +#undef uint32_t + +/* Define to the type of an unsigned integer type of width exactly 64 bits if + such a type exists and the standard includes do not define it. */ +#undef uint64_t + +/* Define to the type of an unsigned integer type of width exactly 8 bits if + such a type exists and the standard includes do not define it. */ +#undef uint8_t + +/* Define to the type of an unsigned integer type wide enough to hold a + pointer, if such a type exists, and if the system does not define it. */ +#undef uintptr_t diff --git a/antlr/libantlr3c-3.4/config.guess b/antlr/libantlr3c-3.4/config.guess new file mode 100755 index 0000000..dc84c68 --- /dev/null +++ b/antlr/libantlr3c-3.4/config.guess @@ -0,0 +1,1501 @@ +#! /bin/sh +# Attempt to guess a canonical system name. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 +# Free Software Foundation, Inc. + +timestamp='2009-11-20' + +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA +# 02110-1301, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + + +# Originally written by Per Bothner. Please send patches (context +# diff format) to and include a ChangeLog +# entry. +# +# This script attempts to guess a canonical system name similar to +# config.sub. If it succeeds, it prints the system name on stdout, and +# exits with 0. Otherwise, it exits with 1. +# +# You can get the latest version of this script from: +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] + +Output the configuration name of the system \`$me' is run on. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.guess ($timestamp) + +Originally written by Per Bothner. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, +2002, 2003, 2004, 2005, 2006, 2007, 2008 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 -q __ELF__ + then + # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). + # Return netbsd for either. FIX? + os=netbsd + else + os=netbsdelf + fi + ;; + *) + os=netbsd + ;; + esac + # The OS release + # Debian GNU/NetBSD machines have a different userland, and + # thus, need a distinct triplet. However, they do not need + # kernel version information, so it can be replaced with a + # suitable tag, in the style of linux-gnu. + case "${UNAME_VERSION}" in + Debian*) + release='-gnu' + ;; + *) + release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + ;; + esac + # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: + # contains redundant information, the shorter form: + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. + echo "${machine}-${os}${release}" + exit ;; + *:OpenBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} + exit ;; + *:ekkoBSD:*:*) + echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} + exit ;; + *:SolidBSD:*:*) + echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} + exit ;; + macppc:MirBSD:*:*) + echo powerpc-unknown-mirbsd${UNAME_RELEASE} + exit ;; + *:MirBSD:*:*) + echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} + exit ;; + alpha:OSF1:*:*) + case $UNAME_RELEASE in + *4.0) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + ;; + *5.*) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` + ;; + esac + # According to Compaq, /usr/sbin/psrinfo has been available on + # OSF/1 and Tru64 systems produced since 1995. I hope that + # covers most systems running today. This code pipes the CPU + # types through head -n 1, so we only detect the type of CPU 0. + ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` + case "$ALPHA_CPU_TYPE" in + "EV4 (21064)") + UNAME_MACHINE="alpha" ;; + "EV4.5 (21064)") + UNAME_MACHINE="alpha" ;; + "LCA4 (21066/21068)") + UNAME_MACHINE="alpha" ;; + "EV5 (21164)") + UNAME_MACHINE="alphaev5" ;; + "EV5.6 (21164A)") + UNAME_MACHINE="alphaev56" ;; + "EV5.6 (21164PC)") + UNAME_MACHINE="alphapca56" ;; + "EV5.7 (21164PC)") + UNAME_MACHINE="alphapca57" ;; + "EV6 (21264)") + UNAME_MACHINE="alphaev6" ;; + "EV6.7 (21264A)") + UNAME_MACHINE="alphaev67" ;; + "EV6.8CB (21264C)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8AL (21264B)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8CX (21264D)") + UNAME_MACHINE="alphaev68" ;; + "EV6.9A (21264/EV69A)") + UNAME_MACHINE="alphaev69" ;; + "EV7 (21364)") + UNAME_MACHINE="alphaev7" ;; + "EV7.9 (21364A)") + UNAME_MACHINE="alphaev79" ;; + esac + # A Pn.n version is a patched version. + # A Vn.n version is a released version. + # A Tn.n version is a released field test version. + # A Xn.n version is an unreleased experimental baselevel. + # 1.2 uses "1.2" for uname -r. + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + 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 ;; + s390x:SunOS:*:*) + echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4H:SunOS:5.*:*) + echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) + echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) + echo i386-pc-auroraux${UNAME_RELEASE} + exit ;; + i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) + eval $set_cc_for_build + SUN_ARCH="i386" + # If there is a compiler, see if it is configured for 64-bit objects. + # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. + # This test works for both compilers. + if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + SUN_ARCH="x86_64" + fi + fi + echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:6*:*) + # According to config.sub, this is the proper way to canonicalize + # SunOS6. Hard to guess exactly what SunOS6 will be like, but + # it's likely to be more like Solaris than SunOS4. + echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:*:*) + case "`/usr/bin/arch -k`" in + Series*|S4*) + UNAME_RELEASE=`uname -v` + ;; + esac + # Japanese Language versions have a version number like `4.1.3-JL'. + echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` + exit ;; + sun3*:SunOS:*:*) + echo m68k-sun-sunos${UNAME_RELEASE} + exit ;; + sun*:*:4.2BSD:*) + UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` + test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 + case "`/bin/arch`" in + sun3) + echo m68k-sun-sunos${UNAME_RELEASE} + ;; + sun4) + echo sparc-sun-sunos${UNAME_RELEASE} + ;; + esac + exit ;; + aushp:SunOS:*:*) + echo sparc-auspex-sunos${UNAME_RELEASE} + exit ;; + # The situation for MiNT is a little confusing. The machine name + # can be virtually everything (everything which is not + # "atarist" or "atariste" at least should have a processor + # > m68000). The system name ranges from "MiNT" over "FreeMiNT" + # to the lowercase version "mint" (or "freemint"). Finally + # the system name "TOS" denotes a system which is actually not + # MiNT. But MiNT is downward compatible to TOS, so this should + # be no problem. + atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) + echo m68k-milan-mint${UNAME_RELEASE} + exit ;; + hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) + echo m68k-hades-mint${UNAME_RELEASE} + exit ;; + *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) + echo m68k-unknown-mint${UNAME_RELEASE} + exit ;; + m68k:machten:*:*) + echo m68k-apple-machten${UNAME_RELEASE} + exit ;; + powerpc:machten:*:*) + echo powerpc-apple-machten${UNAME_RELEASE} + exit ;; + RISC*:Mach:*:*) + echo mips-dec-mach_bsd4.3 + exit ;; + RISC*:ULTRIX:*:*) + echo mips-dec-ultrix${UNAME_RELEASE} + exit ;; + VAX*:ULTRIX*:*:*) + echo vax-dec-ultrix${UNAME_RELEASE} + exit ;; + 2020:CLIX:*:* | 2430:CLIX:*:*) + echo clipper-intergraph-clix${UNAME_RELEASE} + exit ;; + mips:*:*:UMIPS | mips:*:*:RISCos) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c +#ifdef __cplusplus +#include /* for printf() prototype */ + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif + #if defined (host_mips) && defined (MIPSEB) + #if defined (SYSTYPE_SYSV) + printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_SVR4) + printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) + printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); + #endif + #endif + exit (-1); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && + dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && + SYSTEM_NAME=`$dummy $dummyarg` && + { echo "$SYSTEM_NAME"; exit; } + echo mips-mips-riscos${UNAME_RELEASE} + exit ;; + Motorola:PowerMAX_OS:*:*) + echo powerpc-motorola-powermax + exit ;; + Motorola:*:4.3:PL8-*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:Power_UNIX:*:*) + echo powerpc-harris-powerunix + exit ;; + m88k:CX/UX:7*:*) + echo m88k-harris-cxux7 + exit ;; + m88k:*:4*:R4*) + echo m88k-motorola-sysv4 + exit ;; + m88k:*:3*:R3*) + echo m88k-motorola-sysv3 + exit ;; + AViiON:dgux:*:*) + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` + if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] + then + if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ + [ ${TARGET_BINARY_INTERFACE}x = x ] + then + echo m88k-dg-dgux${UNAME_RELEASE} + else + echo m88k-dg-dguxbcs${UNAME_RELEASE} + fi + else + echo i586-dg-dgux${UNAME_RELEASE} + fi + exit ;; + M88*:DolphinOS:*:*) # DolphinOS (SVR3) + echo m88k-dolphin-sysv3 + exit ;; + M88*:*:R3*:*) + # Delta 88k system running SVR3 + echo m88k-motorola-sysv3 + exit ;; + XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) + echo m88k-tektronix-sysv3 + exit ;; + Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) + echo m68k-tektronix-bsd + exit ;; + *:IRIX*:*:*) + echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` + exit ;; + ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. + echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id + exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + i*86:AIX:*:*) + echo i386-ibm-aix + exit ;; + ia64:AIX:*:*) + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} + exit ;; + *:AIX:2:3) + if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + + main() + { + if (!__power_pc()) + exit(1); + puts("powerpc-ibm-aix3.2.5"); + exit(0); + } +EOF + if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` + then + echo "$SYSTEM_NAME" + else + echo rs6000-ibm-aix3.2.5 + fi + elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then + echo rs6000-ibm-aix3.2.4 + else + echo rs6000-ibm-aix3.2 + fi + exit ;; + *:AIX:*:[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 + #include + + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); + + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } +EOF + (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` + test -z "$HP_ARCH" && HP_ARCH=hppa + fi ;; + esac + if [ ${HP_ARCH} = "hppa2.0w" ] + then + eval $set_cc_for_build + + # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating + # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler + # generating 64-bit code. GNU and HP use different nomenclature: + # + # $ CC_FOR_BUILD=cc ./config.guess + # => hppa2.0w-hp-hpux11.23 + # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess + # => hppa64-hp-hpux11.23 + + if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | + grep -q __LP64__ + then + HP_ARCH="hppa2.0w" + else + HP_ARCH="hppa64" + fi + fi + echo ${HP_ARCH}-hp-hpux${HPUX_REV} + exit ;; + ia64:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + echo ia64-hp-hpux${HPUX_REV} + exit ;; + 3050*:HI-UX:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + int + main () + { + long cpu = sysconf (_SC_CPU_VERSION); + /* The order matters, because CPU_IS_HP_MC68K erroneously returns + true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct + results, however. */ + if (CPU_IS_PA_RISC (cpu)) + { + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; + case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; + default: puts ("hppa-hitachi-hiuxwe2"); break; + } + } + else if (CPU_IS_HP_MC68K (cpu)) + puts ("m68k-hitachi-hiuxwe2"); + else puts ("unknown-hitachi-hiuxwe2"); + exit (0); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } + echo unknown-hitachi-hiuxwe2 + exit ;; + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) + echo hppa1.1-hp-bsd + exit ;; + 9000/8??:4.3bsd:*:*) + echo hppa1.0-hp-bsd + exit ;; + *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) + echo hppa1.0-hp-mpeix + exit ;; + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) + echo hppa1.1-hp-osf + exit ;; + hp8??:OSF1:*:*) + echo hppa1.0-hp-osf + exit ;; + i*86:OSF1:*:*) + if [ -x /usr/sbin/sysversion ] ; then + echo ${UNAME_MACHINE}-unknown-osf1mk + else + echo ${UNAME_MACHINE}-unknown-osf1 + fi + exit ;; + parisc*:Lites*:*:*) + echo hppa1.1-hp-lites + exit ;; + C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) + echo c1-convex-bsd + exit ;; + C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) + echo c34-convex-bsd + exit ;; + C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) + echo c38-convex-bsd + exit ;; + C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) + echo c4-convex-bsd + exit ;; + CRAY*Y-MP:*:*:*) + echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*[A-Z]90:*:*:*) + echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ + | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ + -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*TS:*:*:*) + echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*T3E:*:*:*) + echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*SV1:*:*:*) + echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + *:UNICOS/mp:*:*) + echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) + FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + 5000:UNIX_System_V:4.*:*) + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` + echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) + echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} + exit ;; + sparc*:BSD/OS:*:*) + echo sparc-unknown-bsdi${UNAME_RELEASE} + exit ;; + *:BSD/OS:*:*) + echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} + exit ;; + *:FreeBSD:*:*) + 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*:*) + case ${UNAME_MACHINE} in + x86) + echo i586-pc-interix${UNAME_RELEASE} + exit ;; + authenticamd | genuineintel | EM64T) + echo x86_64-unknown-interix${UNAME_RELEASE} + exit ;; + IA64) + echo ia64-unknown-interix${UNAME_RELEASE} + exit ;; + esac ;; + [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) + echo i${UNAME_MACHINE}-pc-mks + exit ;; + 8664:Windows_NT:*) + echo x86_64-pc-mks + exit ;; + i*:Windows_NT*:* | Pentium*:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we + # UNAME_MACHINE based on the output of uname instead of i386? + echo i586-pc-interix + exit ;; + i*:UWIN*:*) + echo ${UNAME_MACHINE}-pc-uwin + exit ;; + amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) + echo x86_64-unknown-cygwin + exit ;; + p*:CYGWIN*:*) + echo powerpcle-unknown-cygwin + exit ;; + prep*:SunOS:5.*:*) + echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + *:GNU:*:*) + # the GNU system + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + exit ;; + *:GNU/*:*:*) + # other systems with GNU libc and userland + echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu + exit ;; + i*86:Minix:*:*) + echo ${UNAME_MACHINE}-pc-minix + exit ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + EV5) UNAME_MACHINE=alphaev5 ;; + EV56) UNAME_MACHINE=alphaev56 ;; + PCA56) UNAME_MACHINE=alphapca56 ;; + PCA57) UNAME_MACHINE=alphapca56 ;; + EV6) UNAME_MACHINE=alphaev6 ;; + EV67) UNAME_MACHINE=alphaev67 ;; + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + objdump --private-headers /bin/sh | grep -q ld.so.1 + if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi + echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} + exit ;; + arm*:Linux:*:*) + eval $set_cc_for_build + if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_EABI__ + then + echo ${UNAME_MACHINE}-unknown-linux-gnu + else + 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 ;; + i*86:Linux:*:*) + LIBC=gnu + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #ifdef __dietlibc__ + LIBC=dietlibc + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` + echo "${UNAME_MACHINE}-pc-linux-${LIBC}" + exit ;; + ia64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + m32r*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + m68*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + mips:Linux:*:* | mips64:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef ${UNAME_MACHINE} + #undef ${UNAME_MACHINE}el + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=${UNAME_MACHINE}el + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=${UNAME_MACHINE} + #else + CPU= + #endif + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } + ;; + or32:Linux:*:*) + echo or32-unknown-linux-gnu + exit ;; + padre:Linux:*:*) + echo sparc-unknown-linux-gnu + exit ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-gnu + exit ;; + parisc:Linux:*:* | hppa:Linux:*:*) + # Look for CPU level + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in + PA7*) echo hppa1.1-unknown-linux-gnu ;; + PA8*) echo hppa2.0-unknown-linux-gnu ;; + *) echo hppa-unknown-linux-gnu ;; + esac + exit ;; + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-gnu + exit ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-gnu + exit ;; + s390:Linux:*:* | s390x:Linux:*:*) + echo ${UNAME_MACHINE}-ibm-linux + exit ;; + sh64*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + sh*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + sparc:Linux:*:* | sparc64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + 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:DYNIX/ptx:4*:*) + # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. + # earlier versions are messed up and put the nodename in both + # sysname and nodename. + echo i386-sequent-sysv4 + exit ;; + i*86:UNIX_SV:4.2MP:2.*) + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, + # I just have to hope. -- rms. + # Use sysv4.2uw... so that sysv4* matches it. + echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} + exit ;; + i*86:OS/2:*:*) + # If we were able to find `uname', then EMX Unix compatibility + # is probably installed. + echo ${UNAME_MACHINE}-pc-os2-emx + exit ;; + i*86:XTS-300:*:STOP) + echo ${UNAME_MACHINE}-unknown-stop + exit ;; + i*86:atheos:*:*) + echo ${UNAME_MACHINE}-unknown-atheos + exit ;; + i*86:syllable:*:*) + echo ${UNAME_MACHINE}-pc-syllable + exit ;; + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) + echo i386-unknown-lynxos${UNAME_RELEASE} + exit ;; + i*86:*DOS:*:*) + echo ${UNAME_MACHINE}-pc-msdosdjgpp + exit ;; + i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) + UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` + if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then + echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} + else + echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} + fi + exit ;; + i*86:*:5:[678]*) + # UnixWare 7.x, OpenUNIX and OpenServer 6. + case `/bin/uname -X | grep "^Machine"` in + *486*) UNAME_MACHINE=i486 ;; + *Pentium) UNAME_MACHINE=i586 ;; + *Pent*|*Celeron) UNAME_MACHINE=i686 ;; + esac + echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} + exit ;; + i*86:*:3.2:*) + if test -f /usr/options/cb.name; then + UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then + UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` + (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 + (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ + && UNAME_MACHINE=i586 + (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ + && UNAME_MACHINE=i686 + (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ + && UNAME_MACHINE=i686 + echo ${UNAME_MACHINE}-pc-sco$UNAME_REL + else + echo ${UNAME_MACHINE}-pc-sysv32 + fi + exit ;; + pc:*:*:*) + # Left here for compatibility: + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i586. + # Note: whatever this is, it MUST be the same as what config.sub + # prints for the "djgpp" host, or else GDB configury will decide that + # this is a cross-build. + echo i586-pc-msdosdjgpp + exit ;; + Intel:Mach:3*:*) + echo i386-pc-mach3 + exit ;; + paragon:*:*:*) + echo i860-intel-osf1 + exit ;; + i860:*:4.*:*) # i860-SVR4 + if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then + echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 + else # Add other i860-SVR4 vendors below as they are discovered. + echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 + fi + exit ;; + mini*:CTIX:SYS*5:*) + # "miniframe" + echo m68010-convergent-sysv + exit ;; + mc68k:UNIX:SYSTEM5:3.51m) + echo m68k-convergent-sysv + exit ;; + M680?0:D-NIX:5.3:*) + echo m68k-diab-dnix + exit ;; + M68*:*:R3V[5678]*:*) + test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; + 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) + OS_REL='' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4; exit; } ;; + NCR*:*:4.2:* | MPRAS*:*:4.2:*) + OS_REL='.3' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) + echo m68k-unknown-lynxos${UNAME_RELEASE} + exit ;; + mc68030:UNIX_System_V:4.*:*) + echo m68k-atari-sysv4 + exit ;; + TSUNAMI:LynxOS:2.*:*) + echo sparc-unknown-lynxos${UNAME_RELEASE} + exit ;; + rs6000:LynxOS:2.*:*) + echo rs6000-unknown-lynxos${UNAME_RELEASE} + exit ;; + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) + echo powerpc-unknown-lynxos${UNAME_RELEASE} + exit ;; + SM[BE]S:UNIX_SV:*:*) + echo mips-dde-sysv${UNAME_RELEASE} + exit ;; + RM*:ReliantUNIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + RM*:SINIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + *:SINIX-*:*:*) + if uname -p 2>/dev/null >/dev/null ; then + UNAME_MACHINE=`(uname -p) 2>/dev/null` + echo ${UNAME_MACHINE}-sni-sysv4 + else + echo ns32k-sni-sysv + fi + exit ;; + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says + echo i586-unisys-sysv4 + exit ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes . + # How about differentiating between stratus architectures? -djm + echo hppa1.1-stratus-sysv4 + exit ;; + *:*:*:FTX*) + # From seanf@swdc.stratus.com. + echo i860-stratus-sysv4 + exit ;; + i*86:VOS:*:*) + # From Paul.Green@stratus.com. + echo ${UNAME_MACHINE}-stratus-vos + exit ;; + *:VOS:*:*) + # From Paul.Green@stratus.com. + echo hppa1.1-stratus-vos + exit ;; + mc68*:A/UX:*:*) + echo m68k-apple-aux${UNAME_RELEASE} + exit ;; + news*:NEWS-OS:6*:*) + echo mips-sony-newsos6 + exit ;; + R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) + if [ -d /usr/nec ]; then + echo mips-nec-sysv${UNAME_RELEASE} + else + echo mips-unknown-sysv${UNAME_RELEASE} + fi + exit ;; + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. + echo powerpc-be-beos + exit ;; + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. + echo powerpc-apple-beos + exit ;; + BePC:BeOS:*:*) # BeOS running on Intel PC compatible. + echo i586-pc-beos + exit ;; + BePC:Haiku:*:*) # Haiku running on Intel PC compatible. + echo i586-pc-haiku + exit ;; + SX-4:SUPER-UX:*:*) + echo sx4-nec-superux${UNAME_RELEASE} + exit ;; + SX-5:SUPER-UX:*:*) + echo sx5-nec-superux${UNAME_RELEASE} + exit ;; + SX-6:SUPER-UX:*:*) + echo sx6-nec-superux${UNAME_RELEASE} + exit ;; + SX-7:SUPER-UX:*:*) + echo sx7-nec-superux${UNAME_RELEASE} + exit ;; + SX-8:SUPER-UX:*:*) + echo sx8-nec-superux${UNAME_RELEASE} + exit ;; + SX-8R:SUPER-UX:*:*) + echo sx8r-nec-superux${UNAME_RELEASE} + exit ;; + Power*:Rhapsody:*:*) + echo powerpc-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Rhapsody:*:*) + echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Darwin:*:*) + UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown + case $UNAME_PROCESSOR in + i386) + eval $set_cc_for_build + if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + UNAME_PROCESSOR="x86_64" + fi + fi ;; + unknown) UNAME_PROCESSOR=powerpc ;; + esac + echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} + exit ;; + *:procnto*:*:* | *:QNX:[0123456789]*:*) + UNAME_PROCESSOR=`uname -p` + if test "$UNAME_PROCESSOR" = "x86"; then + UNAME_PROCESSOR=i386 + UNAME_MACHINE=pc + fi + echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} + exit ;; + *:QNX:*:4*) + echo i386-pc-qnx + exit ;; + NSE-?:NONSTOP_KERNEL:*:*) + echo nse-tandem-nsk${UNAME_RELEASE} + exit ;; + NSR-?:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk${UNAME_RELEASE} + exit ;; + *:NonStop-UX:*:*) + echo mips-compaq-nonstopux + exit ;; + BS2000:POSIX*:*:*) + echo bs2000-siemens-sysv + exit ;; + DS/*:UNIX_System_V:*:*) + echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} + exit ;; + *:Plan9:*:*) + # "uname -m" is not consistent, so use $cputype instead. 386 + # is converted to i386 for consistency with other x86 + # operating systems. + if test "$cputype" = "386"; then + UNAME_MACHINE=i386 + else + UNAME_MACHINE="$cputype" + fi + echo ${UNAME_MACHINE}-unknown-plan9 + exit ;; + *:TOPS-10:*:*) + echo pdp10-unknown-tops10 + exit ;; + *:TENEX:*:*) + echo pdp10-unknown-tenex + exit ;; + KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) + echo pdp10-dec-tops20 + exit ;; + XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) + echo pdp10-xkl-tops20 + exit ;; + *:TOPS-20:*:*) + echo pdp10-unknown-tops20 + exit ;; + *:ITS:*:*) + echo pdp10-unknown-its + exit ;; + SEI:*:*:SEIUX) + echo mips-sei-seiux${UNAME_RELEASE} + exit ;; + *:DragonFly:*:*) + echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + exit ;; + *:*VMS:*:*) + UNAME_MACHINE=`(uname -p) 2>/dev/null` + case "${UNAME_MACHINE}" in + A*) echo alpha-dec-vms ; exit ;; + I*) echo ia64-dec-vms ; exit ;; + V*) echo vax-dec-vms ; exit ;; + esac ;; + *:XENIX:*:SysV) + echo i386-pc-xenix + exit ;; + i*86:skyos:*:*) + echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' + exit ;; + i*86:rdos:*:*) + echo ${UNAME_MACHINE}-pc-rdos + exit ;; + i*86:AROS:*:*) + echo ${UNAME_MACHINE}-pc-aros + exit ;; +esac + +#echo '(No uname command or uname output not recognized.)' 1>&2 +#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 + +eval $set_cc_for_build +cat >$dummy.c < +# include +#endif +main () +{ +#if defined (sony) +#if defined (MIPSEB) + /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, + I don't know.... */ + printf ("mips-sony-bsd\n"); exit (0); +#else +#include + printf ("m68k-sony-newsos%s\n", +#ifdef NEWSOS4 + "4" +#else + "" +#endif + ); exit (0); +#endif +#endif + +#if defined (__arm) && defined (__acorn) && defined (__unix) + printf ("arm-acorn-riscix\n"); exit (0); +#endif + +#if defined (hp300) && !defined (hpux) + printf ("m68k-hp-bsd\n"); exit (0); +#endif + +#if defined (NeXT) +#if !defined (__ARCHITECTURE__) +#define __ARCHITECTURE__ "m68k" +#endif + int version; + version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; + if (version < 4) + printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); + else + printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); + exit (0); +#endif + +#if defined (MULTIMAX) || defined (n16) +#if defined (UMAXV) + printf ("ns32k-encore-sysv\n"); exit (0); +#else +#if defined (CMU) + printf ("ns32k-encore-mach\n"); exit (0); +#else + printf ("ns32k-encore-bsd\n"); exit (0); +#endif +#endif +#endif + +#if defined (__386BSD__) + printf ("i386-pc-bsd\n"); exit (0); +#endif + +#if defined (sequent) +#if defined (i386) + printf ("i386-sequent-dynix\n"); exit (0); +#endif +#if defined (ns32000) + printf ("ns32k-sequent-dynix\n"); exit (0); +#endif +#endif + +#if defined (_SEQUENT_) + struct utsname un; + + uname(&un); + + if (strncmp(un.version, "V2", 2) == 0) { + printf ("i386-sequent-ptx2\n"); exit (0); + } + if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ + printf ("i386-sequent-ptx1\n"); exit (0); + } + printf ("i386-sequent-ptx\n"); exit (0); + +#endif + +#if defined (vax) +# if !defined (ultrix) +# include +# if defined (BSD) +# if BSD == 43 + printf ("vax-dec-bsd4.3\n"); exit (0); +# else +# if BSD == 199006 + printf ("vax-dec-bsd4.3reno\n"); exit (0); +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# endif +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# else + printf ("vax-dec-ultrix\n"); exit (0); +# endif +#endif + +#if defined (alliant) && defined (i860) + printf ("i860-alliant-bsd\n"); exit (0); +#endif + + exit (1); +} +EOF + +$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } + +# Apollos put the system type in the environment. + +test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } + +# Convex versions that predate uname can use getsysinfo(1) + +if [ -x /usr/convex/getsysinfo ] +then + case `getsysinfo -f cpu_type` in + c1*) + echo c1-convex-bsd + exit ;; + c2*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + c34*) + echo c34-convex-bsd + exit ;; + c38*) + echo c38-convex-bsd + exit ;; + c4*) + echo c4-convex-bsd + exit ;; + esac +fi + +cat >&2 < in order to provide the needed +information to handle your system. + +config.guess timestamp = $timestamp + +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null` + +hostinfo = `(hostinfo) 2>/dev/null` +/bin/universe = `(/bin/universe) 2>/dev/null` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` +/bin/arch = `(/bin/arch) 2>/dev/null` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` + +UNAME_MACHINE = ${UNAME_MACHINE} +UNAME_RELEASE = ${UNAME_RELEASE} +UNAME_SYSTEM = ${UNAME_SYSTEM} +UNAME_VERSION = ${UNAME_VERSION} +EOF + +exit 1 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/antlr/libantlr3c-3.4/config.log b/antlr/libantlr3c-3.4/config.log new file mode 100644 index 0000000..656285a --- /dev/null +++ b/antlr/libantlr3c-3.4/config.log @@ -0,0 +1,5651 @@ +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by libantlr3c configure 3.4, which was +generated by GNU Autoconf 2.66. Invocation command line was + + $ ./configure + +## --------- ## +## Platform. ## +## --------- ## + +hostname = pc-4w14-0 +uname -m = x86_64 +uname -r = 3.2.0-2-amd64 +uname -s = Linux +uname -v = #1 SMP Tue Mar 20 18:36:37 UTC 2012 + +/usr/bin/uname -p = unknown +/bin/uname -X = unknown + +/bin/arch = unknown +/usr/bin/arch -k = unknown +/usr/convex/getsysinfo = unknown +/usr/bin/hostinfo = unknown +/bin/machine = unknown +/usr/bin/oslevel = unknown +/bin/universe = unknown + +PATH: /usr/local/bin +PATH: /usr/bin +PATH: /bin +PATH: /usr/local/games +PATH: /usr/games + + +## ----------- ## +## Core tests. ## +## ----------- ## + +configure:2416: checking for a BSD-compatible install +configure:2484: result: /usr/bin/install -c +configure:2495: checking whether build environment is sane +configure:2545: result: yes +configure:2686: checking for a thread-safe mkdir -p +configure:2725: result: /bin/mkdir -p +configure:2738: checking for gawk +configure:2768: result: no +configure:2738: checking for mawk +configure:2754: found /usr/bin/mawk +configure:2765: result: mawk +configure:2776: checking whether make sets $(MAKE) +configure:2798: result: yes +configure:2938: checking for xlc +configure:2968: result: no +configure:2938: checking for aCC +configure:2968: result: no +configure:2938: checking for gcc +configure:2954: found /usr/bin/gcc +configure:2965: result: gcc +configure:2996: checking for C compiler version +configure:3005: gcc --version >&5 +gcc (Debian 4.6.3-4) 4.6.3 +Copyright (C) 2011 Free Software Foundation, Inc. +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +configure:3016: $? = 0 +configure:3005: gcc -v >&5 +Using built-in specs. +COLLECT_GCC=gcc +COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.6/lto-wrapper +Target: x86_64-linux-gnu +Configured with: ../src/configure -v --with-pkgversion='Debian 4.6.3-4' --with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.6 --enable-shared --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.6 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --enable-plugin --enable-objc-gc --with-arch-32=i586 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu +Thread model: posix +gcc version 4.6.3 (Debian 4.6.3-4) +configure:3016: $? = 0 +configure:3005: gcc -V >&5 +gcc: error: unrecognized option '-V' +gcc: fatal error: no input files +compilation terminated. +configure:3016: $? = 4 +configure:3005: gcc -qversion >&5 +gcc: error: unrecognized option '-qversion' +gcc: fatal error: no input files +compilation terminated. +configure:3016: $? = 4 +configure:3036: checking whether the C compiler works +configure:3058: gcc conftest.c >&5 +configure:3062: $? = 0 +configure:3110: result: yes +configure:3113: checking for C compiler default output file name +configure:3115: result: a.out +configure:3121: checking for suffix of executables +configure:3128: gcc -o conftest conftest.c >&5 +configure:3132: $? = 0 +configure:3154: result: +configure:3176: checking whether we are cross compiling +configure:3184: gcc -o conftest conftest.c >&5 +configure:3188: $? = 0 +configure:3195: ./conftest +configure:3199: $? = 0 +configure:3214: result: no +configure:3219: checking for suffix of object files +configure:3241: gcc -c conftest.c >&5 +configure:3245: $? = 0 +configure:3266: result: o +configure:3270: checking whether we are using the GNU C compiler +configure:3289: gcc -c conftest.c >&5 +configure:3289: $? = 0 +configure:3298: result: yes +configure:3307: checking whether gcc accepts -g +configure:3327: gcc -c -g conftest.c >&5 +configure:3327: $? = 0 +configure:3368: result: yes +configure:3385: checking for gcc option to accept ISO C89 +configure:3449: gcc -c -g -O2 conftest.c >&5 +configure:3449: $? = 0 +configure:3462: result: none needed +configure:3493: checking for style of include used by make +configure:3521: result: GNU +configure:3546: checking dependency style of gcc +configure:3656: result: gcc3 +configure:3672: checking whether to enable maintainer-specific portions of Makefiles +configure:3681: result: no +configure:3723: checking build system type +configure:3737: result: x86_64-unknown-linux-gnu +configure:3757: checking host system type +configure:3770: result: x86_64-unknown-linux-gnu +configure:3811: checking how to print strings +configure:3838: result: printf +configure:3859: checking for a sed that does not truncate output +configure:3923: result: /bin/sed +configure:3941: checking for grep that handles long lines and -e +configure:3999: result: /bin/grep +configure:4004: checking for egrep +configure:4066: result: /bin/grep -E +configure:4071: checking for fgrep +configure:4133: result: /bin/grep -F +configure:4168: checking for ld used by gcc +configure:4235: result: /usr/bin/ld +configure:4242: checking if the linker (/usr/bin/ld) is GNU ld +configure:4257: result: yes +configure:4269: checking for BSD- or MS-compatible name lister (nm) +configure:4318: result: /usr/bin/nm -B +configure:4448: checking the name lister (/usr/bin/nm -B) interface +configure:4455: gcc -c -g -O2 conftest.c >&5 +configure:4458: /usr/bin/nm -B "conftest.o" +configure:4461: output +0000000000000000 B some_variable +configure:4468: result: BSD nm +configure:4471: checking whether ln -s works +configure:4475: result: yes +configure:4483: checking the maximum length of command line arguments +configure:4608: result: 1572864 +configure:4625: checking whether the shell understands some XSI constructs +configure:4635: result: yes +configure:4639: checking whether the shell understands "+=" +configure:4645: result: yes +configure:4680: checking for /usr/bin/ld option to reload object files +configure:4687: result: -r +configure:4756: checking for objdump +configure:4772: found /usr/bin/objdump +configure:4783: result: objdump +configure:4815: checking how to recognize dependent libraries +configure:5017: result: pass_all +configure:5077: checking for ar +configure:5093: found /usr/bin/ar +configure:5104: result: ar +configure:5182: checking for strip +configure:5198: found /usr/bin/strip +configure:5209: result: strip +configure:5281: checking for ranlib +configure:5297: found /usr/bin/ranlib +configure:5308: result: ranlib +configure:5410: checking command to parse /usr/bin/nm -B output from gcc object +configure:5528: gcc -c -g -O2 conftest.c >&5 +configure:5531: $? = 0 +configure:5535: /usr/bin/nm -B conftest.o \| sed -n -e 's/^.*[ ]\([ABCDGIRSTW][ABCDGIRSTW]*\)[ ][ ]*\([_A-Za-z][_A-Za-z0-9]*\)$/\1 \2 \2/p' \> conftest.nm +configure:5538: $? = 0 +configure:5592: gcc -o conftest -g -O2 conftest.c conftstm.o >&5 +configure:5595: $? = 0 +configure:5633: result: ok +configure:5729: gcc -c -g -O2 conftest.c >&5 +configure:5732: $? = 0 +configure:6474: checking how to run the C preprocessor +configure:6505: gcc -E conftest.c +configure:6505: $? = 0 +configure:6519: gcc -E conftest.c +conftest.c:11:28: fatal error: ac_nonexistent.h: No such file or directory +compilation terminated. +configure:6519: $? = 1 +configure: failed program was: +| /* confdefs.h */ +| #define PACKAGE_NAME "libantlr3c" +| #define PACKAGE_TARNAME "libantlr3c" +| #define PACKAGE_VERSION "3.4" +| #define PACKAGE_STRING "libantlr3c 3.4" +| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" +| #define PACKAGE_URL "" +| #define PACKAGE "libantlr3c" +| #define VERSION "3.4" +| /* end confdefs.h. */ +| #include +configure:6544: result: gcc -E +configure:6564: gcc -E conftest.c +configure:6564: $? = 0 +configure:6578: gcc -E conftest.c +conftest.c:11:28: fatal error: ac_nonexistent.h: No such file or directory +compilation terminated. +configure:6578: $? = 1 +configure: failed program was: +| /* confdefs.h */ +| #define PACKAGE_NAME "libantlr3c" +| #define PACKAGE_TARNAME "libantlr3c" +| #define PACKAGE_VERSION "3.4" +| #define PACKAGE_STRING "libantlr3c 3.4" +| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" +| #define PACKAGE_URL "" +| #define PACKAGE "libantlr3c" +| #define VERSION "3.4" +| /* end confdefs.h. */ +| #include +configure:6607: checking for ANSI C header files +configure:6627: gcc -c -g -O2 conftest.c >&5 +configure:6627: $? = 0 +configure:6700: gcc -o conftest -g -O2 conftest.c >&5 +configure:6700: $? = 0 +configure:6700: ./conftest +configure:6700: $? = 0 +configure:6711: result: yes +configure:6724: checking for sys/types.h +configure:6724: gcc -c -g -O2 conftest.c >&5 +configure:6724: $? = 0 +configure:6724: result: yes +configure:6724: checking for sys/stat.h +configure:6724: gcc -c -g -O2 conftest.c >&5 +configure:6724: $? = 0 +configure:6724: result: yes +configure:6724: checking for stdlib.h +configure:6724: gcc -c -g -O2 conftest.c >&5 +configure:6724: $? = 0 +configure:6724: result: yes +configure:6724: checking for string.h +configure:6724: gcc -c -g -O2 conftest.c >&5 +configure:6724: $? = 0 +configure:6724: result: yes +configure:6724: checking for memory.h +configure:6724: gcc -c -g -O2 conftest.c >&5 +configure:6724: $? = 0 +configure:6724: result: yes +configure:6724: checking for strings.h +configure:6724: gcc -c -g -O2 conftest.c >&5 +configure:6724: $? = 0 +configure:6724: result: yes +configure:6724: checking for inttypes.h +configure:6724: gcc -c -g -O2 conftest.c >&5 +configure:6724: $? = 0 +configure:6724: result: yes +configure:6724: checking for stdint.h +configure:6724: gcc -c -g -O2 conftest.c >&5 +configure:6724: $? = 0 +configure:6724: result: yes +configure:6724: checking for unistd.h +configure:6724: gcc -c -g -O2 conftest.c >&5 +configure:6724: $? = 0 +configure:6724: result: yes +configure:6738: checking for dlfcn.h +configure:6738: gcc -c -g -O2 conftest.c >&5 +configure:6738: $? = 0 +configure:6738: result: yes +configure:6925: checking for objdir +configure:6940: result: .libs +configure:7211: checking if gcc supports -fno-rtti -fno-exceptions +configure:7229: gcc -c -g -O2 -fno-rtti -fno-exceptions conftest.c >&5 +cc1: warning: command line option '-fno-rtti' is valid for C++/ObjC++ but not for C [enabled by default] +configure:7233: $? = 0 +configure:7246: result: no +configure:7266: checking for gcc option to produce PIC +configure:7551: result: -fPIC -DPIC +configure:7563: checking if gcc PIC flag -fPIC -DPIC works +configure:7581: gcc -c -g -O2 -fPIC -DPIC -DPIC conftest.c >&5 +configure:7585: $? = 0 +configure:7598: result: yes +configure:7622: checking if gcc static flag -static works +configure:7650: result: yes +configure:7665: checking if gcc supports -c -o file.o +configure:7686: gcc -c -g -O2 -o out/conftest2.o conftest.c >&5 +configure:7690: $? = 0 +configure:7712: result: yes +configure:7720: checking if gcc supports -c -o file.o +configure:7767: result: yes +configure:7800: checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries +configure:8875: result: yes +configure:8912: checking whether -lc should be explicitly linked in +configure:8920: gcc -c -g -O2 conftest.c >&5 +configure:8923: $? = 0 +configure:8938: gcc -shared conftest.o -v -Wl,-soname -Wl,conftest -o conftest 2\>\&1 \| /bin/grep -lc \>/dev/null 2\>\&1 +configure:8941: $? = 0 +configure:8955: result: no +configure:9120: checking dynamic linker characteristics +configure:9575: gcc -o conftest -g -O2 -Wl,-rpath -Wl,/foo conftest.c >&5 +configure:9575: $? = 0 +configure:9801: result: GNU/Linux ld.so +configure:9908: checking how to hardcode library paths into programs +configure:9933: result: immediate +configure:10473: checking whether stripping libraries is possible +configure:10478: result: yes +configure:10513: checking if libtool supports shared libraries +configure:10515: result: yes +configure:10518: checking whether to build shared libraries +configure:10539: result: yes +configure:10542: checking whether to build static libraries +configure:10546: result: yes +configure:10587: checking compiler flags required for compiling ANTLR with gcc C compiler on host x86_64-unknown-linux-gnu +configure:10661: result: -m32 -O2 -Wall +configure:10677: checking whether ln -s works +configure:10681: result: yes +configure:10688: checking whether make sets $(MAKE) +configure:10710: result: yes +configure:10727: checking for sys/types.h +configure:10727: result: yes +configure:10727: checking for netinet/in.h +configure:10727: gcc -c -m32 -O2 -Wall conftest.c >&5 +conftest.c:25:25: fatal error: sys/types.h: No such file or directory +compilation terminated. +configure:10727: $? = 1 +configure: failed program was: +| /* confdefs.h */ +| #define PACKAGE_NAME "libantlr3c" +| #define PACKAGE_TARNAME "libantlr3c" +| #define PACKAGE_VERSION "3.4" +| #define PACKAGE_STRING "libantlr3c 3.4" +| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" +| #define PACKAGE_URL "" +| #define PACKAGE "libantlr3c" +| #define VERSION "3.4" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define HAVE_DLFCN_H 1 +| #define LT_OBJDIR ".libs/" +| #define HAVE_SYS_TYPES_H 1 +| /* end confdefs.h. */ +| #ifdef HAVE_SYS_TYPES_H +| # include +| #endif +| #ifdef HAVE_NETINET_IN_H +| # include /* inet_ functions / structs */ +| #endif +| #ifdef HAVE_ARPA_NAMESER_H +| # include /* DNS HEADER struct */ +| #endif +| #ifdef HAVE_NETDB_H +| # include +| #endif +| +| #include +configure:10727: result: no +configure:10727: checking for arpa/nameser.h +configure:10727: gcc -c -m32 -O2 -Wall conftest.c >&5 +conftest.c:25:25: fatal error: sys/types.h: No such file or directory +compilation terminated. +configure:10727: $? = 1 +configure: failed program was: +| /* confdefs.h */ +| #define PACKAGE_NAME "libantlr3c" +| #define PACKAGE_TARNAME "libantlr3c" +| #define PACKAGE_VERSION "3.4" +| #define PACKAGE_STRING "libantlr3c 3.4" +| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" +| #define PACKAGE_URL "" +| #define PACKAGE "libantlr3c" +| #define VERSION "3.4" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define HAVE_DLFCN_H 1 +| #define LT_OBJDIR ".libs/" +| #define HAVE_SYS_TYPES_H 1 +| /* end confdefs.h. */ +| #ifdef HAVE_SYS_TYPES_H +| # include +| #endif +| #ifdef HAVE_NETINET_IN_H +| # include /* inet_ functions / structs */ +| #endif +| #ifdef HAVE_ARPA_NAMESER_H +| # include /* DNS HEADER struct */ +| #endif +| #ifdef HAVE_NETDB_H +| # include +| #endif +| +| #include +configure:10727: result: no +configure:10727: checking for netdb.h +configure:10727: gcc -c -m32 -O2 -Wall conftest.c >&5 +conftest.c:25:25: fatal error: sys/types.h: No such file or directory +compilation terminated. +configure:10727: $? = 1 +configure: failed program was: +| /* confdefs.h */ +| #define PACKAGE_NAME "libantlr3c" +| #define PACKAGE_TARNAME "libantlr3c" +| #define PACKAGE_VERSION "3.4" +| #define PACKAGE_STRING "libantlr3c 3.4" +| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" +| #define PACKAGE_URL "" +| #define PACKAGE "libantlr3c" +| #define VERSION "3.4" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define HAVE_DLFCN_H 1 +| #define LT_OBJDIR ".libs/" +| #define HAVE_SYS_TYPES_H 1 +| /* end confdefs.h. */ +| #ifdef HAVE_SYS_TYPES_H +| # include +| #endif +| #ifdef HAVE_NETINET_IN_H +| # include /* inet_ functions / structs */ +| #endif +| #ifdef HAVE_ARPA_NAMESER_H +| # include /* DNS HEADER struct */ +| #endif +| #ifdef HAVE_NETDB_H +| # include +| #endif +| +| #include +configure:10727: result: no +configure:10727: checking for resolv.h +configure:10727: gcc -c -m32 -O2 -Wall conftest.c >&5 +conftest.c:25:25: fatal error: sys/types.h: No such file or directory +compilation terminated. +configure:10727: $? = 1 +configure: failed program was: +| /* confdefs.h */ +| #define PACKAGE_NAME "libantlr3c" +| #define PACKAGE_TARNAME "libantlr3c" +| #define PACKAGE_VERSION "3.4" +| #define PACKAGE_STRING "libantlr3c 3.4" +| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" +| #define PACKAGE_URL "" +| #define PACKAGE "libantlr3c" +| #define VERSION "3.4" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define HAVE_DLFCN_H 1 +| #define LT_OBJDIR ".libs/" +| #define HAVE_SYS_TYPES_H 1 +| /* end confdefs.h. */ +| #ifdef HAVE_SYS_TYPES_H +| # include +| #endif +| #ifdef HAVE_NETINET_IN_H +| # include /* inet_ functions / structs */ +| #endif +| #ifdef HAVE_ARPA_NAMESER_H +| # include /* DNS HEADER struct */ +| #endif +| #ifdef HAVE_NETDB_H +| # include +| #endif +| +| #include +configure:10727: result: no +configure:10753: checking for sys/malloc.h +configure:10753: gcc -c -m32 -O2 -Wall conftest.c >&5 +conftest.c:32:24: fatal error: sys/malloc.h: No such file or directory +compilation terminated. +configure:10753: $? = 1 +configure: failed program was: +| /* confdefs.h */ +| #define PACKAGE_NAME "libantlr3c" +| #define PACKAGE_TARNAME "libantlr3c" +| #define PACKAGE_VERSION "3.4" +| #define PACKAGE_STRING "libantlr3c 3.4" +| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" +| #define PACKAGE_URL "" +| #define PACKAGE "libantlr3c" +| #define VERSION "3.4" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define HAVE_DLFCN_H 1 +| #define LT_OBJDIR ".libs/" +| #define HAVE_SYS_TYPES_H 1 +| /* end confdefs.h. */ +| #ifdef HAVE_SYS_MALLOC_H +| #include +| #endif +| #ifdef HAVE_MALLOC_H +| #include +| #endif +| +| +| #include +configure:10753: result: no +configure:10753: checking for malloc.h +configure:10753: gcc -c -m32 -O2 -Wall conftest.c >&5 +In file included from /usr/include/malloc.h:24:0, + from conftest.c:32: +/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory +compilation terminated. +configure:10753: $? = 1 +configure: failed program was: +| /* confdefs.h */ +| #define PACKAGE_NAME "libantlr3c" +| #define PACKAGE_TARNAME "libantlr3c" +| #define PACKAGE_VERSION "3.4" +| #define PACKAGE_STRING "libantlr3c 3.4" +| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" +| #define PACKAGE_URL "" +| #define PACKAGE "libantlr3c" +| #define VERSION "3.4" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define HAVE_DLFCN_H 1 +| #define LT_OBJDIR ".libs/" +| #define HAVE_SYS_TYPES_H 1 +| /* end confdefs.h. */ +| #ifdef HAVE_SYS_MALLOC_H +| #include +| #endif +| #ifdef HAVE_MALLOC_H +| #include +| #endif +| +| +| #include +configure:10753: result: no +configure:10772: checking for stdarg.h +configure:10772: gcc -c -m32 -O2 -Wall conftest.c >&5 +configure:10772: $? = 0 +configure:10772: result: yes +configure:10789: checking for sys/stat.h +configure:10789: result: yes +configure:10806: checking for ctype.h +configure:10806: gcc -c -m32 -O2 -Wall conftest.c >&5 +In file included from /usr/include/ctype.h:27:0, + from conftest.c:31: +/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory +compilation terminated. +configure:10806: $? = 1 +configure: failed program was: +| /* confdefs.h */ +| #define PACKAGE_NAME "libantlr3c" +| #define PACKAGE_TARNAME "libantlr3c" +| #define PACKAGE_VERSION "3.4" +| #define PACKAGE_STRING "libantlr3c 3.4" +| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" +| #define PACKAGE_URL "" +| #define PACKAGE "libantlr3c" +| #define VERSION "3.4" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define HAVE_DLFCN_H 1 +| #define LT_OBJDIR ".libs/" +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_STDARG_H 1 +| #define HAVE_SYS_STAT_H 1 +| /* end confdefs.h. */ +| #ifdef HAVE_CTYPE_H +| #include +| #endif +| +| +| #include +configure:10806: result: no +configure:10823: checking for netinet/tcp.h +configure:10823: gcc -c -m32 -O2 -Wall conftest.c >&5 +In file included from /usr/include/netinet/tcp.h:35:0, + from conftest.c:31: +/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory +compilation terminated. +configure:10823: $? = 1 +configure: failed program was: +| /* confdefs.h */ +| #define PACKAGE_NAME "libantlr3c" +| #define PACKAGE_TARNAME "libantlr3c" +| #define PACKAGE_VERSION "3.4" +| #define PACKAGE_STRING "libantlr3c 3.4" +| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" +| #define PACKAGE_URL "" +| #define PACKAGE "libantlr3c" +| #define VERSION "3.4" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define HAVE_DLFCN_H 1 +| #define LT_OBJDIR ".libs/" +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_STDARG_H 1 +| #define HAVE_SYS_STAT_H 1 +| /* end confdefs.h. */ +| #ifdef HAVE_NETINET_TCP_H +| #include +| #endif +| +| +| #include +configure:10823: result: no +configure:10841: checking for sys/socket.h +configure:10841: gcc -c -m32 -O2 -Wall conftest.c >&5 +conftest.c:34:24: fatal error: sys/socket.h: No such file or directory +compilation terminated. +configure:10841: $? = 1 +configure: failed program was: +| /* confdefs.h */ +| #define PACKAGE_NAME "libantlr3c" +| #define PACKAGE_TARNAME "libantlr3c" +| #define PACKAGE_VERSION "3.4" +| #define PACKAGE_STRING "libantlr3c 3.4" +| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" +| #define PACKAGE_URL "" +| #define PACKAGE "libantlr3c" +| #define VERSION "3.4" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define HAVE_DLFCN_H 1 +| #define LT_OBJDIR ".libs/" +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_STDARG_H 1 +| #define HAVE_SYS_STAT_H 1 +| /* end confdefs.h. */ +| #ifdef HAVE_SYS_SOCKET_H +| #include +| #endif +| #ifdef HAVE_SOCKET_H +| #include +| #endif +| +| +| #include +configure:10841: result: no +configure:10841: checking for socket.h +configure:10841: gcc -c -m32 -O2 -Wall conftest.c >&5 +conftest.c:34:20: fatal error: socket.h: No such file or directory +compilation terminated. +configure:10841: $? = 1 +configure: failed program was: +| /* confdefs.h */ +| #define PACKAGE_NAME "libantlr3c" +| #define PACKAGE_TARNAME "libantlr3c" +| #define PACKAGE_VERSION "3.4" +| #define PACKAGE_STRING "libantlr3c 3.4" +| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" +| #define PACKAGE_URL "" +| #define PACKAGE "libantlr3c" +| #define VERSION "3.4" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define HAVE_DLFCN_H 1 +| #define LT_OBJDIR ".libs/" +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_STDARG_H 1 +| #define HAVE_SYS_STAT_H 1 +| /* end confdefs.h. */ +| #ifdef HAVE_SYS_SOCKET_H +| #include +| #endif +| #ifdef HAVE_SOCKET_H +| #include +| #endif +| +| +| #include +configure:10841: result: no +configure:10860: checking for an ANSI C-conforming const +configure:10925: gcc -c -m32 -O2 -Wall conftest.c >&5 +conftest.c: In function 'main': +conftest.c:55:10: warning: 't' is used uninitialized in this function [-Wuninitialized] +configure:10925: $? = 0 +configure:10932: result: yes +configure:10940: checking for size_t +configure:10940: gcc -c -m32 -O2 -Wall conftest.c >&5 +In file included from /usr/include/stdio.h:28:0, + from conftest.c:26: +/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory +compilation terminated. +configure:10940: $? = 1 +configure: failed program was: +| /* confdefs.h */ +| #define PACKAGE_NAME "libantlr3c" +| #define PACKAGE_TARNAME "libantlr3c" +| #define PACKAGE_VERSION "3.4" +| #define PACKAGE_STRING "libantlr3c 3.4" +| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" +| #define PACKAGE_URL "" +| #define PACKAGE "libantlr3c" +| #define VERSION "3.4" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define HAVE_DLFCN_H 1 +| #define LT_OBJDIR ".libs/" +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_STDARG_H 1 +| #define HAVE_SYS_STAT_H 1 +| /* end confdefs.h. */ +| #include +| #ifdef HAVE_SYS_TYPES_H +| # include +| #endif +| #ifdef HAVE_SYS_STAT_H +| # include +| #endif +| #ifdef STDC_HEADERS +| # include +| # include +| #else +| # ifdef HAVE_STDLIB_H +| # include +| # endif +| #endif +| #ifdef HAVE_STRING_H +| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H +| # include +| # endif +| # include +| #endif +| #ifdef HAVE_STRINGS_H +| # include +| #endif +| #ifdef HAVE_INTTYPES_H +| # include +| #endif +| #ifdef HAVE_STDINT_H +| # include +| #endif +| #ifdef HAVE_UNISTD_H +| # include +| #endif +| int +| main () +| { +| if (sizeof (size_t)) +| return 0; +| ; +| return 0; +| } +configure:10940: result: no +configure:10951: checking for int8_t +configure:10951: gcc -c -m32 -O2 -Wall conftest.c >&5 +In file included from /usr/include/stdio.h:28:0, + from conftest.c:27: +/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory +compilation terminated. +configure:10951: $? = 1 +configure: failed program was: +| /* confdefs.h */ +| #define PACKAGE_NAME "libantlr3c" +| #define PACKAGE_TARNAME "libantlr3c" +| #define PACKAGE_VERSION "3.4" +| #define PACKAGE_STRING "libantlr3c 3.4" +| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" +| #define PACKAGE_URL "" +| #define PACKAGE "libantlr3c" +| #define VERSION "3.4" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define HAVE_DLFCN_H 1 +| #define LT_OBJDIR ".libs/" +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_STDARG_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define size_t unsigned int +| /* end confdefs.h. */ +| #include +| #ifdef HAVE_SYS_TYPES_H +| # include +| #endif +| #ifdef HAVE_SYS_STAT_H +| # include +| #endif +| #ifdef STDC_HEADERS +| # include +| # include +| #else +| # ifdef HAVE_STDLIB_H +| # include +| # endif +| #endif +| #ifdef HAVE_STRING_H +| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H +| # include +| # endif +| # include +| #endif +| #ifdef HAVE_STRINGS_H +| # include +| #endif +| #ifdef HAVE_INTTYPES_H +| # include +| #endif +| #ifdef HAVE_STDINT_H +| # include +| #endif +| #ifdef HAVE_UNISTD_H +| # include +| #endif +| enum { N = 8 / 2 - 1 }; +| int +| main () +| { +| static int test_array [1 - 2 * !(0 < (int8_t) (((((int8_t) 1 << N) << N) - 1) * 2 + 1))]; +| test_array [0] = 0 +| +| ; +| return 0; +| } +configure:10951: gcc -c -m32 -O2 -Wall conftest.c >&5 +In file included from /usr/include/stdio.h:28:0, + from conftest.c:27: +/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory +compilation terminated. +configure:10951: $? = 1 +configure: failed program was: +| /* confdefs.h */ +| #define PACKAGE_NAME "libantlr3c" +| #define PACKAGE_TARNAME "libantlr3c" +| #define PACKAGE_VERSION "3.4" +| #define PACKAGE_STRING "libantlr3c 3.4" +| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" +| #define PACKAGE_URL "" +| #define PACKAGE "libantlr3c" +| #define VERSION "3.4" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define HAVE_DLFCN_H 1 +| #define LT_OBJDIR ".libs/" +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_STDARG_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define size_t unsigned int +| /* end confdefs.h. */ +| #include +| #ifdef HAVE_SYS_TYPES_H +| # include +| #endif +| #ifdef HAVE_SYS_STAT_H +| # include +| #endif +| #ifdef STDC_HEADERS +| # include +| # include +| #else +| # ifdef HAVE_STDLIB_H +| # include +| # endif +| #endif +| #ifdef HAVE_STRING_H +| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H +| # include +| # endif +| # include +| #endif +| #ifdef HAVE_STRINGS_H +| # include +| #endif +| #ifdef HAVE_INTTYPES_H +| # include +| #endif +| #ifdef HAVE_STDINT_H +| # include +| #endif +| #ifdef HAVE_UNISTD_H +| # include +| #endif +| enum { N = 8 / 2 - 1 }; +| int +| main () +| { +| static int test_array [1 - 2 * !(0 < (int) (((((int) 1 << N) << N) - 1) * 2 + 1))]; +| test_array [0] = 0 +| +| ; +| return 0; +| } +configure:10951: gcc -c -m32 -O2 -Wall conftest.c >&5 +In file included from /usr/include/stdio.h:28:0, + from conftest.c:27: +/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory +compilation terminated. +configure:10951: $? = 1 +configure: failed program was: +| /* confdefs.h */ +| #define PACKAGE_NAME "libantlr3c" +| #define PACKAGE_TARNAME "libantlr3c" +| #define PACKAGE_VERSION "3.4" +| #define PACKAGE_STRING "libantlr3c 3.4" +| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" +| #define PACKAGE_URL "" +| #define PACKAGE "libantlr3c" +| #define VERSION "3.4" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define HAVE_DLFCN_H 1 +| #define LT_OBJDIR ".libs/" +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_STDARG_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define size_t unsigned int +| /* end confdefs.h. */ +| #include +| #ifdef HAVE_SYS_TYPES_H +| # include +| #endif +| #ifdef HAVE_SYS_STAT_H +| # include +| #endif +| #ifdef STDC_HEADERS +| # include +| # include +| #else +| # ifdef HAVE_STDLIB_H +| # include +| # endif +| #endif +| #ifdef HAVE_STRING_H +| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H +| # include +| # endif +| # include +| #endif +| #ifdef HAVE_STRINGS_H +| # include +| #endif +| #ifdef HAVE_INTTYPES_H +| # include +| #endif +| #ifdef HAVE_STDINT_H +| # include +| #endif +| #ifdef HAVE_UNISTD_H +| # include +| #endif +| enum { N = 8 / 2 - 1 }; +| int +| main () +| { +| static int test_array [1 - 2 * !(0 < (long int) (((((long int) 1 << N) << N) - 1) * 2 + 1))]; +| test_array [0] = 0 +| +| ; +| return 0; +| } +configure:10951: gcc -c -m32 -O2 -Wall conftest.c >&5 +In file included from /usr/include/stdio.h:28:0, + from conftest.c:27: +/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory +compilation terminated. +configure:10951: $? = 1 +configure: failed program was: +| /* confdefs.h */ +| #define PACKAGE_NAME "libantlr3c" +| #define PACKAGE_TARNAME "libantlr3c" +| #define PACKAGE_VERSION "3.4" +| #define PACKAGE_STRING "libantlr3c 3.4" +| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" +| #define PACKAGE_URL "" +| #define PACKAGE "libantlr3c" +| #define VERSION "3.4" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define HAVE_DLFCN_H 1 +| #define LT_OBJDIR ".libs/" +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_STDARG_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define size_t unsigned int +| /* end confdefs.h. */ +| #include +| #ifdef HAVE_SYS_TYPES_H +| # include +| #endif +| #ifdef HAVE_SYS_STAT_H +| # include +| #endif +| #ifdef STDC_HEADERS +| # include +| # include +| #else +| # ifdef HAVE_STDLIB_H +| # include +| # endif +| #endif +| #ifdef HAVE_STRING_H +| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H +| # include +| # endif +| # include +| #endif +| #ifdef HAVE_STRINGS_H +| # include +| #endif +| #ifdef HAVE_INTTYPES_H +| # include +| #endif +| #ifdef HAVE_STDINT_H +| # include +| #endif +| #ifdef HAVE_UNISTD_H +| # include +| #endif +| enum { N = 8 / 2 - 1 }; +| int +| main () +| { +| static int test_array [1 - 2 * !(0 < (long long int) (((((long long int) 1 << N) << N) - 1) * 2 + 1))]; +| test_array [0] = 0 +| +| ; +| return 0; +| } +configure:10951: gcc -c -m32 -O2 -Wall conftest.c >&5 +In file included from /usr/include/stdio.h:28:0, + from conftest.c:27: +/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory +compilation terminated. +configure:10951: $? = 1 +configure: failed program was: +| /* confdefs.h */ +| #define PACKAGE_NAME "libantlr3c" +| #define PACKAGE_TARNAME "libantlr3c" +| #define PACKAGE_VERSION "3.4" +| #define PACKAGE_STRING "libantlr3c 3.4" +| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" +| #define PACKAGE_URL "" +| #define PACKAGE "libantlr3c" +| #define VERSION "3.4" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define HAVE_DLFCN_H 1 +| #define LT_OBJDIR ".libs/" +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_STDARG_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define size_t unsigned int +| /* end confdefs.h. */ +| #include +| #ifdef HAVE_SYS_TYPES_H +| # include +| #endif +| #ifdef HAVE_SYS_STAT_H +| # include +| #endif +| #ifdef STDC_HEADERS +| # include +| # include +| #else +| # ifdef HAVE_STDLIB_H +| # include +| # endif +| #endif +| #ifdef HAVE_STRING_H +| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H +| # include +| # endif +| # include +| #endif +| #ifdef HAVE_STRINGS_H +| # include +| #endif +| #ifdef HAVE_INTTYPES_H +| # include +| #endif +| #ifdef HAVE_STDINT_H +| # include +| #endif +| #ifdef HAVE_UNISTD_H +| # include +| #endif +| enum { N = 8 / 2 - 1 }; +| int +| main () +| { +| static int test_array [1 - 2 * !(0 < (short int) (((((short int) 1 << N) << N) - 1) * 2 + 1))]; +| test_array [0] = 0 +| +| ; +| return 0; +| } +configure:10951: gcc -c -m32 -O2 -Wall conftest.c >&5 +In file included from /usr/include/stdio.h:28:0, + from conftest.c:27: +/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory +compilation terminated. +configure:10951: $? = 1 +configure: failed program was: +| /* confdefs.h */ +| #define PACKAGE_NAME "libantlr3c" +| #define PACKAGE_TARNAME "libantlr3c" +| #define PACKAGE_VERSION "3.4" +| #define PACKAGE_STRING "libantlr3c 3.4" +| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" +| #define PACKAGE_URL "" +| #define PACKAGE "libantlr3c" +| #define VERSION "3.4" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define HAVE_DLFCN_H 1 +| #define LT_OBJDIR ".libs/" +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_STDARG_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define size_t unsigned int +| /* end confdefs.h. */ +| #include +| #ifdef HAVE_SYS_TYPES_H +| # include +| #endif +| #ifdef HAVE_SYS_STAT_H +| # include +| #endif +| #ifdef STDC_HEADERS +| # include +| # include +| #else +| # ifdef HAVE_STDLIB_H +| # include +| # endif +| #endif +| #ifdef HAVE_STRING_H +| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H +| # include +| # endif +| # include +| #endif +| #ifdef HAVE_STRINGS_H +| # include +| #endif +| #ifdef HAVE_INTTYPES_H +| # include +| #endif +| #ifdef HAVE_STDINT_H +| # include +| #endif +| #ifdef HAVE_UNISTD_H +| # include +| #endif +| enum { N = 8 / 2 - 1 }; +| int +| main () +| { +| static int test_array [1 - 2 * !(0 < (signed char) (((((signed char) 1 << N) << N) - 1) * 2 + 1))]; +| test_array [0] = 0 +| +| ; +| return 0; +| } +configure:10951: result: no +configure:10962: checking for int16_t +configure:10962: gcc -c -m32 -O2 -Wall conftest.c >&5 +In file included from /usr/include/stdio.h:28:0, + from conftest.c:27: +/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory +compilation terminated. +configure:10962: $? = 1 +configure: failed program was: +| /* confdefs.h */ +| #define PACKAGE_NAME "libantlr3c" +| #define PACKAGE_TARNAME "libantlr3c" +| #define PACKAGE_VERSION "3.4" +| #define PACKAGE_STRING "libantlr3c 3.4" +| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" +| #define PACKAGE_URL "" +| #define PACKAGE "libantlr3c" +| #define VERSION "3.4" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define HAVE_DLFCN_H 1 +| #define LT_OBJDIR ".libs/" +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_STDARG_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define size_t unsigned int +| /* end confdefs.h. */ +| #include +| #ifdef HAVE_SYS_TYPES_H +| # include +| #endif +| #ifdef HAVE_SYS_STAT_H +| # include +| #endif +| #ifdef STDC_HEADERS +| # include +| # include +| #else +| # ifdef HAVE_STDLIB_H +| # include +| # endif +| #endif +| #ifdef HAVE_STRING_H +| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H +| # include +| # endif +| # include +| #endif +| #ifdef HAVE_STRINGS_H +| # include +| #endif +| #ifdef HAVE_INTTYPES_H +| # include +| #endif +| #ifdef HAVE_STDINT_H +| # include +| #endif +| #ifdef HAVE_UNISTD_H +| # include +| #endif +| enum { N = 16 / 2 - 1 }; +| int +| main () +| { +| static int test_array [1 - 2 * !(0 < (int16_t) (((((int16_t) 1 << N) << N) - 1) * 2 + 1))]; +| test_array [0] = 0 +| +| ; +| return 0; +| } +configure:10962: gcc -c -m32 -O2 -Wall conftest.c >&5 +In file included from /usr/include/stdio.h:28:0, + from conftest.c:27: +/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory +compilation terminated. +configure:10962: $? = 1 +configure: failed program was: +| /* confdefs.h */ +| #define PACKAGE_NAME "libantlr3c" +| #define PACKAGE_TARNAME "libantlr3c" +| #define PACKAGE_VERSION "3.4" +| #define PACKAGE_STRING "libantlr3c 3.4" +| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" +| #define PACKAGE_URL "" +| #define PACKAGE "libantlr3c" +| #define VERSION "3.4" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define HAVE_DLFCN_H 1 +| #define LT_OBJDIR ".libs/" +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_STDARG_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define size_t unsigned int +| /* end confdefs.h. */ +| #include +| #ifdef HAVE_SYS_TYPES_H +| # include +| #endif +| #ifdef HAVE_SYS_STAT_H +| # include +| #endif +| #ifdef STDC_HEADERS +| # include +| # include +| #else +| # ifdef HAVE_STDLIB_H +| # include +| # endif +| #endif +| #ifdef HAVE_STRING_H +| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H +| # include +| # endif +| # include +| #endif +| #ifdef HAVE_STRINGS_H +| # include +| #endif +| #ifdef HAVE_INTTYPES_H +| # include +| #endif +| #ifdef HAVE_STDINT_H +| # include +| #endif +| #ifdef HAVE_UNISTD_H +| # include +| #endif +| enum { N = 16 / 2 - 1 }; +| int +| main () +| { +| static int test_array [1 - 2 * !(0 < (int) (((((int) 1 << N) << N) - 1) * 2 + 1))]; +| test_array [0] = 0 +| +| ; +| return 0; +| } +configure:10962: gcc -c -m32 -O2 -Wall conftest.c >&5 +In file included from /usr/include/stdio.h:28:0, + from conftest.c:27: +/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory +compilation terminated. +configure:10962: $? = 1 +configure: failed program was: +| /* confdefs.h */ +| #define PACKAGE_NAME "libantlr3c" +| #define PACKAGE_TARNAME "libantlr3c" +| #define PACKAGE_VERSION "3.4" +| #define PACKAGE_STRING "libantlr3c 3.4" +| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" +| #define PACKAGE_URL "" +| #define PACKAGE "libantlr3c" +| #define VERSION "3.4" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define HAVE_DLFCN_H 1 +| #define LT_OBJDIR ".libs/" +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_STDARG_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define size_t unsigned int +| /* end confdefs.h. */ +| #include +| #ifdef HAVE_SYS_TYPES_H +| # include +| #endif +| #ifdef HAVE_SYS_STAT_H +| # include +| #endif +| #ifdef STDC_HEADERS +| # include +| # include +| #else +| # ifdef HAVE_STDLIB_H +| # include +| # endif +| #endif +| #ifdef HAVE_STRING_H +| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H +| # include +| # endif +| # include +| #endif +| #ifdef HAVE_STRINGS_H +| # include +| #endif +| #ifdef HAVE_INTTYPES_H +| # include +| #endif +| #ifdef HAVE_STDINT_H +| # include +| #endif +| #ifdef HAVE_UNISTD_H +| # include +| #endif +| enum { N = 16 / 2 - 1 }; +| int +| main () +| { +| static int test_array [1 - 2 * !(0 < (long int) (((((long int) 1 << N) << N) - 1) * 2 + 1))]; +| test_array [0] = 0 +| +| ; +| return 0; +| } +configure:10962: gcc -c -m32 -O2 -Wall conftest.c >&5 +In file included from /usr/include/stdio.h:28:0, + from conftest.c:27: +/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory +compilation terminated. +configure:10962: $? = 1 +configure: failed program was: +| /* confdefs.h */ +| #define PACKAGE_NAME "libantlr3c" +| #define PACKAGE_TARNAME "libantlr3c" +| #define PACKAGE_VERSION "3.4" +| #define PACKAGE_STRING "libantlr3c 3.4" +| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" +| #define PACKAGE_URL "" +| #define PACKAGE "libantlr3c" +| #define VERSION "3.4" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define HAVE_DLFCN_H 1 +| #define LT_OBJDIR ".libs/" +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_STDARG_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define size_t unsigned int +| /* end confdefs.h. */ +| #include +| #ifdef HAVE_SYS_TYPES_H +| # include +| #endif +| #ifdef HAVE_SYS_STAT_H +| # include +| #endif +| #ifdef STDC_HEADERS +| # include +| # include +| #else +| # ifdef HAVE_STDLIB_H +| # include +| # endif +| #endif +| #ifdef HAVE_STRING_H +| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H +| # include +| # endif +| # include +| #endif +| #ifdef HAVE_STRINGS_H +| # include +| #endif +| #ifdef HAVE_INTTYPES_H +| # include +| #endif +| #ifdef HAVE_STDINT_H +| # include +| #endif +| #ifdef HAVE_UNISTD_H +| # include +| #endif +| enum { N = 16 / 2 - 1 }; +| int +| main () +| { +| static int test_array [1 - 2 * !(0 < (long long int) (((((long long int) 1 << N) << N) - 1) * 2 + 1))]; +| test_array [0] = 0 +| +| ; +| return 0; +| } +configure:10962: gcc -c -m32 -O2 -Wall conftest.c >&5 +In file included from /usr/include/stdio.h:28:0, + from conftest.c:27: +/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory +compilation terminated. +configure:10962: $? = 1 +configure: failed program was: +| /* confdefs.h */ +| #define PACKAGE_NAME "libantlr3c" +| #define PACKAGE_TARNAME "libantlr3c" +| #define PACKAGE_VERSION "3.4" +| #define PACKAGE_STRING "libantlr3c 3.4" +| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" +| #define PACKAGE_URL "" +| #define PACKAGE "libantlr3c" +| #define VERSION "3.4" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define HAVE_DLFCN_H 1 +| #define LT_OBJDIR ".libs/" +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_STDARG_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define size_t unsigned int +| /* end confdefs.h. */ +| #include +| #ifdef HAVE_SYS_TYPES_H +| # include +| #endif +| #ifdef HAVE_SYS_STAT_H +| # include +| #endif +| #ifdef STDC_HEADERS +| # include +| # include +| #else +| # ifdef HAVE_STDLIB_H +| # include +| # endif +| #endif +| #ifdef HAVE_STRING_H +| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H +| # include +| # endif +| # include +| #endif +| #ifdef HAVE_STRINGS_H +| # include +| #endif +| #ifdef HAVE_INTTYPES_H +| # include +| #endif +| #ifdef HAVE_STDINT_H +| # include +| #endif +| #ifdef HAVE_UNISTD_H +| # include +| #endif +| enum { N = 16 / 2 - 1 }; +| int +| main () +| { +| static int test_array [1 - 2 * !(0 < (short int) (((((short int) 1 << N) << N) - 1) * 2 + 1))]; +| test_array [0] = 0 +| +| ; +| return 0; +| } +configure:10962: gcc -c -m32 -O2 -Wall conftest.c >&5 +In file included from /usr/include/stdio.h:28:0, + from conftest.c:27: +/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory +compilation terminated. +configure:10962: $? = 1 +configure: failed program was: +| /* confdefs.h */ +| #define PACKAGE_NAME "libantlr3c" +| #define PACKAGE_TARNAME "libantlr3c" +| #define PACKAGE_VERSION "3.4" +| #define PACKAGE_STRING "libantlr3c 3.4" +| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" +| #define PACKAGE_URL "" +| #define PACKAGE "libantlr3c" +| #define VERSION "3.4" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define HAVE_DLFCN_H 1 +| #define LT_OBJDIR ".libs/" +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_STDARG_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define size_t unsigned int +| /* end confdefs.h. */ +| #include +| #ifdef HAVE_SYS_TYPES_H +| # include +| #endif +| #ifdef HAVE_SYS_STAT_H +| # include +| #endif +| #ifdef STDC_HEADERS +| # include +| # include +| #else +| # ifdef HAVE_STDLIB_H +| # include +| # endif +| #endif +| #ifdef HAVE_STRING_H +| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H +| # include +| # endif +| # include +| #endif +| #ifdef HAVE_STRINGS_H +| # include +| #endif +| #ifdef HAVE_INTTYPES_H +| # include +| #endif +| #ifdef HAVE_STDINT_H +| # include +| #endif +| #ifdef HAVE_UNISTD_H +| # include +| #endif +| enum { N = 16 / 2 - 1 }; +| int +| main () +| { +| static int test_array [1 - 2 * !(0 < (signed char) (((((signed char) 1 << N) << N) - 1) * 2 + 1))]; +| test_array [0] = 0 +| +| ; +| return 0; +| } +configure:10962: result: no +configure:10973: checking for int32_t +configure:10973: gcc -c -m32 -O2 -Wall conftest.c >&5 +In file included from /usr/include/stdio.h:28:0, + from conftest.c:27: +/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory +compilation terminated. +configure:10973: $? = 1 +configure: failed program was: +| /* confdefs.h */ +| #define PACKAGE_NAME "libantlr3c" +| #define PACKAGE_TARNAME "libantlr3c" +| #define PACKAGE_VERSION "3.4" +| #define PACKAGE_STRING "libantlr3c 3.4" +| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" +| #define PACKAGE_URL "" +| #define PACKAGE "libantlr3c" +| #define VERSION "3.4" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define HAVE_DLFCN_H 1 +| #define LT_OBJDIR ".libs/" +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_STDARG_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define size_t unsigned int +| /* end confdefs.h. */ +| #include +| #ifdef HAVE_SYS_TYPES_H +| # include +| #endif +| #ifdef HAVE_SYS_STAT_H +| # include +| #endif +| #ifdef STDC_HEADERS +| # include +| # include +| #else +| # ifdef HAVE_STDLIB_H +| # include +| # endif +| #endif +| #ifdef HAVE_STRING_H +| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H +| # include +| # endif +| # include +| #endif +| #ifdef HAVE_STRINGS_H +| # include +| #endif +| #ifdef HAVE_INTTYPES_H +| # include +| #endif +| #ifdef HAVE_STDINT_H +| # include +| #endif +| #ifdef HAVE_UNISTD_H +| # include +| #endif +| enum { N = 32 / 2 - 1 }; +| int +| main () +| { +| static int test_array [1 - 2 * !(0 < (int32_t) (((((int32_t) 1 << N) << N) - 1) * 2 + 1))]; +| test_array [0] = 0 +| +| ; +| return 0; +| } +configure:10973: gcc -c -m32 -O2 -Wall conftest.c >&5 +In file included from /usr/include/stdio.h:28:0, + from conftest.c:27: +/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory +compilation terminated. +configure:10973: $? = 1 +configure: failed program was: +| /* confdefs.h */ +| #define PACKAGE_NAME "libantlr3c" +| #define PACKAGE_TARNAME "libantlr3c" +| #define PACKAGE_VERSION "3.4" +| #define PACKAGE_STRING "libantlr3c 3.4" +| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" +| #define PACKAGE_URL "" +| #define PACKAGE "libantlr3c" +| #define VERSION "3.4" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define HAVE_DLFCN_H 1 +| #define LT_OBJDIR ".libs/" +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_STDARG_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define size_t unsigned int +| /* end confdefs.h. */ +| #include +| #ifdef HAVE_SYS_TYPES_H +| # include +| #endif +| #ifdef HAVE_SYS_STAT_H +| # include +| #endif +| #ifdef STDC_HEADERS +| # include +| # include +| #else +| # ifdef HAVE_STDLIB_H +| # include +| # endif +| #endif +| #ifdef HAVE_STRING_H +| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H +| # include +| # endif +| # include +| #endif +| #ifdef HAVE_STRINGS_H +| # include +| #endif +| #ifdef HAVE_INTTYPES_H +| # include +| #endif +| #ifdef HAVE_STDINT_H +| # include +| #endif +| #ifdef HAVE_UNISTD_H +| # include +| #endif +| enum { N = 32 / 2 - 1 }; +| int +| main () +| { +| static int test_array [1 - 2 * !(0 < (int) (((((int) 1 << N) << N) - 1) * 2 + 1))]; +| test_array [0] = 0 +| +| ; +| return 0; +| } +configure:10973: gcc -c -m32 -O2 -Wall conftest.c >&5 +In file included from /usr/include/stdio.h:28:0, + from conftest.c:27: +/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory +compilation terminated. +configure:10973: $? = 1 +configure: failed program was: +| /* confdefs.h */ +| #define PACKAGE_NAME "libantlr3c" +| #define PACKAGE_TARNAME "libantlr3c" +| #define PACKAGE_VERSION "3.4" +| #define PACKAGE_STRING "libantlr3c 3.4" +| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" +| #define PACKAGE_URL "" +| #define PACKAGE "libantlr3c" +| #define VERSION "3.4" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define HAVE_DLFCN_H 1 +| #define LT_OBJDIR ".libs/" +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_STDARG_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define size_t unsigned int +| /* end confdefs.h. */ +| #include +| #ifdef HAVE_SYS_TYPES_H +| # include +| #endif +| #ifdef HAVE_SYS_STAT_H +| # include +| #endif +| #ifdef STDC_HEADERS +| # include +| # include +| #else +| # ifdef HAVE_STDLIB_H +| # include +| # endif +| #endif +| #ifdef HAVE_STRING_H +| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H +| # include +| # endif +| # include +| #endif +| #ifdef HAVE_STRINGS_H +| # include +| #endif +| #ifdef HAVE_INTTYPES_H +| # include +| #endif +| #ifdef HAVE_STDINT_H +| # include +| #endif +| #ifdef HAVE_UNISTD_H +| # include +| #endif +| enum { N = 32 / 2 - 1 }; +| int +| main () +| { +| static int test_array [1 - 2 * !(0 < (long int) (((((long int) 1 << N) << N) - 1) * 2 + 1))]; +| test_array [0] = 0 +| +| ; +| return 0; +| } +configure:10973: gcc -c -m32 -O2 -Wall conftest.c >&5 +In file included from /usr/include/stdio.h:28:0, + from conftest.c:27: +/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory +compilation terminated. +configure:10973: $? = 1 +configure: failed program was: +| /* confdefs.h */ +| #define PACKAGE_NAME "libantlr3c" +| #define PACKAGE_TARNAME "libantlr3c" +| #define PACKAGE_VERSION "3.4" +| #define PACKAGE_STRING "libantlr3c 3.4" +| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" +| #define PACKAGE_URL "" +| #define PACKAGE "libantlr3c" +| #define VERSION "3.4" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define HAVE_DLFCN_H 1 +| #define LT_OBJDIR ".libs/" +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_STDARG_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define size_t unsigned int +| /* end confdefs.h. */ +| #include +| #ifdef HAVE_SYS_TYPES_H +| # include +| #endif +| #ifdef HAVE_SYS_STAT_H +| # include +| #endif +| #ifdef STDC_HEADERS +| # include +| # include +| #else +| # ifdef HAVE_STDLIB_H +| # include +| # endif +| #endif +| #ifdef HAVE_STRING_H +| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H +| # include +| # endif +| # include +| #endif +| #ifdef HAVE_STRINGS_H +| # include +| #endif +| #ifdef HAVE_INTTYPES_H +| # include +| #endif +| #ifdef HAVE_STDINT_H +| # include +| #endif +| #ifdef HAVE_UNISTD_H +| # include +| #endif +| enum { N = 32 / 2 - 1 }; +| int +| main () +| { +| static int test_array [1 - 2 * !(0 < (long long int) (((((long long int) 1 << N) << N) - 1) * 2 + 1))]; +| test_array [0] = 0 +| +| ; +| return 0; +| } +configure:10973: gcc -c -m32 -O2 -Wall conftest.c >&5 +In file included from /usr/include/stdio.h:28:0, + from conftest.c:27: +/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory +compilation terminated. +configure:10973: $? = 1 +configure: failed program was: +| /* confdefs.h */ +| #define PACKAGE_NAME "libantlr3c" +| #define PACKAGE_TARNAME "libantlr3c" +| #define PACKAGE_VERSION "3.4" +| #define PACKAGE_STRING "libantlr3c 3.4" +| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" +| #define PACKAGE_URL "" +| #define PACKAGE "libantlr3c" +| #define VERSION "3.4" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define HAVE_DLFCN_H 1 +| #define LT_OBJDIR ".libs/" +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_STDARG_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define size_t unsigned int +| /* end confdefs.h. */ +| #include +| #ifdef HAVE_SYS_TYPES_H +| # include +| #endif +| #ifdef HAVE_SYS_STAT_H +| # include +| #endif +| #ifdef STDC_HEADERS +| # include +| # include +| #else +| # ifdef HAVE_STDLIB_H +| # include +| # endif +| #endif +| #ifdef HAVE_STRING_H +| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H +| # include +| # endif +| # include +| #endif +| #ifdef HAVE_STRINGS_H +| # include +| #endif +| #ifdef HAVE_INTTYPES_H +| # include +| #endif +| #ifdef HAVE_STDINT_H +| # include +| #endif +| #ifdef HAVE_UNISTD_H +| # include +| #endif +| enum { N = 32 / 2 - 1 }; +| int +| main () +| { +| static int test_array [1 - 2 * !(0 < (short int) (((((short int) 1 << N) << N) - 1) * 2 + 1))]; +| test_array [0] = 0 +| +| ; +| return 0; +| } +configure:10973: gcc -c -m32 -O2 -Wall conftest.c >&5 +In file included from /usr/include/stdio.h:28:0, + from conftest.c:27: +/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory +compilation terminated. +configure:10973: $? = 1 +configure: failed program was: +| /* confdefs.h */ +| #define PACKAGE_NAME "libantlr3c" +| #define PACKAGE_TARNAME "libantlr3c" +| #define PACKAGE_VERSION "3.4" +| #define PACKAGE_STRING "libantlr3c 3.4" +| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" +| #define PACKAGE_URL "" +| #define PACKAGE "libantlr3c" +| #define VERSION "3.4" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define HAVE_DLFCN_H 1 +| #define LT_OBJDIR ".libs/" +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_STDARG_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define size_t unsigned int +| /* end confdefs.h. */ +| #include +| #ifdef HAVE_SYS_TYPES_H +| # include +| #endif +| #ifdef HAVE_SYS_STAT_H +| # include +| #endif +| #ifdef STDC_HEADERS +| # include +| # include +| #else +| # ifdef HAVE_STDLIB_H +| # include +| # endif +| #endif +| #ifdef HAVE_STRING_H +| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H +| # include +| # endif +| # include +| #endif +| #ifdef HAVE_STRINGS_H +| # include +| #endif +| #ifdef HAVE_INTTYPES_H +| # include +| #endif +| #ifdef HAVE_STDINT_H +| # include +| #endif +| #ifdef HAVE_UNISTD_H +| # include +| #endif +| enum { N = 32 / 2 - 1 }; +| int +| main () +| { +| static int test_array [1 - 2 * !(0 < (signed char) (((((signed char) 1 << N) << N) - 1) * 2 + 1))]; +| test_array [0] = 0 +| +| ; +| return 0; +| } +configure:10973: result: no +configure:10984: checking for int64_t +configure:10984: gcc -c -m32 -O2 -Wall conftest.c >&5 +In file included from /usr/include/stdio.h:28:0, + from conftest.c:27: +/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory +compilation terminated. +configure:10984: $? = 1 +configure: failed program was: +| /* confdefs.h */ +| #define PACKAGE_NAME "libantlr3c" +| #define PACKAGE_TARNAME "libantlr3c" +| #define PACKAGE_VERSION "3.4" +| #define PACKAGE_STRING "libantlr3c 3.4" +| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" +| #define PACKAGE_URL "" +| #define PACKAGE "libantlr3c" +| #define VERSION "3.4" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define HAVE_DLFCN_H 1 +| #define LT_OBJDIR ".libs/" +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_STDARG_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define size_t unsigned int +| /* end confdefs.h. */ +| #include +| #ifdef HAVE_SYS_TYPES_H +| # include +| #endif +| #ifdef HAVE_SYS_STAT_H +| # include +| #endif +| #ifdef STDC_HEADERS +| # include +| # include +| #else +| # ifdef HAVE_STDLIB_H +| # include +| # endif +| #endif +| #ifdef HAVE_STRING_H +| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H +| # include +| # endif +| # include +| #endif +| #ifdef HAVE_STRINGS_H +| # include +| #endif +| #ifdef HAVE_INTTYPES_H +| # include +| #endif +| #ifdef HAVE_STDINT_H +| # include +| #endif +| #ifdef HAVE_UNISTD_H +| # include +| #endif +| enum { N = 64 / 2 - 1 }; +| int +| main () +| { +| static int test_array [1 - 2 * !(0 < (int64_t) (((((int64_t) 1 << N) << N) - 1) * 2 + 1))]; +| test_array [0] = 0 +| +| ; +| return 0; +| } +configure:10984: gcc -c -m32 -O2 -Wall conftest.c >&5 +In file included from /usr/include/stdio.h:28:0, + from conftest.c:27: +/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory +compilation terminated. +configure:10984: $? = 1 +configure: failed program was: +| /* confdefs.h */ +| #define PACKAGE_NAME "libantlr3c" +| #define PACKAGE_TARNAME "libantlr3c" +| #define PACKAGE_VERSION "3.4" +| #define PACKAGE_STRING "libantlr3c 3.4" +| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" +| #define PACKAGE_URL "" +| #define PACKAGE "libantlr3c" +| #define VERSION "3.4" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define HAVE_DLFCN_H 1 +| #define LT_OBJDIR ".libs/" +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_STDARG_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define size_t unsigned int +| /* end confdefs.h. */ +| #include +| #ifdef HAVE_SYS_TYPES_H +| # include +| #endif +| #ifdef HAVE_SYS_STAT_H +| # include +| #endif +| #ifdef STDC_HEADERS +| # include +| # include +| #else +| # ifdef HAVE_STDLIB_H +| # include +| # endif +| #endif +| #ifdef HAVE_STRING_H +| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H +| # include +| # endif +| # include +| #endif +| #ifdef HAVE_STRINGS_H +| # include +| #endif +| #ifdef HAVE_INTTYPES_H +| # include +| #endif +| #ifdef HAVE_STDINT_H +| # include +| #endif +| #ifdef HAVE_UNISTD_H +| # include +| #endif +| enum { N = 64 / 2 - 1 }; +| int +| main () +| { +| static int test_array [1 - 2 * !(0 < (int) (((((int) 1 << N) << N) - 1) * 2 + 1))]; +| test_array [0] = 0 +| +| ; +| return 0; +| } +configure:10984: gcc -c -m32 -O2 -Wall conftest.c >&5 +In file included from /usr/include/stdio.h:28:0, + from conftest.c:27: +/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory +compilation terminated. +configure:10984: $? = 1 +configure: failed program was: +| /* confdefs.h */ +| #define PACKAGE_NAME "libantlr3c" +| #define PACKAGE_TARNAME "libantlr3c" +| #define PACKAGE_VERSION "3.4" +| #define PACKAGE_STRING "libantlr3c 3.4" +| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" +| #define PACKAGE_URL "" +| #define PACKAGE "libantlr3c" +| #define VERSION "3.4" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define HAVE_DLFCN_H 1 +| #define LT_OBJDIR ".libs/" +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_STDARG_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define size_t unsigned int +| /* end confdefs.h. */ +| #include +| #ifdef HAVE_SYS_TYPES_H +| # include +| #endif +| #ifdef HAVE_SYS_STAT_H +| # include +| #endif +| #ifdef STDC_HEADERS +| # include +| # include +| #else +| # ifdef HAVE_STDLIB_H +| # include +| # endif +| #endif +| #ifdef HAVE_STRING_H +| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H +| # include +| # endif +| # include +| #endif +| #ifdef HAVE_STRINGS_H +| # include +| #endif +| #ifdef HAVE_INTTYPES_H +| # include +| #endif +| #ifdef HAVE_STDINT_H +| # include +| #endif +| #ifdef HAVE_UNISTD_H +| # include +| #endif +| enum { N = 64 / 2 - 1 }; +| int +| main () +| { +| static int test_array [1 - 2 * !(0 < (long int) (((((long int) 1 << N) << N) - 1) * 2 + 1))]; +| test_array [0] = 0 +| +| ; +| return 0; +| } +configure:10984: gcc -c -m32 -O2 -Wall conftest.c >&5 +In file included from /usr/include/stdio.h:28:0, + from conftest.c:27: +/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory +compilation terminated. +configure:10984: $? = 1 +configure: failed program was: +| /* confdefs.h */ +| #define PACKAGE_NAME "libantlr3c" +| #define PACKAGE_TARNAME "libantlr3c" +| #define PACKAGE_VERSION "3.4" +| #define PACKAGE_STRING "libantlr3c 3.4" +| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" +| #define PACKAGE_URL "" +| #define PACKAGE "libantlr3c" +| #define VERSION "3.4" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define HAVE_DLFCN_H 1 +| #define LT_OBJDIR ".libs/" +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_STDARG_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define size_t unsigned int +| /* end confdefs.h. */ +| #include +| #ifdef HAVE_SYS_TYPES_H +| # include +| #endif +| #ifdef HAVE_SYS_STAT_H +| # include +| #endif +| #ifdef STDC_HEADERS +| # include +| # include +| #else +| # ifdef HAVE_STDLIB_H +| # include +| # endif +| #endif +| #ifdef HAVE_STRING_H +| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H +| # include +| # endif +| # include +| #endif +| #ifdef HAVE_STRINGS_H +| # include +| #endif +| #ifdef HAVE_INTTYPES_H +| # include +| #endif +| #ifdef HAVE_STDINT_H +| # include +| #endif +| #ifdef HAVE_UNISTD_H +| # include +| #endif +| enum { N = 64 / 2 - 1 }; +| int +| main () +| { +| static int test_array [1 - 2 * !(0 < (long long int) (((((long long int) 1 << N) << N) - 1) * 2 + 1))]; +| test_array [0] = 0 +| +| ; +| return 0; +| } +configure:10984: gcc -c -m32 -O2 -Wall conftest.c >&5 +In file included from /usr/include/stdio.h:28:0, + from conftest.c:27: +/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory +compilation terminated. +configure:10984: $? = 1 +configure: failed program was: +| /* confdefs.h */ +| #define PACKAGE_NAME "libantlr3c" +| #define PACKAGE_TARNAME "libantlr3c" +| #define PACKAGE_VERSION "3.4" +| #define PACKAGE_STRING "libantlr3c 3.4" +| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" +| #define PACKAGE_URL "" +| #define PACKAGE "libantlr3c" +| #define VERSION "3.4" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define HAVE_DLFCN_H 1 +| #define LT_OBJDIR ".libs/" +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_STDARG_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define size_t unsigned int +| /* end confdefs.h. */ +| #include +| #ifdef HAVE_SYS_TYPES_H +| # include +| #endif +| #ifdef HAVE_SYS_STAT_H +| # include +| #endif +| #ifdef STDC_HEADERS +| # include +| # include +| #else +| # ifdef HAVE_STDLIB_H +| # include +| # endif +| #endif +| #ifdef HAVE_STRING_H +| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H +| # include +| # endif +| # include +| #endif +| #ifdef HAVE_STRINGS_H +| # include +| #endif +| #ifdef HAVE_INTTYPES_H +| # include +| #endif +| #ifdef HAVE_STDINT_H +| # include +| #endif +| #ifdef HAVE_UNISTD_H +| # include +| #endif +| enum { N = 64 / 2 - 1 }; +| int +| main () +| { +| static int test_array [1 - 2 * !(0 < (short int) (((((short int) 1 << N) << N) - 1) * 2 + 1))]; +| test_array [0] = 0 +| +| ; +| return 0; +| } +configure:10984: gcc -c -m32 -O2 -Wall conftest.c >&5 +In file included from /usr/include/stdio.h:28:0, + from conftest.c:27: +/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory +compilation terminated. +configure:10984: $? = 1 +configure: failed program was: +| /* confdefs.h */ +| #define PACKAGE_NAME "libantlr3c" +| #define PACKAGE_TARNAME "libantlr3c" +| #define PACKAGE_VERSION "3.4" +| #define PACKAGE_STRING "libantlr3c 3.4" +| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" +| #define PACKAGE_URL "" +| #define PACKAGE "libantlr3c" +| #define VERSION "3.4" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define HAVE_DLFCN_H 1 +| #define LT_OBJDIR ".libs/" +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_STDARG_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define size_t unsigned int +| /* end confdefs.h. */ +| #include +| #ifdef HAVE_SYS_TYPES_H +| # include +| #endif +| #ifdef HAVE_SYS_STAT_H +| # include +| #endif +| #ifdef STDC_HEADERS +| # include +| # include +| #else +| # ifdef HAVE_STDLIB_H +| # include +| # endif +| #endif +| #ifdef HAVE_STRING_H +| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H +| # include +| # endif +| # include +| #endif +| #ifdef HAVE_STRINGS_H +| # include +| #endif +| #ifdef HAVE_INTTYPES_H +| # include +| #endif +| #ifdef HAVE_STDINT_H +| # include +| #endif +| #ifdef HAVE_UNISTD_H +| # include +| #endif +| enum { N = 64 / 2 - 1 }; +| int +| main () +| { +| static int test_array [1 - 2 * !(0 < (signed char) (((((signed char) 1 << N) << N) - 1) * 2 + 1))]; +| test_array [0] = 0 +| +| ; +| return 0; +| } +configure:10984: result: no +configure:10996: checking for intptr_t +configure:10996: gcc -c -m32 -O2 -Wall conftest.c >&5 +In file included from /usr/include/stdio.h:28:0, + from conftest.c:27: +/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory +compilation terminated. +configure:10996: $? = 1 +configure: failed program was: +| /* confdefs.h */ +| #define PACKAGE_NAME "libantlr3c" +| #define PACKAGE_TARNAME "libantlr3c" +| #define PACKAGE_VERSION "3.4" +| #define PACKAGE_STRING "libantlr3c 3.4" +| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" +| #define PACKAGE_URL "" +| #define PACKAGE "libantlr3c" +| #define VERSION "3.4" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define HAVE_DLFCN_H 1 +| #define LT_OBJDIR ".libs/" +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_STDARG_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define size_t unsigned int +| /* end confdefs.h. */ +| #include +| #ifdef HAVE_SYS_TYPES_H +| # include +| #endif +| #ifdef HAVE_SYS_STAT_H +| # include +| #endif +| #ifdef STDC_HEADERS +| # include +| # include +| #else +| # ifdef HAVE_STDLIB_H +| # include +| # endif +| #endif +| #ifdef HAVE_STRING_H +| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H +| # include +| # endif +| # include +| #endif +| #ifdef HAVE_STRINGS_H +| # include +| #endif +| #ifdef HAVE_INTTYPES_H +| # include +| #endif +| #ifdef HAVE_STDINT_H +| # include +| #endif +| #ifdef HAVE_UNISTD_H +| # include +| #endif +| int +| main () +| { +| if (sizeof (intptr_t)) +| return 0; +| ; +| return 0; +| } +configure:10996: result: no +configure:11016: gcc -c -m32 -O2 -Wall conftest.c >&5 +In file included from /usr/include/stdio.h:28:0, + from conftest.c:27: +/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory +compilation terminated. +configure:11016: $? = 1 +configure: failed program was: +| /* confdefs.h */ +| #define PACKAGE_NAME "libantlr3c" +| #define PACKAGE_TARNAME "libantlr3c" +| #define PACKAGE_VERSION "3.4" +| #define PACKAGE_STRING "libantlr3c 3.4" +| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" +| #define PACKAGE_URL "" +| #define PACKAGE "libantlr3c" +| #define VERSION "3.4" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define HAVE_DLFCN_H 1 +| #define LT_OBJDIR ".libs/" +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_STDARG_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define size_t unsigned int +| /* end confdefs.h. */ +| #include +| #ifdef HAVE_SYS_TYPES_H +| # include +| #endif +| #ifdef HAVE_SYS_STAT_H +| # include +| #endif +| #ifdef STDC_HEADERS +| # include +| # include +| #else +| # ifdef HAVE_STDLIB_H +| # include +| # endif +| #endif +| #ifdef HAVE_STRING_H +| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H +| # include +| # endif +| # include +| #endif +| #ifdef HAVE_STRINGS_H +| # include +| #endif +| #ifdef HAVE_INTTYPES_H +| # include +| #endif +| #ifdef HAVE_STDINT_H +| # include +| #endif +| #ifdef HAVE_UNISTD_H +| # include +| #endif +| int +| main () +| { +| static int test_array [1 - 2 * !(sizeof (void *) <= sizeof (int))]; +| test_array [0] = 0 +| +| ; +| return 0; +| } +configure:11016: gcc -c -m32 -O2 -Wall conftest.c >&5 +In file included from /usr/include/stdio.h:28:0, + from conftest.c:27: +/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory +compilation terminated. +configure:11016: $? = 1 +configure: failed program was: +| /* confdefs.h */ +| #define PACKAGE_NAME "libantlr3c" +| #define PACKAGE_TARNAME "libantlr3c" +| #define PACKAGE_VERSION "3.4" +| #define PACKAGE_STRING "libantlr3c 3.4" +| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" +| #define PACKAGE_URL "" +| #define PACKAGE "libantlr3c" +| #define VERSION "3.4" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define HAVE_DLFCN_H 1 +| #define LT_OBJDIR ".libs/" +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_STDARG_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define size_t unsigned int +| /* end confdefs.h. */ +| #include +| #ifdef HAVE_SYS_TYPES_H +| # include +| #endif +| #ifdef HAVE_SYS_STAT_H +| # include +| #endif +| #ifdef STDC_HEADERS +| # include +| # include +| #else +| # ifdef HAVE_STDLIB_H +| # include +| # endif +| #endif +| #ifdef HAVE_STRING_H +| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H +| # include +| # endif +| # include +| #endif +| #ifdef HAVE_STRINGS_H +| # include +| #endif +| #ifdef HAVE_INTTYPES_H +| # include +| #endif +| #ifdef HAVE_STDINT_H +| # include +| #endif +| #ifdef HAVE_UNISTD_H +| # include +| #endif +| int +| main () +| { +| static int test_array [1 - 2 * !(sizeof (void *) <= sizeof (long int))]; +| test_array [0] = 0 +| +| ; +| return 0; +| } +configure:11016: gcc -c -m32 -O2 -Wall conftest.c >&5 +In file included from /usr/include/stdio.h:28:0, + from conftest.c:27: +/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory +compilation terminated. +configure:11016: $? = 1 +configure: failed program was: +| /* confdefs.h */ +| #define PACKAGE_NAME "libantlr3c" +| #define PACKAGE_TARNAME "libantlr3c" +| #define PACKAGE_VERSION "3.4" +| #define PACKAGE_STRING "libantlr3c 3.4" +| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" +| #define PACKAGE_URL "" +| #define PACKAGE "libantlr3c" +| #define VERSION "3.4" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define HAVE_DLFCN_H 1 +| #define LT_OBJDIR ".libs/" +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_STDARG_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define size_t unsigned int +| /* end confdefs.h. */ +| #include +| #ifdef HAVE_SYS_TYPES_H +| # include +| #endif +| #ifdef HAVE_SYS_STAT_H +| # include +| #endif +| #ifdef STDC_HEADERS +| # include +| # include +| #else +| # ifdef HAVE_STDLIB_H +| # include +| # endif +| #endif +| #ifdef HAVE_STRING_H +| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H +| # include +| # endif +| # include +| #endif +| #ifdef HAVE_STRINGS_H +| # include +| #endif +| #ifdef HAVE_INTTYPES_H +| # include +| #endif +| #ifdef HAVE_STDINT_H +| # include +| #endif +| #ifdef HAVE_UNISTD_H +| # include +| #endif +| int +| main () +| { +| static int test_array [1 - 2 * !(sizeof (void *) <= sizeof (long long int))]; +| test_array [0] = 0 +| +| ; +| return 0; +| } +configure:11030: checking for uint8_t +configure:11030: gcc -c -m32 -O2 -Wall conftest.c >&5 +In file included from /usr/include/stdio.h:28:0, + from conftest.c:27: +/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory +compilation terminated. +configure:11030: $? = 1 +configure: failed program was: +| /* confdefs.h */ +| #define PACKAGE_NAME "libantlr3c" +| #define PACKAGE_TARNAME "libantlr3c" +| #define PACKAGE_VERSION "3.4" +| #define PACKAGE_STRING "libantlr3c 3.4" +| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" +| #define PACKAGE_URL "" +| #define PACKAGE "libantlr3c" +| #define VERSION "3.4" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define HAVE_DLFCN_H 1 +| #define LT_OBJDIR ".libs/" +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_STDARG_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define size_t unsigned int +| /* end confdefs.h. */ +| #include +| #ifdef HAVE_SYS_TYPES_H +| # include +| #endif +| #ifdef HAVE_SYS_STAT_H +| # include +| #endif +| #ifdef STDC_HEADERS +| # include +| # include +| #else +| # ifdef HAVE_STDLIB_H +| # include +| # endif +| #endif +| #ifdef HAVE_STRING_H +| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H +| # include +| # endif +| # include +| #endif +| #ifdef HAVE_STRINGS_H +| # include +| #endif +| #ifdef HAVE_INTTYPES_H +| # include +| #endif +| #ifdef HAVE_STDINT_H +| # include +| #endif +| #ifdef HAVE_UNISTD_H +| # include +| #endif +| int +| main () +| { +| static int test_array [1 - 2 * !(((uint8_t) -1 >> (8 / 2 - 1)) >> (8 / 2 - 1) == 3)]; +| test_array [0] = 0 +| +| ; +| return 0; +| } +configure:11030: gcc -c -m32 -O2 -Wall conftest.c >&5 +In file included from /usr/include/stdio.h:28:0, + from conftest.c:27: +/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory +compilation terminated. +configure:11030: $? = 1 +configure: failed program was: +| /* confdefs.h */ +| #define PACKAGE_NAME "libantlr3c" +| #define PACKAGE_TARNAME "libantlr3c" +| #define PACKAGE_VERSION "3.4" +| #define PACKAGE_STRING "libantlr3c 3.4" +| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" +| #define PACKAGE_URL "" +| #define PACKAGE "libantlr3c" +| #define VERSION "3.4" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define HAVE_DLFCN_H 1 +| #define LT_OBJDIR ".libs/" +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_STDARG_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define size_t unsigned int +| /* end confdefs.h. */ +| #include +| #ifdef HAVE_SYS_TYPES_H +| # include +| #endif +| #ifdef HAVE_SYS_STAT_H +| # include +| #endif +| #ifdef STDC_HEADERS +| # include +| # include +| #else +| # ifdef HAVE_STDLIB_H +| # include +| # endif +| #endif +| #ifdef HAVE_STRING_H +| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H +| # include +| # endif +| # include +| #endif +| #ifdef HAVE_STRINGS_H +| # include +| #endif +| #ifdef HAVE_INTTYPES_H +| # include +| #endif +| #ifdef HAVE_STDINT_H +| # include +| #endif +| #ifdef HAVE_UNISTD_H +| # include +| #endif +| int +| main () +| { +| static int test_array [1 - 2 * !(((unsigned int) -1 >> (8 / 2 - 1)) >> (8 / 2 - 1) == 3)]; +| test_array [0] = 0 +| +| ; +| return 0; +| } +configure:11030: gcc -c -m32 -O2 -Wall conftest.c >&5 +In file included from /usr/include/stdio.h:28:0, + from conftest.c:27: +/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory +compilation terminated. +configure:11030: $? = 1 +configure: failed program was: +| /* confdefs.h */ +| #define PACKAGE_NAME "libantlr3c" +| #define PACKAGE_TARNAME "libantlr3c" +| #define PACKAGE_VERSION "3.4" +| #define PACKAGE_STRING "libantlr3c 3.4" +| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" +| #define PACKAGE_URL "" +| #define PACKAGE "libantlr3c" +| #define VERSION "3.4" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define HAVE_DLFCN_H 1 +| #define LT_OBJDIR ".libs/" +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_STDARG_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define size_t unsigned int +| /* end confdefs.h. */ +| #include +| #ifdef HAVE_SYS_TYPES_H +| # include +| #endif +| #ifdef HAVE_SYS_STAT_H +| # include +| #endif +| #ifdef STDC_HEADERS +| # include +| # include +| #else +| # ifdef HAVE_STDLIB_H +| # include +| # endif +| #endif +| #ifdef HAVE_STRING_H +| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H +| # include +| # endif +| # include +| #endif +| #ifdef HAVE_STRINGS_H +| # include +| #endif +| #ifdef HAVE_INTTYPES_H +| # include +| #endif +| #ifdef HAVE_STDINT_H +| # include +| #endif +| #ifdef HAVE_UNISTD_H +| # include +| #endif +| int +| main () +| { +| static int test_array [1 - 2 * !(((unsigned long int) -1 >> (8 / 2 - 1)) >> (8 / 2 - 1) == 3)]; +| test_array [0] = 0 +| +| ; +| return 0; +| } +configure:11030: gcc -c -m32 -O2 -Wall conftest.c >&5 +In file included from /usr/include/stdio.h:28:0, + from conftest.c:27: +/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory +compilation terminated. +configure:11030: $? = 1 +configure: failed program was: +| /* confdefs.h */ +| #define PACKAGE_NAME "libantlr3c" +| #define PACKAGE_TARNAME "libantlr3c" +| #define PACKAGE_VERSION "3.4" +| #define PACKAGE_STRING "libantlr3c 3.4" +| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" +| #define PACKAGE_URL "" +| #define PACKAGE "libantlr3c" +| #define VERSION "3.4" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define HAVE_DLFCN_H 1 +| #define LT_OBJDIR ".libs/" +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_STDARG_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define size_t unsigned int +| /* end confdefs.h. */ +| #include +| #ifdef HAVE_SYS_TYPES_H +| # include +| #endif +| #ifdef HAVE_SYS_STAT_H +| # include +| #endif +| #ifdef STDC_HEADERS +| # include +| # include +| #else +| # ifdef HAVE_STDLIB_H +| # include +| # endif +| #endif +| #ifdef HAVE_STRING_H +| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H +| # include +| # endif +| # include +| #endif +| #ifdef HAVE_STRINGS_H +| # include +| #endif +| #ifdef HAVE_INTTYPES_H +| # include +| #endif +| #ifdef HAVE_STDINT_H +| # include +| #endif +| #ifdef HAVE_UNISTD_H +| # include +| #endif +| int +| main () +| { +| static int test_array [1 - 2 * !(((unsigned long long int) -1 >> (8 / 2 - 1)) >> (8 / 2 - 1) == 3)]; +| test_array [0] = 0 +| +| ; +| return 0; +| } +configure:11030: gcc -c -m32 -O2 -Wall conftest.c >&5 +In file included from /usr/include/stdio.h:28:0, + from conftest.c:27: +/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory +compilation terminated. +configure:11030: $? = 1 +configure: failed program was: +| /* confdefs.h */ +| #define PACKAGE_NAME "libantlr3c" +| #define PACKAGE_TARNAME "libantlr3c" +| #define PACKAGE_VERSION "3.4" +| #define PACKAGE_STRING "libantlr3c 3.4" +| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" +| #define PACKAGE_URL "" +| #define PACKAGE "libantlr3c" +| #define VERSION "3.4" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define HAVE_DLFCN_H 1 +| #define LT_OBJDIR ".libs/" +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_STDARG_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define size_t unsigned int +| /* end confdefs.h. */ +| #include +| #ifdef HAVE_SYS_TYPES_H +| # include +| #endif +| #ifdef HAVE_SYS_STAT_H +| # include +| #endif +| #ifdef STDC_HEADERS +| # include +| # include +| #else +| # ifdef HAVE_STDLIB_H +| # include +| # endif +| #endif +| #ifdef HAVE_STRING_H +| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H +| # include +| # endif +| # include +| #endif +| #ifdef HAVE_STRINGS_H +| # include +| #endif +| #ifdef HAVE_INTTYPES_H +| # include +| #endif +| #ifdef HAVE_STDINT_H +| # include +| #endif +| #ifdef HAVE_UNISTD_H +| # include +| #endif +| int +| main () +| { +| static int test_array [1 - 2 * !(((unsigned short int) -1 >> (8 / 2 - 1)) >> (8 / 2 - 1) == 3)]; +| test_array [0] = 0 +| +| ; +| return 0; +| } +configure:11030: gcc -c -m32 -O2 -Wall conftest.c >&5 +In file included from /usr/include/stdio.h:28:0, + from conftest.c:27: +/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory +compilation terminated. +configure:11030: $? = 1 +configure: failed program was: +| /* confdefs.h */ +| #define PACKAGE_NAME "libantlr3c" +| #define PACKAGE_TARNAME "libantlr3c" +| #define PACKAGE_VERSION "3.4" +| #define PACKAGE_STRING "libantlr3c 3.4" +| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" +| #define PACKAGE_URL "" +| #define PACKAGE "libantlr3c" +| #define VERSION "3.4" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define HAVE_DLFCN_H 1 +| #define LT_OBJDIR ".libs/" +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_STDARG_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define size_t unsigned int +| /* end confdefs.h. */ +| #include +| #ifdef HAVE_SYS_TYPES_H +| # include +| #endif +| #ifdef HAVE_SYS_STAT_H +| # include +| #endif +| #ifdef STDC_HEADERS +| # include +| # include +| #else +| # ifdef HAVE_STDLIB_H +| # include +| # endif +| #endif +| #ifdef HAVE_STRING_H +| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H +| # include +| # endif +| # include +| #endif +| #ifdef HAVE_STRINGS_H +| # include +| #endif +| #ifdef HAVE_INTTYPES_H +| # include +| #endif +| #ifdef HAVE_STDINT_H +| # include +| #endif +| #ifdef HAVE_UNISTD_H +| # include +| #endif +| int +| main () +| { +| static int test_array [1 - 2 * !(((unsigned char) -1 >> (8 / 2 - 1)) >> (8 / 2 - 1) == 3)]; +| test_array [0] = 0 +| +| ; +| return 0; +| } +configure:11030: result: no +configure:11044: checking for uint16_t +configure:11044: gcc -c -m32 -O2 -Wall conftest.c >&5 +In file included from /usr/include/stdio.h:28:0, + from conftest.c:27: +/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory +compilation terminated. +configure:11044: $? = 1 +configure: failed program was: +| /* confdefs.h */ +| #define PACKAGE_NAME "libantlr3c" +| #define PACKAGE_TARNAME "libantlr3c" +| #define PACKAGE_VERSION "3.4" +| #define PACKAGE_STRING "libantlr3c 3.4" +| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" +| #define PACKAGE_URL "" +| #define PACKAGE "libantlr3c" +| #define VERSION "3.4" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define HAVE_DLFCN_H 1 +| #define LT_OBJDIR ".libs/" +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_STDARG_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define size_t unsigned int +| /* end confdefs.h. */ +| #include +| #ifdef HAVE_SYS_TYPES_H +| # include +| #endif +| #ifdef HAVE_SYS_STAT_H +| # include +| #endif +| #ifdef STDC_HEADERS +| # include +| # include +| #else +| # ifdef HAVE_STDLIB_H +| # include +| # endif +| #endif +| #ifdef HAVE_STRING_H +| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H +| # include +| # endif +| # include +| #endif +| #ifdef HAVE_STRINGS_H +| # include +| #endif +| #ifdef HAVE_INTTYPES_H +| # include +| #endif +| #ifdef HAVE_STDINT_H +| # include +| #endif +| #ifdef HAVE_UNISTD_H +| # include +| #endif +| int +| main () +| { +| static int test_array [1 - 2 * !(((uint16_t) -1 >> (16 / 2 - 1)) >> (16 / 2 - 1) == 3)]; +| test_array [0] = 0 +| +| ; +| return 0; +| } +configure:11044: gcc -c -m32 -O2 -Wall conftest.c >&5 +In file included from /usr/include/stdio.h:28:0, + from conftest.c:27: +/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory +compilation terminated. +configure:11044: $? = 1 +configure: failed program was: +| /* confdefs.h */ +| #define PACKAGE_NAME "libantlr3c" +| #define PACKAGE_TARNAME "libantlr3c" +| #define PACKAGE_VERSION "3.4" +| #define PACKAGE_STRING "libantlr3c 3.4" +| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" +| #define PACKAGE_URL "" +| #define PACKAGE "libantlr3c" +| #define VERSION "3.4" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define HAVE_DLFCN_H 1 +| #define LT_OBJDIR ".libs/" +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_STDARG_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define size_t unsigned int +| /* end confdefs.h. */ +| #include +| #ifdef HAVE_SYS_TYPES_H +| # include +| #endif +| #ifdef HAVE_SYS_STAT_H +| # include +| #endif +| #ifdef STDC_HEADERS +| # include +| # include +| #else +| # ifdef HAVE_STDLIB_H +| # include +| # endif +| #endif +| #ifdef HAVE_STRING_H +| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H +| # include +| # endif +| # include +| #endif +| #ifdef HAVE_STRINGS_H +| # include +| #endif +| #ifdef HAVE_INTTYPES_H +| # include +| #endif +| #ifdef HAVE_STDINT_H +| # include +| #endif +| #ifdef HAVE_UNISTD_H +| # include +| #endif +| int +| main () +| { +| static int test_array [1 - 2 * !(((unsigned int) -1 >> (16 / 2 - 1)) >> (16 / 2 - 1) == 3)]; +| test_array [0] = 0 +| +| ; +| return 0; +| } +configure:11044: gcc -c -m32 -O2 -Wall conftest.c >&5 +In file included from /usr/include/stdio.h:28:0, + from conftest.c:27: +/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory +compilation terminated. +configure:11044: $? = 1 +configure: failed program was: +| /* confdefs.h */ +| #define PACKAGE_NAME "libantlr3c" +| #define PACKAGE_TARNAME "libantlr3c" +| #define PACKAGE_VERSION "3.4" +| #define PACKAGE_STRING "libantlr3c 3.4" +| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" +| #define PACKAGE_URL "" +| #define PACKAGE "libantlr3c" +| #define VERSION "3.4" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define HAVE_DLFCN_H 1 +| #define LT_OBJDIR ".libs/" +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_STDARG_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define size_t unsigned int +| /* end confdefs.h. */ +| #include +| #ifdef HAVE_SYS_TYPES_H +| # include +| #endif +| #ifdef HAVE_SYS_STAT_H +| # include +| #endif +| #ifdef STDC_HEADERS +| # include +| # include +| #else +| # ifdef HAVE_STDLIB_H +| # include +| # endif +| #endif +| #ifdef HAVE_STRING_H +| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H +| # include +| # endif +| # include +| #endif +| #ifdef HAVE_STRINGS_H +| # include +| #endif +| #ifdef HAVE_INTTYPES_H +| # include +| #endif +| #ifdef HAVE_STDINT_H +| # include +| #endif +| #ifdef HAVE_UNISTD_H +| # include +| #endif +| int +| main () +| { +| static int test_array [1 - 2 * !(((unsigned long int) -1 >> (16 / 2 - 1)) >> (16 / 2 - 1) == 3)]; +| test_array [0] = 0 +| +| ; +| return 0; +| } +configure:11044: gcc -c -m32 -O2 -Wall conftest.c >&5 +In file included from /usr/include/stdio.h:28:0, + from conftest.c:27: +/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory +compilation terminated. +configure:11044: $? = 1 +configure: failed program was: +| /* confdefs.h */ +| #define PACKAGE_NAME "libantlr3c" +| #define PACKAGE_TARNAME "libantlr3c" +| #define PACKAGE_VERSION "3.4" +| #define PACKAGE_STRING "libantlr3c 3.4" +| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" +| #define PACKAGE_URL "" +| #define PACKAGE "libantlr3c" +| #define VERSION "3.4" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define HAVE_DLFCN_H 1 +| #define LT_OBJDIR ".libs/" +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_STDARG_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define size_t unsigned int +| /* end confdefs.h. */ +| #include +| #ifdef HAVE_SYS_TYPES_H +| # include +| #endif +| #ifdef HAVE_SYS_STAT_H +| # include +| #endif +| #ifdef STDC_HEADERS +| # include +| # include +| #else +| # ifdef HAVE_STDLIB_H +| # include +| # endif +| #endif +| #ifdef HAVE_STRING_H +| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H +| # include +| # endif +| # include +| #endif +| #ifdef HAVE_STRINGS_H +| # include +| #endif +| #ifdef HAVE_INTTYPES_H +| # include +| #endif +| #ifdef HAVE_STDINT_H +| # include +| #endif +| #ifdef HAVE_UNISTD_H +| # include +| #endif +| int +| main () +| { +| static int test_array [1 - 2 * !(((unsigned long long int) -1 >> (16 / 2 - 1)) >> (16 / 2 - 1) == 3)]; +| test_array [0] = 0 +| +| ; +| return 0; +| } +configure:11044: gcc -c -m32 -O2 -Wall conftest.c >&5 +In file included from /usr/include/stdio.h:28:0, + from conftest.c:27: +/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory +compilation terminated. +configure:11044: $? = 1 +configure: failed program was: +| /* confdefs.h */ +| #define PACKAGE_NAME "libantlr3c" +| #define PACKAGE_TARNAME "libantlr3c" +| #define PACKAGE_VERSION "3.4" +| #define PACKAGE_STRING "libantlr3c 3.4" +| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" +| #define PACKAGE_URL "" +| #define PACKAGE "libantlr3c" +| #define VERSION "3.4" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define HAVE_DLFCN_H 1 +| #define LT_OBJDIR ".libs/" +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_STDARG_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define size_t unsigned int +| /* end confdefs.h. */ +| #include +| #ifdef HAVE_SYS_TYPES_H +| # include +| #endif +| #ifdef HAVE_SYS_STAT_H +| # include +| #endif +| #ifdef STDC_HEADERS +| # include +| # include +| #else +| # ifdef HAVE_STDLIB_H +| # include +| # endif +| #endif +| #ifdef HAVE_STRING_H +| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H +| # include +| # endif +| # include +| #endif +| #ifdef HAVE_STRINGS_H +| # include +| #endif +| #ifdef HAVE_INTTYPES_H +| # include +| #endif +| #ifdef HAVE_STDINT_H +| # include +| #endif +| #ifdef HAVE_UNISTD_H +| # include +| #endif +| int +| main () +| { +| static int test_array [1 - 2 * !(((unsigned short int) -1 >> (16 / 2 - 1)) >> (16 / 2 - 1) == 3)]; +| test_array [0] = 0 +| +| ; +| return 0; +| } +configure:11044: gcc -c -m32 -O2 -Wall conftest.c >&5 +In file included from /usr/include/stdio.h:28:0, + from conftest.c:27: +/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory +compilation terminated. +configure:11044: $? = 1 +configure: failed program was: +| /* confdefs.h */ +| #define PACKAGE_NAME "libantlr3c" +| #define PACKAGE_TARNAME "libantlr3c" +| #define PACKAGE_VERSION "3.4" +| #define PACKAGE_STRING "libantlr3c 3.4" +| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" +| #define PACKAGE_URL "" +| #define PACKAGE "libantlr3c" +| #define VERSION "3.4" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define HAVE_DLFCN_H 1 +| #define LT_OBJDIR ".libs/" +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_STDARG_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define size_t unsigned int +| /* end confdefs.h. */ +| #include +| #ifdef HAVE_SYS_TYPES_H +| # include +| #endif +| #ifdef HAVE_SYS_STAT_H +| # include +| #endif +| #ifdef STDC_HEADERS +| # include +| # include +| #else +| # ifdef HAVE_STDLIB_H +| # include +| # endif +| #endif +| #ifdef HAVE_STRING_H +| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H +| # include +| # endif +| # include +| #endif +| #ifdef HAVE_STRINGS_H +| # include +| #endif +| #ifdef HAVE_INTTYPES_H +| # include +| #endif +| #ifdef HAVE_STDINT_H +| # include +| #endif +| #ifdef HAVE_UNISTD_H +| # include +| #endif +| int +| main () +| { +| static int test_array [1 - 2 * !(((unsigned char) -1 >> (16 / 2 - 1)) >> (16 / 2 - 1) == 3)]; +| test_array [0] = 0 +| +| ; +| return 0; +| } +configure:11044: result: no +configure:11056: checking for uint32_t +configure:11056: gcc -c -m32 -O2 -Wall conftest.c >&5 +In file included from /usr/include/stdio.h:28:0, + from conftest.c:27: +/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory +compilation terminated. +configure:11056: $? = 1 +configure: failed program was: +| /* confdefs.h */ +| #define PACKAGE_NAME "libantlr3c" +| #define PACKAGE_TARNAME "libantlr3c" +| #define PACKAGE_VERSION "3.4" +| #define PACKAGE_STRING "libantlr3c 3.4" +| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" +| #define PACKAGE_URL "" +| #define PACKAGE "libantlr3c" +| #define VERSION "3.4" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define HAVE_DLFCN_H 1 +| #define LT_OBJDIR ".libs/" +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_STDARG_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define size_t unsigned int +| /* end confdefs.h. */ +| #include +| #ifdef HAVE_SYS_TYPES_H +| # include +| #endif +| #ifdef HAVE_SYS_STAT_H +| # include +| #endif +| #ifdef STDC_HEADERS +| # include +| # include +| #else +| # ifdef HAVE_STDLIB_H +| # include +| # endif +| #endif +| #ifdef HAVE_STRING_H +| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H +| # include +| # endif +| # include +| #endif +| #ifdef HAVE_STRINGS_H +| # include +| #endif +| #ifdef HAVE_INTTYPES_H +| # include +| #endif +| #ifdef HAVE_STDINT_H +| # include +| #endif +| #ifdef HAVE_UNISTD_H +| # include +| #endif +| int +| main () +| { +| static int test_array [1 - 2 * !(((uint32_t) -1 >> (32 / 2 - 1)) >> (32 / 2 - 1) == 3)]; +| test_array [0] = 0 +| +| ; +| return 0; +| } +configure:11056: gcc -c -m32 -O2 -Wall conftest.c >&5 +In file included from /usr/include/stdio.h:28:0, + from conftest.c:27: +/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory +compilation terminated. +configure:11056: $? = 1 +configure: failed program was: +| /* confdefs.h */ +| #define PACKAGE_NAME "libantlr3c" +| #define PACKAGE_TARNAME "libantlr3c" +| #define PACKAGE_VERSION "3.4" +| #define PACKAGE_STRING "libantlr3c 3.4" +| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" +| #define PACKAGE_URL "" +| #define PACKAGE "libantlr3c" +| #define VERSION "3.4" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define HAVE_DLFCN_H 1 +| #define LT_OBJDIR ".libs/" +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_STDARG_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define size_t unsigned int +| /* end confdefs.h. */ +| #include +| #ifdef HAVE_SYS_TYPES_H +| # include +| #endif +| #ifdef HAVE_SYS_STAT_H +| # include +| #endif +| #ifdef STDC_HEADERS +| # include +| # include +| #else +| # ifdef HAVE_STDLIB_H +| # include +| # endif +| #endif +| #ifdef HAVE_STRING_H +| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H +| # include +| # endif +| # include +| #endif +| #ifdef HAVE_STRINGS_H +| # include +| #endif +| #ifdef HAVE_INTTYPES_H +| # include +| #endif +| #ifdef HAVE_STDINT_H +| # include +| #endif +| #ifdef HAVE_UNISTD_H +| # include +| #endif +| int +| main () +| { +| static int test_array [1 - 2 * !(((unsigned int) -1 >> (32 / 2 - 1)) >> (32 / 2 - 1) == 3)]; +| test_array [0] = 0 +| +| ; +| return 0; +| } +configure:11056: gcc -c -m32 -O2 -Wall conftest.c >&5 +In file included from /usr/include/stdio.h:28:0, + from conftest.c:27: +/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory +compilation terminated. +configure:11056: $? = 1 +configure: failed program was: +| /* confdefs.h */ +| #define PACKAGE_NAME "libantlr3c" +| #define PACKAGE_TARNAME "libantlr3c" +| #define PACKAGE_VERSION "3.4" +| #define PACKAGE_STRING "libantlr3c 3.4" +| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" +| #define PACKAGE_URL "" +| #define PACKAGE "libantlr3c" +| #define VERSION "3.4" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define HAVE_DLFCN_H 1 +| #define LT_OBJDIR ".libs/" +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_STDARG_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define size_t unsigned int +| /* end confdefs.h. */ +| #include +| #ifdef HAVE_SYS_TYPES_H +| # include +| #endif +| #ifdef HAVE_SYS_STAT_H +| # include +| #endif +| #ifdef STDC_HEADERS +| # include +| # include +| #else +| # ifdef HAVE_STDLIB_H +| # include +| # endif +| #endif +| #ifdef HAVE_STRING_H +| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H +| # include +| # endif +| # include +| #endif +| #ifdef HAVE_STRINGS_H +| # include +| #endif +| #ifdef HAVE_INTTYPES_H +| # include +| #endif +| #ifdef HAVE_STDINT_H +| # include +| #endif +| #ifdef HAVE_UNISTD_H +| # include +| #endif +| int +| main () +| { +| static int test_array [1 - 2 * !(((unsigned long int) -1 >> (32 / 2 - 1)) >> (32 / 2 - 1) == 3)]; +| test_array [0] = 0 +| +| ; +| return 0; +| } +configure:11056: gcc -c -m32 -O2 -Wall conftest.c >&5 +In file included from /usr/include/stdio.h:28:0, + from conftest.c:27: +/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory +compilation terminated. +configure:11056: $? = 1 +configure: failed program was: +| /* confdefs.h */ +| #define PACKAGE_NAME "libantlr3c" +| #define PACKAGE_TARNAME "libantlr3c" +| #define PACKAGE_VERSION "3.4" +| #define PACKAGE_STRING "libantlr3c 3.4" +| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" +| #define PACKAGE_URL "" +| #define PACKAGE "libantlr3c" +| #define VERSION "3.4" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define HAVE_DLFCN_H 1 +| #define LT_OBJDIR ".libs/" +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_STDARG_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define size_t unsigned int +| /* end confdefs.h. */ +| #include +| #ifdef HAVE_SYS_TYPES_H +| # include +| #endif +| #ifdef HAVE_SYS_STAT_H +| # include +| #endif +| #ifdef STDC_HEADERS +| # include +| # include +| #else +| # ifdef HAVE_STDLIB_H +| # include +| # endif +| #endif +| #ifdef HAVE_STRING_H +| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H +| # include +| # endif +| # include +| #endif +| #ifdef HAVE_STRINGS_H +| # include +| #endif +| #ifdef HAVE_INTTYPES_H +| # include +| #endif +| #ifdef HAVE_STDINT_H +| # include +| #endif +| #ifdef HAVE_UNISTD_H +| # include +| #endif +| int +| main () +| { +| static int test_array [1 - 2 * !(((unsigned long long int) -1 >> (32 / 2 - 1)) >> (32 / 2 - 1) == 3)]; +| test_array [0] = 0 +| +| ; +| return 0; +| } +configure:11056: gcc -c -m32 -O2 -Wall conftest.c >&5 +In file included from /usr/include/stdio.h:28:0, + from conftest.c:27: +/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory +compilation terminated. +configure:11056: $? = 1 +configure: failed program was: +| /* confdefs.h */ +| #define PACKAGE_NAME "libantlr3c" +| #define PACKAGE_TARNAME "libantlr3c" +| #define PACKAGE_VERSION "3.4" +| #define PACKAGE_STRING "libantlr3c 3.4" +| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" +| #define PACKAGE_URL "" +| #define PACKAGE "libantlr3c" +| #define VERSION "3.4" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define HAVE_DLFCN_H 1 +| #define LT_OBJDIR ".libs/" +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_STDARG_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define size_t unsigned int +| /* end confdefs.h. */ +| #include +| #ifdef HAVE_SYS_TYPES_H +| # include +| #endif +| #ifdef HAVE_SYS_STAT_H +| # include +| #endif +| #ifdef STDC_HEADERS +| # include +| # include +| #else +| # ifdef HAVE_STDLIB_H +| # include +| # endif +| #endif +| #ifdef HAVE_STRING_H +| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H +| # include +| # endif +| # include +| #endif +| #ifdef HAVE_STRINGS_H +| # include +| #endif +| #ifdef HAVE_INTTYPES_H +| # include +| #endif +| #ifdef HAVE_STDINT_H +| # include +| #endif +| #ifdef HAVE_UNISTD_H +| # include +| #endif +| int +| main () +| { +| static int test_array [1 - 2 * !(((unsigned short int) -1 >> (32 / 2 - 1)) >> (32 / 2 - 1) == 3)]; +| test_array [0] = 0 +| +| ; +| return 0; +| } +configure:11056: gcc -c -m32 -O2 -Wall conftest.c >&5 +In file included from /usr/include/stdio.h:28:0, + from conftest.c:27: +/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory +compilation terminated. +configure:11056: $? = 1 +configure: failed program was: +| /* confdefs.h */ +| #define PACKAGE_NAME "libantlr3c" +| #define PACKAGE_TARNAME "libantlr3c" +| #define PACKAGE_VERSION "3.4" +| #define PACKAGE_STRING "libantlr3c 3.4" +| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" +| #define PACKAGE_URL "" +| #define PACKAGE "libantlr3c" +| #define VERSION "3.4" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define HAVE_DLFCN_H 1 +| #define LT_OBJDIR ".libs/" +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_STDARG_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define size_t unsigned int +| /* end confdefs.h. */ +| #include +| #ifdef HAVE_SYS_TYPES_H +| # include +| #endif +| #ifdef HAVE_SYS_STAT_H +| # include +| #endif +| #ifdef STDC_HEADERS +| # include +| # include +| #else +| # ifdef HAVE_STDLIB_H +| # include +| # endif +| #endif +| #ifdef HAVE_STRING_H +| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H +| # include +| # endif +| # include +| #endif +| #ifdef HAVE_STRINGS_H +| # include +| #endif +| #ifdef HAVE_INTTYPES_H +| # include +| #endif +| #ifdef HAVE_STDINT_H +| # include +| #endif +| #ifdef HAVE_UNISTD_H +| # include +| #endif +| int +| main () +| { +| static int test_array [1 - 2 * !(((unsigned char) -1 >> (32 / 2 - 1)) >> (32 / 2 - 1) == 3)]; +| test_array [0] = 0 +| +| ; +| return 0; +| } +configure:11056: result: no +configure:11070: checking for uint64_t +configure:11070: gcc -c -m32 -O2 -Wall conftest.c >&5 +In file included from /usr/include/stdio.h:28:0, + from conftest.c:27: +/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory +compilation terminated. +configure:11070: $? = 1 +configure: failed program was: +| /* confdefs.h */ +| #define PACKAGE_NAME "libantlr3c" +| #define PACKAGE_TARNAME "libantlr3c" +| #define PACKAGE_VERSION "3.4" +| #define PACKAGE_STRING "libantlr3c 3.4" +| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" +| #define PACKAGE_URL "" +| #define PACKAGE "libantlr3c" +| #define VERSION "3.4" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define HAVE_DLFCN_H 1 +| #define LT_OBJDIR ".libs/" +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_STDARG_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define size_t unsigned int +| /* end confdefs.h. */ +| #include +| #ifdef HAVE_SYS_TYPES_H +| # include +| #endif +| #ifdef HAVE_SYS_STAT_H +| # include +| #endif +| #ifdef STDC_HEADERS +| # include +| # include +| #else +| # ifdef HAVE_STDLIB_H +| # include +| # endif +| #endif +| #ifdef HAVE_STRING_H +| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H +| # include +| # endif +| # include +| #endif +| #ifdef HAVE_STRINGS_H +| # include +| #endif +| #ifdef HAVE_INTTYPES_H +| # include +| #endif +| #ifdef HAVE_STDINT_H +| # include +| #endif +| #ifdef HAVE_UNISTD_H +| # include +| #endif +| int +| main () +| { +| static int test_array [1 - 2 * !(((uint64_t) -1 >> (64 / 2 - 1)) >> (64 / 2 - 1) == 3)]; +| test_array [0] = 0 +| +| ; +| return 0; +| } +configure:11070: gcc -c -m32 -O2 -Wall conftest.c >&5 +In file included from /usr/include/stdio.h:28:0, + from conftest.c:27: +/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory +compilation terminated. +configure:11070: $? = 1 +configure: failed program was: +| /* confdefs.h */ +| #define PACKAGE_NAME "libantlr3c" +| #define PACKAGE_TARNAME "libantlr3c" +| #define PACKAGE_VERSION "3.4" +| #define PACKAGE_STRING "libantlr3c 3.4" +| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" +| #define PACKAGE_URL "" +| #define PACKAGE "libantlr3c" +| #define VERSION "3.4" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define HAVE_DLFCN_H 1 +| #define LT_OBJDIR ".libs/" +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_STDARG_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define size_t unsigned int +| /* end confdefs.h. */ +| #include +| #ifdef HAVE_SYS_TYPES_H +| # include +| #endif +| #ifdef HAVE_SYS_STAT_H +| # include +| #endif +| #ifdef STDC_HEADERS +| # include +| # include +| #else +| # ifdef HAVE_STDLIB_H +| # include +| # endif +| #endif +| #ifdef HAVE_STRING_H +| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H +| # include +| # endif +| # include +| #endif +| #ifdef HAVE_STRINGS_H +| # include +| #endif +| #ifdef HAVE_INTTYPES_H +| # include +| #endif +| #ifdef HAVE_STDINT_H +| # include +| #endif +| #ifdef HAVE_UNISTD_H +| # include +| #endif +| int +| main () +| { +| static int test_array [1 - 2 * !(((unsigned int) -1 >> (64 / 2 - 1)) >> (64 / 2 - 1) == 3)]; +| test_array [0] = 0 +| +| ; +| return 0; +| } +configure:11070: gcc -c -m32 -O2 -Wall conftest.c >&5 +In file included from /usr/include/stdio.h:28:0, + from conftest.c:27: +/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory +compilation terminated. +configure:11070: $? = 1 +configure: failed program was: +| /* confdefs.h */ +| #define PACKAGE_NAME "libantlr3c" +| #define PACKAGE_TARNAME "libantlr3c" +| #define PACKAGE_VERSION "3.4" +| #define PACKAGE_STRING "libantlr3c 3.4" +| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" +| #define PACKAGE_URL "" +| #define PACKAGE "libantlr3c" +| #define VERSION "3.4" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define HAVE_DLFCN_H 1 +| #define LT_OBJDIR ".libs/" +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_STDARG_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define size_t unsigned int +| /* end confdefs.h. */ +| #include +| #ifdef HAVE_SYS_TYPES_H +| # include +| #endif +| #ifdef HAVE_SYS_STAT_H +| # include +| #endif +| #ifdef STDC_HEADERS +| # include +| # include +| #else +| # ifdef HAVE_STDLIB_H +| # include +| # endif +| #endif +| #ifdef HAVE_STRING_H +| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H +| # include +| # endif +| # include +| #endif +| #ifdef HAVE_STRINGS_H +| # include +| #endif +| #ifdef HAVE_INTTYPES_H +| # include +| #endif +| #ifdef HAVE_STDINT_H +| # include +| #endif +| #ifdef HAVE_UNISTD_H +| # include +| #endif +| int +| main () +| { +| static int test_array [1 - 2 * !(((unsigned long int) -1 >> (64 / 2 - 1)) >> (64 / 2 - 1) == 3)]; +| test_array [0] = 0 +| +| ; +| return 0; +| } +configure:11070: gcc -c -m32 -O2 -Wall conftest.c >&5 +In file included from /usr/include/stdio.h:28:0, + from conftest.c:27: +/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory +compilation terminated. +configure:11070: $? = 1 +configure: failed program was: +| /* confdefs.h */ +| #define PACKAGE_NAME "libantlr3c" +| #define PACKAGE_TARNAME "libantlr3c" +| #define PACKAGE_VERSION "3.4" +| #define PACKAGE_STRING "libantlr3c 3.4" +| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" +| #define PACKAGE_URL "" +| #define PACKAGE "libantlr3c" +| #define VERSION "3.4" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define HAVE_DLFCN_H 1 +| #define LT_OBJDIR ".libs/" +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_STDARG_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define size_t unsigned int +| /* end confdefs.h. */ +| #include +| #ifdef HAVE_SYS_TYPES_H +| # include +| #endif +| #ifdef HAVE_SYS_STAT_H +| # include +| #endif +| #ifdef STDC_HEADERS +| # include +| # include +| #else +| # ifdef HAVE_STDLIB_H +| # include +| # endif +| #endif +| #ifdef HAVE_STRING_H +| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H +| # include +| # endif +| # include +| #endif +| #ifdef HAVE_STRINGS_H +| # include +| #endif +| #ifdef HAVE_INTTYPES_H +| # include +| #endif +| #ifdef HAVE_STDINT_H +| # include +| #endif +| #ifdef HAVE_UNISTD_H +| # include +| #endif +| int +| main () +| { +| static int test_array [1 - 2 * !(((unsigned long long int) -1 >> (64 / 2 - 1)) >> (64 / 2 - 1) == 3)]; +| test_array [0] = 0 +| +| ; +| return 0; +| } +configure:11070: gcc -c -m32 -O2 -Wall conftest.c >&5 +In file included from /usr/include/stdio.h:28:0, + from conftest.c:27: +/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory +compilation terminated. +configure:11070: $? = 1 +configure: failed program was: +| /* confdefs.h */ +| #define PACKAGE_NAME "libantlr3c" +| #define PACKAGE_TARNAME "libantlr3c" +| #define PACKAGE_VERSION "3.4" +| #define PACKAGE_STRING "libantlr3c 3.4" +| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" +| #define PACKAGE_URL "" +| #define PACKAGE "libantlr3c" +| #define VERSION "3.4" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define HAVE_DLFCN_H 1 +| #define LT_OBJDIR ".libs/" +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_STDARG_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define size_t unsigned int +| /* end confdefs.h. */ +| #include +| #ifdef HAVE_SYS_TYPES_H +| # include +| #endif +| #ifdef HAVE_SYS_STAT_H +| # include +| #endif +| #ifdef STDC_HEADERS +| # include +| # include +| #else +| # ifdef HAVE_STDLIB_H +| # include +| # endif +| #endif +| #ifdef HAVE_STRING_H +| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H +| # include +| # endif +| # include +| #endif +| #ifdef HAVE_STRINGS_H +| # include +| #endif +| #ifdef HAVE_INTTYPES_H +| # include +| #endif +| #ifdef HAVE_STDINT_H +| # include +| #endif +| #ifdef HAVE_UNISTD_H +| # include +| #endif +| int +| main () +| { +| static int test_array [1 - 2 * !(((unsigned short int) -1 >> (64 / 2 - 1)) >> (64 / 2 - 1) == 3)]; +| test_array [0] = 0 +| +| ; +| return 0; +| } +configure:11070: gcc -c -m32 -O2 -Wall conftest.c >&5 +In file included from /usr/include/stdio.h:28:0, + from conftest.c:27: +/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory +compilation terminated. +configure:11070: $? = 1 +configure: failed program was: +| /* confdefs.h */ +| #define PACKAGE_NAME "libantlr3c" +| #define PACKAGE_TARNAME "libantlr3c" +| #define PACKAGE_VERSION "3.4" +| #define PACKAGE_STRING "libantlr3c 3.4" +| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" +| #define PACKAGE_URL "" +| #define PACKAGE "libantlr3c" +| #define VERSION "3.4" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define HAVE_DLFCN_H 1 +| #define LT_OBJDIR ".libs/" +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_STDARG_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define size_t unsigned int +| /* end confdefs.h. */ +| #include +| #ifdef HAVE_SYS_TYPES_H +| # include +| #endif +| #ifdef HAVE_SYS_STAT_H +| # include +| #endif +| #ifdef STDC_HEADERS +| # include +| # include +| #else +| # ifdef HAVE_STDLIB_H +| # include +| # endif +| #endif +| #ifdef HAVE_STRING_H +| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H +| # include +| # endif +| # include +| #endif +| #ifdef HAVE_STRINGS_H +| # include +| #endif +| #ifdef HAVE_INTTYPES_H +| # include +| #endif +| #ifdef HAVE_STDINT_H +| # include +| #endif +| #ifdef HAVE_UNISTD_H +| # include +| #endif +| int +| main () +| { +| static int test_array [1 - 2 * !(((unsigned char) -1 >> (64 / 2 - 1)) >> (64 / 2 - 1) == 3)]; +| test_array [0] = 0 +| +| ; +| return 0; +| } +configure:11070: result: no +configure:11085: checking for uintptr_t +configure:11085: gcc -c -m32 -O2 -Wall conftest.c >&5 +In file included from /usr/include/stdio.h:28:0, + from conftest.c:27: +/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory +compilation terminated. +configure:11085: $? = 1 +configure: failed program was: +| /* confdefs.h */ +| #define PACKAGE_NAME "libantlr3c" +| #define PACKAGE_TARNAME "libantlr3c" +| #define PACKAGE_VERSION "3.4" +| #define PACKAGE_STRING "libantlr3c 3.4" +| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" +| #define PACKAGE_URL "" +| #define PACKAGE "libantlr3c" +| #define VERSION "3.4" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define HAVE_DLFCN_H 1 +| #define LT_OBJDIR ".libs/" +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_STDARG_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define size_t unsigned int +| /* end confdefs.h. */ +| #include +| #ifdef HAVE_SYS_TYPES_H +| # include +| #endif +| #ifdef HAVE_SYS_STAT_H +| # include +| #endif +| #ifdef STDC_HEADERS +| # include +| # include +| #else +| # ifdef HAVE_STDLIB_H +| # include +| # endif +| #endif +| #ifdef HAVE_STRING_H +| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H +| # include +| # endif +| # include +| #endif +| #ifdef HAVE_STRINGS_H +| # include +| #endif +| #ifdef HAVE_INTTYPES_H +| # include +| #endif +| #ifdef HAVE_STDINT_H +| # include +| #endif +| #ifdef HAVE_UNISTD_H +| # include +| #endif +| int +| main () +| { +| if (sizeof (uintptr_t)) +| return 0; +| ; +| return 0; +| } +configure:11085: result: no +configure:11106: gcc -c -m32 -O2 -Wall conftest.c >&5 +In file included from /usr/include/stdio.h:28:0, + from conftest.c:27: +/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory +compilation terminated. +configure:11106: $? = 1 +configure: failed program was: +| /* confdefs.h */ +| #define PACKAGE_NAME "libantlr3c" +| #define PACKAGE_TARNAME "libantlr3c" +| #define PACKAGE_VERSION "3.4" +| #define PACKAGE_STRING "libantlr3c 3.4" +| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" +| #define PACKAGE_URL "" +| #define PACKAGE "libantlr3c" +| #define VERSION "3.4" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define HAVE_DLFCN_H 1 +| #define LT_OBJDIR ".libs/" +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_STDARG_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define size_t unsigned int +| /* end confdefs.h. */ +| #include +| #ifdef HAVE_SYS_TYPES_H +| # include +| #endif +| #ifdef HAVE_SYS_STAT_H +| # include +| #endif +| #ifdef STDC_HEADERS +| # include +| # include +| #else +| # ifdef HAVE_STDLIB_H +| # include +| # endif +| #endif +| #ifdef HAVE_STRING_H +| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H +| # include +| # endif +| # include +| #endif +| #ifdef HAVE_STRINGS_H +| # include +| #endif +| #ifdef HAVE_INTTYPES_H +| # include +| #endif +| #ifdef HAVE_STDINT_H +| # include +| #endif +| #ifdef HAVE_UNISTD_H +| # include +| #endif +| int +| main () +| { +| static int test_array [1 - 2 * !(sizeof (void *) <= sizeof (unsigned int))]; +| test_array [0] = 0 +| +| ; +| return 0; +| } +configure:11106: gcc -c -m32 -O2 -Wall conftest.c >&5 +In file included from /usr/include/stdio.h:28:0, + from conftest.c:27: +/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory +compilation terminated. +configure:11106: $? = 1 +configure: failed program was: +| /* confdefs.h */ +| #define PACKAGE_NAME "libantlr3c" +| #define PACKAGE_TARNAME "libantlr3c" +| #define PACKAGE_VERSION "3.4" +| #define PACKAGE_STRING "libantlr3c 3.4" +| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" +| #define PACKAGE_URL "" +| #define PACKAGE "libantlr3c" +| #define VERSION "3.4" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define HAVE_DLFCN_H 1 +| #define LT_OBJDIR ".libs/" +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_STDARG_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define size_t unsigned int +| /* end confdefs.h. */ +| #include +| #ifdef HAVE_SYS_TYPES_H +| # include +| #endif +| #ifdef HAVE_SYS_STAT_H +| # include +| #endif +| #ifdef STDC_HEADERS +| # include +| # include +| #else +| # ifdef HAVE_STDLIB_H +| # include +| # endif +| #endif +| #ifdef HAVE_STRING_H +| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H +| # include +| # endif +| # include +| #endif +| #ifdef HAVE_STRINGS_H +| # include +| #endif +| #ifdef HAVE_INTTYPES_H +| # include +| #endif +| #ifdef HAVE_STDINT_H +| # include +| #endif +| #ifdef HAVE_UNISTD_H +| # include +| #endif +| int +| main () +| { +| static int test_array [1 - 2 * !(sizeof (void *) <= sizeof (unsigned long int))]; +| test_array [0] = 0 +| +| ; +| return 0; +| } +configure:11106: gcc -c -m32 -O2 -Wall conftest.c >&5 +In file included from /usr/include/stdio.h:28:0, + from conftest.c:27: +/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory +compilation terminated. +configure:11106: $? = 1 +configure: failed program was: +| /* confdefs.h */ +| #define PACKAGE_NAME "libantlr3c" +| #define PACKAGE_TARNAME "libantlr3c" +| #define PACKAGE_VERSION "3.4" +| #define PACKAGE_STRING "libantlr3c 3.4" +| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" +| #define PACKAGE_URL "" +| #define PACKAGE "libantlr3c" +| #define VERSION "3.4" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define HAVE_DLFCN_H 1 +| #define LT_OBJDIR ".libs/" +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_STDARG_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define size_t unsigned int +| /* end confdefs.h. */ +| #include +| #ifdef HAVE_SYS_TYPES_H +| # include +| #endif +| #ifdef HAVE_SYS_STAT_H +| # include +| #endif +| #ifdef STDC_HEADERS +| # include +| # include +| #else +| # ifdef HAVE_STDLIB_H +| # include +| # endif +| #endif +| #ifdef HAVE_STRING_H +| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H +| # include +| # endif +| # include +| #endif +| #ifdef HAVE_STRINGS_H +| # include +| #endif +| #ifdef HAVE_INTTYPES_H +| # include +| #endif +| #ifdef HAVE_STDINT_H +| # include +| #endif +| #ifdef HAVE_UNISTD_H +| # include +| #endif +| int +| main () +| { +| static int test_array [1 - 2 * !(sizeof (void *) <= sizeof (unsigned long long int))]; +| test_array [0] = 0 +| +| ; +| return 0; +| } +configure:11120: checking for inline +configure:11136: gcc -c -m32 -O2 -Wall conftest.c >&5 +configure:11136: $? = 0 +configure:11144: result: inline +configure:11168: checking for memmove +configure:11168: gcc -o conftest -m32 -O2 -Wall conftest.c >&5 +In file included from /usr/include/limits.h:27:0, + from /usr/lib/gcc/x86_64-linux-gnu/4.6/include-fixed/limits.h:169, + from /usr/lib/gcc/x86_64-linux-gnu/4.6/include-fixed/syslimits.h:7, + from /usr/lib/gcc/x86_64-linux-gnu/4.6/include-fixed/limits.h:34, + from conftest.c:37: +/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory +compilation terminated. +configure:11168: $? = 1 +configure: failed program was: +| /* confdefs.h */ +| #define PACKAGE_NAME "libantlr3c" +| #define PACKAGE_TARNAME "libantlr3c" +| #define PACKAGE_VERSION "3.4" +| #define PACKAGE_STRING "libantlr3c 3.4" +| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" +| #define PACKAGE_URL "" +| #define PACKAGE "libantlr3c" +| #define VERSION "3.4" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define HAVE_DLFCN_H 1 +| #define LT_OBJDIR ".libs/" +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_STDARG_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define size_t unsigned int +| /* end confdefs.h. */ +| /* Define memmove to an innocuous variant, in case declares memmove. +| For example, HP-UX 11i declares gettimeofday. */ +| #define memmove innocuous_memmove +| +| /* System header to define __stub macros and hopefully few prototypes, +| which can conflict with char memmove (); below. +| Prefer to if __STDC__ is defined, since +| exists even on freestanding compilers. */ +| +| #ifdef __STDC__ +| # include +| #else +| # include +| #endif +| +| #undef memmove +| +| /* 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 memmove (); +| /* 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_memmove || defined __stub___memmove +| choke me +| #endif +| +| int +| main () +| { +| return memmove (); +| ; +| return 0; +| } +configure:11168: result: no +configure:11168: checking for memset +configure:11168: gcc -o conftest -m32 -O2 -Wall conftest.c >&5 +In file included from /usr/include/limits.h:27:0, + from /usr/lib/gcc/x86_64-linux-gnu/4.6/include-fixed/limits.h:169, + from /usr/lib/gcc/x86_64-linux-gnu/4.6/include-fixed/syslimits.h:7, + from /usr/lib/gcc/x86_64-linux-gnu/4.6/include-fixed/limits.h:34, + from conftest.c:37: +/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory +compilation terminated. +configure:11168: $? = 1 +configure: failed program was: +| /* confdefs.h */ +| #define PACKAGE_NAME "libantlr3c" +| #define PACKAGE_TARNAME "libantlr3c" +| #define PACKAGE_VERSION "3.4" +| #define PACKAGE_STRING "libantlr3c 3.4" +| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" +| #define PACKAGE_URL "" +| #define PACKAGE "libantlr3c" +| #define VERSION "3.4" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define HAVE_DLFCN_H 1 +| #define LT_OBJDIR ".libs/" +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_STDARG_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define size_t unsigned int +| /* end confdefs.h. */ +| /* Define memset to an innocuous variant, in case declares memset. +| For example, HP-UX 11i declares gettimeofday. */ +| #define memset innocuous_memset +| +| /* System header to define __stub macros and hopefully few prototypes, +| which can conflict with char memset (); below. +| Prefer to if __STDC__ is defined, since +| exists even on freestanding compilers. */ +| +| #ifdef __STDC__ +| # include +| #else +| # include +| #endif +| +| #undef memset +| +| /* 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 memset (); +| /* 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_memset || defined __stub___memset +| choke me +| #endif +| +| int +| main () +| { +| return memset (); +| ; +| return 0; +| } +configure:11168: result: no +configure:11168: checking for strdup +configure:11168: gcc -o conftest -m32 -O2 -Wall conftest.c >&5 +In file included from /usr/include/limits.h:27:0, + from /usr/lib/gcc/x86_64-linux-gnu/4.6/include-fixed/limits.h:169, + from /usr/lib/gcc/x86_64-linux-gnu/4.6/include-fixed/syslimits.h:7, + from /usr/lib/gcc/x86_64-linux-gnu/4.6/include-fixed/limits.h:34, + from conftest.c:37: +/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory +compilation terminated. +configure:11168: $? = 1 +configure: failed program was: +| /* confdefs.h */ +| #define PACKAGE_NAME "libantlr3c" +| #define PACKAGE_TARNAME "libantlr3c" +| #define PACKAGE_VERSION "3.4" +| #define PACKAGE_STRING "libantlr3c 3.4" +| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" +| #define PACKAGE_URL "" +| #define PACKAGE "libantlr3c" +| #define VERSION "3.4" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define HAVE_DLFCN_H 1 +| #define LT_OBJDIR ".libs/" +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_STDARG_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define size_t unsigned int +| /* end confdefs.h. */ +| /* Define strdup to an innocuous variant, in case declares strdup. +| For example, HP-UX 11i declares gettimeofday. */ +| #define strdup innocuous_strdup +| +| /* System header to define __stub macros and hopefully few prototypes, +| which can conflict with char strdup (); below. +| Prefer to if __STDC__ is defined, since +| exists even on freestanding compilers. */ +| +| #ifdef __STDC__ +| # include +| #else +| # include +| #endif +| +| #undef strdup +| +| /* 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 strdup (); +| /* 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_strdup || defined __stub___strdup +| choke me +| #endif +| +| int +| main () +| { +| return strdup (); +| ; +| return 0; +| } +configure:11168: result: no +configure:11168: checking for accept +configure:11168: gcc -o conftest -m32 -O2 -Wall conftest.c >&5 +In file included from /usr/include/limits.h:27:0, + from /usr/lib/gcc/x86_64-linux-gnu/4.6/include-fixed/limits.h:169, + from /usr/lib/gcc/x86_64-linux-gnu/4.6/include-fixed/syslimits.h:7, + from /usr/lib/gcc/x86_64-linux-gnu/4.6/include-fixed/limits.h:34, + from conftest.c:37: +/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory +compilation terminated. +configure:11168: $? = 1 +configure: failed program was: +| /* confdefs.h */ +| #define PACKAGE_NAME "libantlr3c" +| #define PACKAGE_TARNAME "libantlr3c" +| #define PACKAGE_VERSION "3.4" +| #define PACKAGE_STRING "libantlr3c 3.4" +| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" +| #define PACKAGE_URL "" +| #define PACKAGE "libantlr3c" +| #define VERSION "3.4" +| #define STDC_HEADERS 1 +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define HAVE_STDLIB_H 1 +| #define HAVE_STRING_H 1 +| #define HAVE_MEMORY_H 1 +| #define HAVE_STRINGS_H 1 +| #define HAVE_INTTYPES_H 1 +| #define HAVE_STDINT_H 1 +| #define HAVE_UNISTD_H 1 +| #define HAVE_DLFCN_H 1 +| #define LT_OBJDIR ".libs/" +| #define HAVE_SYS_TYPES_H 1 +| #define HAVE_STDARG_H 1 +| #define HAVE_SYS_STAT_H 1 +| #define size_t unsigned int +| /* end confdefs.h. */ +| /* Define accept to an innocuous variant, in case declares accept. +| For example, HP-UX 11i declares gettimeofday. */ +| #define accept innocuous_accept +| +| /* System header to define __stub macros and hopefully few prototypes, +| which can conflict with char accept (); below. +| Prefer to if __STDC__ is defined, since +| exists even on freestanding compilers. */ +| +| #ifdef __STDC__ +| # include +| #else +| # include +| #endif +| +| #undef accept +| +| /* 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 accept (); +| /* 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_accept || defined __stub___accept +| choke me +| #endif +| +| int +| main () +| { +| return accept (); +| ; +| return 0; +| } +configure:11168: result: no +configure:11307: creating ./config.status + +## ---------------------- ## +## Running config.status. ## +## ---------------------- ## + +This file was extended by libantlr3c config.status 3.4, which was +generated by GNU Autoconf 2.66. Invocation command line was + + CONFIG_FILES = + CONFIG_HEADERS = + CONFIG_LINKS = + CONFIG_COMMANDS = + $ ./config.status + +on pc-4w14-0 + +config.status:1073: creating Makefile +config.status:1073: creating antlr3config.h +config.status:1253: antlr3config.h is unchanged +config.status:1301: executing depfiles commands +config.status:1301: executing libtool commands + +## ---------------- ## +## Cache variables. ## +## ---------------- ## + +ac_cv_build=x86_64-unknown-linux-gnu +ac_cv_c_compiler_gnu=yes +ac_cv_c_const=yes +ac_cv_c_inline=inline +ac_cv_c_int16_t=no +ac_cv_c_int32_t=no +ac_cv_c_int64_t=no +ac_cv_c_int8_t=no +ac_cv_c_uint16_t=no +ac_cv_c_uint32_t=no +ac_cv_c_uint64_t=no +ac_cv_c_uint8_t=no +ac_cv_env_CC_set= +ac_cv_env_CC_value= +ac_cv_env_CFLAGS_set= +ac_cv_env_CFLAGS_value= +ac_cv_env_CPPFLAGS_set= +ac_cv_env_CPPFLAGS_value= +ac_cv_env_CPP_set= +ac_cv_env_CPP_value= +ac_cv_env_LDFLAGS_set= +ac_cv_env_LDFLAGS_value= +ac_cv_env_LIBS_set= +ac_cv_env_LIBS_value= +ac_cv_env_build_alias_set= +ac_cv_env_build_alias_value= +ac_cv_env_host_alias_set= +ac_cv_env_host_alias_value= +ac_cv_env_target_alias_set= +ac_cv_env_target_alias_value= +ac_cv_func_accept=no +ac_cv_func_memmove=no +ac_cv_func_memset=no +ac_cv_func_strdup=no +ac_cv_header_arpa_nameser_h=no +ac_cv_header_ctype_h=no +ac_cv_header_dlfcn_h=yes +ac_cv_header_inttypes_h=yes +ac_cv_header_malloc_h=no +ac_cv_header_memory_h=yes +ac_cv_header_netdb_h=no +ac_cv_header_netinet_in_h=no +ac_cv_header_netinet_tcp_h=no +ac_cv_header_resolv_h=no +ac_cv_header_socket_h=no +ac_cv_header_stdarg_h=yes +ac_cv_header_stdc=yes +ac_cv_header_stdint_h=yes +ac_cv_header_stdlib_h=yes +ac_cv_header_string_h=yes +ac_cv_header_strings_h=yes +ac_cv_header_sys_malloc_h=no +ac_cv_header_sys_socket_h=no +ac_cv_header_sys_stat_h=yes +ac_cv_header_sys_types_h=yes +ac_cv_header_unistd_h=yes +ac_cv_host=x86_64-unknown-linux-gnu +ac_cv_objext=o +ac_cv_path_EGREP='/bin/grep -E' +ac_cv_path_FGREP='/bin/grep -F' +ac_cv_path_GREP=/bin/grep +ac_cv_path_SED=/bin/sed +ac_cv_path_install='/usr/bin/install -c' +ac_cv_path_mkdir=/bin/mkdir +ac_cv_prog_AWK=mawk +ac_cv_prog_CPP='gcc -E' +ac_cv_prog_ac_ct_AR=ar +ac_cv_prog_ac_ct_CC=gcc +ac_cv_prog_ac_ct_OBJDUMP=objdump +ac_cv_prog_ac_ct_RANLIB=ranlib +ac_cv_prog_ac_ct_STRIP=strip +ac_cv_prog_cc_c89= +ac_cv_prog_cc_g=yes +ac_cv_prog_make_make_set=yes +ac_cv_type_intptr_t=no +ac_cv_type_size_t=no +ac_cv_type_uintptr_t=no +am_cv_CC_dependencies_compiler_type=gcc3 +lt_cv_archive_cmds_need_lc=no +lt_cv_deplibs_check_method=pass_all +lt_cv_file_magic_cmd='$MAGIC_CMD' +lt_cv_file_magic_test_file= +lt_cv_ld_reload_flag=-r +lt_cv_nm_interface='BSD nm' +lt_cv_objdir=.libs +lt_cv_path_LD=/usr/bin/ld +lt_cv_path_NM='/usr/bin/nm -B' +lt_cv_prog_compiler_c_o=yes +lt_cv_prog_compiler_pic_works=yes +lt_cv_prog_compiler_rtti_exceptions=no +lt_cv_prog_compiler_static_works=yes +lt_cv_prog_gnu_ld=yes +lt_cv_shlibpath_overrides_runpath=no +lt_cv_sys_global_symbol_pipe='sed -n -e '\''s/^.*[ ]\([ABCDGIRSTW][ABCDGIRSTW]*\)[ ][ ]*\([_A-Za-z][_A-Za-z0-9]*\)$/\1 \2 \2/p'\''' +lt_cv_sys_global_symbol_to_c_name_address='sed -n -e '\''s/^: \([^ ]*\) $/ {\"\1\", (void *) 0},/p'\'' -e '\''s/^[ABCDGIRSTW]* \([^ ]*\) \([^ ]*\)$/ {"\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/^[ABCDGIRSTW]* \([^ ]*\) \(lib[^ ]*\)$/ {"\2", (void *) \&\2},/p'\'' -e '\''s/^[ABCDGIRSTW]* \([^ ]*\) \([^ ]*\)$/ {"lib\2", (void *) \&\2},/p'\''' +lt_cv_sys_global_symbol_to_cdecl='sed -n -e '\''s/^T .* \(.*\)$/extern int \1();/p'\'' -e '\''s/^[ABCDGIRSTW]* .* \(.*\)$/extern char \1;/p'\''' +lt_cv_sys_max_cmd_len=1572864 + +## ----------------- ## +## Output variables. ## +## ----------------- ## + +ACLOCAL='${SHELL} /home/carlo/laptop-repository/impl/antlr/libantlr3c-3.4/missing --run aclocal-1.11' +AMDEPBACKSLASH='\' +AMDEP_FALSE='#' +AMDEP_TRUE='' +AMTAR='${SHELL} /home/carlo/laptop-repository/impl/antlr/libantlr3c-3.4/missing --run tar' +AR='ar' +AUTOCONF='${SHELL} /home/carlo/laptop-repository/impl/antlr/libantlr3c-3.4/missing --run autoconf' +AUTOHEADER='${SHELL} /home/carlo/laptop-repository/impl/antlr/libantlr3c-3.4/missing --run autoheader' +AUTOMAKE='${SHELL} /home/carlo/laptop-repository/impl/antlr/libantlr3c-3.4/missing --run automake-1.11' +AWK='mawk' +CC='gcc' +CCDEPMODE='depmode=gcc3' +CFLAGS='-m32 -O2 -Wall' +CPP='gcc -E' +CPPFLAGS='' +CYGPATH_W='echo' +DEFS='-DHAVE_CONFIG_H' +DEPDIR='.deps' +DSYMUTIL='' +DUMPBIN='' +ECHO_C='' +ECHO_N='-n' +ECHO_T='' +EGREP='/bin/grep -E' +EXEEXT='' +FGREP='/bin/grep -F' +GREP='/bin/grep' +INSTALL_DATA='${INSTALL} -m 644' +INSTALL_PROGRAM='${INSTALL}' +INSTALL_SCRIPT='${INSTALL}' +INSTALL_STRIP_PROGRAM='$(install_sh) -c -s' +LD='/usr/bin/ld -m elf_x86_64' +LDFLAGS='' +LIBOBJS='' +LIBS='' +LIBTOOL='$(SHELL) $(top_builddir)/libtool' +LIPO='' +LN_S='ln -s' +LTLIBOBJS='' +MAINT='#' +MAINTAINER_MODE_FALSE='' +MAINTAINER_MODE_TRUE='#' +MAKEINFO='${SHELL} /home/carlo/laptop-repository/impl/antlr/libantlr3c-3.4/missing --run makeinfo' +MKDIR_P='/bin/mkdir -p' +NM='/usr/bin/nm -B' +NMEDIT='' +OBJDUMP='objdump' +OBJECT_MODE='' +OBJEXT='o' +OTOOL64='' +OTOOL='' +PACKAGE='libantlr3c' +PACKAGE_BUGREPORT='jimi@temporal-wave.com' +PACKAGE_NAME='libantlr3c' +PACKAGE_STRING='libantlr3c 3.4' +PACKAGE_TARNAME='libantlr3c' +PACKAGE_URL='' +PACKAGE_VERSION='3.4' +PATH_SEPARATOR=':' +RANLIB='ranlib' +SED='/bin/sed' +SET_MAKE='' +SHELL='/bin/bash' +STRIP='strip' +VERSION='3.4' +ac_ct_CC='gcc' +ac_ct_DUMPBIN='' +am__EXEEXT_FALSE='' +am__EXEEXT_TRUE='#' +am__fastdepCC_FALSE='#' +am__fastdepCC_TRUE='' +am__include='include' +am__isrc='' +am__leading_dot='.' +am__quote='' +am__tar='${AMTAR} chof - "$$tardir"' +am__untar='${AMTAR} xf -' +bindir='${exec_prefix}/bin' +build='x86_64-unknown-linux-gnu' +build_alias='' +build_cpu='x86_64' +build_os='linux-gnu' +build_vendor='unknown' +datadir='${datarootdir}' +datarootdir='${prefix}/share' +docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' +dvidir='${docdir}' +exec_prefix='${prefix}' +host='x86_64-unknown-linux-gnu' +host_alias='' +host_cpu='x86_64' +host_os='linux-gnu' +host_vendor='unknown' +htmldir='${docdir}' +includedir='${prefix}/include' +infodir='${datarootdir}/info' +install_sh='${SHELL} /home/carlo/laptop-repository/impl/antlr/libantlr3c-3.4/install-sh' +libdir='${exec_prefix}/lib' +libexecdir='${exec_prefix}/libexec' +localedir='${datarootdir}/locale' +localstatedir='${prefix}/var' +mandir='${datarootdir}/man' +mkdir_p='/bin/mkdir -p' +oldincludedir='/usr/include' +pdfdir='${docdir}' +prefix='/usr/local' +program_transform_name='s,x,x,' +psdir='${docdir}' +sbindir='${exec_prefix}/sbin' +sharedstatedir='${prefix}/com' +sysconfdir='${prefix}/etc' +target_alias='' + +## ----------- ## +## confdefs.h. ## +## ----------- ## + +/* confdefs.h */ +#define PACKAGE_NAME "libantlr3c" +#define PACKAGE_TARNAME "libantlr3c" +#define PACKAGE_VERSION "3.4" +#define PACKAGE_STRING "libantlr3c 3.4" +#define PACKAGE_BUGREPORT "jimi@temporal-wave.com" +#define PACKAGE_URL "" +#define PACKAGE "libantlr3c" +#define VERSION "3.4" +#define STDC_HEADERS 1 +#define HAVE_SYS_TYPES_H 1 +#define HAVE_SYS_STAT_H 1 +#define HAVE_STDLIB_H 1 +#define HAVE_STRING_H 1 +#define HAVE_MEMORY_H 1 +#define HAVE_STRINGS_H 1 +#define HAVE_INTTYPES_H 1 +#define HAVE_STDINT_H 1 +#define HAVE_UNISTD_H 1 +#define HAVE_DLFCN_H 1 +#define LT_OBJDIR ".libs/" +#define HAVE_SYS_TYPES_H 1 +#define HAVE_STDARG_H 1 +#define HAVE_SYS_STAT_H 1 +#define size_t unsigned int + +configure: exit 0 diff --git a/antlr/libantlr3c-3.4/config.status b/antlr/libantlr3c-3.4/config.status new file mode 100755 index 0000000..3ab6ce7 --- /dev/null +++ b/antlr/libantlr3c-3.4/config.status @@ -0,0 +1,2048 @@ +#! /bin/bash +# Generated 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 +ac_cs_recheck=false +ac_cs_silent=false + +SHELL=${CONFIG_SHELL-/bin/bash} +export SHELL +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -p' + fi +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in #( + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +exec 6>&1 +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +# 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 libantlr3c $as_me 3.4, which was +generated by GNU Autoconf 2.66. 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` +" + +# Files that config.status was made for. +config_files=" Makefile" +config_headers=" antlr3config.h" +config_commands=" depfiles libtool" + +ac_cs_usage="\ +\`$as_me' instantiates files and other configuration actions +from templates according to the current configuration. Unless the files +and actions are specified as TAGs, all are instantiated by default. + +Usage: $0 [OPTION]... [TAG]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + --config print configuration, then exit + -q, --quiet, --silent + do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Configuration commands: +$config_commands + +Report bugs to ." + +ac_cs_config="" +ac_cs_version="\ +libantlr3c config.status 3.4 +configured by ./configure, generated by GNU Autoconf 2.66, + with options \"$ac_cs_config\" + +Copyright (C) 2010 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='/home/carlo/laptop-repository/impl/antlr/libantlr3c-3.4' +srcdir='.' +INSTALL='/usr/bin/install -c' +MKDIR_P='/bin/mkdir -p' +AWK='mawk' +test -n "$AWK" || AWK=awk +# 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 ;; + --config | --confi | --conf | --con | --co | --c ) + $as_echo "$ac_cs_config"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append CONFIG_HEADERS " '$ac_optarg'" + ac_need_defaults=false;; + --he | --h) + # Conflict between --help and --header + as_fn_error $? "ambiguous option: \`$1' +Try \`$0 --help' for more information.";; + --help | --hel | -h ) + $as_echo "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) as_fn_error $? "unrecognized option: \`$1' +Try \`$0 --help' for more information." ;; + + *) as_fn_append ac_config_targets " $1" + ac_need_defaults=false ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +if $ac_cs_recheck; then + set X '/bin/bash' './configure' $ac_configure_extra_args --no-create --no-recursion + shift + $as_echo "running CONFIG_SHELL=/bin/bash $*" >&6 + CONFIG_SHELL='/bin/bash' + export CONFIG_SHELL + exec "$@" +fi + +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 + +# +# INIT-COMMANDS +# +AMDEP_TRUE="" 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='s/\(["`$\\]\)/\\\1/g' +double_quote_subst='s/\(["`\\]\)/\\\1/g' +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' +macro_version='2.2.10' +macro_revision='1.3175' +enable_shared='yes' +enable_static='yes' +pic_mode='default' +enable_fast_install='yes' +SHELL='/bin/bash' +ECHO='printf %s\n' +host_alias='' +host='x86_64-unknown-linux-gnu' +host_os='linux-gnu' +build_alias='' +build='x86_64-unknown-linux-gnu' +build_os='linux-gnu' +SED='/bin/sed' +Xsed='/bin/sed -e 1s/^X//' +GREP='/bin/grep' +EGREP='/bin/grep -E' +FGREP='/bin/grep -F' +LD='/usr/bin/ld -m elf_x86_64' +NM='/usr/bin/nm -B' +LN_S='ln -s' +max_cmd_len='1572864' +ac_objext='o' +exeext='' +lt_unset='unset' +lt_SP2NL='tr \040 \012' +lt_NL2SP='tr \015\012 \040\040' +reload_flag=' -r' +reload_cmds='$LD$reload_flag -o $output$reload_objs' +OBJDUMP='objdump' +deplibs_check_method='pass_all' +file_magic_cmd='$MAGIC_CMD' +AR='ar' +AR_FLAGS='cru' +STRIP='strip' +RANLIB='ranlib' +old_postinstall_cmds='chmod 644 $oldlib~$RANLIB $oldlib' +old_postuninstall_cmds='' +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs~$RANLIB $oldlib' +lock_old_archive_extraction='no' +CC='gcc' +CFLAGS='-m32 -O2 -Wall' +compiler='gcc' +GCC='yes' +lt_cv_sys_global_symbol_pipe='sed -n -e '\''s/^.*[ ]\([ABCDGIRSTW][ABCDGIRSTW]*\)[ ][ ]*\([_A-Za-z][_A-Za-z0-9]*\)$/\1 \2 \2/p'\''' +lt_cv_sys_global_symbol_to_cdecl='sed -n -e '\''s/^T .* \(.*\)$/extern int \1();/p'\'' -e '\''s/^[ABCDGIRSTW]* .* \(.*\)$/extern char \1;/p'\''' +lt_cv_sys_global_symbol_to_c_name_address='sed -n -e '\''s/^: \([^ ]*\) $/ {\"\1\", (void *) 0},/p'\'' -e '\''s/^[ABCDGIRSTW]* \([^ ]*\) \([^ ]*\)$/ {"\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/^[ABCDGIRSTW]* \([^ ]*\) \(lib[^ ]*\)$/ {"\2", (void *) \&\2},/p'\'' -e '\''s/^[ABCDGIRSTW]* \([^ ]*\) \([^ ]*\)$/ {"lib\2", (void *) \&\2},/p'\''' +objdir='.libs' +MAGIC_CMD='file' +lt_prog_compiler_no_builtin_flag=' -fno-builtin' +lt_prog_compiler_wl='-Wl,' +lt_prog_compiler_pic=' -fPIC -DPIC' +lt_prog_compiler_static='-static' +lt_cv_prog_compiler_c_o='yes' +need_locks='no' +DSYMUTIL='' +NMEDIT='' +LIPO='' +OTOOL='' +OTOOL64='' +libext='a' +shrext_cmds='.so' +extract_expsyms_cmds='' +archive_cmds_need_lc='no' +enable_shared_with_static_runtimes='no' +export_dynamic_flag_spec='${wl}--export-dynamic' +whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive' +compiler_needs_object='no' +old_archive_from_new_cmds='' +old_archive_from_expsyms_cmds='' +archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' +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 -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' +module_cmds='' +module_expsym_cmds='' +with_gnu_ld='yes' +allow_undefined_flag='' +no_undefined_flag='' +hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' +hardcode_libdir_flag_spec_ld='' +hardcode_libdir_separator='' +hardcode_direct='no' +hardcode_direct_absolute='no' +hardcode_minus_L='no' +hardcode_shlibpath_var='unsupported' +hardcode_automatic='no' +inherit_rpath='no' +link_all_deplibs='unknown' +fix_srcfile_path='' +always_export_symbols='no' +export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' +exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' +include_expsyms='' +prelink_cmds='' +file_list_spec='' +variables_saved_for_relink='PATH LD_LIBRARY_PATH LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH' +need_lib_prefix='no' +need_version='no' +version_type='linux' +runpath_var='LD_RUN_PATH' +shlibpath_var='LD_LIBRARY_PATH' +shlibpath_overrides_runpath='no' +libname_spec='lib$name' +library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' +soname_spec='${libname}${release}${shared_ext}$major' +install_override_mode='' +postinstall_cmds='' +postuninstall_cmds='' +finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' +finish_eval='' +hardcode_into_libs='yes' +sys_lib_search_path_spec='/usr/lib/gcc/x86_64-linux-gnu/4.6 /usr/lib/x86_64-linux-gnu /usr/lib /lib/x86_64-linux-gnu /lib ' +sys_lib_dlsearch_path_spec='/lib64 /usr/lib64 /lib /usr/lib /usr/local/lib /lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu /lib32 /usr/lib32 ' +hardcode_action='immediate' +enable_dlopen='unknown' +enable_dlopen_self='unknown' +enable_dlopen_self_static='unknown' +old_striplib='strip --strip-debug' +striplib='strip --strip-unneeded' + +LTCC='gcc' +LTCFLAGS='-g -O2' +compiler='gcc' + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +$1 +_LTECHO_EOF' +} + +# Quote evaled strings. +for var in SHELL ECHO 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 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 install_override_mode finish_eval old_striplib striplib; do + case `eval \\$ECHO \\""\\$$var"\\"` in + *[\\\`\"\$]*) + eval "lt_$var=\\\"\`\$ECHO \"\$$var\" | \$SED \"\$sed_quote_subst\"\`\\\"" + ;; + *) + eval "lt_$var=\\\"\$$var\\\"" + ;; + esac +done + +# Double-quote double-evaled strings. +for var in reload_cmds old_postinstall_cmds old_postuninstall_cmds old_archive_cmds extract_expsyms_cmds old_archive_from_new_cmds old_archive_from_expsyms_cmds archive_cmds archive_expsym_cmds module_cmds module_expsym_cmds export_symbols_cmds prelink_cmds postinstall_cmds postuninstall_cmds finish_cmds sys_lib_search_path_spec sys_lib_dlsearch_path_spec; do + case `eval \\$ECHO \\""\\$$var"\\"` in + *[\\\`\"\$]*) + eval "lt_$var=\\\"\`\$ECHO \"\$$var\" | \$SED -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" + ;; + *) + eval "lt_$var=\\\"\$$var\\\"" + ;; + esac +done + +ac_aux_dir='.' +xsi_shell='yes' +lt_shell_append='yes' + +# 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='libantlr3c' + VERSION='3.4' + TIMESTAMP='' + RM='rm -f' + ofile='libtool' + + + + + +# 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" ;; + "antlr3config.h") CONFIG_HEADERS="$CONFIG_HEADERS antlr3config.h" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + esac +done + + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+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 'as_fn_exit 1' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -n "$tmp" && test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$tmp/subs1.awk" && +cat >>"$tmp/subs1.awk" <<\_ACAWK && +S["am__EXEEXT_FALSE"]="" +S["am__EXEEXT_TRUE"]="#" +S["LTLIBOBJS"]="" +S["LIBOBJS"]="" +S["OBJECT_MODE"]="" +S["CPP"]="gcc -E" +S["OTOOL64"]="" +S["OTOOL"]="" +S["LIPO"]="" +S["NMEDIT"]="" +S["DSYMUTIL"]="" +S["RANLIB"]="ranlib" +S["AR"]="ar" +S["OBJDUMP"]="objdump" +S["LN_S"]="ln -s" +S["NM"]="/usr/bin/nm -B" +S["ac_ct_DUMPBIN"]="" +S["DUMPBIN"]="" +S["LD"]="/usr/bin/ld -m elf_x86_64" +S["FGREP"]="/bin/grep -F" +S["EGREP"]="/bin/grep -E" +S["GREP"]="/bin/grep" +S["SED"]="/bin/sed" +S["host_os"]="linux-gnu" +S["host_vendor"]="unknown" +S["host_cpu"]="x86_64" +S["host"]="x86_64-unknown-linux-gnu" +S["build_os"]="linux-gnu" +S["build_vendor"]="unknown" +S["build_cpu"]="x86_64" +S["build"]="x86_64-unknown-linux-gnu" +S["LIBTOOL"]="$(SHELL) $(top_builddir)/libtool" +S["MAINT"]="#" +S["MAINTAINER_MODE_FALSE"]="" +S["MAINTAINER_MODE_TRUE"]="#" +S["am__fastdepCC_FALSE"]="#" +S["am__fastdepCC_TRUE"]="" +S["CCDEPMODE"]="depmode=gcc3" +S["AMDEPBACKSLASH"]="\\" +S["AMDEP_FALSE"]="#" +S["AMDEP_TRUE"]="" +S["am__quote"]="" +S["am__include"]="include" +S["DEPDIR"]=".deps" +S["OBJEXT"]="o" +S["EXEEXT"]="" +S["ac_ct_CC"]="gcc" +S["CPPFLAGS"]="" +S["LDFLAGS"]="" +S["CFLAGS"]="-m32 -O2 -Wall" +S["CC"]="gcc" +S["am__untar"]="${AMTAR} xf -" +S["am__tar"]="${AMTAR} chof - \"$$tardir\"" +S["AMTAR"]="${SHELL} /home/carlo/laptop-repository/impl/antlr/libantlr3c-3.4/missing --run tar" +S["am__leading_dot"]="." +S["SET_MAKE"]="" +S["AWK"]="mawk" +S["mkdir_p"]="/bin/mkdir -p" +S["MKDIR_P"]="/bin/mkdir -p" +S["INSTALL_STRIP_PROGRAM"]="$(install_sh) -c -s" +S["STRIP"]="strip" +S["install_sh"]="${SHELL} /home/carlo/laptop-repository/impl/antlr/libantlr3c-3.4/install-sh" +S["MAKEINFO"]="${SHELL} /home/carlo/laptop-repository/impl/antlr/libantlr3c-3.4/missing --run makeinfo" +S["AUTOHEADER"]="${SHELL} /home/carlo/laptop-repository/impl/antlr/libantlr3c-3.4/missing --run autoheader" +S["AUTOMAKE"]="${SHELL} /home/carlo/laptop-repository/impl/antlr/libantlr3c-3.4/missing --run automake-1.11" +S["AUTOCONF"]="${SHELL} /home/carlo/laptop-repository/impl/antlr/libantlr3c-3.4/missing --run autoconf" +S["ACLOCAL"]="${SHELL} /home/carlo/laptop-repository/impl/antlr/libantlr3c-3.4/missing --run aclocal-1.11" +S["VERSION"]="3.4" +S["PACKAGE"]="libantlr3c" +S["CYGPATH_W"]="echo" +S["am__isrc"]="" +S["INSTALL_DATA"]="${INSTALL} -m 644" +S["INSTALL_SCRIPT"]="${INSTALL}" +S["INSTALL_PROGRAM"]="${INSTALL}" +S["target_alias"]="" +S["host_alias"]="" +S["build_alias"]="" +S["LIBS"]="" +S["ECHO_T"]="" +S["ECHO_N"]="-n" +S["ECHO_C"]="" +S["DEFS"]="-DHAVE_CONFIG_H" +S["mandir"]="${datarootdir}/man" +S["localedir"]="${datarootdir}/locale" +S["libdir"]="${exec_prefix}/lib" +S["psdir"]="${docdir}" +S["pdfdir"]="${docdir}" +S["dvidir"]="${docdir}" +S["htmldir"]="${docdir}" +S["infodir"]="${datarootdir}/info" +S["docdir"]="${datarootdir}/doc/${PACKAGE_TARNAME}" +S["oldincludedir"]="/usr/include" +S["includedir"]="${prefix}/include" +S["localstatedir"]="${prefix}/var" +S["sharedstatedir"]="${prefix}/com" +S["sysconfdir"]="${prefix}/etc" +S["datadir"]="${datarootdir}" +S["datarootdir"]="${prefix}/share" +S["libexecdir"]="${exec_prefix}/libexec" +S["sbindir"]="${exec_prefix}/sbin" +S["bindir"]="${exec_prefix}/bin" +S["program_transform_name"]="s,x,x," +S["prefix"]="/usr/local" +S["exec_prefix"]="${prefix}" +S["PACKAGE_URL"]="" +S["PACKAGE_BUGREPORT"]="jimi@temporal-wave.com" +S["PACKAGE_STRING"]="libantlr3c 3.4" +S["PACKAGE_VERSION"]="3.4" +S["PACKAGE_TARNAME"]="libantlr3c" +S["PACKAGE_NAME"]="libantlr3c" +S["PATH_SEPARATOR"]=":" +S["SHELL"]="/bin/bash" +_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 +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_fn_error $? "could not setup config files machinery" "$LINENO" 5 +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 { +D["PACKAGE_NAME"]=" \"libantlr3c\"" +D["PACKAGE_TARNAME"]=" \"libantlr3c\"" +D["PACKAGE_VERSION"]=" \"3.4\"" +D["PACKAGE_STRING"]=" \"libantlr3c 3.4\"" +D["PACKAGE_BUGREPORT"]=" \"jimi@temporal-wave.com\"" +D["PACKAGE_URL"]=" \"\"" +D["PACKAGE"]=" \"libantlr3c\"" +D["VERSION"]=" \"3.4\"" +D["STDC_HEADERS"]=" 1" +D["HAVE_SYS_TYPES_H"]=" 1" +D["HAVE_SYS_STAT_H"]=" 1" +D["HAVE_STDLIB_H"]=" 1" +D["HAVE_STRING_H"]=" 1" +D["HAVE_MEMORY_H"]=" 1" +D["HAVE_STRINGS_H"]=" 1" +D["HAVE_INTTYPES_H"]=" 1" +D["HAVE_STDINT_H"]=" 1" +D["HAVE_UNISTD_H"]=" 1" +D["HAVE_DLFCN_H"]=" 1" +D["LT_OBJDIR"]=" \".libs/\"" +D["HAVE_SYS_TYPES_H"]=" 1" +D["HAVE_STDARG_H"]=" 1" +D["HAVE_SYS_STAT_H"]=" 1" +D["size_t"]=" unsigned int" + for (key in D) D_is_set[key] = 1 + FS = "" +} +/^[\t ]*#[\t ]*(define|undef)[\t ]+[_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ][_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789]*([\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 + as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 +fi # test -n "$CONFIG_HEADERS" + + +eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; + esac + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + as_fn_append ac_file_inputs " '$ac_f'" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir="$ac_dir"; as_fn_mkdir_p + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + esac + ac_MKDIR_P=$MKDIR_P + case $MKDIR_P in + [\\/$]* | ?:[\\/]* ) ;; + */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; + esac +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} + ac_datarootdir_hack=' + s&@datadir@&${datarootdir}&g + s&@docdir@&${datarootdir}/doc/${PACKAGE_TARNAME}&g + s&@infodir@&${datarootdir}/info&g + s&@localedir@&${datarootdir}/locale&g + s&@mandir@&${datarootdir}/man&g + s&\${datarootdir}&${prefix}/share&g' ;; +esac +ac_sed_extra="/^[ ]*VPATH[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// +s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// +s/^[^=]*=[ ]*$// +} + +: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_fn_error $? "could not create $ac_file" "$LINENO" 5 + +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:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&5 +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&2;} + + rm -f "$tmp/stdin" + case $ac_file in + -) cat "$tmp/out" && rm -f "$tmp/out";; + *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; + esac \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + ;; + :H) + # + # CONFIG_HEADER + # + if test x"$ac_file" != x-; then + { + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" + } >"$tmp/config.h" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then + { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 +$as_echo "$as_me: $ac_file is unchanged" >&6;} + else + rm -f "$ac_file" + mv "$tmp/config.h" "$ac_file" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + fi + else + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \ + || as_fn_error $? "could not create -" "$LINENO" 5 + fi +# Compute "$ac_file"'s index in $config_headers. +_am_arg="$ac_file" +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || +$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$_am_arg" : 'X\(//\)[^/]' \| \ + X"$_am_arg" : 'X\(//\)$' \| \ + X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$_am_arg" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'`/stamp-h$_am_stamp_count + ;; + + :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 +$as_echo "$as_me: executing $ac_file commands" >&6;} + ;; + esac + + + case $ac_file$ac_mode in + "depfiles":C) test x"$AMDEP_TRUE" != x"" || { + # Autoconf 2.62 quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac + shift + for mf + do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`$as_dirname -- "$mf" || +$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$mf" : 'X\(//\)[^/]' \| \ + X"$mf" : 'X\(//\)$' \| \ + X"$mf" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$mf" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`$as_dirname -- "$file" || +$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$file" : 'X\(//\)[^/]' \| \ + X"$file" : 'X\(//\)$' \| \ + X"$file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir=$dirpart/$fdir; as_fn_mkdir_p + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done + done +} + ;; + "libtool":C) + + # See if we are running on zsh, and set the options which allow our + # commands through without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + + cfgfile="${ofile}T" + trap "$RM \"$cfgfile\"; exit 1" 1 2 15 + $RM "$cfgfile" + + cat <<_LT_EOF >> "$cfgfile" +#! $SHELL + +# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: +# NOTE: Changes made to this file will be lost: look at ltmain.sh. +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +# 2006, 2007, 2008, 2009, 2010 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 + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# An echo program that protects backslashes. +ECHO=$lt_ECHO + +# 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 + +# 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 + +# Whether to use a lock for old archive extraction. +lock_old_archive_extraction=$lock_old_archive_extraction + +# A C compiler. +LTCC=$lt_CC + +# LTCC compiler flags. +LTCFLAGS=$lt_CFLAGS + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration. +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm in a C name address pair. +global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address + +# Transform the output of nm in a C name address pair when lib prefix is needed. +global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# Used to examine libraries when file_magic_cmd begins with "file". +MAGIC_CMD=$MAGIC_CMD + +# Must we lock files when doing compilation? +need_locks=$lt_need_locks + +# Tool to manipulate archived DWARF debug symbol files on Mac OS X. +DSYMUTIL=$lt_DSYMUTIL + +# Tool to change global to local symbols on Mac OS X. +NMEDIT=$lt_NMEDIT + +# Tool to manipulate fat objects and archives on Mac OS X. +LIPO=$lt_LIPO + +# ldd/readelf like tool for Mach-O binaries on Mac OS X. +OTOOL=$lt_OTOOL + +# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. +OTOOL64=$lt_OTOOL64 + +# Old archive suffix (normally "a"). +libext=$libext + +# Shared library suffix (normally ".so"). +shrext_cmds=$lt_shrext_cmds + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at link time. +variables_saved_for_relink=$lt_variables_saved_for_relink + +# Do we need the "lib" prefix for modules? +need_lib_prefix=$need_lib_prefix + +# Do we need a version for libraries? +need_version=$need_version + +# Library versioning type. +version_type=$version_type + +# Shared library runtime path variable. +runpath_var=$runpath_var + +# Shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# Format of library name prefix. +libname_spec=$lt_libname_spec + +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME +library_names_spec=$lt_library_names_spec + +# The coded name of the library, if different from the real name. +soname_spec=$lt_soname_spec + +# Permission mode override for installation of shared libraries. +install_override_mode=$lt_install_override_mode + +# Command to use after installation of a shared archive. +postinstall_cmds=$lt_postinstall_cmds + +# Command to use after uninstallation of a shared archive. +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# As "finish_cmds", except a single script fragment to be evaled but +# not shown. +finish_eval=$lt_finish_eval + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# Compile-time system search path for libraries. +sys_lib_search_path_spec=$lt_sys_lib_search_path_spec + +# Run-time system search path for libraries. +sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec + +# Whether dlopen is supported. +dlopen_support=$enable_dlopen + +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self + +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + + +# The linker used to build libraries. +LD=$lt_LD + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# Commands used to build an old-style archive. +old_archive_cmds=$lt_old_archive_cmds + +# A language specific compiler. +CC=$lt_compiler + +# Is the compiler the GNU compiler? +with_gcc=$GCC + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag + +# 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 "${1}" | $SED "$dirname"` + if test "X$func_dirname_result" = "X${1}"; then + func_dirname_result="${3}" + else + func_dirname_result="$func_dirname_result${2}" + fi +} + +# func_basename file +func_basename () +{ + func_basename_result=`$ECHO "${1}" | $SED "$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 "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; + *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; 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 "${1}" | $SED "$my_sed_long_opt"` + func_opt_split_arg=`$ECHO "${1}" | $SED "$my_sed_long_arg"` +} + +# func_lo2o object +func_lo2o () +{ + func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` +} + +# func_xform libobj-or-source +func_xform () +{ + func_xform_result=`$ECHO "${1}" | $SED '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 + + +as_fn_exit 0 diff --git a/antlr/libantlr3c-3.4/config.sub b/antlr/libantlr3c-3.4/config.sub new file mode 100755 index 0000000..2a55a50 --- /dev/null +++ b/antlr/libantlr3c-3.4/config.sub @@ -0,0 +1,1705 @@ +#! /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, 2009 +# Free Software Foundation, Inc. + +timestamp='2009-11-20' + +# 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 . Submit a context +# diff and a properly formatted GNU ChangeLog entry. +# +# Configuration subroutine to validate and canonicalize a configuration type. +# Supply the specified configuration type as an argument. +# If it is invalid, we print an error message on stderr and exit with code 1. +# Otherwise, we print the canonical config type on stdout and succeed. + +# You can get the latest version of this script from: +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD + +# This file is supposed to be the same for all GNU packages +# and recognize all the CPU types, system types and aliases +# that are meaningful with *any* GNU software. +# Each package is responsible for reporting which valid configurations +# it does not support. The user should be able to distinguish +# a failure to support a valid configuration from a meaningless +# configuration. + +# The goal of this file is to map all the various variations of a given +# machine specification into a single specification in the form: +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or in some cases, the newer four-part form: +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +# It is wrong to echo any other type of specification. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] CPU-MFR-OPSYS + $0 [OPTION] ALIAS + +Canonicalize a configuration name. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.sub ($timestamp) + +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, +2002, 2003, 2004, 2005, 2006, 2007, 2008 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 | -microblaze) + os= + basic_machine=$1 + ;; + -bluegene*) + os=-cnk + ;; + -sim | -cisco | -oki | -wec | -winbond) + os= + basic_machine=$1 + ;; + -scout) + ;; + -wrs) + os=-vxworks + basic_machine=$1 + ;; + -chorusos*) + os=-chorusos + basic_machine=$1 + ;; + -chorusrdb) + os=-chorusrdb + basic_machine=$1 + ;; + -hiux*) + os=-hiuxwe2 + ;; + -sco6) + os=-sco5v6 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco5) + os=-sco3.2v5 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco4) + os=-sco3.2v4 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2.[4-9]*) + os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2v[4-9]*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco5v6*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco*) + os=-sco3.2v2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -udk*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -isc) + os=-isc2.2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -clix*) + basic_machine=clipper-intergraph + ;; + -isc*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -lynx*) + os=-lynxos + ;; + -ptx*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` + ;; + -windowsnt*) + os=`echo $os | sed -e 's/windowsnt/winnt/'` + ;; + -psos*) + os=-psos + ;; + -mint | -mint[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; +esac + +# Decode aliases for certain CPU-COMPANY combinations. +case $basic_machine in + # Recognize the basic CPU types without company name. + # Some are omitted here because they have special meanings below. + 1750a | 580 \ + | a29k \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ + | am33_2.0 \ + | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ + | 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 \ + | moxie \ + | mt \ + | msp430 \ + | nios | nios2 \ + | ns16k | ns32k \ + | or32 \ + | pdp10 | pdp11 | pj | pjl \ + | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ + | pyramid \ + | rx \ + | score \ + | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ + | sh64 | sh64le \ + | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ + | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ + | spu | strongarm \ + | tahoe | thumb | tic4x | tic80 | tron \ + | ubicom32 \ + | v850 | v850e \ + | we32k \ + | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ + | z8k | z80) + basic_machine=$basic_machine-unknown + ;; + m6811 | m68hc11 | m6812 | m68hc12 | picochip) + # 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-* | microblaze-* \ + | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ + | mips16-* \ + | mips64-* | mips64el-* \ + | mips64octeon-* | mips64octeonel-* \ + | mips64orion-* | mips64orionel-* \ + | mips64r5900-* | mips64r5900el-* \ + | mips64vr-* | mips64vrel-* \ + | mips64vr4100-* | mips64vr4100el-* \ + | mips64vr4300-* | mips64vr4300el-* \ + | mips64vr5000-* | mips64vr5000el-* \ + | mips64vr5900-* | mips64vr5900el-* \ + | mipsisa32-* | mipsisa32el-* \ + | mipsisa32r2-* | mipsisa32r2el-* \ + | mipsisa64-* | mipsisa64el-* \ + | mipsisa64r2-* | mipsisa64r2el-* \ + | mipsisa64sb1-* | mipsisa64sb1el-* \ + | mipsisa64sr71k-* | mipsisa64sr71kel-* \ + | mipstx39-* | mipstx39el-* \ + | mmix-* \ + | mt-* \ + | msp430-* \ + | nios-* | nios2-* \ + | none-* | np1-* | ns16k-* | ns32k-* \ + | orion-* \ + | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ + | pyramid-* \ + | romp-* | rs6000-* | rx-* \ + | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ + | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ + | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ + | sparclite-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ + | tahoe-* | thumb-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \ + | tron-* \ + | ubicom32-* \ + | 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 + ;; + bluegene*) + basic_machine=powerpc-ibm + os=-cnk + ;; + 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 + ;; + microblaze) + basic_machine=microblaze-xilinx + ;; + mingw32) + basic_machine=i386-pc + os=-mingw32 + ;; + mingw32ce) + basic_machine=arm-unknown + os=-mingw32ce + ;; + miniframe) + basic_machine=m68000-convergent + ;; + *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; + mips3*-*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` + ;; + mips3*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown + ;; + monitor) + basic_machine=m68k-rom68k + os=-coff + ;; + morphos) + basic_machine=powerpc-unknown + os=-morphos + ;; + msdos) + basic_machine=i386-pc + os=-msdos + ;; + ms1-*) + basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` + ;; + 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. + -auroraux) + os=-auroraux + ;; + -solaris1 | -solaris1.*) + os=`echo $os | sed -e 's|solaris1|sunos4|'` + ;; + -solaris) + os=-solaris2 + ;; + -svr4*) + os=-sysv4 + ;; + -unixware*) + os=-sysv4.2uw + ;; + -gnu/linux*) + os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` + ;; + # First accept the basic system types. + # The portable systems comes first. + # Each alternative MUST END IN A *, to match a version number. + # -sysv* is not here because it comes later, after sysvr4. + -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ + | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ + | -sym* | -kopensolaris* \ + | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ + | -aos* | -aros* \ + | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ + | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ + | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ + | -openbsd* | -solidbsd* \ + | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ + | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ + | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ + | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ + | -chorusos* | -chorusrdb* | -cegcc* \ + | -cygwin* | -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* | -es*) + # Remember, each alternative MUST END IN *, to match a version number. + ;; + -qnx*) + case $basic_machine in + x86-* | i*86-*) + ;; + *) + os=-nto$os + ;; + esac + ;; + -nto-qnx*) + ;; + -nto*) + os=`echo $os | sed -e 's|nto|nto-qnx|'` + ;; + -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ + | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ + | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) + ;; + -mac*) + os=`echo $os | sed -e 's|mac|macos|'` + ;; + -linux-dietlibc) + os=-linux-dietlibc + ;; + -linux*) + os=`echo $os | sed -e 's|linux|linux-gnu|'` + ;; + -sunos5*) + os=`echo $os | sed -e 's|sunos5|solaris2|'` + ;; + -sunos6*) + os=`echo $os | sed -e 's|sunos6|solaris3|'` + ;; + -opened*) + os=-openedition + ;; + -os400*) + os=-os400 + ;; + -wince*) + os=-wince + ;; + -osfrose*) + os=-osfrose + ;; + -osf*) + os=-osf + ;; + -utek*) + os=-bsd + ;; + -dynix*) + os=-bsd + ;; + -acis*) + os=-aos + ;; + -atheos*) + os=-atheos + ;; + -syllable*) + os=-syllable + ;; + -386bsd) + os=-bsd + ;; + -ctix* | -uts*) + os=-sysv + ;; + -nova*) + os=-rtmk-nova + ;; + -ns2 ) + os=-nextstep2 + ;; + -nsk*) + os=-nsk + ;; + # Preserve the version number of sinix5. + -sinix5.*) + os=`echo $os | sed -e 's|sinix|sysv|'` + ;; + -sinix*) + os=-sysv4 + ;; + -tpf*) + os=-tpf + ;; + -triton*) + os=-sysv3 + ;; + -oss*) + os=-sysv3 + ;; + -svr4) + os=-sysv4 + ;; + -svr3) + os=-sysv3 + ;; + -sysvr4) + os=-sysv4 + ;; + # This must come after -sysvr4. + -sysv*) + ;; + -ose*) + os=-ose + ;; + -es1800*) + os=-ose + ;; + -xenix) + os=-xenix + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + os=-mint + ;; + -aros*) + os=-aros + ;; + -kaos*) + os=-kaos + ;; + -zvmoe) + os=-zvmoe + ;; + -dicos*) + os=-dicos + ;; + -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 + ;; + -cnk*|-aix*) + vendor=ibm + ;; + -beos*) + vendor=be + ;; + -hpux*) + vendor=hp + ;; + -mpeix*) + vendor=hp + ;; + -hiux*) + vendor=hitachi + ;; + -unos*) + vendor=crds + ;; + -dgux*) + vendor=dg + ;; + -luna*) + vendor=omron + ;; + -genix*) + vendor=ns + ;; + -mvs* | -opened*) + vendor=ibm + ;; + -os400*) + vendor=ibm + ;; + -ptx*) + vendor=sequent + ;; + -tpf*) + vendor=ibm + ;; + -vxsim* | -vxworks* | -windiss*) + vendor=wrs + ;; + -aux*) + vendor=apple + ;; + -hms*) + vendor=hitachi + ;; + -mpw* | -macos*) + vendor=apple + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + vendor=atari + ;; + -vos*) + vendor=stratus + ;; + esac + basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` + ;; +esac + +echo $basic_machine$os +exit + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/antlr/libantlr3c-3.4/configure b/antlr/libantlr3c-3.4/configure new file mode 100755 index 0000000..c548a98 --- /dev/null +++ b/antlr/libantlr3c-3.4/configure @@ -0,0 +1,13527 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.66 for libantlr3c 3.4. +# +# Report bugs to . +# +# +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software +# Foundation, Inc. +# +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. +# +# +# (The "BSD licence") +# Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC +# http://www.temporal-wave.com +# http://www.linkedin.com/in/jimidle +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +if test "x$CONFIG_SHELL" = x; then + as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi +" + as_required="as_fn_return () { (exit \$1); } +as_fn_success () { as_fn_return 0; } +as_fn_failure () { as_fn_return 1; } +as_fn_ret_success () { return 0; } +as_fn_ret_failure () { return 1; } + +exitcode=0 +as_fn_success || { exitcode=1; echo as_fn_success failed.; } +as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } +as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } +as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } +if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : + +else + exitcode=1; echo positional parameters were not saved. +fi +test x\$exitcode = x0 || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 + + test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( + ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' + ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO + ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO + PATH=/empty FPATH=/empty; export PATH FPATH + test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ + || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1 +test \$(( 1 + 1 )) = 2 || exit 1" + if (eval "$as_required") 2>/dev/null; then : + as_have_required=yes +else + as_have_required=no +fi + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : + +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + as_found=: + case $as_dir in #( + /*) + for as_base in sh bash ksh sh5; do + # Try only shells that exist, to save several forks. + as_shell=$as_dir/$as_base + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + CONFIG_SHELL=$as_shell as_have_required=yes + if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + break 2 +fi +fi + done;; + esac + as_found=false +done +$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi; } +IFS=$as_save_IFS + + + if test "x$CONFIG_SHELL" != x; then : + # We cannot yet assume a decent shell, so we have to provide a + # neutralization value for shells without unset; and this also + # works around shells that cannot unset nonexistent variables. + BASH_ENV=/dev/null + ENV=/dev/null + (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} +fi + + if test x$as_have_required = xno; then : + $as_echo "$0: This script requires a shell more modern than all" + $as_echo "$0: the shells that I found on your system." + if test x${ZSH_VERSION+set} = xset ; then + $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" + $as_echo "$0: be upgraded to zsh 4.3.4 or later." + else + $as_echo "$0: Please tell bug-autoconf@gnu.org and +$0: jimi@temporal-wave.com about your system, including any +$0: error possibly output before this message. Then install +$0: a modern shell, or manually run the script under such a +$0: shell if you do have one." + fi + exit 1 +fi +fi +fi +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL +# Unset more variables known to interfere with behavior of common tools. +CLICOLOR_FORCE= GREP_OPTIONS= +unset CLICOLOR_FORCE GREP_OPTIONS + +## --------------------- ## +## M4sh Shell Functions. ## +## --------------------- ## +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + + + as_lineno_1=$LINENO as_lineno_1a=$LINENO + as_lineno_2=$LINENO as_lineno_2a=$LINENO + eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && + test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { + # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -p' + fi +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in #( + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + +SHELL=${CONFIG_SHELL-/bin/sh} + + +test -n "$DJDIR" || exec 7<&0 &1 + +# Name of the host. +# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_clean_files= +ac_config_libobj_dir=. +LIBOBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= + +# Identity of this package. +PACKAGE_NAME='libantlr3c' +PACKAGE_TARNAME='libantlr3c' +PACKAGE_VERSION='3.4' +PACKAGE_STRING='libantlr3c 3.4' +PACKAGE_BUGREPORT='jimi@temporal-wave.com' +PACKAGE_URL='' + +ac_unique_file="src/antlr3parser.c" +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif +#ifdef STDC_HEADERS +# include +# include +#else +# ifdef HAVE_STDLIB_H +# include +# endif +#endif +#ifdef HAVE_STRING_H +# if !defined STDC_HEADERS && defined HAVE_MEMORY_H +# include +# endif +# include +#endif +#ifdef HAVE_STRINGS_H +# include +#endif +#ifdef HAVE_INTTYPES_H +# include +#endif +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_UNISTD_H +# include +#endif" + +ac_subst_vars='am__EXEEXT_FALSE +am__EXEEXT_TRUE +LTLIBOBJS +LIBOBJS +OBJECT_MODE +CPP +OTOOL64 +OTOOL +LIPO +NMEDIT +DSYMUTIL +RANLIB +AR +OBJDUMP +LN_S +NM +ac_ct_DUMPBIN +DUMPBIN +LD +FGREP +EGREP +GREP +SED +host_os +host_vendor +host_cpu +host +build_os +build_vendor +build_cpu +build +LIBTOOL +MAINT +MAINTAINER_MODE_FALSE +MAINTAINER_MODE_TRUE +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 +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_URL +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL' +ac_subst_files='' +ac_user_opts=' +enable_option_checking +enable_debuginfo +enable_64bit +enable_abiflags +enable_antlrdebug +enable_dependency_tracking +enable_maintainer_mode +enable_shared +enable_static +with_pic +enable_fast_install +with_gnu_ld +enable_libtool_lock +' + 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_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; + + -enable-* | --enable-*) + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=\$ac_optarg ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst | --locals) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=\$ac_optarg ;; + + -without-* | --without-*) + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error $? "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=no ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) as_fn_error $? "unrecognized option: \`$ac_option' +Try \`$0 --help' for more information" + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + case $ac_envvar in #( + '' | [0-9]* | *[!_$as_cr_alnum]* ) + as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; + esac + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + as_fn_error $? "missing argument to $ac_option" +fi + +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; + *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac +fi + +# Check all directory arguments for consistency. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir +do + eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host. + If a cross compiler is detected then cross compile mode will be used" >&2 + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + as_fn_error $? "working directory cannot be determined" +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + as_fn_error $? "pwd does not report name of working directory" + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_myself" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r "$srcdir/$ac_unique_file"; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" +fi +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures libantlr3c 3.4 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/libantlr3c] + --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 libantlr3c 3.4:";; + 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-debuginfo Compiles debug info into the library (default + --disable-debuginfo) + --enable-64bit Turns on flags that produce 64 bit object code if + any are required (default --disable-64bit) + --disable-abiflags Does not add ABI flags -m32 or -m64 for older + versions of gcc, such as itanium 3.x (default + --enable-abiflags=yes) + --disable-antlrdebug Turns off default flags that include the antlr + debugger in the runtime. Specify to remove debugger + and the socket dependancies (default + --enable-antlrdebug) + --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors + --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-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] + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + LIBS libraries to pass to the linker, e.g. -l + CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if + you have headers in a nonstandard directory + CPP C preprocessor + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +Report bugs to . +_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 +libantlr3c configure 3.4 +generated by GNU Autoconf 2.66 + +Copyright (C) 2010 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. + + + (The "BSD licence") + Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC + http://www.temporal-wave.com + http://www.linkedin.com/in/jimidle + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + 3. The name of the author may not be used to endorse or promote products + derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +_ACEOF + exit +fi + +## ------------------------ ## +## Autoconf initialization. ## +## ------------------------ ## + +# ac_fn_c_try_compile LINENO +# -------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + as_fn_set_status $ac_retval + +} # ac_fn_c_try_compile + +# ac_fn_c_try_link LINENO +# ----------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + as_fn_set_status $ac_retval + +} # ac_fn_c_try_link + +# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists and can be compiled using the include files in +# INCLUDES, setting the cache variable VAR accordingly. +ac_fn_c_check_header_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval "test \"\${$3+set}\"" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + +} # ac_fn_c_check_header_compile + +# ac_fn_c_try_cpp LINENO +# ---------------------- +# Try to preprocess conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_cpp () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + as_fn_set_status $ac_retval + +} # ac_fn_c_try_cpp + +# ac_fn_c_try_run LINENO +# ---------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes +# that executables *can* be run. +ac_fn_c_try_run () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then : + ac_retval=0 +else + $as_echo "$as_me: program exited with status $ac_status" >&5 + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=$ac_status +fi + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + as_fn_set_status $ac_retval + +} # ac_fn_c_try_run + +# ac_fn_c_check_func LINENO FUNC VAR +# ---------------------------------- +# Tests whether FUNC exists, setting the cache variable VAR accordingly +ac_fn_c_check_func () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval "test \"\${$3+set}\"" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Define $2 to an innocuous variant, in case declares $2. + For example, HP-UX 11i declares gettimeofday. */ +#define $2 innocuous_$2 + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $2 (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $2 + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $2 (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$2 || defined __stub___$2 +choke me +#endif + +int +main () +{ +return $2 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + +} # ac_fn_c_check_func + +# ac_fn_c_check_type LINENO TYPE VAR INCLUDES +# ------------------------------------------- +# Tests whether TYPE exists after having included INCLUDES, setting cache +# variable VAR accordingly. +ac_fn_c_check_type () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval "test \"\${$3+set}\"" = set; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=no" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +if (sizeof ($2)) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +if (sizeof (($2))) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + eval "$3=yes" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + +} # ac_fn_c_check_type + +# ac_fn_c_find_intX_t LINENO BITS VAR +# ----------------------------------- +# Finds a signed integer type with width BITS, setting cache variable VAR +# accordingly. +ac_fn_c_find_intX_t () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for int$2_t" >&5 +$as_echo_n "checking for int$2_t... " >&6; } +if eval "test \"\${$3+set}\"" = set; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=no" + # Order is important - never check a type that is potentially smaller + # than half of the expected target width. + for ac_type in int$2_t 'int' 'long int' \ + 'long long int' 'short int' 'signed char'; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default + enum { N = $2 / 2 - 1 }; +int +main () +{ +static int test_array [1 - 2 * !(0 < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1))]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default + enum { N = $2 / 2 - 1 }; +int +main () +{ +static int test_array [1 - 2 * !(($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1) + < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 2))]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + case $ac_type in #( + int$2_t) : + eval "$3=yes" ;; #( + *) : + eval "$3=\$ac_type" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if eval test \"x\$"$3"\" = x"no"; then : + +else + break +fi + done +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + +} # ac_fn_c_find_intX_t + +# ac_fn_c_find_uintX_t LINENO BITS VAR +# ------------------------------------ +# Finds an unsigned integer type with width BITS, setting cache variable VAR +# accordingly. +ac_fn_c_find_uintX_t () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uint$2_t" >&5 +$as_echo_n "checking for uint$2_t... " >&6; } +if eval "test \"\${$3+set}\"" = set; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=no" + # Order is important - never check a type that is potentially smaller + # than half of the expected target width. + for ac_type in uint$2_t 'unsigned int' 'unsigned long int' \ + 'unsigned long long int' 'unsigned short int' 'unsigned char'; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !((($ac_type) -1 >> ($2 / 2 - 1)) >> ($2 / 2 - 1) == 3)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + case $ac_type in #( + uint$2_t) : + eval "$3=yes" ;; #( + *) : + eval "$3=\$ac_type" ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if eval test \"x\$"$3"\" = x"no"; then : + +else + break +fi + done +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + +} # ac_fn_c_find_uintX_t +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 libantlr3c $as_me 3.4, which was +generated by GNU Autoconf 2.66. Invocation command line was + + $ $0 $@ + +_ACEOF +exec 5>>config.log +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + $as_echo "PATH: $as_dir" + done +IFS=$as_save_IFS + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *\'*) + ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; + 2) + as_fn_append ac_configure_args1 " '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + as_fn_append ac_configure_args " '$ac_arg'" + ;; + esac + done +done +{ ac_configure_args0=; unset ac_configure_args0;} +{ ac_configure_args1=; unset ac_configure_args1;} + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + $as_echo "## ---------------- ## +## Cache variables. ## +## ---------------- ##" + echo + # The following way of writing the cache mishandles newlines in values, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + + $as_echo "## ----------------- ## +## Output variables. ## +## ----------------- ##" + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + $as_echo "## ------------------- ## +## File substitutions. ## +## ------------------- ##" + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + $as_echo "## ----------- ## +## confdefs.h. ## +## ----------- ##" + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + $as_echo "$as_me: caught signal $ac_signal" + $as_echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status +' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -f -r conftest* confdefs.h + +$as_echo "/* confdefs.h */" > confdefs.h + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_URL "$PACKAGE_URL" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer an explicitly selected file to automatically selected ones. +ac_site_file1=NONE +ac_site_file2=NONE +if test -n "$CONFIG_SITE"; then + # We do not want a PATH search for config.site. + case $CONFIG_SITE in #(( + -*) ac_site_file1=./$CONFIG_SITE;; + */*) ac_site_file1=$CONFIG_SITE;; + *) ac_site_file1=./$CONFIG_SITE;; + esac +elif test "x$prefix" != xNONE; then + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site +else + ac_site_file1=$ac_default_prefix/share/config.site + ac_site_file2=$ac_default_prefix/etc/config.site +fi +for ac_site_file in "$ac_site_file1" "$ac_site_file2" +do + test "x$ac_site_file" = xNONE && continue + if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +$as_echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" \ + || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "failed to load site script $ac_site_file +See \`config.log' for more details" "$LINENO" 5; } + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special files + # actually), so we avoid doing that. DJGPP emulates it as a regular file. + if test /dev/null != "$cache_file" && test -f "$cache_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +$as_echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +$as_echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) as_fn_append ac_configure_args " '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 +fi +## -------------------- ## +## Main body of script. ## +## -------------------- ## + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + + + + + +# Check whether --enable-debuginfo was given. +if test "${enable_debuginfo+set}" = set; then : + enableval=$enable_debuginfo; +else + enable_debuginfo=no +fi + + +# Check whether --enable-64bit was given. +if test "${enable_64bit+set}" = set; then : + enableval=$enable_64bit; +else + enable_64bit=no +fi + + +# Check whether --enable-abiflags was given. +if test "${enable_abiflags+set}" = set; then : + enableval=$enable_abiflags; +else + enable_abiflags=yes +fi + + +# Check whether --enable-antlrdebug was given. +if test "${enable_antlrdebug+set}" = set; then : + enableval=$enable_antlrdebug; +else + enable_antlrdebug=yes +fi + + +am__api_version='1.11' + +ac_aux_dir= +for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do + if test -f "$ac_dir/install-sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f "$ac_dir/install.sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f "$ac_dir/shtool"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi +done +if test -z "$ac_aux_dir"; then + as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 +fi + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +# Reject install programs that cannot install multiple files. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +$as_echo_n "checking for a BSD-compatible install... " >&6; } +if test -z "$INSTALL"; then +if 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:${as_lineno-$LINENO}: result: $INSTALL" >&5 +$as_echo "$INSTALL" >&6; } + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 +$as_echo_n "checking whether build environment is sane... " >&6; } +# Just in case +sleep 1 +echo timestamp > conftest.file +# Reject unsafe characters in $srcdir or the absolute working directory +# name. Accept space and tab only in the latter. +am_lf=' +' +case `pwd` in + *[\\\"\#\$\&\'\`$am_lf]*) + as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; +esac +case $srcdir in + *[\\\"\#\$\&\'\`$am_lf\ \ ]*) + as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;; +esac + +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t "$srcdir/configure" conftest.file` + fi + rm -f conftest.file + if test "$*" != "X $srcdir/configure conftest.file" \ + && test "$*" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + as_fn_error $? "ls -t appears to fail. Make sure there is not a broken +alias in your environment" "$LINENO" 5 + fi + + test "$2" = conftest.file + ) +then + # Ok. + : +else + as_fn_error $? "newly created file is older than distributed files! +Check your system clock" "$LINENO" 5 +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +test "$program_prefix" != NONE && + program_transform_name="s&^&$program_prefix&;$program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s&\$&$program_suffix&;$program_transform_name" +# Double any \ or $. +# By default was `s,x,x', remove it if useless. +ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' +program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` + +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` + +if test x"${MISSING+set}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; + *) + MISSING="\${SHELL} $am_aux_dir/missing" ;; + esac +fi +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5 +$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} +fi + +if test x"${install_sh}" != xset; then + case $am_aux_dir in + *\ * | *\ *) + install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; + *) + install_sh="\${SHELL} $am_aux_dir/install-sh" + esac +fi + +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +if test "$cross_compiling" != no; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if 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:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if 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:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 +$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } +if test -z "$MKDIR_P"; then + if 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 + + test -d ./--version && rmdir ./--version + if test "${ac_cv_path_mkdir+set}" = set; then + MKDIR_P="$ac_cv_path_mkdir -p" + else + # As a last resort, use the slow shell script. Don't cache a + # value for MKDIR_P within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + MKDIR_P="$ac_install_sh -d" + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 +$as_echo "$MKDIR_P" >&6; } + +mkdir_p="$MKDIR_P" +case $mkdir_p in + [\\/$]* | ?:[\\/]*) ;; + */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; +esac + +for ac_prog in gawk mawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if 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:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +$as_echo "$AWK" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$AWK" && break +done + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval "test \"\${ac_cv_prog_make_${ac_make}_set+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:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + SET_MAKE= +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + +rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null + +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + am__isrc=' -I$(srcdir)' + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi + + +# Define the identity of the package. + PACKAGE='libantlr3c' + VERSION='3.4' + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE "$PACKAGE" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define VERSION "$VERSION" +_ACEOF + +# Some tools Automake needs. + +ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} + + +AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} + + +AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} + + +AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} + + +MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} + +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +# Always define AMTAR for backward compatibility. + +AMTAR=${AMTAR-"${am_missing_run}tar"} + +am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' + + + + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + for ac_prog in xlc aCC gcc cc + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if 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:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in xlc aCC gcc cc +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if 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:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + + +test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5; } + +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +$as_echo_n "checking whether the C compiler works... " >&6; } +ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" + +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { { ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; + * ) + break;; + esac +done +test "$ac_cv_exeext" = no && ac_cv_exeext= + +else + ac_file='' +fi +if test -z "$ac_file"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +$as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "C compiler cannot create executables +See \`config.log' for more details" "$LINENO" 5; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +$as_echo_n "checking for C compiler default output file name... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +$as_echo "$ac_file" >&6; } +ac_exeext=$ac_cv_exeext + +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +$as_echo_n "checking for suffix of executables... " >&6; } +if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + break;; + * ) break;; + esac +done +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest conftest$ac_cv_exeext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +$as_echo "$ac_cv_exeext" >&6; } + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +FILE *f = fopen ("conftest.out", "w"); + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +ac_clean_files="$ac_clean_files conftest.out" +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +if test "$cross_compiling" != yes; then + { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if { ac_try='./conftest$ac_cv_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details" "$LINENO" 5; } + fi + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } + +rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +$as_echo_n "checking for suffix of object files... " >&6; } +if test "${ac_cv_objext+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "cannot compute suffix of object files: cannot compile +See \`config.log' for more details" "$LINENO" 5; } +fi +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +$as_echo "$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +if test "${ac_cv_c_compiler_gnu+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } +if 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 confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +else + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$ac_cv_prog_cc_g" >&6; } +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if 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 confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c89" != xno; then : + +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +DEPDIR="${am__leading_dot}deps" + +ac_config_commands="$ac_config_commands depfiles" + + +am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo this is the am__doit target +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 +$as_echo_n "checking for style of include used by $am_make... " >&6; } +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# Ignore all kinds of additional output from `make'. +case `$am_make -s -f confmf 2> /dev/null` in #( +*the\ am__doit\ target*) + am__include=include + am__quote= + _am_result=GNU + ;; +esac +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + case `$am_make -s -f confmf 2> /dev/null` in #( + *the\ am__doit\ target*) + am__include=.include + am__quote="\"" + _am_result=BSD + ;; + esac +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 +$as_echo "$_am_result" >&6; } +rm -f confinc confmf + +# Check whether --enable-dependency-tracking was given. +if test "${enable_dependency_tracking+set}" = set; then : + enableval=$enable_dependency_tracking; +fi + +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' +fi + if test "x$enable_dependency_tracking" != xno; then + AMDEP_TRUE= + AMDEP_FALSE='#' +else + AMDEP_TRUE='#' + AMDEP_FALSE= +fi + + + +depcc="$CC" am_compiler_list= + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +$as_echo_n "checking dependency style of $depcc... " >&6; } +if 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 + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvisualcpp | msvcmsys) + # This compiler won't grok `-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 +$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' +else + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= +fi + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 +$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } + # Check whether --enable-maintainer-mode was given. +if test "${enable_maintainer_mode+set}" = set; then : + enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval +else + USE_MAINTAINER_MODE=no +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 +$as_echo "$USE_MAINTAINER_MODE" >&6; } + if test $USE_MAINTAINER_MODE = yes; then + MAINTAINER_MODE_TRUE= + MAINTAINER_MODE_FALSE='#' +else + MAINTAINER_MODE_TRUE='#' + MAINTAINER_MODE_FALSE= +fi + + MAINT=$MAINTAINER_MODE_TRUE + + +case `pwd` in + *\ * | *\ *) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 +$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; +esac + + + +macro_version='2.2.10' +macro_revision='1.3175' + + + + + + + + + + + + + +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_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 +$as_echo_n "checking build system type... " >&6; } +if 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_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 +ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 +$as_echo "$ac_cv_build" >&6; } +case $ac_cv_build in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; +esac +build=$ac_cv_build +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_build +shift +build_cpu=$1 +build_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +build_os=$* +IFS=$ac_save_IFS +case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 +$as_echo_n "checking host system type... " >&6; } +if 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_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 +$as_echo "$ac_cv_host" >&6; } +case $ac_cv_host in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; +esac +host=$ac_cv_host +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_host +shift +host_cpu=$1 +host_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +host_os=$* +IFS=$ac_save_IFS +case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac + + +# Backslashify metacharacters that are still active within +# double-quoted strings. +sed_quote_subst='s/\(["`$\\]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\(["`\\]\)/\\\1/g' + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to delay expansion of an escaped single quote. +delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' + +ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 +$as_echo_n "checking how to print strings... " >&6; } +# Test print first, because it will be a builtin if present. +if test "X`print -r -- -n 2>/dev/null`" = X-n && \ + test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='print -r --' +elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='printf %s\n' +else + # Use this function as a fallback that always works. + func_fallback_echo () + { + eval 'cat <<_LTECHO_EOF +$1 +_LTECHO_EOF' + } + ECHO='func_fallback_echo' +fi + +# func_echo_all arg... +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "" +} + +case "$ECHO" in + printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 +$as_echo "printf" >&6; } ;; + print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 +$as_echo "print -r" >&6; } ;; + *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 +$as_echo "cat" >&6; } ;; +esac + + + + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 +$as_echo_n "checking for a sed that does not truncate output... " >&6; } +if 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 + { ac_script=; unset ac_script;} + if test -z "$SED"; then + ac_path_SED_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue +# Check for GNU ac_path_SED and select it if it is found. + # Check for GNU $ac_path_SED +case `"$ac_path_SED" --version 2>&1` in +*GNU*) + ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo '' >> "conftest.nl" + "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_SED_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_SED="$ac_path_SED" + ac_path_SED_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_SED_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_SED"; then + as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 + fi +else + ac_cv_path_SED=$SED +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 +$as_echo "$ac_cv_path_SED" >&6; } + SED="$ac_cv_path_SED" + rm -f conftest.sed + +test -z "$SED" && SED=sed +Xsed="$SED -e 1s/^X//" + + + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for 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 + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_GREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_GREP"; then + as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_GREP=$GREP +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +$as_echo "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +$as_echo_n "checking for egrep... " >&6; } +if 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 + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_EGREP=$EGREP +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +$as_echo "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for 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 + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_FGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_FGREP="$ac_path_FGREP" + ac_path_FGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_FGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_FGREP"; then + as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_FGREP=$FGREP +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 +$as_echo "$ac_cv_path_FGREP" >&6; } + FGREP="$ac_cv_path_FGREP" + + +test -z "$GREP" && GREP=grep + + + + + + + + + + + + + + + + + + + +# Check whether --with-gnu-ld was given. +if test "${with_gnu_ld+set}" = set; then : + withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes +else + with_gnu_ld=no +fi + +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 +$as_echo_n "checking for ld used by $CC... " >&6; } + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [\\/]* | ?:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` + while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do + ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 +$as_echo_n "checking for GNU ld... " >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 +$as_echo_n "checking for non-GNU ld... " >&6; } +fi +if 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 &5 +$as_echo "$LD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 +$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } +if 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 &5 +$as_echo "$lt_cv_prog_gnu_ld" >&6; } +with_gnu_ld=$lt_cv_prog_gnu_ld + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 +$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } +if 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:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 +$as_echo "$lt_cv_path_NM" >&6; } +if test "$lt_cv_path_NM" != "no"; then + NM="$lt_cv_path_NM" +else + # Didn't find any BSD compatible name lister, look for dumpbin. + if test -n "$DUMPBIN"; then : + # Let the user override the test. + else + if test -n "$ac_tool_prefix"; then + for ac_prog in dumpbin "link -dump" + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if 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:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DUMPBIN=$ac_cv_prog_DUMPBIN +if test -n "$DUMPBIN"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 +$as_echo "$DUMPBIN" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$DUMPBIN" && break + done +fi +if test -z "$DUMPBIN"; then + ac_ct_DUMPBIN=$DUMPBIN + for ac_prog in dumpbin "link -dump" +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if 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:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN +if test -n "$ac_ct_DUMPBIN"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 +$as_echo "$ac_ct_DUMPBIN" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_DUMPBIN" && break +done + + if test "x$ac_ct_DUMPBIN" = x; then + DUMPBIN=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DUMPBIN=$ac_ct_DUMPBIN + fi +fi + + case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in + *COFF*) + DUMPBIN="$DUMPBIN -symbols" + ;; + *) + DUMPBIN=: + ;; + esac + fi + + if test "$DUMPBIN" != ":"; then + NM="$DUMPBIN" + fi +fi +test -z "$NM" && NM=nm + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 +$as_echo_n "checking the name lister ($NM) interface... " >&6; } +if 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:$LINENO: $ac_compile\"" >&5) + (eval "$ac_compile" 2>conftest.err) + cat conftest.err >&5 + (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) + (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) + cat conftest.err >&5 + (eval echo "\"\$as_me:$LINENO: output\"" >&5) + cat conftest.out >&5 + if $GREP 'External.*some_variable' conftest.out > /dev/null; then + lt_cv_nm_interface="MS dumpbin" + fi + rm -f conftest* +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 +$as_echo "$lt_cv_nm_interface" >&6; } + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 +$as_echo_n "checking whether ln -s works... " >&6; } +LN_S=$as_ln_s +if test "$LN_S" = "ln -s"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 +$as_echo "no, using $LN_S" >&6; } +fi + +# find the maximum length of command line arguments +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 +$as_echo_n "checking the maximum length of command line arguments... " >&6; } +if 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; + ;; + + mint*) + # On MiNT this can take a long time and run out of memory. + lt_cv_sys_max_cmd_len=8192; + ;; + + amigaos*) + # On AmigaOS with pdksh, this test takes hours, literally. + # So we just punt and use a minimum line length of 8192. + lt_cv_sys_max_cmd_len=8192; + ;; + + netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) + # This has been around since 386BSD, at least. Likely further. + if test -x /sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` + elif test -x /usr/sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` + else + lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs + fi + # And add a safety zone + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + ;; + + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + 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"`func_fallback_echo "$teststring$teststring" 2>/dev/null` \ + = "X$teststring$teststring"; } >/dev/null 2>&1 && + test $i != 17 # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + # Only check the string length outside the loop. + lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` + teststring= + # Add a significant safety factor because C++ compilers can tack on + # massive amounts of additional arguments before passing them to the + # linker. It appears as though 1/2 is a usable value. + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` + fi + ;; + esac + +fi + +if test -n $lt_cv_sys_max_cmd_len ; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 +$as_echo "$lt_cv_sys_max_cmd_len" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 +$as_echo "none" >&6; } +fi +max_cmd_len=$lt_cv_sys_max_cmd_len + + + + + + +: ${CP="cp -f"} +: ${MV="mv -f"} +: ${RM="rm -f"} + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5 +$as_echo_n "checking whether the shell understands some XSI constructs... " >&6; } +# Try some XSI features +xsi_shell=no +( _lt_dummy="a/b/c" + test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \ + = 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:${as_lineno-$LINENO}: result: $xsi_shell" >&5 +$as_echo "$xsi_shell" >&6; } + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5 +$as_echo_n "checking whether the shell understands \"+=\"... " >&6; } +lt_shell_append=no +( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \ + >/dev/null 2>&1 \ + && lt_shell_append=yes +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5 +$as_echo "$lt_shell_append" >&6; } + + +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + lt_unset=unset +else + lt_unset=false +fi + + + + + +# test EBCDIC or ASCII +case `echo X|tr X '\101'` in + A) # ASCII based system + # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr + lt_SP2NL='tr \040 \012' + lt_NL2SP='tr \015\012 \040\040' + ;; + *) # EBCDIC based system + lt_SP2NL='tr \100 \n' + lt_NL2SP='tr \r\n \100\100' + ;; +esac + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking 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:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 +$as_echo "$lt_cv_ld_reload_flag" >&6; } +reload_flag=$lt_cv_ld_reload_flag +case $reload_flag in +"" | " "*) ;; +*) reload_flag=" $reload_flag" ;; +esac +reload_cmds='$LD$reload_flag -o $output$reload_objs' +case $host_os in + darwin*) + if test "$GCC" = yes; then + reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' + else + reload_cmds='$LD$reload_flag -o $output$reload_objs' + fi + ;; +esac + + + + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. +set dummy ${ac_tool_prefix}objdump; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if 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:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OBJDUMP=$ac_cv_prog_OBJDUMP +if test -n "$OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 +$as_echo "$OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OBJDUMP"; then + ac_ct_OBJDUMP=$OBJDUMP + # Extract the first word of "objdump", so it can be a program name with args. +set dummy objdump; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if 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:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP +if test -n "$ac_ct_OBJDUMP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 +$as_echo "$ac_ct_OBJDUMP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OBJDUMP" = x; then + OBJDUMP="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OBJDUMP=$ac_ct_OBJDUMP + fi +else + OBJDUMP="$ac_cv_prog_OBJDUMP" +fi + +test -z "$OBJDUMP" && OBJDUMP=objdump + + + + + + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 +$as_echo_n "checking how to recognize dependent libraries... " >&6; } +if 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. + # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. + if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + else + # Keep this pattern in sync with the one in func_win32_libid. + lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' + lt_cv_file_magic_cmd='$OBJDUMP -f' + fi + ;; + +cegcc*) + # use the weaker test based on 'objdump'. See mingw*. + lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + ;; + +darwin* | rhapsody*) + lt_cv_deplibs_check_method=pass_all + ;; + +freebsd* | dragonfly*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + case $host_cpu in + i*86 ) + # Not sure whether the presence of OpenBSD here was a mistake. + # Let's accept both of them until this is cleared up. + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; + +gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + +haiku*) + lt_cv_deplibs_check_method=pass_all + ;; + +hpux10.20* | hpux11*) + lt_cv_file_magic_cmd=/usr/bin/file + case $host_cpu in + ia64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' + lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so + ;; + hppa*64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' + lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl + ;; + *) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + esac + ;; + +interix[3-9]*) + # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' + ;; + +irix5* | irix6* | nonstopux*) + case $LD in + *-32|*"-32 ") libmagic=32-bit;; + *-n32|*"-n32 ") libmagic=N32;; + *-64|*"-64 ") libmagic=64-bit;; + *) libmagic=never-match;; + esac + lt_cv_deplibs_check_method=pass_all + ;; + +# This must be Linux ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu) + lt_cv_deplibs_check_method=pass_all + ;; + +netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' + fi + ;; + +newos6*) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libnls.so + ;; + +*nto* | *qnx*) + lt_cv_deplibs_check_method=pass_all + ;; + +openbsd*) + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' + fi + ;; + +osf3* | osf4* | osf5*) + lt_cv_deplibs_check_method=pass_all + ;; + +rdos*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv4 | sysv4.3*) + case $host_vendor in + motorola) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + ncr) + lt_cv_deplibs_check_method=pass_all + ;; + sequent) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' + ;; + sni) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" + lt_cv_file_magic_test_file=/lib/libc.so + ;; + siemens) + lt_cv_deplibs_check_method=pass_all + ;; + pc) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +tpf*) + lt_cv_deplibs_check_method=pass_all + ;; +esac + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 +$as_echo "$lt_cv_deplibs_check_method" >&6; } +file_magic_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:${as_lineno-$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:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +$as_echo "$AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +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:${as_lineno-$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:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +$as_echo "$ac_ct_AR" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_AR" = x; then + AR="false" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + AR=$ac_ct_AR + fi +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:${as_lineno-$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:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if 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:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +test -z "$STRIP" && STRIP=: + + + + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if 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:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 +$as_echo "$RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if 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:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 +$as_echo "$ac_ct_RANLIB" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + RANLIB=$ac_ct_RANLIB + fi +else + RANLIB="$ac_cv_prog_RANLIB" +fi + +test -z "$RANLIB" && RANLIB=: + + + + + + +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= + +if test -n "$RANLIB"; then + case $host_os in + openbsd*) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" + ;; + *) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" +fi + +case $host_os in + darwin*) + lock_old_archive_extraction=yes ;; + *) + lock_old_archive_extraction=no ;; +esac + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# Check for command to grab the raw symbol name followed by C symbol from nm. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 +$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } +if 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\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + # Now try to grab the symbols. + nlist=conftest.nm + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 + (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s "$nlist"; then + # Try sorting and uniquifying the output. + if sort "$nlist" | uniq > "$nlist"T; then + mv -f "$nlist"T "$nlist" + else + rm -f "$nlist"T + fi + + # Make sure that we snagged all the symbols we need. + if $GREP ' nm_test_var$' "$nlist" >/dev/null; then + if $GREP ' nm_test_func$' "$nlist" >/dev/null; then + cat <<_LT_EOF > conftest.$ac_ext +#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\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest${ac_exeext}; then + pipe_works=yes + fi + LIBS="$lt_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:${as_lineno-$LINENO}: result: failed" >&5 +$as_echo "failed" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +$as_echo "ok" >&6; } +fi + + + + + + + + + + + + + + + + + + + + + + + +# Check whether --enable-libtool-lock was given. +if test "${enable_libtool_lock+set}" = set; then : + enableval=$enable_libtool_lock; +fi + +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case $host in +ia64-*-hpux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `/usr/bin/file conftest.$ac_objext` in + *ELF-32*) + HPUX_IA64_MODE="32" + ;; + *ELF-64*) + HPUX_IA64_MODE="64" + ;; + esac + fi + rm -rf conftest* + ;; +*-*-irix6*) + # Find out which ABI we are using. + echo '#line '$LINENO' "configure"' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + if test "$lt_cv_prog_gnu_ld" = yes; then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" + ;; + *N32*) + LD="${LD-ld} -melf32bmipn32" + ;; + *64-bit*) + LD="${LD-ld} -melf64bmip" + ;; + esac + else + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + fi + rm -rf conftest* + ;; + +x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ +s390*-*linux*|s390*-*tpf*|sparc*-*linux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `/usr/bin/file conftest.o` in + *32-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_i386_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_i386" + ;; + ppc64-*linux*|powerpc64-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) + LD="${LD-ld} -m elf_s390" + ;; + sparc64-*linux*) + LD="${LD-ld} -m elf32_sparc" + ;; + esac + ;; + *64-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_x86_64_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + ppc*-*linux*|powerpc*-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*|s390*-*tpf*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + +*-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -belf" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 +$as_echo_n "checking whether the C compiler needs -belf... " >&6; } +if 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 confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + lt_cv_cc_needs_belf=yes +else + lt_cv_cc_needs_belf=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 +$as_echo "$lt_cv_cc_needs_belf" >&6; } + if test x"$lt_cv_cc_needs_belf" != x"yes"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS="$SAVE_CFLAGS" + fi + ;; +sparc*-*solaris*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + case `/usr/bin/file conftest.o` in + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) 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:${as_lineno-$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:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +DSYMUTIL=$ac_cv_prog_DSYMUTIL +if test -n "$DSYMUTIL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 +$as_echo "$DSYMUTIL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_DSYMUTIL"; then + ac_ct_DSYMUTIL=$DSYMUTIL + # Extract the first word of "dsymutil", so it can be a program name with args. +set dummy dsymutil; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if 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:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL +if test -n "$ac_ct_DSYMUTIL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 +$as_echo "$ac_ct_DSYMUTIL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_DSYMUTIL" = x; then + DSYMUTIL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + DSYMUTIL=$ac_ct_DSYMUTIL + fi +else + DSYMUTIL="$ac_cv_prog_DSYMUTIL" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. +set dummy ${ac_tool_prefix}nmedit; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if 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:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +NMEDIT=$ac_cv_prog_NMEDIT +if test -n "$NMEDIT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 +$as_echo "$NMEDIT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_NMEDIT"; then + ac_ct_NMEDIT=$NMEDIT + # Extract the first word of "nmedit", so it can be a program name with args. +set dummy nmedit; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if 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:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT +if test -n "$ac_ct_NMEDIT"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 +$as_echo "$ac_ct_NMEDIT" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_NMEDIT" = x; then + NMEDIT=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + NMEDIT=$ac_ct_NMEDIT + fi +else + NMEDIT="$ac_cv_prog_NMEDIT" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. +set dummy ${ac_tool_prefix}lipo; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if 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:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +LIPO=$ac_cv_prog_LIPO +if test -n "$LIPO"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 +$as_echo "$LIPO" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_LIPO"; then + ac_ct_LIPO=$LIPO + # Extract the first word of "lipo", so it can be a program name with args. +set dummy lipo; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if 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:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO +if test -n "$ac_ct_LIPO"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 +$as_echo "$ac_ct_LIPO" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_LIPO" = x; then + LIPO=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + LIPO=$ac_ct_LIPO + fi +else + LIPO="$ac_cv_prog_LIPO" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. +set dummy ${ac_tool_prefix}otool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if 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:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OTOOL=$ac_cv_prog_OTOOL +if test -n "$OTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 +$as_echo "$OTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OTOOL"; then + ac_ct_OTOOL=$OTOOL + # Extract the first word of "otool", so it can be a program name with args. +set dummy otool; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if 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:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL +if test -n "$ac_ct_OTOOL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 +$as_echo "$ac_ct_OTOOL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OTOOL" = x; then + OTOOL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OTOOL=$ac_ct_OTOOL + fi +else + OTOOL="$ac_cv_prog_OTOOL" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. +set dummy ${ac_tool_prefix}otool64; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if 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:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +OTOOL64=$ac_cv_prog_OTOOL64 +if test -n "$OTOOL64"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 +$as_echo "$OTOOL64" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_OTOOL64"; then + ac_ct_OTOOL64=$OTOOL64 + # Extract the first word of "otool64", so it can be a program name with args. +set dummy otool64; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if 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:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 +if test -n "$ac_ct_OTOOL64"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 +$as_echo "$ac_ct_OTOOL64" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_OTOOL64" = x; then + OTOOL64=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + OTOOL64=$ac_ct_OTOOL64 + fi +else + OTOOL64="$ac_cv_prog_OTOOL64" +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 +$as_echo_n "checking for -single_module linker flag... " >&6; } +if 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:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 +$as_echo "$lt_cv_apple_cc_single_mod" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 +$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } +if 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 confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + lt_cv_ld_exported_symbols_list=yes +else + lt_cv_ld_exported_symbols_list=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS="$save_LDFLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 +$as_echo "$lt_cv_ld_exported_symbols_list" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 +$as_echo_n "checking for -force_load linker flag... " >&6; } +if test "${lt_cv_ld_force_load+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_ld_force_load=no + cat > conftest.c << _LT_EOF +int forced_loaded() { return 2;} +_LT_EOF + echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 + $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 + echo "$AR cru libconftest.a conftest.o" >&5 + $AR cru libconftest.a conftest.o 2>&5 + echo "$RANLIB libconftest.a" >&5 + $RANLIB libconftest.a 2>&5 + cat > conftest.c << _LT_EOF +int main() { return 0;} +_LT_EOF + echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 + $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err + _lt_result=$? + if test -f conftest && test ! -s conftest.err && test $_lt_result = 0 && $GREP forced_load conftest 2>&1 >/dev/null; then + lt_cv_ld_force_load=yes + else + cat conftest.err >&5 + fi + rm -f conftest.err libconftest.a conftest conftest.c + rm -rf conftest.dSYM + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 +$as_echo "$lt_cv_ld_force_load" >&6; } + case $host_os in + rhapsody* | darwin1.[012]) + _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; + darwin1.*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + darwin*) # darwin 5.x on + # if running on 10.5 or later, the deployment target defaults + # to the OS version, if on x86, and 10.4, the deployment + # target defaults to 10.4. Don't you love it? + case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in + 10.0,*86*-darwin8*|10.0,*-darwin[91]*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + 10.[012]*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + 10.*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + esac + ;; + esac + if test "$lt_cv_apple_cc_single_mod" = "yes"; then + _lt_dar_single_mod='$single_module' + fi + if test "$lt_cv_ld_exported_symbols_list" = "yes"; then + _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' + else + _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then + _lt_dsymutil='~$DSYMUTIL $lib || :' + else + _lt_dsymutil= + fi + ;; + esac + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 +$as_echo_n "checking how to run the C preprocessor... " >&6; } +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if 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 to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.$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:${as_lineno-$LINENO}: result: $CPP" >&5 +$as_echo "$CPP" >&6; } +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.$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:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if test "${ac_cv_header_stdc+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_stdc=yes +else + ac_cv_header_stdc=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + +else + ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +$as_echo "#define STDC_HEADERS 1" >>confdefs.h + +fi + +# On IRIX 5.3, sys/types and inttypes.h are conflicting. +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +for ac_header in dlfcn.h +do : + ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default +" +if test "x$ac_cv_header_dlfcn_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_DLFCN_H 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:${as_lineno-$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:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 +$as_echo "$lt_cv_objdir" >&6; } +objdir=$lt_cv_objdir + + + + + +cat >>confdefs.h <<_ACEOF +#define LT_OBJDIR "$lt_cv_objdir/" +_ACEOF + + + + +case $host_os in +aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES + fi + ;; +esac + +# Global variables: +ofile=libtool +can_build_shared=yes + +# All known linkers require a `.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a + +with_gnu_ld="$lt_cv_prog_gnu_ld" + +old_CC="$CC" +old_CFLAGS="$CFLAGS" + +# Set sane defaults for various variables +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS +test -z "$LD" && LD=ld +test -z "$ac_objext" && ac_objext=o + +for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` + + +# Only perform the check for file, if the check method requires it +test -z "$MAGIC_CMD" && MAGIC_CMD=file +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 +$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } +if 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:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 +$as_echo "$MAGIC_CMD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + + + +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 +$as_echo_n "checking for file... " >&6; } +if 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:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 +$as_echo "$MAGIC_CMD" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + else + MAGIC_CMD=: + fi +fi + + fi + ;; +esac + +# Use C for the default configuration in the libtool script + +lt_save_CC="$CC" +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +# Source file extension for C test sources. +ac_ext=c + +# Object file extension for compiled C test sources. +objext=o +objext=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(){return(0);}' + + + + + + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + +# Save the default compiler, since it gets overwritten when the other +# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. +compiler_DEFAULT=$CC + +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +echo "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$RM conftest* + +ac_outfile=conftest.$ac_objext +echo "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$RM -r conftest* + + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... +if test -n "$compiler"; then + +lt_prog_compiler_no_builtin_flag= + +if test "$GCC" = yes; then + case $cc_basename in + nvcc*) + lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; + *) + lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; + esac + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 +$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } +if 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:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_rtti_exceptions=yes + fi + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 +$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } + +if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then + lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" +else + : +fi + +fi + + + + + + + lt_prog_compiler_wl= +lt_prog_compiler_pic= +lt_prog_compiler_static= + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 +$as_echo_n "checking for $compiler option to produce PIC... " >&6; } + + if test "$GCC" = yes; then + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_static='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + lt_prog_compiler_pic='-fPIC' + ;; + m68k) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + lt_prog_compiler_pic='-DDLL_EXPORT' + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic='-fno-common' + ;; + + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + lt_prog_compiler_static= + ;; + + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + ;; + + interix[3-9]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + lt_prog_compiler_can_build_shared=no + enable_shared=no + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic='-fPIC -shared' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic=-Kconform_pic + fi + ;; + + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + + case $cc_basename in + nvcc*) # Cuda Compiler Driver 2.2 + lt_prog_compiler_wl='-Xlinker ' + lt_prog_compiler_pic='-Xcompiler -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 | kopensolaris*-gnu) + case $cc_basename in + # old Intel for x86_64 which still supported -KPIC. + ecc*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-static' + ;; + # icc used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + icc* | ifort*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fPIC' + lt_prog_compiler_static='-static' + ;; + # Lahey Fortran 8.1. + lf95*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='--shared' + lt_prog_compiler_static='--static' + ;; + pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fpic' + lt_prog_compiler_static='-Bstatic' + ;; + ccc*) + lt_prog_compiler_wl='-Wl,' + # All Alpha code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + xl* | bgxl* | bgf* | mpixl*) + # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-qpic' + lt_prog_compiler_static='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ F* | *Sun*Fortran*) + # Sun Fortran 8.3 passes all unrecognized flags to the linker + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='' + ;; + *Sun\ C*) + # Sun C 5.9 + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='-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* | sunf77* | sunf90* | sunf95*) + lt_prog_compiler_wl='-Qoption ld ';; + *) + lt_prog_compiler_wl='-Wl,';; + esac + ;; + + sunos4*) + lt_prog_compiler_wl='-Qoption ld ' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec ;then + lt_prog_compiler_pic='-Kconform_pic' + lt_prog_compiler_static='-Bstatic' + fi + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; + + unicos*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_can_build_shared=no + ;; + + uts4*) + lt_prog_compiler_pic='-pic' + lt_prog_compiler_static='-Bstatic' + ;; + + *) + lt_prog_compiler_can_build_shared=no + ;; + esac + fi + +case $host_os in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic= + ;; + *) + lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" + ;; +esac +{ $as_echo "$as_me:${as_lineno-$LINENO}: 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:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 +$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } +if 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:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_pic_works=yes + fi + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 +$as_echo "$lt_cv_prog_compiler_pic_works" >&6; } + +if test x"$lt_cv_prog_compiler_pic_works" = xyes; then + case $lt_prog_compiler_pic in + "" | " "*) ;; + *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; + esac +else + lt_prog_compiler_pic= + lt_prog_compiler_can_build_shared=no +fi + +fi + + + + + + +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } +if 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 "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_static_works=yes + fi + else + lt_cv_prog_compiler_static_works=yes + fi + fi + $RM -r conftest* + LDFLAGS="$save_LDFLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 +$as_echo "$lt_cv_prog_compiler_static_works" >&6; } + +if test x"$lt_cv_prog_compiler_static_works" = xyes; then + : +else + lt_prog_compiler_static= +fi + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if 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:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 +$as_echo "$lt_cv_prog_compiler_c_o" >&6; } + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if 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:$LINENO: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 +$as_echo "$lt_cv_prog_compiler_c_o" >&6; } + + + + +hard_links="nottested" +if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 +$as_echo_n "checking if we can lock with hard links... " >&6; } + hard_links=yes + $RM conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 +$as_echo "$hard_links" >&6; } + if test "$hard_links" = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} + need_locks=warn + fi +else + need_locks=no +fi + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } + + runpath_var= + allow_undefined_flag= + always_export_symbols=no + archive_cmds= + archive_expsym_cmds= + compiler_needs_object=no + enable_shared_with_static_runtimes=no + export_dynamic_flag_spec= + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + hardcode_automatic=no + hardcode_direct=no + hardcode_direct_absolute=no + hardcode_libdir_flag_spec= + hardcode_libdir_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 + + # On some targets, GNU ld is compatible enough with the native linker + # that we're better off using the native interface for both. + lt_use_gnu_ld_interface=no + if test "$with_gnu_ld" = yes; then + case $host_os in + aix*) + # The AIX port of GNU ld has always aspired to compatibility + # with the native linker. However, as the warning in the GNU ld + # block says, versions before 2.19.5* couldn't really create working + # shared libraries, regardless of the interface used. + case `$LD -v 2>&1` in + *\ \(GNU\ Binutils\)\ 2.19.5*) ;; + *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; + *\ \(GNU\ Binutils\)\ [3-9]*) ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + fi + + if test "$lt_use_gnu_ld_interface" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + export_dynamic_flag_spec='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + whole_archive_flag_spec= + fi + supports_anon_versioning=no + case `$LD -v 2>&1` in + *GNU\ gold*) supports_anon_versioning=yes ;; + *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + + # See if GNU ld supports shared libraries. + case $host_os in + aix[3-9]*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: the GNU linker, at least up to release 2.19, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to install binutils +*** 2.20 or above, or modify your PATH so that a non-GNU linker is found. +*** You will then need to restart the configuration process. + +_LT_EOF + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='' + ;; + m68k) + archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + ;; + esac + ;; + + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + ld_shlibs=no + fi + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec='-L$libdir' + export_dynamic_flag_spec='${wl}--export-all-symbols' + allow_undefined_flag=unsupported + always_export_symbols=no + enable_shared_with_static_runtimes=yes + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' | $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 + ;; + + haiku*) + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + link_all_deplibs=yes + ;; + + interix[3-9]*) + hardcode_direct=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + export_dynamic_flag_spec='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) + tmp_diet=no + if test "$host_os" = linux-dietlibc; then + case $cc_basename in + diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) + esac + fi + if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ + && test "$tmp_diet" = no + then + tmp_addflag= + tmp_sharedflag='-shared' + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group f77 and f90 compilers + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + lf95*) # Lahey Fortran 8.1 + whole_archive_flag_spec= + tmp_sharedflag='--shared' ;; + xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) + tmp_sharedflag='-qmkshrobj' + tmp_addflag= ;; + nvcc*) # Cuda Compiler Driver 2.2 + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + compiler_needs_object=yes + ;; + esac + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) # Sun C 5.9 + whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + compiler_needs_object=yes + tmp_sharedflag='-G' ;; + *Sun\ F*) # Sun Fortran 8.3 + tmp_sharedflag='-G' ;; + esac + archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + + if test "x$supports_anon_versioning" = xyes; then + archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + + case $cc_basename in + xlf* | bgf* | bgxlf* | mpixlf*) + # IBM XL Fortran 10.1 on PPC cannot create shared libs itself + whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' + hardcode_libdir_flag_spec= + hardcode_libdir_flag_spec_ld='-rpath $libdir' + archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' + if test "x$supports_anon_versioning" = xyes; then + archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + fi + ;; + esac + else + ld_shlibs=no + fi + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + archive_cmds='$CC -shared $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 + # Also, AIX nm treats weak defined symbols like other global + # defined symbols, whereas GNU nm marks them as "W". + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + archive_cmds='' + hardcode_direct=yes + hardcode_direct_absolute=yes + hardcode_libdir_separator=':' + link_all_deplibs=yes + file_list_spec='${wl}-f,' + + if test "$GCC" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + hardcode_direct=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L=yes + hardcode_libdir_flag_spec='-L$libdir' + hardcode_libdir_separator= + fi + ;; + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + 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 confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + +lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\(.*\)$/\1/ + p + } + }' +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 +fi +rm -f core conftest.err conftest.$ac_objext \ + 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 func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' + allow_undefined_flag="-z nodefs" + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + +lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\(.*\)$/\1/ + p + } + }' +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 +fi +rm -f core conftest.err conftest.$ac_objext \ + 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' + if test "$with_gnu_ld" = yes; then + # We only use this code for GNU lds that support --whole-archive. + whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec='$convenience' + fi + archive_cmds_need_lc=yes + # This is similar to how AIX traditionally builds its shared libraries. + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='' + ;; + m68k) + archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + ;; + esac + ;; + + bsdi[45]*) + export_dynamic_flag_spec=-rdynamic + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + old_archive_from_new_cmds='true' + # FIXME: Should let the user specify the lib program. + old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' + 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 + if test "$lt_cv_ld_force_load" = "yes"; then + whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + else + whole_archive_flag_spec='' + fi + link_all_deplibs=yes + allow_undefined_flag="$_lt_dar_allow_undefined" + case $cc_basename in + ifort*) _lt_dar_can_shared=yes ;; + *) _lt_dar_can_shared=$GCC ;; + esac + if test "$_lt_dar_can_shared" = "yes"; then + output_verbose_link_cmd=func_echo_all + archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" + module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" + archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" + module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" + + else + ld_shlibs=no + fi + + ;; + + dgux*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + + 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 && test "$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 && test "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -shared -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' + ;; + *) + + # Older versions of the 11.00 compiler do not understand -b yet + # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 +$as_echo_n "checking if $CC understands -b... " >&6; } +if test "${lt_cv_prog_compiler__b+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_prog_compiler__b=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -b" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler__b=yes + fi + else + lt_cv_prog_compiler__b=yes + fi + fi + $RM -r conftest* + LDFLAGS="$save_LDFLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 +$as_echo "$lt_cv_prog_compiler__b" >&6; } + +if test x"$lt_cv_prog_compiler__b" = xyes; then + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' +else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' +fi + + ;; + esac + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + + case $host_cpu in + hppa*64*|ia64*) + hardcode_direct=no + hardcode_shlibpath_var=no + ;; + *) + hardcode_direct=yes + hardcode_direct_absolute=yes + export_dynamic_flag_spec='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + # Try to use the -exported_symbol ld option, if it does not + # work, assume that -exports_file does not work either and + # implicitly export all symbols. + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int foo(void) {} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' + +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS="$save_LDFLAGS" + else + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' + fi + archive_cmds_need_lc='no' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + inherit_rpath=yes + link_all_deplibs=yes + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + newsos6) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_shlibpath_var=no + ;; + + *nto* | *qnx*) + ;; + + openbsd*) + if test -f /usr/libexec/ld.so; then + hardcode_direct=yes + hardcode_shlibpath_var=no + hardcode_direct_absolute=yes + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + export_dynamic_flag_spec='${wl}-E' + else + case $host_os in + openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-R$libdir' + ;; + *) + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + ;; + esac + fi + else + ld_shlibs=no + fi + ;; + + os2*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + allow_undefined_flag=unsupported + archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + + osf3*) + if test "$GCC" = yes; then + allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + fi + archive_cmds_need_lc='no' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ + $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' + + # Both c and cxx compiler support -rpath directly + hardcode_libdir_flag_spec='-rpath $libdir' + fi + archive_cmds_need_lc='no' + hardcode_libdir_separator=: + ;; + + solaris*) + no_undefined_flag=' -z defs' + if test "$GCC" = yes; then + wlarc='${wl}' + archive_cmds='$CC -shared ${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:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 +$as_echo "$ld_shlibs" >&6; } +test "$ld_shlibs" = no && can_build_shared=no + +with_gnu_ld=$with_gnu_ld + + + + + + + + + + + + + + + +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $archive_cmds in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 +$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } +if test "${lt_cv_archive_cmds_need_lc+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + $RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl + pic_flag=$lt_prog_compiler_pic + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag + allow_undefined_flag= + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 + (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + then + lt_cv_archive_cmds_need_lc=no + else + lt_cv_archive_cmds_need_lc=yes + fi + allow_undefined_flag=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 +$as_echo "$lt_cv_archive_cmds_need_lc" >&6; } + archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc + ;; + esac + fi + ;; +esac + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 +$as_echo_n "checking dynamic linker characteristics... " >&6; } + +if test "$GCC" = yes; then + case $host_os in + darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; + *) lt_awk_arg="/^libraries:/" ;; + esac + case $host_os in + mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;; + *) lt_sed_strip_eq="s,=/,/,g" ;; + esac + lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` + case $lt_search_path_spec in + *\;*) + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` + ;; + *) + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` + ;; + esac + # Ok, now we have the path, separated by spaces, we can step through it + # and add multilib dir if necessary. + lt_tmp_lt_search_path_spec= + lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` + for lt_sys_path in $lt_search_path_spec; do + if test -d "$lt_sys_path/$lt_multi_os_dir"; then + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" + else + test -d "$lt_sys_path" && \ + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" + fi + done + lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' +BEGIN {RS=" "; FS="/|\n";} { + lt_foo=""; + lt_count=0; + for (lt_i = NF; lt_i > 0; lt_i--) { + if ($lt_i != "" && $lt_i != ".") { + if ($lt_i == "..") { + lt_count++; + } else { + if (lt_count == 0) { + lt_foo="/" $lt_i lt_foo; + } else { + lt_count--; + } + } + } + } + if (lt_foo != "") { lt_freq[lt_foo]++; } + if (lt_freq[lt_foo] == 1) { print lt_foo; } +}'` + # AWK program above erroneously prepends '/' to C:/dos/paths + # for these hosts. + case $host_os in + mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ + $SED 's,/\([A-Za-z]:\),\1,g'` ;; + esac + sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux + 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.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + case $host_cpu in + powerpc) + # Since July 2007 AmigaOS4 officially supports .so libraries. + # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + ;; + m68k) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + esac + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[45]*) + version_type=linux + 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="$sys_lib_search_path_spec /usr/lib/w32api" + ;; + mingw* | cegcc*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + esac + ;; + + *) + 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 + ;; + +haiku*) + version_type=linux + need_lib_prefix=no + need_version=no + dynamic_linker="$host_os runtime_loader" + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LIBRARY_PATH + shlibpath_overrides_runpath=yes + sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555, ... + postinstall_cmds='chmod 555 $lib' + # or fails outright, so override atomically: + install_override_mode=555 + ;; + +interix[3-9]*) + version_type=linux + 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 | kopensolaris*-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 + if test "${lt_cv_shlibpath_overrides_runpath+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + lt_cv_shlibpath_overrides_runpath=no + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ + LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : + lt_cv_shlibpath_overrides_runpath=yes +fi +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + +fi + + shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Add ABI-specific directories to the system library path. + sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib" + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" + + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux + 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:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 +$as_echo "$dynamic_linker" >&6; } +test "$dynamic_linker" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then + sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" +fi +if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then + sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 +$as_echo_n "checking how to hardcode library paths into programs... " >&6; } +hardcode_action= +if test -n "$hardcode_libdir_flag_spec" || + test -n "$runpath_var" || + test "X$hardcode_automatic" = "Xyes" ; then + + # We can hardcode non-existent directories. + if test "$hardcode_direct" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no && + test "$hardcode_minus_L" != no; then + # Linking always hardcodes the temporary library directory. + hardcode_action=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action=unsupported +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 +$as_echo "$hardcode_action" >&6; } + +if test "$hardcode_action" = relink || + test "$inherit_rpath" = yes; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi + + + + + + + if test "x$enable_dlopen" != xyes; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + + case $host_os in + beos*) + lt_cv_dlopen="load_add_on" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + mingw* | pw32* | cegcc*) + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= + ;; + + cygwin*) + lt_cv_dlopen="dlopen" + lt_cv_dlopen_libs= + ;; + + darwin*) + # if libdl is installed we need to link against it + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } +if 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 confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dl_dlopen=yes +else + ac_cv_lib_dl_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = 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 + + ;; + + *) + ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" +if test "x$ac_cv_func_shl_load" = x""yes; then : + lt_cv_dlopen="shl_load" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 +$as_echo_n "checking for shl_load in -ldld... " >&6; } +if 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 confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char shl_load (); +int +main () +{ +return shl_load (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dld_shl_load=yes +else + ac_cv_lib_dld_shl_load=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 +$as_echo "$ac_cv_lib_dld_shl_load" >&6; } +if test "x$ac_cv_lib_dld_shl_load" = x""yes; then : + lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" +else + ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" +if test "x$ac_cv_func_dlopen" = x""yes; then : + lt_cv_dlopen="dlopen" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +$as_echo_n "checking for dlopen in -ldl... " >&6; } +if 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 confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dl_dlopen=yes +else + ac_cv_lib_dl_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +$as_echo "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = x""yes; then : + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 +$as_echo_n "checking for dlopen in -lsvld... " >&6; } +if 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 confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen (); +int +main () +{ +return dlopen (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_svld_dlopen=yes +else + ac_cv_lib_svld_dlopen=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 +$as_echo "$ac_cv_lib_svld_dlopen" >&6; } +if test "x$ac_cv_lib_svld_dlopen" = x""yes; then : + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 +$as_echo_n "checking for dld_link in -ldld... " >&6; } +if 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 confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dld_link (); +int +main () +{ +return dld_link (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dld_dld_link=yes +else + ac_cv_lib_dld_dld_link=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 +$as_echo "$ac_cv_lib_dld_dld_link" >&6; } +if test "x$ac_cv_lib_dld_dld_link" = 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:${as_lineno-$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 $LINENO "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +/* When -fvisbility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +void fnord () __attribute__((visibility("default"))); +#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; + else puts (dlerror ()); + } + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return status; +} +_LT_EOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; + x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self=no + fi +fi +rm -fr conftest* + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 +$as_echo "$lt_cv_dlopen_self" >&6; } + + if test "x$lt_cv_dlopen_self" = xyes; then + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 +$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } +if 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 $LINENO "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +/* When -fvisbility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +void fnord () __attribute__((visibility("default"))); +#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; + else puts (dlerror ()); + } + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return status; +} +_LT_EOF + if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 + (eval $ac_link) 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; + esac + else : + # compilation failed + lt_cv_dlopen_self_static=no + fi +fi +rm -fr conftest* + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 +$as_echo "$lt_cv_dlopen_self_static" >&6; } + fi + + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + LIBS="$save_LIBS" + ;; + esac + + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac + + case $lt_cv_dlopen_self_static in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac +fi + + + + + + + + + + + + + + + + + +striplib= +old_striplib= +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 +$as_echo_n "checking whether stripping libraries is possible... " >&6; } +if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else +# FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP" ; then + striplib="$STRIP -x" + old_striplib="$STRIP -S" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + fi + ;; + *) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + ;; + esac +fi + + + + + + + + + + + + + # Report which library types will actually be built + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 +$as_echo_n "checking if libtool supports shared libraries... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 +$as_echo "$can_build_shared" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 +$as_echo_n "checking whether to build shared libraries... " >&6; } + test "$can_build_shared" = "no" && enable_shared=no + + # On AIX, shared libraries and static libraries use the same namespace, and + # are all built from PIC. + case $host_os in + aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + + aix[4-9]*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; + esac + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 +$as_echo "$enable_shared" >&6; } + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 +$as_echo_n "checking whether to build static libraries... " >&6; } + # Make sure either enable_shared or enable_static is yes. + test "$enable_shared" = yes || enable_static=yes + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 +$as_echo "$enable_static" >&6; } + + + + +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +CC="$lt_save_CC" + + + + + + + + + + + + + + ac_config_commands="$ac_config_commands libtool" + + + + +# Only expand once: + + + + + + +OBJECT_MODE= +# Checks for programs. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking compiler flags required for compiling ANTLR with $CC C compiler on host $host" >&5 +$as_echo_n "checking compiler flags required for compiling ANTLR with $CC C compiler on host $host... " >&6; } +WARNFLAGS= +case $CC in +xlc*) + CPPCMNTFLAGS="-qcpluscmt" + if test x"$enable_64bit" = xyes; then + CCFLAGS64="-q64 -Wl,-b64" + OBJECT_MODE="64" + else + OBJECT_MODE="32" + fi + OPTIMFLAGS="-O2" + if test x"$enable_debuginfo" = xyes; then + DEBUGFLAGS="-g" + fi + ;; + +aCC*) + CPPCMNTFLAGS= + if test x"$enable_64bit" = xyes; then + CCFLAGS64="+DD64" + fi + OPTIMFLAGS="-O" + if test $DEBUGINF = 1; then + DEBUGFLAGS="-g" + fi + ;; + +gcc*) + CPPCMNTFLAGS= + if test x"$enable_64bit" = xyes; then + GCCABIFLAGS="-m64" + else + GCCABIFLAGS="-m32" + fi + if test x"$enable_abiflags" = xyes; then + CCFLAGS64=$GCCABIFLAGS + fi + OPTIMFLAGS="-O2" + if test x"$enable_debuginfo" = xyes; then + DEBUGFLAGS="-g" + fi + WARNFLAGS=-Wall + ;; + +*) + +case $host in +sparc*-*solaris*) + CPPCMNTFLAGS= + if test x"$enable_64bit" = xyes; then + CCFLAGS64="-fast -xtarget=ultra4 -m64 -xarch=sparcvis" + fi + OPTIMFLAGS="-O" + if test x"$enable_debuginfo" = xyes; then + DEBUGFLAGS='-g' + fi + ;; + +*) + CPPCMNTFLAGS= + CCFLAGS64= + OPTIMFLAGS="-O" + if test x"$enable_debuginfo" = xyes; then + DEBUGFLAGS='-g' + fi + ;; +esac + + ;; +esac + +CFLAGS="$CCFLAGS64 $CPPCMNTFLAGS $OPTIMFLAGS $DEBUGFLAGS $WARNFLAGS" +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CFLAGS" >&5 +$as_echo "$CFLAGS" >&6; } + + +if test "x$enable_antlrdebug" = xno; then : + +$as_echo "#define ANTLR3_NODEBUGGER 1" >>confdefs.h + +fi +if test x"$enable_64bit" = xyes; then : + +$as_echo "#define ANTLR3_USE_64BIT 1" >>confdefs.h + +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 +$as_echo_n "checking whether ln -s works... " >&6; } +LN_S=$as_ln_s +if test "$LN_S" = "ln -s"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 +$as_echo "no, using $LN_S" >&6; } +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval "test \"\${ac_cv_prog_make_${ac_make}_set+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:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + SET_MAKE= +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + + +# Checks for libraries. + +# Checks for header files. +$ac_includes_default +for ac_header in sys/types.h netinet/in.h arpa/nameser.h netdb.h resolv.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_NETINET_IN_H +# include /* inet_ functions / structs */ +#endif +#ifdef HAVE_ARPA_NAMESER_H +# include /* DNS HEADER struct */ +#endif +#ifdef HAVE_NETDB_H +# include +#endif +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +for ac_header in sys/malloc.h malloc.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "#ifdef HAVE_SYS_MALLOC_H +#include +#endif +#ifdef HAVE_MALLOC_H +#include +#endif + +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + +for ac_header in stdarg.h +do : + ac_fn_c_check_header_compile "$LINENO" "stdarg.h" "ac_cv_header_stdarg_h" "#ifdef HAVE_STDARG_H +#include +#endif + +" +if test "x$ac_cv_header_stdarg_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_STDARG_H 1 +_ACEOF + +fi + +done + + +for ac_header in sys/stat.h +do : + ac_fn_c_check_header_compile "$LINENO" "sys/stat.h" "ac_cv_header_sys_stat_h" "#ifdef HAVE_SYS_STAT_H +#include +#endif + +" +if test "x$ac_cv_header_sys_stat_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_SYS_STAT_H 1 +_ACEOF + +fi + +done + + +for ac_header in ctype.h +do : + ac_fn_c_check_header_compile "$LINENO" "ctype.h" "ac_cv_header_ctype_h" "#ifdef HAVE_CTYPE_H +#include +#endif + +" +if test "x$ac_cv_header_ctype_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_CTYPE_H 1 +_ACEOF + +fi + +done + + +for ac_header in netinet/tcp.h +do : + ac_fn_c_check_header_compile "$LINENO" "netinet/tcp.h" "ac_cv_header_netinet_tcp_h" "#ifdef HAVE_NETINET_TCP_H +#include +#endif + +" +if test "x$ac_cv_header_netinet_tcp_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_NETINET_TCP_H 1 +_ACEOF + +fi + +done + + +for ac_header in sys/socket.h socket.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "#ifdef HAVE_SYS_SOCKET_H +#include +#endif +#ifdef HAVE_SOCKET_H +#include +#endif + +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +# Checks for typedefs, structures, and compiler characteristics. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 +$as_echo_n "checking for an ANSI C-conforming const... " >&6; } +if test "${ac_cv_c_const+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +/* FIXME: Include the comments suggested by Paul. */ +#ifndef __cplusplus + /* Ultrix mips cc rejects this. */ + typedef int charset[2]; + const charset cs; + /* SunOS 4.1.1 cc rejects this. */ + char const *const *pcpcc; + char **ppc; + /* NEC SVR4.0.2 mips cc rejects this. */ + struct point {int x, y;}; + static struct point const zero = {0,0}; + /* 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"; + pcpcc = &g + (g ? g-g : 0); + /* HPUX 7.0 cc rejects these. */ + ++pcpcc; + ppc = (char**) pcpcc; + pcpcc = (char const *const *) ppc; + { /* SCO 3.2v4 cc rejects this. */ + char *t; + char const *s = 0 ? (char *) 0 : (char const *) 0; + + *t++ = 0; + if (s) return 0; + } + { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ + int x[] = {25, 17}; + const int *foo = &x[0]; + ++foo; + } + { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ + typedef const int *iptr; + iptr p = 0; + ++p; + } + { /* 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; + if (!foo) return 0; + } + return !cs[0] && !zero.x; +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_const=yes +else + ac_cv_c_const=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 +$as_echo "$ac_cv_c_const" >&6; } +if test $ac_cv_c_const = no; then + +$as_echo "#define const /**/" >>confdefs.h + +fi + +ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" +if test "x$ac_cv_type_size_t" = x""yes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define size_t unsigned int +_ACEOF + +fi + +ac_fn_c_find_intX_t "$LINENO" "8" "ac_cv_c_int8_t" +case $ac_cv_c_int8_t in #( + no|yes) ;; #( + *) + +cat >>confdefs.h <<_ACEOF +#define int8_t $ac_cv_c_int8_t +_ACEOF +;; +esac + +ac_fn_c_find_intX_t "$LINENO" "16" "ac_cv_c_int16_t" +case $ac_cv_c_int16_t in #( + no|yes) ;; #( + *) + +cat >>confdefs.h <<_ACEOF +#define int16_t $ac_cv_c_int16_t +_ACEOF +;; +esac + +ac_fn_c_find_intX_t "$LINENO" "32" "ac_cv_c_int32_t" +case $ac_cv_c_int32_t in #( + no|yes) ;; #( + *) + +cat >>confdefs.h <<_ACEOF +#define int32_t $ac_cv_c_int32_t +_ACEOF +;; +esac + +ac_fn_c_find_intX_t "$LINENO" "64" "ac_cv_c_int64_t" +case $ac_cv_c_int64_t in #( + no|yes) ;; #( + *) + +cat >>confdefs.h <<_ACEOF +#define int64_t $ac_cv_c_int64_t +_ACEOF +;; +esac + + + ac_fn_c_check_type "$LINENO" "intptr_t" "ac_cv_type_intptr_t" "$ac_includes_default" +if test "x$ac_cv_type_intptr_t" = x""yes; then : + +$as_echo "#define HAVE_INTPTR_T 1" >>confdefs.h + +else + for ac_type in 'int' 'long int' 'long long int'; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(sizeof (void *) <= sizeof ($ac_type))]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +cat >>confdefs.h <<_ACEOF +#define intptr_t $ac_type +_ACEOF + + ac_type= +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + test -z "$ac_type" && break + done +fi + + +ac_fn_c_find_uintX_t "$LINENO" "8" "ac_cv_c_uint8_t" +case $ac_cv_c_uint8_t in #( + no|yes) ;; #( + *) + +$as_echo "#define _UINT8_T 1" >>confdefs.h + + +cat >>confdefs.h <<_ACEOF +#define uint8_t $ac_cv_c_uint8_t +_ACEOF +;; + esac + +ac_fn_c_find_uintX_t "$LINENO" "16" "ac_cv_c_uint16_t" +case $ac_cv_c_uint16_t in #( + no|yes) ;; #( + *) + + +cat >>confdefs.h <<_ACEOF +#define uint16_t $ac_cv_c_uint16_t +_ACEOF +;; + esac + +ac_fn_c_find_uintX_t "$LINENO" "32" "ac_cv_c_uint32_t" +case $ac_cv_c_uint32_t in #( + no|yes) ;; #( + *) + +$as_echo "#define _UINT32_T 1" >>confdefs.h + + +cat >>confdefs.h <<_ACEOF +#define uint32_t $ac_cv_c_uint32_t +_ACEOF +;; + esac + +ac_fn_c_find_uintX_t "$LINENO" "64" "ac_cv_c_uint64_t" +case $ac_cv_c_uint64_t in #( + no|yes) ;; #( + *) + +$as_echo "#define _UINT64_T 1" >>confdefs.h + + +cat >>confdefs.h <<_ACEOF +#define uint64_t $ac_cv_c_uint64_t +_ACEOF +;; + esac + + + ac_fn_c_check_type "$LINENO" "uintptr_t" "ac_cv_type_uintptr_t" "$ac_includes_default" +if test "x$ac_cv_type_uintptr_t" = x""yes; then : + +$as_echo "#define HAVE_UINTPTR_T 1" >>confdefs.h + +else + for ac_type in 'unsigned int' 'unsigned long int' \ + 'unsigned long long int'; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +static int test_array [1 - 2 * !(sizeof (void *) <= sizeof ($ac_type))]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +cat >>confdefs.h <<_ACEOF +#define uintptr_t $ac_type +_ACEOF + + ac_type= +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + test -z "$ac_type" && break + done +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 +$as_echo_n "checking for inline... " >&6; } +if test "${ac_cv_c_inline+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_c_inline=no +for ac_kw in inline __inline__ __inline; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifndef __cplusplus +typedef int foo_t; +static $ac_kw foo_t static_foo () {return 0; } +$ac_kw foo_t foo () {return 0; } +#endif + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_inline=$ac_kw +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + test "$ac_cv_c_inline" != no && break +done + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 +$as_echo "$ac_cv_c_inline" >&6; } + +case $ac_cv_c_inline in + inline | yes) ;; + *) + case $ac_cv_c_inline in + no) ac_val=;; + *) ac_val=$ac_cv_c_inline;; + esac + cat >>confdefs.h <<_ACEOF +#ifndef __cplusplus +#define inline $ac_val +#endif +_ACEOF + ;; +esac + + + +# Checks for library functions. +for ac_func in memmove memset strdup accept +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + + + +ac_config_headers="$ac_config_headers antlr3config.h" + +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:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + # `set' does not quote correctly, so add quotes: double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \. + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; #( + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + test "x$cache_file" != "x/dev/null" && + { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +$as_echo "$as_me: updating cache $cache_file" >&6;} + cat confcache >$cache_file + else + { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +DEFS=-DHAVE_CONFIG_H + +ac_libobjs= +ac_ltlibobjs= +U= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" + as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + + if test -n "$EXEEXT"; then + am__EXEEXT_TRUE= + am__EXEEXT_FALSE='#' +else + am__EXEEXT_TRUE='#' + am__EXEEXT_FALSE= +fi + +if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then + as_fn_error $? "conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then + as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi + +: ${CONFIG_STATUS=./config.status} +ac_write_fail=0 +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +as_write_fail=0 +cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false + +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + + +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with STATUS, using 1 if that was 0. +as_fn_error () +{ + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + fi + $as_echo "$as_me: error: $2" >&2 + as_fn_exit $as_status +} # as_fn_error + + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -p' + fi +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" + + +} # as_fn_mkdir_p +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in #( + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +exec 6>&1 +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +_ASEOF +test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# Save the log message, to keep $0 and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by libantlr3c $as_me 3.4, which was +generated by GNU Autoconf 2.66. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac + +case $ac_config_headers in *" +"*) set x $ac_config_headers; shift; ac_config_headers=$*;; +esac + + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# Files that config.status was made for. +config_files="$ac_config_files" +config_headers="$ac_config_headers" +config_commands="$ac_config_commands" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +ac_cs_usage="\ +\`$as_me' instantiates files and other configuration actions +from templates according to the current configuration. Unless the files +and actions are specified as TAGs, all are instantiated by default. + +Usage: $0 [OPTION]... [TAG]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + --config print configuration, then exit + -q, --quiet, --silent + do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Configuration commands: +$config_commands + +Report bugs to ." + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" +ac_cs_version="\\ +libantlr3c config.status 3.4 +configured by $0, generated by GNU Autoconf 2.66, + with options \\"\$ac_cs_config\\" + +Copyright (C) 2010 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' +MKDIR_P='$MKDIR_P' +AWK='$AWK' +test -n "\$AWK" || AWK=awk +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + $as_echo "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + $as_echo "$ac_cs_config"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append CONFIG_HEADERS " '$ac_optarg'" + ac_need_defaults=false;; + --he | --h) + # Conflict between --help and --header + as_fn_error $? "ambiguous option: \`$1' +Try \`$0 --help' for more information.";; + --help | --hel | -h ) + $as_echo "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) as_fn_error $? "unrecognized option: \`$1' +Try \`$0 --help' for more information." ;; + + *) as_fn_append ac_config_targets " $1" + ac_need_defaults=false ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +if \$ac_cs_recheck; then + set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' + export CONFIG_SHELL + exec "\$@" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + $as_echo "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# +# INIT-COMMANDS +# +AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" + + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +sed_quote_subst='$sed_quote_subst' +double_quote_subst='$double_quote_subst' +delay_variable_subst='$delay_variable_subst' +macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' +macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' +enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' +enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' +pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' +enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' +SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' +ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' +host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' +host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' +host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' +build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' +build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' +build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' +SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' +Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' +GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' +EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' +FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' +LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' +NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' +LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' +max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' +ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' +exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' +lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' +lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' +lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' +reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' +reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' +OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' +deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' +file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' +AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' +AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' +STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' +RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' +old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' +old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' +old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' +lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' +CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' +CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' +compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' +GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' +objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' +MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' +lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' +lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' +need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' +DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' +NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' +LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' +OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' +OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' +libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' +shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' +extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' +archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' +enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' +export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' +whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' +compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' +old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' +old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' +archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' +archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' +module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' +module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' +with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' +allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' +no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec_ld='`$ECHO "$hardcode_libdir_flag_spec_ld" | $SED "$delay_single_quote_subst"`' +hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' +hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' +hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' +hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' +hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' +hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' +inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' +link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' +fix_srcfile_path='`$ECHO "$fix_srcfile_path" | $SED "$delay_single_quote_subst"`' +always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' +export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' +exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' +include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' +prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' +file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' +variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' +need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' +need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' +version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' +runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' +shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' +shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' +libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' +library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' +soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' +install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' +postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' +postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' +finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' +finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' +hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' +sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' +sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`' +hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' +enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' +enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' +enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' +old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' +striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' + +LTCC='$LTCC' +LTCFLAGS='$LTCFLAGS' +compiler='$compiler_DEFAULT' + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$1 +_LTECHO_EOF' +} + +# Quote evaled strings. +for var in SHELL \ +ECHO \ +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 \ +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 \ +install_override_mode \ +finish_eval \ +old_striplib \ +striplib; do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[\\\\\\\`\\"\\\$]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +# Double-quote double-evaled strings. +for var in reload_cmds \ +old_postinstall_cmds \ +old_postuninstall_cmds \ +old_archive_cmds \ +extract_expsyms_cmds \ +old_archive_from_new_cmds \ +old_archive_from_expsyms_cmds \ +archive_cmds \ +archive_expsym_cmds \ +module_cmds \ +module_expsym_cmds \ +export_symbols_cmds \ +prelink_cmds \ +postinstall_cmds \ +postuninstall_cmds \ +finish_cmds \ +sys_lib_search_path_spec \ +sys_lib_dlsearch_path_spec; do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[\\\\\\\`\\"\\\$]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +ac_aux_dir='$ac_aux_dir' +xsi_shell='$xsi_shell' +lt_shell_append='$lt_shell_append' + +# See if we are running on zsh, and set the options which allow our +# commands through without removal of \ escapes INIT. +if test -n "\${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi + + + PACKAGE='$PACKAGE' + VERSION='$VERSION' + TIMESTAMP='$TIMESTAMP' + RM='$RM' + ofile='$ofile' + + + + +_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" ;; + "antlr3config.h") CONFIG_HEADERS="$CONFIG_HEADERS antlr3config.h" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + esac +done + + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+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 'as_fn_exit 1' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -n "$tmp" && test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$tmp/subs1.awk" && +_ACEOF + + +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + . ./conf$$subs.sh || + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then + break + elif $ac_last_try; then + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done +rm -f conf$$subs.sh + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$tmp/subs1.awk" <<\\_ACAWK && +_ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\)..*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\)..*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' >$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$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_fn_error $? "could not setup config files machinery" "$LINENO" 5 +_ACEOF + +# VPATH may cause trouble with some makes, so we remove sole $(srcdir), +# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// +s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +fi # test -n "$CONFIG_FILES" + +# Set up the scripts for CONFIG_HEADERS section. +# No need to generate them if there are no CONFIG_HEADERS. +# This happens for instance with `./config.status Makefile'. +if test -n "$CONFIG_HEADERS"; then +cat >"$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_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +# For the awk script, D is an array of macro values keyed by name, +# likewise P contains macro parameters if any. Preserve backslash +# newline sequences. + +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +sed -n ' +s/.\{148\}/&'"$ac_delim"'/g +t rset +:rset +s/^[ ]*#[ ]*define[ ][ ]*/ / +t def +d +:def +s/\\$// +t bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3"/p +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p +d +:bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3\\\\\\n"\\/p +t cont +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p +t cont +d +:cont +n +s/.\{148\}/&'"$ac_delim"'/g +t clear +:clear +s/\\$// +t bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/"/p +d +:bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p +b cont +' >$CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + for (key in D) D_is_set[key] = 1 + FS = "" +} +/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { + line = \$ 0 + split(line, arg, " ") + if (arg[1] == "#") { + defundef = arg[2] + mac1 = arg[3] + } else { + defundef = substr(arg[1], 2) + mac1 = arg[2] + } + split(mac1, mac2, "(") #) + macro = mac2[1] + prefix = substr(line, 1, index(line, defundef) - 1) + if (D_is_set[macro]) { + # Preserve the white space surrounding the "#". + print prefix "define", macro P[macro] D[macro] + next + } else { + # Replace #undef with comments. This is necessary, for example, + # in the case of _POSIX_SOURCE, which is predefined and required + # on some systems where configure will not decide to define it. + if (defundef == "undef") { + print "/*", prefix defundef, macro, "*/" + next + } + } +} +{ print } +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 +fi # test -n "$CONFIG_HEADERS" + + +eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; + esac + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + as_fn_append ac_file_inputs " '$ac_f'" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir="$ac_dir"; as_fn_mkdir_p + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + esac + ac_MKDIR_P=$MKDIR_P + case $MKDIR_P in + [\\/$]* | ?:[\\/]* ) ;; + */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; + esac +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_sed_extra="$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +s&@MKDIR_P@&$ac_MKDIR_P&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&5 +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined" >&2;} + + rm -f "$tmp/stdin" + case $ac_file in + -) cat "$tmp/out" && rm -f "$tmp/out";; + *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; + esac \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + ;; + :H) + # + # CONFIG_HEADER + # + if test x"$ac_file" != x-; then + { + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" + } >"$tmp/config.h" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then + { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 +$as_echo "$as_me: $ac_file is unchanged" >&6;} + else + rm -f "$ac_file" + mv "$tmp/config.h" "$ac_file" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + fi + else + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \ + || as_fn_error $? "could not create -" "$LINENO" 5 + fi +# Compute "$ac_file"'s index in $config_headers. +_am_arg="$ac_file" +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || +$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$_am_arg" : 'X\(//\)[^/]' \| \ + X"$_am_arg" : 'X\(//\)$' \| \ + X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$_am_arg" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'`/stamp-h$_am_stamp_count + ;; + + :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 +$as_echo "$as_me: executing $ac_file commands" >&6;} + ;; + esac + + + case $ac_file$ac_mode in + "depfiles":C) test x"$AMDEP_TRUE" != x"" || { + # Autoconf 2.62 quotes --file arguments for eval, but not when files + # are listed without --file. Let's play safe and only enable the eval + # if we detect the quoting. + case $CONFIG_FILES in + *\'*) eval set x "$CONFIG_FILES" ;; + *) set x $CONFIG_FILES ;; + esac + shift + for mf + do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`$as_dirname -- "$mf" || +$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$mf" : 'X\(//\)[^/]' \| \ + X"$mf" : 'X\(//\)$' \| \ + X"$mf" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$mf" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`$as_dirname -- "$file" || +$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$file" : 'X\(//\)[^/]' \| \ + X"$file" : 'X\(//\)$' \| \ + X"$file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir=$dirpart/$fdir; as_fn_mkdir_p + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done + done +} + ;; + "libtool":C) + + # See if we are running on zsh, and set the options which allow our + # commands through without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + + cfgfile="${ofile}T" + trap "$RM \"$cfgfile\"; exit 1" 1 2 15 + $RM "$cfgfile" + + cat <<_LT_EOF >> "$cfgfile" +#! $SHELL + +# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: +# NOTE: Changes made to this file will be lost: look at ltmain.sh. +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +# 2006, 2007, 2008, 2009, 2010 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 + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# An echo program that protects backslashes. +ECHO=$lt_ECHO + +# 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 + +# 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 + +# Whether to use a lock for old archive extraction. +lock_old_archive_extraction=$lock_old_archive_extraction + +# A C compiler. +LTCC=$lt_CC + +# LTCC compiler flags. +LTCFLAGS=$lt_CFLAGS + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe + +# Transform the output of nm in a proper C declaration. +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + +# Transform the output of nm in a C name address pair. +global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address + +# Transform the output of nm in a C name address pair when lib prefix is needed. +global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# Used to examine libraries when file_magic_cmd begins with "file". +MAGIC_CMD=$MAGIC_CMD + +# Must we lock files when doing compilation? +need_locks=$lt_need_locks + +# Tool to manipulate archived DWARF debug symbol files on Mac OS X. +DSYMUTIL=$lt_DSYMUTIL + +# Tool to change global to local symbols on Mac OS X. +NMEDIT=$lt_NMEDIT + +# Tool to manipulate fat objects and archives on Mac OS X. +LIPO=$lt_LIPO + +# ldd/readelf like tool for Mach-O binaries on Mac OS X. +OTOOL=$lt_OTOOL + +# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. +OTOOL64=$lt_OTOOL64 + +# Old archive suffix (normally "a"). +libext=$libext + +# Shared library suffix (normally ".so"). +shrext_cmds=$lt_shrext_cmds + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at link time. +variables_saved_for_relink=$lt_variables_saved_for_relink + +# Do we need the "lib" prefix for modules? +need_lib_prefix=$need_lib_prefix + +# Do we need a version for libraries? +need_version=$need_version + +# Library versioning type. +version_type=$version_type + +# Shared library runtime path variable. +runpath_var=$runpath_var + +# Shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# Format of library name prefix. +libname_spec=$lt_libname_spec + +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME +library_names_spec=$lt_library_names_spec + +# The coded name of the library, if different from the real name. +soname_spec=$lt_soname_spec + +# Permission mode override for installation of shared libraries. +install_override_mode=$lt_install_override_mode + +# Command to use after installation of a shared archive. +postinstall_cmds=$lt_postinstall_cmds + +# Command to use after uninstallation of a shared archive. +postuninstall_cmds=$lt_postuninstall_cmds + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds + +# As "finish_cmds", except a single script fragment to be evaled but +# not shown. +finish_eval=$lt_finish_eval + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs + +# Compile-time system search path for libraries. +sys_lib_search_path_spec=$lt_sys_lib_search_path_spec + +# Run-time system search path for libraries. +sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec + +# Whether dlopen is supported. +dlopen_support=$enable_dlopen + +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self + +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static + +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib + + +# The linker used to build libraries. +LD=$lt_LD + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# Commands used to build an old-style archive. +old_archive_cmds=$lt_old_archive_cmds + +# A language specific compiler. +CC=$lt_compiler + +# Is the compiler the GNU compiler? +with_gcc=$GCC + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag + +# 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 "${1}" | $SED "$dirname"` + if test "X$func_dirname_result" = "X${1}"; then + func_dirname_result="${3}" + else + func_dirname_result="$func_dirname_result${2}" + fi +} + +# func_basename file +func_basename () +{ + func_basename_result=`$ECHO "${1}" | $SED "$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 "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; + *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; 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 "${1}" | $SED "$my_sed_long_opt"` + func_opt_split_arg=`$ECHO "${1}" | $SED "$my_sed_long_arg"` +} + +# func_lo2o object +func_lo2o () +{ + func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` +} + +# func_xform libobj-or-source +func_xform () +{ + func_xform_result=`$ECHO "${1}" | $SED '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 + + +as_fn_exit 0 +_ACEOF +ac_clean_files=$ac_clean_files_save + +test $ac_write_fail = 0 || + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || as_fn_exit 1 +fi +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi + diff --git a/antlr/libantlr3c-3.4/configure.ac b/antlr/libantlr3c-3.4/configure.ac new file mode 100644 index 0000000..b3d9c3a --- /dev/null +++ b/antlr/libantlr3c-3.4/configure.ac @@ -0,0 +1,217 @@ +# -*- Autoconf -*- +# Process this file with autoconf to produce a configure script. + +AC_INIT(libantlr3c, 3.4, jimi@temporal-wave.com) +AC_PREREQ(2.60) +AC_COPYRIGHT([ + (The "BSD licence") + Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC + http://www.temporal-wave.com + http://www.linkedin.com/in/jimidle + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + 3. The name of the author may not be used to endorse or promote products + derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +]) +AC_CONFIG_SRCDIR(src/antlr3parser.c) + + +AC_ARG_ENABLE([debuginfo], + [AS_HELP_STRING([--enable-debuginfo], [Compiles debug info into the library (default --disable-debuginfo)])], + [], [enable_debuginfo=no]) + +AC_ARG_ENABLE([64bit], + [AS_HELP_STRING([--enable-64bit], [Turns on flags that produce 64 bit object code if any are required (default --disable-64bit)])], + [], [enable_64bit=no]) + +AC_ARG_ENABLE([abiflags], + [AS_HELP_STRING([--disable-abiflags], [Does not add ABI flags -m32 or -m64 for older versions of gcc, such as itanium 3.x (default --enable-abiflags=yes)])], + [], [enable_abiflags=yes]) + +AC_ARG_ENABLE([antlrdebug], + [AS_HELP_STRING([--disable-antlrdebug], [Turns off default flags that include the antlr debugger in the runtime. Specify to remove debugger and the socket dependancies (default --enable-antlrdebug)])], + [], [enable_antlrdebug=yes]) + +AM_INIT_AUTOMAKE(foreign) +AC_LANG(C) +AC_PROG_CC([xlc aCC gcc cc]) +AM_MAINTAINER_MODE +AM_PROG_LIBTOOL + +AC_CANONICAL_BUILD +AC_CANONICAL_HOST + +OBJECT_MODE= +# Checks for programs. +AC_MSG_CHECKING([compiler flags required for compiling ANTLR with $CC C compiler on host $host]) +WARNFLAGS= +case $CC in +xlc*) + CPPCMNTFLAGS="-qcpluscmt" + if test x"$enable_64bit" = xyes; then + CCFLAGS64="-q64 -Wl,-b64" + OBJECT_MODE="64" + else + OBJECT_MODE="32" + fi + OPTIMFLAGS="-O2" + if test x"$enable_debuginfo" = xyes; then + DEBUGFLAGS="-g" + fi + ;; + +aCC*) + CPPCMNTFLAGS= + if test x"$enable_64bit" = xyes; then + CCFLAGS64="+DD64" + fi + OPTIMFLAGS="-O" + if test $DEBUGINF = 1; then + DEBUGFLAGS="-g" + fi + ;; + +gcc*) + CPPCMNTFLAGS= + if test x"$enable_64bit" = xyes; then + GCCABIFLAGS="-m64" + else + GCCABIFLAGS="-m32" + fi + if test x"$enable_abiflags" = xyes; then + CCFLAGS64=$GCCABIFLAGS + fi + OPTIMFLAGS="-O2" + if test x"$enable_debuginfo" = xyes; then + DEBUGFLAGS="-g" + fi + WARNFLAGS=-Wall + ;; + +*) + +case $host in +sparc*-*solaris*) + CPPCMNTFLAGS= + if test x"$enable_64bit" = xyes; then + CCFLAGS64="-fast -xtarget=ultra4 -m64 -xarch=sparcvis" + fi + OPTIMFLAGS="-O" + if test x"$enable_debuginfo" = xyes; then + DEBUGFLAGS='-g' + fi + ;; + +*) + CPPCMNTFLAGS= + CCFLAGS64= + OPTIMFLAGS="-O" + if test x"$enable_debuginfo" = xyes; then + DEBUGFLAGS='-g' + fi + ;; +esac + + ;; +esac + +CFLAGS="$CCFLAGS64 $CPPCMNTFLAGS $OPTIMFLAGS $DEBUGFLAGS $WARNFLAGS" +AC_MSG_RESULT([$CFLAGS]) +AC_SUBST([OBJECT_MODE]) + +AS_IF([test "x$enable_antlrdebug" = xno], [AC_DEFINE([ANTLR3_NODEBUGGER], [1], [Define if ANTLR debugger not required])], []) +AS_IF([test x"$enable_64bit" = xyes], [AC_DEFINE([ANTLR3_USE_64BIT], [1], [Define if 64 bit mode required])], []) + +AC_PROG_INSTALL +AC_PROG_LN_S +AC_PROG_MAKE_SET + +# Checks for libraries. + +# Checks for header files. +AC_INCLUDES_DEFAULT() +AC_HEADER_RESOLV +AC_CHECK_HEADERS([sys/malloc.h malloc.h], [], [], +[[#ifdef HAVE_SYS_MALLOC_H +#include +#endif +#ifdef HAVE_MALLOC_H +#include +#endif +]]) +AC_CHECK_HEADERS([stdarg.h], [], [], +[[#ifdef HAVE_STDARG_H +#include +#endif +]]) + +AC_CHECK_HEADERS([sys/stat.h], [], [], +[[#ifdef HAVE_SYS_STAT_H +#include +#endif +]]) + +AC_CHECK_HEADERS([ctype.h], [], [], +[[#ifdef HAVE_CTYPE_H +#include +#endif +]]) + +AC_CHECK_HEADERS([netinet/tcp.h], [], [], +[[#ifdef HAVE_NETINET_TCP_H +#include +#endif +]]) + +AC_CHECK_HEADERS([sys/socket.h socket.h], [], [], +[[#ifdef HAVE_SYS_SOCKET_H +#include +#endif +#ifdef HAVE_SOCKET_H +#include +#endif +]]) + +# Checks for typedefs, structures, and compiler characteristics. +AC_C_CONST +AC_TYPE_SIZE_T +AC_TYPE_INT8_T +AC_TYPE_INT16_T +AC_TYPE_INT32_T +AC_TYPE_INT64_T +AC_TYPE_INTPTR_T +AC_TYPE_UINT8_T +AC_TYPE_UINT16_T +AC_TYPE_UINT32_T +AC_TYPE_UINT64_T +AC_TYPE_UINTPTR_T +AC_C_INLINE + + +# Checks for library functions. +AC_CHECK_FUNCS([memmove memset strdup accept]) + +AC_CONFIG_MACRO_DIR([m4]) + +AC_CONFIG_HEADERS(antlr3config.h) +AC_CONFIG_FILES([Makefile]) +AC_OUTPUT diff --git a/antlr/libantlr3c-3.4/depcomp b/antlr/libantlr3c-3.4/depcomp new file mode 100755 index 0000000..df8eea7 --- /dev/null +++ b/antlr/libantlr3c-3.4/depcomp @@ -0,0 +1,630 @@ +#! /bin/sh +# depcomp - compile a program generating dependencies as side-effects + +scriptversion=2009-04-28.21; # UTC + +# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 Free +# Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Originally written by Alexandre Oliva . + +case $1 in + '') + echo "$0: No command. Try \`$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: depcomp [--help] [--version] PROGRAM [ARGS] + +Run PROGRAMS ARGS to compile a file, generating dependencies +as side-effects. + +Environment variables: + depmode Dependency tracking mode. + source Source file read by `PROGRAMS ARGS'. + object Object file output by `PROGRAMS ARGS'. + DEPDIR directory where to store dependencies. + depfile Dependency file to output. + tmpdepfile Temporary file to use when outputing dependencies. + libtool Whether libtool is used (yes/no). + +Report bugs to . +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 + +cygpath_u="cygpath -u -f -" +if test "$depmode" = msvcmsys; then + # This is just like msvisualcpp but w/o cygpath translation. + # Just convert the backslash-escaped backslashes to single forward + # slashes to satisfy depend.m4 + cygpath_u="sed s,\\\\\\\\,/,g" + depmode=msvisualcpp +fi + +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 "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + # Remove `-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + test -z "$dashmflag" && dashmflag=-M + # Require at least two characters before searching for `:' + # in the target name. This is to cope with DOS-style filenames: + # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. + "$@" $dashmflag | + sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$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 "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + # X makedepend + shift + cleared=no eat=no + for arg + do + case $cleared in + no) + set ""; shift + cleared=yes ;; + esac + if test $eat = yes; then + eat=no + continue + fi + case "$arg" in + -D*|-I*) + set fnord "$@" "$arg"; shift ;; + # Strip any option that makedepend may not understand. Remove + # the object too, otherwise makedepend will parse it as a source file. + -arch) + eat=yes ;; + -*|$object) + ;; + *) + set fnord "$@" "$arg"; shift ;; + esac + done + obj_suffix=`echo "$object" | sed 's/^.*\././'` + touch "$tmpdepfile" + ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" + rm -f "$depfile" + 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 "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + # Remove `-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + "$@" -E | + sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ + -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | + sed '$ s: \\$::' > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + cat < "$tmpdepfile" >> "$depfile" + sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvisualcpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test "X$1" != 'X--mode=compile'; do + shift + done + shift + fi + + IFS=" " + for arg + do + case "$arg" in + -o) + shift + ;; + $object) + shift + ;; + "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") + set fnord "$@" + shift + shift + ;; + *) + set fnord "$@" "$arg" + shift + shift + ;; + esac + done + "$@" -E 2>/dev/null | + sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" + echo " " >> "$depfile" + sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvcmsys) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +none) + exec "$@" + ;; + +*) + echo "Unknown depmode $depmode" 1>&2 + exit 1 + ;; +esac + +exit 0 + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/antlr/libantlr3c-3.4/doxyfile b/antlr/libantlr3c-3.4/doxyfile new file mode 100644 index 0000000..859f6df --- /dev/null +++ b/antlr/libantlr3c-3.4/doxyfile @@ -0,0 +1,1659 @@ +# Doxyfile 1.7.1 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project +# +# All text after a hash (#) is considered a comment and will be ignored +# The format is: +# TAG = value [value, ...] +# For lists items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (" ") + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +# This tag specifies the encoding used for all characters in the config file +# that follow. The default is UTF-8 which is also the encoding used for all +# text before the first occurrence of this tag. Doxygen uses libiconv (or the +# iconv built into libc) for the transcoding. See +# http://www.gnu.org/software/libiconv for the list of possible encodings. + +DOXYFILE_ENCODING = UTF-8 + +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded +# by quotes) that should identify the project. + +PROJECT_NAME = ANTLR3C + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. +# This could be handy for archiving the generated documentation or +# if some version control system is used. + +PROJECT_NUMBER = 3.3.1 + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) +# base path where the generated documentation will be put. +# If a relative path is entered, it will be relative to the location +# where doxygen was started. If left blank the current directory will be used. + +OUTPUT_DIRECTORY = api + +# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create +# 4096 sub-directories (in 2 levels) under the output directory of each output +# format and will distribute the generated files over these directories. +# Enabling this option can be useful when feeding doxygen a huge amount of +# source files, where putting all generated files in the same directory would +# otherwise cause performance problems for the file system. + +CREATE_SUBDIRS = NO + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# The default language is English, other supported languages are: +# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, +# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German, +# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English +# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, +# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak, +# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese. + +OUTPUT_LANGUAGE = English + +# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will +# include brief member descriptions after the members that are listed in +# the file and class documentation (similar to JavaDoc). +# Set to NO to disable this. + +BRIEF_MEMBER_DESC = YES + +# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend +# the brief description of a member or function before the detailed description. +# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. + +REPEAT_BRIEF = YES + +# This tag implements a quasi-intelligent brief description abbreviator +# that is used to form the text in various listings. Each string +# in this list, if found as the leading text of the brief description, will be +# stripped from the text and the result after processing the whole list, is +# used as the annotated text. Otherwise, the brief description is used as-is. +# If left blank, the following values are used ("$name" is automatically +# replaced with the name of the entity): "The $name class" "The $name widget" +# "The $name file" "is" "provides" "specifies" "contains" +# "represents" "a" "an" "the" + +ABBREVIATE_BRIEF = "The $name class" \ + "The $name widget" \ + "The $name file" \ + is \ + provides \ + specifies \ + contains \ + represents \ + a \ + an \ + the + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# Doxygen will generate a detailed section even if there is only a brief +# description. + +ALWAYS_DETAILED_SEC = NO + +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all +# inherited members of a class in the documentation of that class as if those +# members were ordinary class members. Constructors, destructors and assignment +# operators of the base classes will not be shown. + +INLINE_INHERITED_MEMB = NO + +# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full +# path before files name in the file list and in the header files. If set +# to NO the shortest path that makes the file name unique will be used. + +FULL_PATH_NAMES = YES + +# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag +# can be used to strip a user-defined part of the path. Stripping is +# only done if one of the specified strings matches the left-hand part of +# the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the +# path to strip. + +STRIP_FROM_PATH = + +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of +# the path mentioned in the documentation of a class, which tells +# the reader which header file to include in order to use a class. +# If left blank only the name of the header file containing the class +# definition is used. Otherwise one should specify the include paths that +# are normally passed to the compiler using the -I flag. + +STRIP_FROM_INC_PATH = + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter +# (but less readable) file names. This can be useful is your file systems +# doesn't support long names like on DOS, Mac, or CD-ROM. + +SHORT_NAMES = NO + +# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen +# will interpret the first line (until the first dot) of a JavaDoc-style +# comment as the brief description. If set to NO, the JavaDoc +# comments will behave just like regular Qt-style comments +# (thus requiring an explicit @brief command for a brief description.) + +JAVADOC_AUTOBRIEF = YES + +# If the QT_AUTOBRIEF tag is set to YES then Doxygen will +# interpret the first line (until the first dot) of a Qt-style +# comment as the brief description. If set to NO, the comments +# will behave just like regular Qt-style comments (thus requiring +# an explicit \brief command for a brief description.) + +QT_AUTOBRIEF = NO + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen +# treat a multi-line C++ special comment block (i.e. a block of //! or /// +# comments) as a brief description. This used to be the default behaviour. +# The new default is to treat a multi-line C++ comment block as a detailed +# description. Set this tag to YES if you prefer the old behaviour instead. + +MULTILINE_CPP_IS_BRIEF = NO + +# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented +# member inherits the documentation from any documented member that it +# re-implements. + +INHERIT_DOCS = YES + +# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce +# a new page for each member. If set to NO, the documentation of a member will +# be part of the file/class/namespace that contains it. + +SEPARATE_MEMBER_PAGES = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. +# Doxygen uses this value to replace tabs by spaces in code fragments. + +TAB_SIZE = 4 + +# This tag can be used to specify a number of aliases that acts +# as commands in the documentation. An alias has the form "name=value". +# For example adding "sideeffect=\par Side Effects:\n" will allow you to +# put the command \sideeffect (or @sideeffect) in the documentation, which +# will result in a user-defined paragraph with heading "Side Effects:". +# You can put \n's in the value part of an alias to insert newlines. + +ALIASES = + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C +# sources only. Doxygen will then generate output that is more tailored for C. +# For instance, some of the names that are used will be different. The list +# of all members will be omitted, etc. + +OPTIMIZE_OUTPUT_FOR_C = YES + +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java +# sources only. Doxygen will then generate output that is more tailored for +# Java. For instance, namespaces will be presented as packages, qualified +# scopes will look different, etc. + +OPTIMIZE_OUTPUT_JAVA = NO + +# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran +# sources only. Doxygen will then generate output that is more tailored for +# Fortran. + +OPTIMIZE_FOR_FORTRAN = NO + +# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL +# sources. Doxygen will then generate output that is tailored for +# VHDL. + +OPTIMIZE_OUTPUT_VHDL = NO + +# Doxygen selects the parser to use depending on the extension of the files it +# parses. With this tag you can assign which parser to use for a given extension. +# Doxygen has a built-in mapping, but you can override or extend it using this +# tag. The format is ext=language, where ext is a file extension, and language +# is one of the parsers supported by doxygen: IDL, Java, Javascript, CSharp, C, +# C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, C++. For instance to make +# doxygen treat .inc files as Fortran files (default is PHP), and .f files as C +# (default is Fortran), use: inc=Fortran f=C. Note that for custom extensions +# you also need to set FILE_PATTERNS otherwise the files are not read by doxygen. + +EXTENSION_MAPPING = + +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want +# to include (a tag file for) the STL sources as input, then you should +# set this tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. +# func(std::string) {}). This also make the inheritance and collaboration +# diagrams that involve STL classes more complete and accurate. + +BUILTIN_STL_SUPPORT = NO + +# If you use Microsoft's C++/CLI language, you should set this option to YES to +# enable parsing support. + +CPP_CLI_SUPPORT = NO + +# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. +# Doxygen will parse them like normal C++ but will assume all classes use public +# instead of private inheritance when no explicit protection keyword is present. + +SIP_SUPPORT = NO + +# For Microsoft's IDL there are propget and propput attributes to indicate getter +# and setter methods for a property. Setting this option to YES (the default) +# will make doxygen to replace the get and set methods by a property in the +# documentation. This will only work if the methods are indeed getting or +# setting a simple type. If this is not the case, or you want to show the +# methods anyway, you should set this option to NO. + +IDL_PROPERTY_SUPPORT = YES + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES, then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. + +DISTRIBUTE_GROUP_DOC = NO + +# Set the SUBGROUPING tag to YES (the default) to allow class member groups of +# the same type (for instance a group of public functions) to be put as a +# subgroup of that type (e.g. under the Public Functions section). Set it to +# NO to prevent subgrouping. Alternatively, this can be done per class using +# the \nosubgrouping command. + +SUBGROUPING = YES + +# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum +# is documented as struct, union, or enum with the name of the typedef. So +# typedef struct TypeS {} TypeT, will appear in the documentation as a struct +# with name TypeT. When disabled the typedef will appear as a member of a file, +# namespace, or class. And the struct will be named TypeS. This can typically +# be useful for C code in case the coding convention dictates that all compound +# types are typedef'ed and only the typedef is referenced, never the tag name. + +TYPEDEF_HIDES_STRUCT = NO + +# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to +# determine which symbols to keep in memory and which to flush to disk. +# When the cache is full, less often used symbols will be written to disk. +# For small to medium size projects (<1000 input files) the default value is +# probably good enough. For larger projects a too small cache size can cause +# doxygen to be busy swapping symbols to and from disk most of the time +# causing a significant performance penality. +# If the system has enough physical memory increasing the cache will improve the +# performance by keeping more symbols in memory. Note that the value works on +# a logarithmic scale so increasing the size by one will rougly double the +# memory usage. The cache size is given by this formula: +# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, +# corresponding to a cache size of 2^16 = 65536 symbols + +SYMBOL_CACHE_SIZE = 0 + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in +# documentation are documented, even if no documentation was available. +# Private class members and static file members will be hidden unless +# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES + +EXTRACT_ALL = YES + +# If the EXTRACT_PRIVATE tag is set to YES all private members of a class +# will be included in the documentation. + +EXTRACT_PRIVATE = YES + +# If the EXTRACT_STATIC tag is set to YES all static members of a file +# will be included in the documentation. + +EXTRACT_STATIC = YES + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) +# defined locally in source files will be included in the documentation. +# If set to NO only classes defined in header files are included. + +EXTRACT_LOCAL_CLASSES = YES + +# This flag is only useful for Objective-C code. When set to YES local +# methods, which are defined in the implementation section but not in +# the interface are included in the documentation. +# If set to NO (the default) only methods in the interface are included. + +EXTRACT_LOCAL_METHODS = NO + +# If this flag is set to YES, the members of anonymous namespaces will be +# extracted and appear in the documentation as a namespace called +# 'anonymous_namespace{file}', where file will be replaced with the base +# name of the file that contains the anonymous namespace. By default +# anonymous namespace are hidden. + +EXTRACT_ANON_NSPACES = NO + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all +# undocumented members of documented classes, files or namespaces. +# If set to NO (the default) these members will be included in the +# various overviews, but no documentation section is generated. +# This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_MEMBERS = NO + +# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. +# If set to NO (the default) these classes will be included in the various +# overviews. This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_CLASSES = NO + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all +# friend (class|struct|union) declarations. +# If set to NO (the default) these declarations will be included in the +# documentation. + +HIDE_FRIEND_COMPOUNDS = NO + +# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any +# documentation blocks found inside the body of a function. +# If set to NO (the default) these blocks will be appended to the +# function's detailed documentation block. + +HIDE_IN_BODY_DOCS = NO + +# The INTERNAL_DOCS tag determines if documentation +# that is typed after a \internal command is included. If the tag is set +# to NO (the default) then the documentation will be excluded. +# Set it to YES to include the internal documentation. + +INTERNAL_DOCS = NO + +# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate +# file names in lower-case letters. If set to YES upper-case letters are also +# allowed. This is useful if you have classes or files whose names only differ +# in case and if your file system supports case sensitive file names. Windows +# and Mac users are advised to set this option to NO. + +CASE_SENSE_NAMES = NO + +# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen +# will show members with their full class and namespace scopes in the +# documentation. If set to YES the scope will be hidden. + +HIDE_SCOPE_NAMES = NO + +# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen +# will put a list of the files that are included by a file in the documentation +# of that file. + +SHOW_INCLUDE_FILES = YES + +# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen +# will list include files with double quotes in the documentation +# rather than with sharp brackets. + +FORCE_LOCAL_INCLUDES = NO + +# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] +# is inserted in the documentation for inline members. + +INLINE_INFO = YES + +# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen +# will sort the (detailed) documentation of file and class members +# alphabetically by member name. If set to NO the members will appear in +# declaration order. + +SORT_MEMBER_DOCS = YES + +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the +# brief documentation of file, namespace and class members alphabetically +# by member name. If set to NO (the default) the members will appear in +# declaration order. + +SORT_BRIEF_DOCS = YES + +# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen +# will sort the (brief and detailed) documentation of class members so that +# constructors and destructors are listed first. If set to NO (the default) +# the constructors will appear in the respective orders defined by +# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. +# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO +# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO. + +SORT_MEMBERS_CTORS_1ST = NO + +# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the +# hierarchy of group names into alphabetical order. If set to NO (the default) +# the group names will appear in their defined order. + +SORT_GROUP_NAMES = NO + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be +# sorted by fully-qualified names, including namespaces. If set to +# NO (the default), the class list will be sorted only by class name, +# not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the +# alphabetical list. + +SORT_BY_SCOPE_NAME = NO + +# The GENERATE_TODOLIST tag can be used to enable (YES) or +# disable (NO) the todo list. This list is created by putting \todo +# commands in the documentation. + +GENERATE_TODOLIST = YES + +# The GENERATE_TESTLIST tag can be used to enable (YES) or +# disable (NO) the test list. This list is created by putting \test +# commands in the documentation. + +GENERATE_TESTLIST = YES + +# The GENERATE_BUGLIST tag can be used to enable (YES) or +# disable (NO) the bug list. This list is created by putting \bug +# commands in the documentation. + +GENERATE_BUGLIST = YES + +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or +# disable (NO) the deprecated list. This list is created by putting +# \deprecated commands in the documentation. + +GENERATE_DEPRECATEDLIST= YES + +# The ENABLED_SECTIONS tag can be used to enable conditional +# documentation sections, marked by \if sectionname ... \endif. + +ENABLED_SECTIONS = + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines +# the initial value of a variable or define consists of for it to appear in +# the documentation. If the initializer consists of more lines than specified +# here it will be hidden. Use a value of 0 to hide initializers completely. +# The appearance of the initializer of individual variables and defines in the +# documentation can be controlled using \showinitializer or \hideinitializer +# command in the documentation regardless of this setting. + +MAX_INITIALIZER_LINES = 30 + +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated +# at the bottom of the documentation of classes and structs. If set to YES the +# list will mention the files that were used to generate the documentation. + +SHOW_USED_FILES = YES + +# If the sources in your project are distributed over multiple directories +# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy +# in the documentation. The default is NO. + +SHOW_DIRECTORIES = YES + +# Set the SHOW_FILES tag to NO to disable the generation of the Files page. +# This will remove the Files entry from the Quick Index and from the +# Folder Tree View (if specified). The default is YES. + +SHOW_FILES = YES + +# Set the SHOW_NAMESPACES tag to NO to disable the generation of the +# Namespaces page. This will remove the Namespaces entry from the Quick Index +# and from the Folder Tree View (if specified). The default is YES. + +SHOW_NAMESPACES = YES + +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from +# the version control system). Doxygen will invoke the program by executing (via +# popen()) the command , where is the value of +# the FILE_VERSION_FILTER tag, and is the name of an input file +# provided by doxygen. Whatever the program writes to standard output +# is used as the file version. See the manual for examples. + +FILE_VERSION_FILTER = + +# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed +# by doxygen. The layout file controls the global structure of the generated +# output files in an output format independent way. The create the layout file +# that represents doxygen's defaults, run doxygen with the -l option. +# You can optionally specify a file name after the option, if omitted +# DoxygenLayout.xml will be used as the name of the layout file. + +LAYOUT_FILE = + +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated +# by doxygen. Possible values are YES and NO. If left blank NO is used. + +QUIET = NO + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated by doxygen. Possible values are YES and NO. If left blank +# NO is used. + +WARNINGS = YES + +# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings +# for undocumented members. If EXTRACT_ALL is set to YES then this flag will +# automatically be disabled. + +WARN_IF_UNDOCUMENTED = YES + +# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as not documenting some +# parameters in a documented function, or documenting parameters that +# don't exist or using markup commands wrongly. + +WARN_IF_DOC_ERROR = YES + +# This WARN_NO_PARAMDOC option can be abled to get warnings for +# functions that are documented, but have no documentation for their parameters +# or return value. If set to NO (the default) doxygen will only warn about +# wrong or incomplete parameter documentation, but not about the absence of +# documentation. + +WARN_NO_PARAMDOC = YES + +# The WARN_FORMAT tag determines the format of the warning messages that +# doxygen can produce. The string should contain the $file, $line, and $text +# tags, which will be replaced by the file and line number from which the +# warning originated and the warning text. Optionally the format may contain +# $version, which will be replaced by the version of the file (if it could +# be obtained via FILE_VERSION_FILTER) + +WARN_FORMAT = "$file:$line: $text" + +# The WARN_LOGFILE tag can be used to specify a file to which warning +# and error messages should be written. If left blank the output is written +# to stderr. + +WARN_LOGFILE = docwarn.txt + +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- + +# The INPUT tag can be used to specify the files and/or directories that contain +# documented source files. You may enter file names like "myfile.cpp" or +# directories like "/usr/src/myproject". Separate the files or directories +# with spaces. + +INPUT = src \ + include \ + doxygen + +# This tag can be used to specify the character encoding of the source files +# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is +# also the default input encoding. Doxygen uses libiconv (or the iconv built +# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for +# the list of possible encodings. + +INPUT_ENCODING = UTF-8 + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank the following patterns are tested: +# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx +# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90 + +FILE_PATTERNS = *.c \ + *.cc \ + *.cxx \ + *.cpp \ + *.c++ \ + *.d \ + *.java \ + *.ii \ + *.ixx \ + *.ipp \ + *.i++ \ + *.inl \ + *.h \ + *.hh \ + *.hxx \ + *.hpp \ + *.h++ \ + *.idl \ + *.odl \ + *.cs \ + *.php \ + *.php3 \ + *.inc \ + *.m \ + *.mm \ + *.dox \ + *.py + +# The RECURSIVE tag can be used to turn specify whether or not subdirectories +# should be searched for input files as well. Possible values are YES and NO. +# If left blank NO is used. + +RECURSIVE = YES + +# The EXCLUDE tag can be used to specify files and/or directories that should +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. + +EXCLUDE = + +# The EXCLUDE_SYMLINKS tag can be used select whether or not files or +# directories that are symbolic links (a Unix filesystem feature) are excluded +# from the input. + +EXCLUDE_SYMLINKS = NO + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. Note that the wildcards are matched +# against the file with absolute path, so to exclude all test directories +# for example use the pattern */test/* + +EXCLUDE_PATTERNS = + +# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names +# (namespaces, classes, functions, etc.) that should be excluded from the +# output. The symbol name can be a fully qualified name, a word, or if the +# wildcard * is used, a substring. Examples: ANamespace, AClass, +# AClass::ANamespace, ANamespace::*Test + +EXCLUDE_SYMBOLS = + +# The EXAMPLE_PATH tag can be used to specify one or more files or +# directories that contain example code fragments that are included (see +# the \include command). + +EXAMPLE_PATH = + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank all files are included. + +EXAMPLE_PATTERNS = * + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude +# commands irrespective of the value of the RECURSIVE tag. +# Possible values are YES and NO. If left blank NO is used. + +EXAMPLE_RECURSIVE = NO + +# The IMAGE_PATH tag can be used to specify one or more files or +# directories that contain image that are included in the documentation (see +# the \image command). + +IMAGE_PATH = + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command , where +# is the value of the INPUT_FILTER tag, and is the name of an +# input file. Doxygen will then use the output that the filter program writes +# to standard output. If FILTER_PATTERNS is specified, this tag will be +# ignored. + +INPUT_FILTER = + +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. The filters are a list of the form: +# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further +# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER +# is applied to all files. + +FILTER_PATTERNS = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER) will be used to filter the input files when producing source +# files to browse (i.e. when SOURCE_BROWSER is set to YES). + +FILTER_SOURCE_FILES = NO + +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- + +# If the SOURCE_BROWSER tag is set to YES then a list of source files will +# be generated. Documented entities will be cross-referenced with these sources. +# Note: To get rid of all source code in the generated output, make sure also +# VERBATIM_HEADERS is set to NO. + +SOURCE_BROWSER = NO + +# Setting the INLINE_SOURCES tag to YES will include the body +# of functions and classes directly in the documentation. + +INLINE_SOURCES = NO + +# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct +# doxygen to hide any special comment blocks from generated source code +# fragments. Normal C and C++ comments will always remain visible. + +STRIP_CODE_COMMENTS = YES + +# If the REFERENCED_BY_RELATION tag is set to YES +# then for each documented function all documented +# functions referencing it will be listed. + +REFERENCED_BY_RELATION = YES + +# If the REFERENCES_RELATION tag is set to YES +# then for each documented function all documented entities +# called/used by that function will be listed. + +REFERENCES_RELATION = YES + +# If the REFERENCES_LINK_SOURCE tag is set to YES (the default) +# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from +# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will +# link to the source code. Otherwise they will link to the documentation. + +REFERENCES_LINK_SOURCE = YES + +# If the USE_HTAGS tag is set to YES then the references to source code +# will point to the HTML generated by the htags(1) tool instead of doxygen +# built-in source browser. The htags tool is part of GNU's global source +# tagging system (see http://www.gnu.org/software/global/global.html). You +# will need version 4.8.6 or higher. + +USE_HTAGS = NO + +# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen +# will generate a verbatim copy of the header file for each class for +# which an include is specified. Set to NO to disable this. + +VERBATIM_HEADERS = NO + +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index +# of all compounds will be generated. Enable this if the project +# contains a lot of classes, structs, unions or interfaces. + +ALPHABETICAL_INDEX = YES + +# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then +# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns +# in which this list will be split (can be a number in the range [1..20]) + +COLS_IN_ALPHA_INDEX = 5 + +# In case all classes in a project start with a common prefix, all +# classes will be put under the same header in the alphabetical index. +# The IGNORE_PREFIX tag can be used to specify one or more prefixes that +# should be ignored while generating the index headers. + +IGNORE_PREFIX = + +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- + +# If the GENERATE_HTML tag is set to YES (the default) Doxygen will +# generate HTML output. + +GENERATE_HTML = YES + +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `html' will be used as the default path. + +HTML_OUTPUT = . + +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for +# each generated HTML page (for example: .htm,.php,.asp). If it is left blank +# doxygen will generate files with .html extension. + +HTML_FILE_EXTENSION = .html + +# The HTML_HEADER tag can be used to specify a personal HTML header for +# each generated HTML page. If it is left blank doxygen will generate a +# standard header. + +HTML_HEADER = + +# The HTML_FOOTER tag can be used to specify a personal HTML footer for +# each generated HTML page. If it is left blank doxygen will generate a +# standard footer. + +HTML_FOOTER = + +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading +# style sheet that is used by each HTML page. It can be used to +# fine-tune the look of the HTML output. If the tag is left blank doxygen +# will generate a default style sheet. Note that doxygen will try to copy +# the style sheet file to the HTML output directory, so don't put your own +# stylesheet in the HTML output directory as well, or it will be erased! + +HTML_STYLESHEET = + +# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. +# Doxygen will adjust the colors in the stylesheet and background images +# according to this color. Hue is specified as an angle on a colorwheel, +# see http://en.wikipedia.org/wiki/Hue for more information. +# For instance the value 0 represents red, 60 is yellow, 120 is green, +# 180 is cyan, 240 is blue, 300 purple, and 360 is red again. +# The allowed range is 0 to 359. + +HTML_COLORSTYLE_HUE = 220 + +# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of +# the colors in the HTML output. For a value of 0 the output will use +# grayscales only. A value of 255 will produce the most vivid colors. + +HTML_COLORSTYLE_SAT = 100 + +# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to +# the luminance component of the colors in the HTML output. Values below +# 100 gradually make the output lighter, whereas values above 100 make +# the output darker. The value divided by 100 is the actual gamma applied, +# so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2, +# and 100 does not change the gamma. + +HTML_COLORSTYLE_GAMMA = 80 + +# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML +# page will contain the date and time when the page was generated. Setting +# this to NO can help when comparing the output of multiple runs. + +HTML_TIMESTAMP = YES + +# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, +# files or namespaces will be aligned in HTML using tables. If set to +# NO a bullet list will be used. + +HTML_ALIGN_MEMBERS = YES + +# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML +# documentation will contain sections that can be hidden and shown after the +# page has loaded. For this to work a browser that supports +# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox +# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). + +HTML_DYNAMIC_SECTIONS = NO + +# If the GENERATE_DOCSET tag is set to YES, additional index files +# will be generated that can be used as input for Apple's Xcode 3 +# integrated development environment, introduced with OSX 10.5 (Leopard). +# To create a documentation set, doxygen will generate a Makefile in the +# HTML output directory. Running make will produce the docset in that +# directory and running "make install" will install the docset in +# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find +# it at startup. +# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html +# for more information. + +GENERATE_DOCSET = NO + +# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the +# feed. A documentation feed provides an umbrella under which multiple +# documentation sets from a single provider (such as a company or product suite) +# can be grouped. + +DOCSET_FEEDNAME = "Doxygen generated docs" + +# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that +# should uniquely identify the documentation set bundle. This should be a +# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen +# will append .docset to the name. + +DOCSET_BUNDLE_ID = org.doxygen.Project + +# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely identify +# the documentation publisher. This should be a reverse domain-name style +# string, e.g. com.mycompany.MyDocSet.documentation. + +DOCSET_PUBLISHER_ID = org.doxygen.Publisher + +# The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher. + +DOCSET_PUBLISHER_NAME = Publisher + +# If the GENERATE_HTMLHELP tag is set to YES, additional index files +# will be generated that can be used as input for tools like the +# Microsoft HTML help workshop to generate a compiled HTML help file (.chm) +# of the generated HTML documentation. + +GENERATE_HTMLHELP = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can +# be used to specify the file name of the resulting .chm file. You +# can add a path in front of the file if the result should not be +# written to the html output directory. + +CHM_FILE = + +# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can +# be used to specify the location (absolute path including file name) of +# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run +# the HTML help compiler on the generated index.hhp. + +HHC_LOCATION = + +# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag +# controls if a separate .chi index file is generated (YES) or that +# it should be included in the master .chm file (NO). + +GENERATE_CHI = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING +# is used to encode HtmlHelp index (hhk), content (hhc) and project file +# content. + +CHM_INDEX_ENCODING = + +# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag +# controls whether a binary table of contents is generated (YES) or a +# normal table of contents (NO) in the .chm file. + +BINARY_TOC = NO + +# The TOC_EXPAND flag can be set to YES to add extra items for group members +# to the contents of the HTML help documentation and to the tree view. + +TOC_EXPAND = NO + +# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and +# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated +# that can be used as input for Qt's qhelpgenerator to generate a +# Qt Compressed Help (.qch) of the generated HTML documentation. + +GENERATE_QHP = NO + +# If the QHG_LOCATION tag is specified, the QCH_FILE tag can +# be used to specify the file name of the resulting .qch file. +# The path specified is relative to the HTML output folder. + +QCH_FILE = + +# The QHP_NAMESPACE tag specifies the namespace to use when generating +# Qt Help Project output. For more information please see +# http://doc.trolltech.com/qthelpproject.html#namespace + +QHP_NAMESPACE = org.doxygen.Project + +# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating +# Qt Help Project output. For more information please see +# http://doc.trolltech.com/qthelpproject.html#virtual-folders + +QHP_VIRTUAL_FOLDER = doc + +# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to +# add. For more information please see +# http://doc.trolltech.com/qthelpproject.html#custom-filters + +QHP_CUST_FILTER_NAME = + +# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the +# custom filter to add. For more information please see +# +# Qt Help Project / Custom Filters. + +QHP_CUST_FILTER_ATTRS = + +# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this +# project's +# filter section matches. +# +# Qt Help Project / Filter Attributes. + +QHP_SECT_FILTER_ATTRS = + +# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can +# be used to specify the location of Qt's qhelpgenerator. +# If non-empty doxygen will try to run qhelpgenerator on the generated +# .qhp file. + +QHG_LOCATION = + +# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files +# will be generated, which together with the HTML files, form an Eclipse help +# plugin. To install this plugin and make it available under the help contents +# menu in Eclipse, the contents of the directory containing the HTML and XML +# files needs to be copied into the plugins directory of eclipse. The name of +# the directory within the plugins directory should be the same as +# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before +# the help appears. + +GENERATE_ECLIPSEHELP = NO + +# A unique identifier for the eclipse help plugin. When installing the plugin +# the directory name containing the HTML and XML files should also have +# this name. + +ECLIPSE_DOC_ID = org.doxygen.Project + +# The DISABLE_INDEX tag can be used to turn on/off the condensed index at +# top of each HTML page. The value NO (the default) enables the index and +# the value YES disables it. + +DISABLE_INDEX = NO + +# This tag can be used to set the number of enum values (range [1..20]) +# that doxygen will group on one line in the generated HTML documentation. + +ENUM_VALUES_PER_LINE = 4 + +# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index +# structure should be generated to display hierarchical information. +# If the tag value is set to YES, a side panel will be generated +# containing a tree-like index structure (just like the one that +# is generated for HTML Help). For this to work a browser that supports +# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser). +# Windows users are probably better off using the HTML help feature. + +GENERATE_TREEVIEW = YES + +# By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories, +# and Class Hierarchy pages using a tree view instead of an ordered list. + +USE_INLINE_TREES = NO + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be +# used to set the initial width (in pixels) of the frame in which the tree +# is shown. + +TREEVIEW_WIDTH = 300 + +# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open +# links to external symbols imported via tag files in a separate window. + +EXT_LINKS_IN_WINDOW = NO + +# Use this tag to change the font size of Latex formulas included +# as images in the HTML documentation. The default is 10. Note that +# when you change the font size after a successful doxygen run you need +# to manually remove any form_*.png images from the HTML output directory +# to force them to be regenerated. + +FORMULA_FONTSIZE = 10 + +# Use the FORMULA_TRANPARENT tag to determine whether or not the images +# generated for formulas are transparent PNGs. Transparent PNGs are +# not supported properly for IE 6.0, but are supported on all modern browsers. +# Note that when changing this option you need to delete any form_*.png files +# in the HTML output before the changes have effect. + +FORMULA_TRANSPARENT = YES + +# When the SEARCHENGINE tag is enabled doxygen will generate a search box +# for the HTML output. The underlying search engine uses javascript +# and DHTML and should work on any modern browser. Note that when using +# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets +# (GENERATE_DOCSET) there is already a search function so this one should +# typically be disabled. For large projects the javascript based search engine +# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution. + +SEARCHENGINE = NO + +# When the SERVER_BASED_SEARCH tag is enabled the search engine will be +# implemented using a PHP enabled web server instead of at the web client +# using Javascript. Doxygen will generate the search PHP script and index +# file to put on the web server. The advantage of the server +# based approach is that it scales better to large projects and allows +# full text search. The disadvances is that it is more difficult to setup +# and does not have live searching capabilities. + +SERVER_BASED_SEARCH = NO + +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- + +# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will +# generate Latex output. + +GENERATE_LATEX = NO + +# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `latex' will be used as the default path. + +LATEX_OUTPUT = latex + +# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be +# invoked. If left blank `latex' will be used as the default command name. +# Note that when enabling USE_PDFLATEX this option is only used for +# generating bitmaps for formulas in the HTML output, but not in the +# Makefile that is written to the output directory. + +LATEX_CMD_NAME = latex + +# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to +# generate index for LaTeX. If left blank `makeindex' will be used as the +# default command name. + +MAKEINDEX_CMD_NAME = makeindex + +# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact +# LaTeX documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_LATEX = NO + +# The PAPER_TYPE tag can be used to set the paper type that is used +# by the printer. Possible values are: a4, a4wide, letter, legal and +# executive. If left blank a4wide will be used. + +PAPER_TYPE = a4wide + +# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX +# packages that should be included in the LaTeX output. + +EXTRA_PACKAGES = + +# The LATEX_HEADER tag can be used to specify a personal LaTeX header for +# the generated latex document. The header should contain everything until +# the first chapter. If it is left blank doxygen will generate a +# standard header. Notice: only use this tag if you know what you are doing! + +LATEX_HEADER = + +# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated +# is prepared for conversion to pdf (using ps2pdf). The pdf file will +# contain links (just like the HTML output) instead of page references +# This makes the output suitable for online browsing using a pdf viewer. + +PDF_HYPERLINKS = NO + +# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of +# plain latex in the generated Makefile. Set this option to YES to get a +# higher quality PDF documentation. + +USE_PDFLATEX = NO + +# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. +# command to the generated LaTeX files. This will instruct LaTeX to keep +# running if errors occur, instead of asking the user for help. +# This option is also used when generating formulas in HTML. + +LATEX_BATCHMODE = NO + +# If LATEX_HIDE_INDICES is set to YES then doxygen will not +# include the index chapters (such as File Index, Compound Index, etc.) +# in the output. + +LATEX_HIDE_INDICES = NO + +# If LATEX_SOURCE_CODE is set to YES then doxygen will include +# source code with syntax highlighting in the LaTeX output. +# Note that which sources are shown also depends on other settings +# such as SOURCE_BROWSER. + +LATEX_SOURCE_CODE = NO + +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- + +# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output +# The RTF output is optimized for Word 97 and may not look very pretty with +# other RTF readers or editors. + +GENERATE_RTF = NO + +# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `rtf' will be used as the default path. + +RTF_OUTPUT = rtf + +# If the COMPACT_RTF tag is set to YES Doxygen generates more compact +# RTF documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_RTF = NO + +# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated +# will contain hyperlink fields. The RTF file will +# contain links (just like the HTML output) instead of page references. +# This makes the output suitable for online browsing using WORD or other +# programs which support those fields. +# Note: wordpad (write) and others do not support links. + +RTF_HYPERLINKS = NO + +# Load stylesheet definitions from file. Syntax is similar to doxygen's +# config file, i.e. a series of assignments. You only have to provide +# replacements, missing definitions are set to their default value. + +RTF_STYLESHEET_FILE = + +# Set optional variables used in the generation of an rtf document. +# Syntax is similar to doxygen's config file. + +RTF_EXTENSIONS_FILE = + +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- + +# If the GENERATE_MAN tag is set to YES (the default) Doxygen will +# generate man pages + +GENERATE_MAN = YES + +# The MAN_OUTPUT tag is used to specify where the man pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `man' will be used as the default path. + +MAN_OUTPUT = man + +# The MAN_EXTENSION tag determines the extension that is added to +# the generated man pages (default is the subroutine's section .3) + +MAN_EXTENSION = .3 + +# If the MAN_LINKS tag is set to YES and Doxygen generates man output, +# then it will generate one additional man file for each entity +# documented in the real man page(s). These additional files +# only source the real man page, but without them the man command +# would be unable to find the correct page. The default is NO. + +MAN_LINKS = YES + +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- + +# If the GENERATE_XML tag is set to YES Doxygen will +# generate an XML file that captures the structure of +# the code including all documentation. + +GENERATE_XML = NO + +# The XML_OUTPUT tag is used to specify where the XML pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `xml' will be used as the default path. + +XML_OUTPUT = xml + +# The XML_SCHEMA tag can be used to specify an XML schema, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_SCHEMA = + +# The XML_DTD tag can be used to specify an XML DTD, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_DTD = + +# If the XML_PROGRAMLISTING tag is set to YES Doxygen will +# dump the program listings (including syntax highlighting +# and cross-referencing information) to the XML output. Note that +# enabling this will significantly increase the size of the XML output. + +XML_PROGRAMLISTING = YES + +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- + +# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will +# generate an AutoGen Definitions (see autogen.sf.net) file +# that captures the structure of the code including all +# documentation. Note that this feature is still experimental +# and incomplete at the moment. + +GENERATE_AUTOGEN_DEF = NO + +#--------------------------------------------------------------------------- +# configuration options related to the Perl module output +#--------------------------------------------------------------------------- + +# If the GENERATE_PERLMOD tag is set to YES Doxygen will +# generate a Perl module file that captures the structure of +# the code including all documentation. Note that this +# feature is still experimental and incomplete at the +# moment. + +GENERATE_PERLMOD = NO + +# If the PERLMOD_LATEX tag is set to YES Doxygen will generate +# the necessary Makefile rules, Perl scripts and LaTeX code to be able +# to generate PDF and DVI output from the Perl module output. + +PERLMOD_LATEX = NO + +# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be +# nicely formatted so it can be parsed by a human reader. This is useful +# if you want to understand what is going on. On the other hand, if this +# tag is set to NO the size of the Perl module output will be much smaller +# and Perl will parse it just the same. + +PERLMOD_PRETTY = YES + +# The names of the make variables in the generated doxyrules.make file +# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. +# This is useful so different doxyrules.make files included by the same +# Makefile don't overwrite each other's variables. + +PERLMOD_MAKEVAR_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- + +# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will +# evaluate all C-preprocessor directives found in the sources and include +# files. + +ENABLE_PREPROCESSING = YES + +# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro +# names in the source code. If set to NO (the default) only conditional +# compilation will be performed. Macro expansion can be done in a controlled +# way by setting EXPAND_ONLY_PREDEF to YES. + +MACRO_EXPANSION = NO + +# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES +# then the macro expansion is limited to the macros specified with the +# PREDEFINED and EXPAND_AS_DEFINED tags. + +EXPAND_ONLY_PREDEF = NO + +# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files +# in the INCLUDE_PATH (see below) will be search if a #include is found. + +SEARCH_INCLUDES = YES + +# The INCLUDE_PATH tag can be used to specify one or more directories that +# contain include files that are not input files but should be processed by +# the preprocessor. + +INCLUDE_PATH = + +# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard +# patterns (like *.h and *.hpp) to filter out the header-files in the +# directories. If left blank, the patterns specified with FILE_PATTERNS will +# be used. + +INCLUDE_FILE_PATTERNS = + +# The PREDEFINED tag can be used to specify one or more macro names that +# are defined before the preprocessor is started (similar to the -D option of +# gcc). The argument of the tag is a list of macros of the form: name +# or name=definition (no spaces). If the definition and the = are +# omitted =1 is assumed. To prevent a macro definition from being +# undefined via #undef or recursively expanded use the := operator +# instead of the = operator. + +PREDEFINED = + +# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then +# this tag can be used to specify a list of macro names that should be expanded. +# The macro definition that is found in the sources will be used. +# Use the PREDEFINED tag if you want to use a different macro definition. + +EXPAND_AS_DEFINED = + +# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then +# doxygen's preprocessor will remove all function-like macros that are alone +# on a line, have an all uppercase name, and do not end with a semicolon. Such +# function macros are typically used for boiler-plate code, and will confuse +# the parser if not removed. + +SKIP_FUNCTION_MACROS = YES + +#--------------------------------------------------------------------------- +# Configuration::additions related to external references +#--------------------------------------------------------------------------- + +# The TAGFILES option can be used to specify one or more tagfiles. +# Optionally an initial location of the external documentation +# can be added for each tagfile. The format of a tag file without +# this location is as follows: +# TAGFILES = file1 file2 ... +# Adding location for the tag files is done as follows: +# TAGFILES = file1=loc1 "file2 = loc2" ... +# where "loc1" and "loc2" can be relative or absolute paths or +# URLs. If a location is present for each tag, the installdox tool +# does not have to be run to correct the links. +# Note that each tag file must have a unique name +# (where the name does NOT include the path) +# If a tag file is not located in the directory in which doxygen +# is run, you must also specify the path to the tagfile here. + +TAGFILES = + +# When a file name is specified after GENERATE_TAGFILE, doxygen will create +# a tag file that is based on the input files it reads. + +GENERATE_TAGFILE = + +# If the ALLEXTERNALS tag is set to YES all external classes will be listed +# in the class index. If set to NO only the inherited external classes +# will be listed. + +ALLEXTERNALS = NO + +# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed +# in the modules index. If set to NO, only the current project's groups will +# be listed. + +EXTERNAL_GROUPS = YES + +# The PERL_PATH should be the absolute path and name of the perl script +# interpreter (i.e. the result of `which perl'). + +PERL_PATH = /usr/bin/perl + +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- + +# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will +# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base +# or super classes. Setting the tag to NO turns the diagrams off. Note that +# this option is superseded by the HAVE_DOT option below. This is only a +# fallback. It is recommended to install and use dot, since it yields more +# powerful graphs. + +CLASS_DIAGRAMS = YES + +# You can define message sequence charts within doxygen comments using the \msc +# command. Doxygen will then run the mscgen tool (see +# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the +# documentation. The MSCGEN_PATH tag allows you to specify the directory where +# the mscgen tool resides. If left empty the tool is assumed to be found in the +# default search path. + +MSCGEN_PATH = + +# If set to YES, the inheritance and collaboration graphs will hide +# inheritance and usage relations if the target is undocumented +# or is not a class. + +HIDE_UNDOC_RELATIONS = YES + +# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is +# available from the path. This tool is part of Graphviz, a graph visualization +# toolkit from AT&T and Lucent Bell Labs. The other options in this section +# have no effect if this option is set to NO (the default) + +HAVE_DOT = YES + +# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is +# allowed to run in parallel. When set to 0 (the default) doxygen will +# base this on the number of processors available in the system. You can set it +# explicitly to a value larger than 0 to get control over the balance +# between CPU load and processing speed. + +DOT_NUM_THREADS = 0 + +# By default doxygen will write a font called FreeSans.ttf to the output +# directory and reference it in all dot files that doxygen generates. This +# font does not include all possible unicode characters however, so when you need +# these (or just want a differently looking font) you can specify the font name +# using DOT_FONTNAME. You need need to make sure dot is able to find the font, +# which can be done by putting it in a standard location or by setting the +# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory +# containing the font. + +DOT_FONTNAME = FreeSans.ttf + +# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. +# The default size is 10pt. + +DOT_FONTSIZE = 10 + +# By default doxygen will tell dot to use the output directory to look for the +# FreeSans.ttf font (which doxygen will put there itself). If you specify a +# different font using DOT_FONTNAME you can set the path where dot +# can find it using this tag. + +DOT_FONTPATH = + +# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect inheritance relations. Setting this tag to YES will force the +# the CLASS_DIAGRAMS tag to NO. + +CLASS_GRAPH = YES + +# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect implementation dependencies (inheritance, containment, and +# class references variables) of the class with other documented classes. + +COLLABORATION_GRAPH = YES + +# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for groups, showing the direct groups dependencies + +GROUP_GRAPHS = YES + +# If the UML_LOOK tag is set to YES doxygen will generate inheritance and +# collaboration diagrams in a style similar to the OMG's Unified Modeling +# Language. + +UML_LOOK = NO + +# If set to YES, the inheritance and collaboration graphs will show the +# relations between templates and their instances. + +TEMPLATE_RELATIONS = NO + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT +# tags are set to YES then doxygen will generate a graph for each documented +# file showing the direct and indirect include dependencies of the file with +# other documented files. + +INCLUDE_GRAPH = YES + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and +# HAVE_DOT tags are set to YES then doxygen will generate a graph for each +# documented header file showing the documented files that directly or +# indirectly include this file. + +INCLUDED_BY_GRAPH = YES + +# If the CALL_GRAPH and HAVE_DOT options are set to YES then +# doxygen will generate a call dependency graph for every global function +# or class method. Note that enabling this option will significantly increase +# the time of a run. So in most cases it will be better to enable call graphs +# for selected functions only using the \callgraph command. + +CALL_GRAPH = YES + +# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then +# doxygen will generate a caller dependency graph for every global function +# or class method. Note that enabling this option will significantly increase +# the time of a run. So in most cases it will be better to enable caller +# graphs for selected functions only using the \callergraph command. + +CALLER_GRAPH = YES + +# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen +# will graphical hierarchy of all classes instead of a textual one. + +GRAPHICAL_HIERARCHY = YES + +# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES +# then doxygen will show the dependencies a directory has on other directories +# in a graphical way. The dependency relations are determined by the #include +# relations between the files in the directories. + +DIRECTORY_GRAPH = YES + +# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images +# generated by dot. Possible values are png, jpg, or gif +# If left blank png will be used. + +DOT_IMAGE_FORMAT = png + +# The tag DOT_PATH can be used to specify the path where the dot tool can be +# found. If left blank, it is assumed the dot tool can be found in the path. + +DOT_PATH = + +# The DOTFILE_DIRS tag can be used to specify one or more directories that +# contain dot files that are included in the documentation (see the +# \dotfile command). + +DOTFILE_DIRS = + +# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of +# nodes that will be shown in the graph. If the number of nodes in a graph +# becomes larger than this value, doxygen will truncate the graph, which is +# visualized by representing a node as a red box. Note that doxygen if the +# number of direct children of the root node in a graph is already larger than +# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note +# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. + +DOT_GRAPH_MAX_NODES = 50 + +# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the +# graphs generated by dot. A depth value of 3 means that only nodes reachable +# from the root by following a path via at most 3 edges will be shown. Nodes +# that lay further from the root node will be omitted. Note that setting this +# option to 1 or 2 may greatly reduce the computation time needed for large +# code bases. Also note that the size of a graph can be further restricted by +# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. + +MAX_DOT_GRAPH_DEPTH = 0 + +# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent +# background. This is disabled by default, because dot on Windows does not +# seem to support this out of the box. Warning: Depending on the platform used, +# enabling this option may lead to badly anti-aliased labels on the edges of +# a graph (i.e. they become hard to read). + +DOT_TRANSPARENT = NO + +# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output +# files in one run (i.e. multiple -o and -T options on the command line). This +# makes dot run faster, but since only newer versions of dot (>1.8.10) +# support this, this feature is disabled by default. + +DOT_MULTI_TARGETS = YES + +# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will +# generate a legend page explaining the meaning of the various boxes and +# arrows in the dot generated graphs. + +GENERATE_LEGEND = YES + +# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will +# remove the intermediate dot files that are used to generate +# the various graphs. + +DOT_CLEANUP = YES diff --git a/antlr/libantlr3c-3.4/doxygen/atsections.dox b/antlr/libantlr3c-3.4/doxygen/atsections.dox new file mode 100644 index 0000000..bd4ea12 --- /dev/null +++ b/antlr/libantlr3c-3.4/doxygen/atsections.dox @@ -0,0 +1,143 @@ +/// \page atsections Using Sections Within Grammar Files +/// +/// \section intro Introduction +/// +/// A C targeted grammar can make use of special annotations within a grammar +/// file, which are prefixed with the \@ character. These sections cause the +/// the placement of their contents within the generated code at defined points +/// such as within the generated C header file. +/// +/// The general form of these annotations is: +/// +/// \code +/// section +/// : '@' (( 'parser' | 'lexer' ) '::')? SECTIONNAME '{' yourcode '}' +/// ; +/// \endcode +/// +/// If the 'parser' or lexer keywords are left out of the specification, then the +/// ANTLR tool assumes a lexer target for a lexer grammar, a parser target for a parser +/// or tree parser grammar, and a parser target for a combined lexer/parser grammar. You +/// are advised as a matter of course to include the parser or lexer target keyword. +/// +/// Documentation regarding the \@sections available for a grammar targeted at C now +/// follows. +/// +/// \subsection psrinit Sections \@init and \@declarations +/// +/// Java targeted grammars allow the special section \@init to be placed after the declaration +/// of a rule (lexer, parser and tree parser rules). This allows you to both declare and initialize +/// variables that are local to the code generated for that rule. You can then reference them within +/// your rule action code. +/// +/// With the C target, the generated code is subject to the restrictions of C semantics and this +/// means that you must declare any local variables, then assign to them afterwards. As well as the +/// \@init section, which C programmers should use to initialize their local variables, the C +/// target provides the \@declarations section, which is also a rule based section. This section +/// is where the C programmer should declare the local variables, thus separating their declaration +/// from their initialization. Here is an example: +/// +/// \code +/// translation_unit +/// @declarations +/// { +/// pANTLR3_BOOLEAN hasUsing; +/// } +/// @init +/// { +/// +/// // Assume no Using directives +/// // +/// hasUsing = ANTLR3_FALSE; +/// +/// } +/// : rulea ruleb ... +/// +/// \endcode +/// +/// Using the \@declarations and \@init sections guarantees that your generated code will +/// compile correctly on any standard C compiler (assuming, of course, that you type in valid C code.) +/// +/// \subsection psrheader \@header section. +/// +/// The \@parser::header or \@lexer::header annotations cause the code they encapsulate +/// to be placed at the start of each generated file, regardless of whether it is a .c or .h file. This can +/// be useful for inserting copyright information and so on in all your generated files. +/// +/// \bNOTE: Be careful not to confuse this concept with placing code in the generated .h header file. The name choice is +/// unfortunate, but was already used in the Java target to allow the placement of \c imports statements +/// in generated java classes. We have therefore kept the intent of this section the same. +/// +/// Here is an example: +//// +/// \code +/// @lexer::header +/// { +/// // Copyright (c) Jim Idle 2007 - All your grammar are belong to us. +/// } +/// +/// @parser::header +/// { +/// // Copyright (c) Jim Idle 2007 - All your grammar are belong to us. +/// } +/// \endcode +/// +/// +/// \subsection hdrinclude \@includes section +/// +/// The \@parser::includes or \@lexer::includes annotations cause +/// the code they encapsulate to be placed in the generated .h file, \b after the standard +/// includes required by the ANTLR generated code. +/// +/// Here you could for instance place a \#include +/// statement to cause your grammar code to include some standard definitions. Because you +/// may use multiple parsers and lexers in your solution, you should probably not place +/// #define statements here, but in the \@postinclude section. Then you +/// may create different \#defines for different recognizers. +/// +/// Here is an example: +//// +/// \code +/// @lexer::includes +/// { +/// #include "myprojectcommondefs.h" +/// } +/// +/// @parser::includes +/// { +/// #include "myprojectcommondefs.h" +/// } +/// \endcode +/// +/// +/// \subsection hdrpreinclude \@preincludes section +/// +/// The \@parser::preincludes or \@lexer::preincludes annotations cause +/// the code they encapsulate to be placed in the generated .h file, \b before the standard +/// includes required by the ANTLR generated code. +/// +/// You should use this section when you wish to place #defines and other definitions +/// in the code before the standard ANTLR runtime includes defined them. This allows you +/// to override any predefined symbols and options that the includes otherwise take +/// defaults for. For instance, if you have built a version of the runtime with a +/// special version of malloc, you can \#define #ANTLR3_MALLOC to match the definition +/// you used for the ANTLR runtime library. +/// +/// \subsection hdrpostinclude \@postinclude section +/// +/// The \@parser::postinclude or \@lexer::postinclude annotations cause +/// the code they encapsulate to be placed in the generated .C file, after the generated include +/// file (which includes the standard ANTLR3C library includes. +/// +/// Code you place here then will be subject to any macros defined by your own includes, by the +/// generated include and by the standard ANTLR3 includes. This is a good place to \#undef +/// anything that you don;t like the default values of, but cannot override before the includes +/// define them. +/// +/// This is also a good place to #define any macros you may wish to use in the generated +/// .c file. As you can include multiple parsers in your projects, you will need to include the +/// generated .h file of each of them, possibly globally, but almost certainly in a context where you +/// are including more than one .h file simultaneously. Hence if you commonly use the same macro +/// names for accessing structures and so on, and they change from grammar to grammar, you should +/// define them here to avoid creating conflicting definitions in the header files. +/// \ No newline at end of file diff --git a/antlr/libantlr3c-3.4/doxygen/build.dox b/antlr/libantlr3c-3.4/doxygen/build.dox new file mode 100644 index 0000000..05c3c66 --- /dev/null +++ b/antlr/libantlr3c-3.4/doxygen/build.dox @@ -0,0 +1,207 @@ +/// \page build Building From Source +/// +/// The C runtime is provided in source code form only as there are too many binary +/// versions to sensibly maintain binaries on www.antlr.org. +/// +/// The runtime code is provided with .sln and .vcproj files for Visual Studio 2005 and 2008, +/// and \b configure files for building and installation on UNIX or other systems that support this tool. If your +/// system is neither Windows nor \b configure compatible, then you should find it +/// reasonable to build the code manually (see section "Building Manually".) +/// +/// \section src Source Code Organization +/// +/// The source code expands from a tar/zip file to give you the following +/// directories: +/// +/// - ./ The location of the configure script and the antlr3config.h file +/// generated by the running the configure script.This directory also +/// contains the solution and project files for visual studio 2005 and +/// 2008. +/// - ./src The location of all the C files in the project. +/// - ./include The location of all the header files for the project +/// - ./doxygen The location of documentation files such as the one that generates this page +/// - Other ancillary directories used by the build or documentation process. +/// +/// \section winbuild Building for Windows +/// +/// If you are building for Cygwin, or a similar UNIX on Windows System, follow the "Building With Configure" instructions below. +/// +/// Note that the runtime is no longer compatible with the VC6 Microsoft compiler. If you absolutely need to build with +/// this compiler, you can probably hack the source code to deall with the pieces that VC6 cannot handle such as the +/// ULL suffix for constants. +/// +/// If you wish to build the binaries for Windows using Visual Studio 2005, or 2008 you may build using the IDE: +/// -# Open the C.sln file +/// -# Select batch Build from the Build menu +/// -# Select all configurations and press the build button. +/// +/// If you wish or need to build the libraries from the command line, then you must +/// use a Windows command shell configured for access to VS2005/VS2008 compilers, such as the one that is +/// started from: +/// +/// Start->Microsoft Visual Studio 2005->Visual Studio Tools->Visual Studio 2005 Command Prompt +/// +/// There appears to be no way to build all targets at once in a batch mode from the command line, +/// so you may build one or all of the following: +/// \verbatim + C:\antlrsrc\code\antlr\main\runtime\C> DEVENV C.sln /Build ReleaseDLL + C:\antlrsrc\code\antlr\main\runtime\C> DEVENV C.sln /Build Release + C:\antlrsrc\code\antlr\main\runtime\C> DEVENV C.sln /Build DebugDLL + C:\antlrsrc\code\antlr\main\runtime\C> DEVENV C.sln /Build Debug +\endverbatim +/// +/// After the build is complete you will find the \c.\cDLL and \c.\cLIB files under the directory containing C.sln, +/// in a subdirectory named after the /Build target. In the Release and Debug targets, you will find that there is only a \c.\cLIB archive file, +/// which you can link directly into your own projects if you wish to avoid the DLL. In \c ReleaseDLL and \c DebugDLL you will find both a +/// \c .LIB file which you should link your projects with and a DLL. The library and names on Windows are as follows: +/// +/// \verbatim + - ReleaseDLL : ANTLR3C.DLL and ANTLR3C_DLL.LIB + - DebugDLL : ANTLR3CD.DLL and ANTLR3CD_DLL.LIB + - Release : ANTLR3C.LIB + - Debug : ANTLR3CD.LIB +\endverbatim +/// +/// There currently no .msi modules or other installs built for Windows, so you must place the DLLs in a directory referenced +/// by the PATH environment variable and make the include directory available to your project configurations. +/// +/// +/// \section configure Building with configure +/// +/// Before starting, make sure that you are using a source code distribution and not the source code directly from the +/// Perforce repository. If you use the source from the perforce tree directly, you will find that there is no configure +/// script as this is generated as part of the distribution build by the maintainers. If you feel the need to build from +/// the distribution tree then you must have all the autobuild packages available on your system and can generate the +/// configure script using autoreconf. If you are not familiar with these tools, then please use the tgz files in the +/// dist subdirectory (or downloaded from the ANTLR web site). +/// +/// The source code file should be expanded in a directory of your choice (probably your working directory) using the command: +/// +/// \verbatim +gzip -dc antlrtgzname.tar.gz | tar xvf - +\endverbatim +/// +/// Where: antlrtgzname.tar.gz is of course the name of the tar when you downloaded it. You should find a \b configure script in the sub directory thus created. +/// +/// The configure script accepts the usual options, such as --prefix= but the default is to build in the source directory and to place libraries in +/// /usr/local/lib and include files (for building your recognizers) in /usr/local/include. There are also a number of antlr specific options, which you may wish to utilize. The command: +/// \verbatim +./configure --help +\endverbatim +/// +/// Will document the latest incarnations of these options in case this documentation is ever out of date. At this time the options are: +/// +/// \verbatim + --enable-debuginfo Compiles debug info into the library (default no) + --enable-64bit Turns on flags that produce 64 bit object code if + any are required (default no) +\endverbatim +/// +/// Unless you need 64 bit builds, or a change in library types, you will generally use the configure command without options: +/// +/// Here is a sample configure output: +/// +/// \verbatim +[jimi@localhost dist]$ tar zvxf libantlr3c-3.0.0-rc8.tar.gz + +libantlr3c-3.0.0-rc8/ +libantlr3c-3.0.0-rc8/antlr3config.h +libantlr3c-3.0.0-rc8/src/ +libantlr3c-3.0.0-rc8/src/antlr3stringstream.c +... +libantlr3c-3.0.0-rc8/antlr3config.h.in +\endverbatim +/// \verbatim +[jimi@localhost dist]$ cd libantlr3c-3.0.0-rc +\endverbatim +/// \verbatim +[jimi@localhost libantlr3c-3.0.0-rc8]$ ./configure + +checking for a BSD-compatible install... /usr/bin/install -c +checking whether build environment is sane... yes +checking for a thread-safe mkdir -p... /bin/mkdir -p +checking for gawk... gawk +checking whether make sets $(MAKE)... yes +checking for xlc... no +checking for aCC... no +checking for gcc... gcc +... +checking for strdup... yes +configure: creating ./config.status +config.status: creating Makefile +config.status: creating antlr3config.h +config.status: antlr3config.h is unchanged +config.status: executing depfiles commands +\endverbatim +/// +/// Having configured the library successfully, you need only make it, and install it: +/// +/// \verbatim +[jimi@localhost libantlr3c-3.0.0-rc8]$ make +\endverbatim +/// \verbatim +make all-am +make[1]: Entering directory `/home/jimi/antlrsrc/code/antlr/main/runtime/C/dist/libantlr3c-3.0.0-rc8' +/bin/sh ./libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -Iinclude -Iinclude -O2 -MT antlr3baserecognizer.lo -MD -MP -MF .deps/antlr3baserecognizer.Tpo -c -o antlr3baserecognizer.lo `test -f 'src/antlr3baserecognizer.c' || echo './'`src/antlr3baserecognizer.c +... +gcc -shared .libs/antlr3baserecognizer.o .libs/antlr3basetree.o .libs/antlr3basetreeadaptor.o .libs/antlr3bitset.o .libs/antlr3collections.o .libs/antlr3commontoken.o .libs/antlr3commontree.o .libs/antlr3commontreeadaptor.o .libs/antlr3commontreenodestream.o .libs/antlr3cyclicdfa.o .libs/antlr3encodings.o .libs/antlr3exception.o .libs/antlr3filestream.o .libs/antlr3inputstream.o .libs/antlr3intstream.o .libs/antlr3lexer.o .libs/antlr3parser.o .libs/antlr3string.o .libs/antlr3stringstream.o .libs/antlr3tokenstream.o .libs/antlr3treeparser.o .libs/antlr3rewritestreams.o .libs/antlr3ucs2inputstream.o -Wl,-soname -Wl,libantlr3c.so -o .libs/libantlr3c.so +ar cru .libs/libantlr3c.a antlr3baserecognizer.o antlr3basetree.o antlr3basetreeadaptor.o antlr3bitset.o antlr3collections.o antlr3commontoken.o antlr3commontree.o antlr3commontreeadaptor.o antlr3commontreenodestream.o antlr3cyclicdfa.o antlr3encodings.o antlr3exception.o antlr3filestream.o antlr3inputstream.o antlr3intstream.o antlr3lexer.o antlr3parser.o antlr3string.o antlr3stringstream.o antlr3tokenstream.o antlr3treeparser.o antlr3rewritestreams.o antlr3ucs2inputstream.o +ranlib .libs/libantlr3c.a +creating libantlr3c.la + +(cd .libs && rm -f libantlr3c.la && ln -s ../libantlr3c.la libantlr3c.la) +make[1]: Leaving directory `/home/jimi/antlrsrc/code/antlr/main/runtime/C/dist/libantlr3c-3.0.0-rc8' +\endverbatim +/// \verbatim +[jimi@localhost libantlr3c-3.0.0-rc8]$ sudo make install +\endverbatim +/// \verbatim +make[1]: Entering directory `/home/jimi/antlrsrc/code/antlr/main/runtime/C/dist/libantlr3c-3.0.0-rc8' +test -z "/usr/local/lib" || /bin/mkdir -p "/usr/local/lib" + /bin/sh ./libtool --mode=install /usr/bin/install -c 'libantlr3c.la' '/usr/local/lib/libantlr3c.la' +/usr/bin/install -c .libs/libantlr3c.so /usr/local/lib/libantlr3c.so +/usr/bin/install -c .libs/libantlr3c.lai /usr/local/lib/libantlr3c.la +/usr/bin/install -c .libs/libantlr3c.a /usr/local/lib/libantlr3c.a +... + /usr/bin/install -c -m 644 'include/antlr3stringstream.h' '/usr/local/include/antlr3stringstream.h' +... + /usr/bin/install -c -m 644 'antlr3config.h' '/usr/local/include/antlr3config.h' +make[1]: Leaving directory `/home/jimi/antlrsrc/code/antlr/main/runtime/C/dist/libantlr3c-3.0.0-rc8' + +[jimi@localhost libantlr3c-3.0.0-rc8]$ +\endverbatim +/// +/// You are now ready to generate C recognizers and compile and link them with the ANTLR 3 C Runtime. +/// +/// +/// \section buildman Building Manually +/// +/// The only step that configure performs that cannot be done +/// manually (without effort) is to produce the header file +/// \c antlr3config.h, which contains typedefs of the fundamental types +/// that your local C compiler supports. The easiest way to produce +/// this file for your system, if you cannot port \b automake and \b configure +/// to the system is: +/// +/// -# Run configure on a system that does support configure +/// -# Copy the generated \c antlr3config.h file to the target system +/// -# Edit the file locally and change any types that differ on this +/// system to the target systems. There are only a few types and you should +/// find this relatively easy. +/// +/// Having produced a compatible antlr3config.h file, then you should be able to +/// compile the source files in the \c ./src subdirectory, providing an include path +/// to the location of \c antlr3config.h and the \c ./include subdirectory. Something akin +/// to: +/// \verbatim + +~/C/src: cc -c -O -I.. -I../include *.c + +\endverbatim +/// +/// Having produced the .o (or equivalent) files for the local system you can then +/// build an archive or shared library for the C runtime. +/// +/// When you wish to build and link with the C runtime, specify the path to the +/// supplied header files, and the path to the library that you built. +/// \ No newline at end of file diff --git a/antlr/libantlr3c-3.4/doxygen/buildrec.dox b/antlr/libantlr3c-3.4/doxygen/buildrec.dox new file mode 100644 index 0000000..816a845 --- /dev/null +++ b/antlr/libantlr3c-3.4/doxygen/buildrec.dox @@ -0,0 +1,269 @@ +/// \page buildrec How to build Generated C Code +/// +/// \section generated Generated Files +/// +/// The antlr tool jar, run against a grammar file that targets the C language, will generate the following files +/// according to whether your grammar file contains a lexer, parser, combined or treeparser specification. +/// Your grammar file name and the subject of the grammar line in your file are expected to match. Here the generic name G is used: +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +///
Suffix Generated files
lexer grammar (G.g3l) GLexer.c GLexer.h
parser grammar (G.g3p) GParser.c GParser.h
grammar G (G.g3pl) GParser.c GParser.h GLexer.c GLexer.h
tree grammar G; (G.g3t) G.c G.h
+/// +/// The generated .c files reference the .h files using , so you must use -I. on your compiler command line +/// (or include the current directory in your include paths in Visual Studio). Additionally, the generated .h files reference +/// antlr3.h, so you must use -I/path/to/antlr/include (E.g. -I /usr/local/include) to reference the standard ANTLR include files. +/// +/// In order to reference the library file at compile time (you can/should only reference one) you need to use the +/// -L/path/to/antlr/lib (E.g. -L /usr/local/lib) on Unix, or add the path to your "Additional Library Path" in +/// Visual Studio. You also need to specify the library using -L on Unix (E.g. -L /usr/local/lib -l antlr3c) or add antlr3c_dll.lib +/// to your Additional Library Dependencies in Visual Studio. +/// +/// In case it isn't obvious, the generated files may be used to produce either a library or an executable (.EXE on Windows) file. +/// +/// If you use the shared version of the libraries, DLL or .so/.so/.a then you must ship the library with your +/// application must run in an environment whereby the library can be found by the runtime linker/loader. +/// This usually involves specifying the directory in which the library lives to an environment variable. +/// On Windows, X:{yourwininstalldir}\system32 will be searched automatically. +/// +/// \section invoke Invoking Your Generated Recognizer +/// +/// In order to run your lexer/parser/tree parser combination, you will need a small function (or main) +/// function that controls the sequence of events, from reading the input file or string, through to +/// invoking the tree parser(s) and retrieving the results. See "Using the ANTLR3C C Target" for more +/// detailed instructions, but if you just want to get going as fast as possible, study the following +/// code example. +/// +/// \code +/// +/// // You may adopt your own practices by all means, but in general it is best +/// // to create a single include for your project, that will include the ANTLR3 C +/// // runtime header files, the generated header files (all of which are safe to include +/// // multiple times) and your own project related header files. Use <> to include and +/// // -I on the compile line (which vs2005 now handles, where vs2003 did not). +/// // +/// #include +/// +/// // Main entry point for this example +/// // +/// int ANTLR3_CDECL +/// main (int argc, char *argv[]) +/// { +/// // Now we declare the ANTLR related local variables we need. +/// // Note that unless you are convinced you will never need thread safe +/// // versions for your project, then you should always create such things +/// // as instance variables for each invocation. +/// // ------------------- +/// +/// // Name of the input file. Note that we always use the abstract type pANTLR3_UINT8 +/// // for ASCII/8 bit strings - the runtime library guarantees that this will be +/// // good on all platforms. This is a general rule - always use the ANTLR3 supplied +/// // typedefs for pointers/types/etc. +/// // +/// pANTLR3_UINT8 fName; +/// +/// // The ANTLR3 character input stream, which abstracts the input source such that +/// // it is easy to privide inpput from different sources such as files, or +/// // memory strings. +/// // +/// // For an 8Bit/latin-1/etc memory string use: +/// // input = antlr3New8BitStringInPlaceStream (stringtouse, (ANTLR3_UINT32) length, NULL); +/// // +/// // For a UTF16 memory string use: +/// // input = antlr3NewUTF16StringInPlaceStream (stringtouse, (ANTLR3_UINT32) length, NULL); +/// // +/// // For input from a file, see code below +/// // +/// // Note that this is essentially a pointer to a structure containing pointers to functions. +/// // You can create your own input stream type (copy one of the existing ones) and override any +/// // individual function by installing your own pointer after you have created the standard +/// // version. +/// // +/// pANTLR3_INPUT_STREAM input; +/// +/// // The lexer is of course generated by ANTLR, and so the lexer type is not upper case. +/// // The lexer is supplied with a pANTLR3_INPUT_STREAM from whence it consumes its +/// // input and generates a token stream as output. This is the ctx (CTX macro) pointer +/// // for your lexer. +/// // +/// pLangLexer lxr; +/// +/// // The token stream is produced by the ANTLR3 generated lexer. Again it is a structure based +/// // API/Object, which you can customise and override methods of as you wish. a Token stream is +/// // supplied to the generated parser, and you can write your own token stream and pass this in +/// // if you wish. +/// // +/// pANTLR3_COMMON_TOKEN_STREAM tstream; +/// +/// // The Lang parser is also generated by ANTLR and accepts a token stream as explained +/// // above. The token stream can be any source in fact, so long as it implements the +/// // ANTLR3_TOKEN_SOURCE interface. In this case the parser does not return anything +/// // but it can of course specify any kind of return type from the rule you invoke +/// // when calling it. This is the ctx (CTX macro) pointer for your parser. +/// // +/// pLangParser psr; +/// +/// // The parser produces an AST, which is returned as a member of the return type of +/// // the starting rule (any rule can start first of course). This is a generated type +/// // based upon the rule we start with. +/// // +/// LangParser_decl_return langAST; +/// +/// +/// // The tree nodes are managed by a tree adaptor, which doles +/// // out the nodes upon request. You can make your own tree types and adaptors +/// // and override the built in versions. See runtime source for details and +/// // eventually the wiki entry for the C target. +/// // +/// pANTLR3_COMMON_TREE_NODE_STREAM nodes; +/// +/// // Finally, when the parser runs, it will produce an AST that can be traversed by the +/// // the tree parser: c.f. LangDumpDecl.g3t This is the ctx (CTX macro) pointer for your +/// // tree parser. +/// // +/// pLangDumpDecl treePsr; +/// +/// // Create the input stream based upon the argument supplied to us on the command line +/// // for this example, the input will always default to ./input if there is no explicit +/// // argument. +/// // +/// if (argc < 2 || argv[1] == NULL) +/// { +/// fName =(pANTLR3_UINT8)"./input"; // Note in VS2005 debug, working directory must be configured +/// } +/// else +/// { +/// fName = (pANTLR3_UINT8)argv[1]; +/// } +/// +/// // Create the input stream using the supplied file name +/// // (Use antlr38BitFileStreamNew for UTF16 input). +/// // +/// input = antlr38BitFileStreamNew(fName); +/// +/// // The input will be created successfully, providing that there is enough +/// // memory and the file exists etc +/// // +/// if ( input == NULL ) +/// { +/// ANTLR3_FPRINTF(stderr, "Unable to open file %s due to malloc() failure1\n", (char *)fName); +/// } +/// +/// // Our input stream is now open and all set to go, so we can create a new instance of our +/// // lexer and set the lexer input to our input stream: +/// // (file | memory | ?) --> inputstream -> lexer --> tokenstream --> parser ( --> treeparser )? +/// // +/// lxr = LangLexerNew(input); // CLexerNew is generated by ANTLR +/// +/// // Need to check for errors +/// // +/// if ( lxr == NULL ) +/// { +/// ANTLR3_FPRINTF(stderr, "Unable to create the lexer due to malloc() failure1\n"); +/// exit(ANTLR3_ERR_NOMEM); +/// } +/// +/// // Our lexer is in place, so we can create the token stream from it +/// // NB: Nothing happens yet other than the file has been read. We are just +/// // connecting all these things together and they will be invoked when we +/// // call the parser rule. ANTLR3_SIZE_HINT can be left at the default usually +/// // unless you have a very large token stream/input. Each generated lexer +/// // provides a token source interface, which is the second argument to the +/// // token stream creator. +/// // Note tha even if you implement your own token structure, it will always +/// // contain a standard common token within it and this is the pointer that +/// // you pass around to everything else. A common token as a pointer within +/// // it that should point to your own outer token structure. +/// // +/// tstream = antlr3CommonTokenStreamSourceNew(ANTLR3_SIZE_HINT, lxr->pLexer->tokSource); +/// +/// if (tstream == NULL) +/// { +/// ANTLR3_FPRINTF(stderr, "Out of memory trying to allocate token stream\n"); +/// exit(ANTLR3_ERR_NOMEM); +/// } +/// +/// // Finally, now that we have our lexer constructed, we can create the parser +/// // +/// psr = LangParserNew(tstream); // CParserNew is generated by ANTLR3 +/// +/// if (psr == NULL) +/// { +/// ANTLR3_FPRINTF(stderr, "Out of memory trying to allocate parser\n"); +/// exit(ANTLR3_ERR_NOMEM); +/// } +/// +/// // We are all ready to go. Though that looked complicated at first glance, +/// // I am sure, you will see that in fact most of the code above is dealing +/// // with errors and there isn;t really that much to do (isn;t this always the +/// // case in C? ;-). +/// // +/// // So, we now invoke the parser. All elements of ANTLR3 generated C components +/// // as well as the ANTLR C runtime library itself are pseudo objects. This means +/// // that they are represented as pointers to structures, which contain any +/// // instance data they need, and a set of pointers to other interfaces or +/// // 'methods'. Note that in general, these few pointers we have created here are +/// // the only things you will ever explicitly free() as everything else is created +/// // via factories, that allocate memory efficiently and free() everything they use +/// // automatically when you close the parser/lexer/etc. +/// // +/// // Note that this means only that the methods are always called via the object +/// // pointer and the first argument to any method, is a pointer to the structure itself. +/// // It also has the side advantage, if you are using an IDE such as VS2005 that can do it +/// // that when you type ->, you will see a list of all the methods the object supports. +/// // +/// langAST = psr->decl(psr); +/// +/// // If the parser ran correctly, we will have a tree to parse. In general I recommend +/// // keeping your own flags as part of the error trapping, but here is how you can +/// // work out if there were errors if you are using the generic error messages +/// // +/// if (psr->pParser->rec->errorCount > 0) +/// { +/// ANTLR3_FPRINTF(stderr, "The parser returned %d errors, tree walking aborted.\n", psr->pParser->rec->errorCount); +/// +/// } +/// else +/// { +/// nodes = antlr3CommonTreeNodeStreamNewTree(langAST.tree, ANTLR3_SIZE_HINT); // sIZE HINT WILL SOON BE DEPRECATED!! +/// +/// // Tree parsers are given a common tree node stream (or your override) +/// // +/// treePsr = LangDumpDeclNew(nodes); +/// +/// treePsr->decl(treePsr); +/// nodes ->free (nodes); nodes = NULL; +/// treePsr ->free (treePsr); treePsr = NULL; +/// } +/// +/// // We did not return anything from this parser rule, so we can finish. It only remains +/// // to close down our open objects, in the reverse order we created them +/// // +/// psr ->free (psr); psr = NULL; +/// tstream ->free (tstream); tstream = NULL; +/// lxr ->free (lxr); lxr = NULL; +/// input ->close (input); input = NULL; +/// +/// return 0; +/// } +/// \endcode +/// diff --git a/antlr/libantlr3c-3.4/doxygen/changes31.dox b/antlr/libantlr3c-3.4/doxygen/changes31.dox new file mode 100644 index 0000000..d1793db --- /dev/null +++ b/antlr/libantlr3c-3.4/doxygen/changes31.dox @@ -0,0 +1,56 @@ +/// \page changes31 Changes in 3.1 from 3.0 +/// +/// The following changes have taken place from 3.0 to 3.1. Some of +/// them may require minor changes to your grammar files or the +/// programs that invoke your grammar. Please take the time to read +/// through this list as it may save you time later. +/// +/// \section returns Constructor Return Values +/// +/// In previous releases the return value from both the generated constructors and +/// built in constructor functions would return a value of -1 or -2 if a problem +/// occurred. However, the only problem that can really occur is lack of memory, +/// hence to avoid the remote change that some memory allocation scheme would return +/// an address of -1 for a pointer, the return address is now NULL if there was +/// no memory available. The old macros for this mechanism have been removed which +/// will force you to read this information. You now need only check the return +/// address for NULL, or you could not bother doing that and join with 95% of the world's +/// C code. +/// +/// \section trees Tree Parser Rewrites +/// +/// The 3.1 runtime now supports tree rewrites from tree parsers. See the main ANTLR +/// documentation for more details. This beta version contains \subpage knownissues regarding +/// the release of mmeory allocated to tree nodes when they are rewritten in some combinations +/// of re-writing tree parsers. These issues will be corrected before release. +/// +/// \section debugger ANTLRWorks Debugger +/// +/// The ANTLRWorks debugger is now fully supported by this version of the runtime. It +/// supports remote debugging only (you cannot generate C, compile and debug it from the +/// ANTLRWorks IDE.) However both parser and tree parser debugging is supported providing +/// you are using a version of ANTLRWorks that supports tree parser debugging. Generate +/// the C code with the -debug option of the ANTLR tool, as per any other target. +/// +/// Note that when you invoke your debugging version of the parser, it will appear to hang +/// but is in fact waiting on a local TCP socket connection from the ANTLRWorks debugger. As the +/// target environment is unknown, it is not prudent to generate notification status messages +/// using something like printf, as the target environment may not have a console or implement +/// printf. +/// +/// \section macros Macro Changes +/// +/// Prior to the 3.1 release, accessing the token source of a lexer required knowledge of where +/// the token source pointer was located wihtin the lexer. In 3.1, the token source was burried +/// further in the innards of the C runtime and such knowledge is considerd irreleavant and confusing. +/// Hence, when creating a token stream from a token source, it is now mandatory to use the new +/// C macro TOKENSOURCE(lxr), which will expand to point at the token source interface. This MACRO +/// will be maintained across future versions. You can see how to use it in the downloadable +/// examples, avaiable from the downloads page of the ANTLR web site. Here is the relevant code +/// for creating a token stream, extracted from those examples: +/// +/// \code +/// tstream = antlr3CommonTokenStreamSourceNew(ANTLR3_SIZE_HINT, TOKENSOURCE(lxr)); +/// \endcode +/// + diff --git a/antlr/libantlr3c-3.4/doxygen/doxygengroups.dox b/antlr/libantlr3c-3.4/doxygen/doxygengroups.dox new file mode 100644 index 0000000..de259f3 --- /dev/null +++ b/antlr/libantlr3c-3.4/doxygen/doxygengroups.dox @@ -0,0 +1,243 @@ +// Definitions of documentation groups so we can organize the API and +// usage documentation nicely. + +/// \defgroup apiclasses API Classes +/// +/// The API classes are divided into the typdefs (and their underlying structs) +/// that are the containers for each 'object' within the ANTLR3C runtime, and +/// their implementations (the functions that are installed by default in to +/// these structures when you create them.) +/// +/// The typedefs contain data and function pointers, which together define +/// the object. The implementation functions are the default implementations +/// of the 'methds' encapsulated by the typdef structures.You may override +/// any of the methods once their objects are created by installing a pointer to +/// your own function. Some of these methods create other 'objects' (instances of +/// typedef structures), which allows you install your own method and create your +/// own implementation of these. +/// + + /// \defgroup apistructures API Typedefs and Structs + /// \ingroup apiclasses + /// + /// These structures (and the typedefs that you use to reference them + /// and their pointers) are the C equivalent of objects. They correspond + /// (roughly) to the Java runtime system classes and contain all the + /// data elements for a particular interface as well as all the pointers + /// to functions that implement these interfaces. + /// + /// There are constructor functions exported from the C runtime, which you + /// use to create a default implementation of one of these 'classes'. You can + /// then override any part of the implementation by installing your own + /// function pointers, before using the interface 'object' you have created. + /// + /// For instance, you can override the default error message reporting function + /// by replacing the standard (example) implementation of this function with + /// your own. In your grammar, you would place the following + /// + /// \code + /// @parser::apifuncs + /// { + /// // Install custom error message display + /// // + /// RECOGNIZER->displayRecognitionError = produceError; + /// } + /// \endcode + /// + /// The special section @parser::apiFuncs is guaranteed to be generated after + /// the RECONGIZER 'object' has already be created and initialized, so you may + /// install your own implementations of the #ANTLR3_BASE_RECOGNIZER interface + /// functions. The error display function is likely to be the only one you are + /// interested in replacing. + /// + /// Some typedef structures contain either pointers to 'inherited' objects (usual) + /// or embedded structures/typedefs (unusual). In some cases, the pointers passed + /// around by the paresr or tree parser are actually the pointers to these embedded + /// structures (such as #pANTLR3_BASE_TREE), and these embedded 'objects' contain + /// pointers to their encapsulating objects. This is the equivalent of passing + /// interface objects around in object oriented languages. + /// + + /// \defgroup ANTLR3_BASE_RECOGNIZER ANTLR3_BASE_RECOGNIZER - Base Recognizer Class Definition + /// \ingroup apistructures + /// + /// This is the definition of the base recognizer interface, instantiations + /// of which are referred to via #pANTLR3_BASE_RECOGNIZER. + /// + /// In general you will not refer to one of these structures directly as a + /// a #pANTLR3_BASE_RECOGNIZER will be embedded within a higher level + /// object such as #pANTLR3_PARSER + /// + /// \defgroup ANTLR3_RECOGNIZER_SHARED_STATE ANTLR3_RECOGNIZER_SHARED_STATE Recognizer Shared State Class Definition + /// \ingroup apistructures + /// \defgroup ANTLR3_BITSET ANTLR3_BITSET - Bitset Class Definition + /// \ingroup apistructures + /// \defgroup ANTLR3_TOKEN_FACTORY ANTLR3_TOKEN_FACTORY - Token Factory Class Definition + /// \ingroup apistructures + /// \defgroup ANTLR3_COMMON_TOKEN ANTLR3_COMMON_TOKEN - Common Token Class Definition + /// \ingroup apistructures + /// \defgroup ANTLR3_EXCEPTION ANTLR3_EXCEPTION - Exception Class Definition + /// \ingroup apistructures + /// \defgroup ANTLR3_HASH_BUCKET ANTLR3_HASH_BUCKET - Hash Table Bucket Class Definition + /// \ingroup apistructures + /// \defgroup ANTLR3_HASH_ENTRY ANTLR3_HASH_ENTRY - Hash Table Entry Class Definition + /// \ingroup apistructures + /// \defgroup ANTLR3_HASH_ENUM ANTLR3_HASH_ENUM - Hash Table Enumerator Class Definition + /// \ingroup apistructures + /// \defgroup ANTLR3_HASH_TABLE ANTLR3_HASH_TABLE - Hash Table Class Definition + /// \ingroup apistructures + /// \defgroup ANTLR3_LIST ANTLR3_LIST - List Class Definition + /// \ingroup apistructures + /// \defgroup ANTLR3_VECTOR_FACTORY ANTLR3_VECTOR_FACTORY - Vector Factory Class Definition + /// \ingroup apistructures + /// \defgroup ANTLR3_VECTOR ANTLR3_VECTOR - Vector Class Definition + /// \ingroup apistructures + /// \defgroup ANTLR3_STACK ANTLR3_STACK - Stack Class Definition + /// \ingroup apistructures + /// \defgroup ANTLR3_INPUT_STREAM ANTLR3_INPUT_STREAM - Input Stream Class Definition + /// \ingroup apistructures + /// \defgroup ANTLR3_LEX_STATE ANTLR3_LEX_STATE - Lexer State Class Definition + /// \ingroup apistructures + /// \defgroup ANTLR3_STRING_FACTORY ANTLR3_STRING_FACTORY - String Factory Class Definition + /// \ingroup apistructures + /// \defgroup ANTLR3_STRING ANTLR3_STRING - String Class Definition + /// \ingroup apistructures + /// \defgroup ANTLR3_TOKEN_SOURCE ANTLR3_TOKEN_SOURCE - Token Source Class Definition + /// \ingroup apistructures + /// \defgroup ANTLR3_TOKEN_STREAM ANTLR3_TOKEN_STREAM - Token Stream Class Definition + /// \ingroup apistructures + /// \defgroup ANTLR3_COMMON_TOKEN_STREAM ANTLR3_COMMON_TOKEN_STREAM - Common Token Stream Class Definition + /// \ingroup apistructures + /// \defgroup ANTLR3_CYCLIC_DFA ANTLR3_CYCLIC_DFA - Cyclic DFA Class Definition + /// \ingroup apistructures + /// \defgroup ANTLR3_LEXER ANTLR3_LEXER - Lexer Class Definition + /// \ingroup apistructures + /// \defgroup ANTLR3_PARSER ANTLR3_PARSER - Parser Class Definition + /// \ingroup apistructures + /// \defgroup ANTLR3_BASE_TREE ANTLR3_BASE_TREE - Base Tree Class Definition + /// \ingroup apistructures + /// \defgroup ANTLR3_COMMON_TREE ANTLR3_COMMON_TREE - Common Tree Class Definition + /// \ingroup apistructures + /// \defgroup ANTLR3_ARBORETUM ANTLR3_ARBORETUM - Tree Factory Class Definition + /// \ingroup apistructures + /// \defgroup ANTLR3_PARSE_TREE ANTLR3_PARSE_TREE - Parse Tree Class Definition + /// \ingroup apistructures + /// \defgroup ANTLR3_TREE_NODE_STREAM ANTLR3_TREE_NODE_STREAM - Tree Node Class Definition + /// \ingroup apistructures + /// \defgroup ANTLR3_COMMON_TREE_NODE_STREAM ANTLR3_COMMON_TREE_NODE_STREAM - Common Tree Node Class Definition + /// \ingroup apistructures + /// \defgroup ANTLR3_TREE_WALK_STATE ANTLR3_TREE_WALK_STATE - Tree Walk State Class Definition + /// \ingroup apistructures + /// \defgroup ANTLR3_BASE_TREE_ADAPTOR ANTLR3_BASE_TREE_ADAPTOR - Base Tree Class Definition + /// \ingroup apistructures + /// \defgroup ANTLR3_COMMON_TREE_ADAPTOR ANTLR3_COMMON_TREE_ADAPTOR - Common Tree Adaptor Class Definition + /// \ingroup apistructures + /// \defgroup ANTLR3_TREE_PARSER ANTLR3_TREE_PARSER - Tree Parser Class Definition + /// \ingroup apistructures + /// \defgroup ANTLR3_INT_TRIE ANTLR3_INT_TRIE - Trie Class Definition + /// \ingroup apistructures + /// \defgroup ANTLR3_REWRITE_RULE_ELEMENT_STREAM ANTLR3_REWRITE_RULE_ELEMENT_STREAM - Token Rewrite Stream Class Definition + /// \ingroup apistructures + /// \defgroup ANTLR3_DEBUG_EVENT_LISTENER ANTLR3_DEBUG_EVENT_LISTENER - Debugger Class Definition + /// \ingroup apistructures + + /// \defgroup apiimplementations API Implementation functions + /// \ingroup apiclasses + /// + /// API implementation functions are the default implementation of each of the + /// methods in a particular typedef structure. + /// + /// They are generally grouped together in the same source code file. + /// For instance the default implementations of the + /// methods contained by a #pANTLR3_BASE_RECOGNIZER will be found in the file + /// antlr3baserecognizer.c + /// + /// A source file that provides the default implementations of functions will usually + /// also supply the public (exported from the .DLL or code library) 'constructor' functions + /// that create and initialize the typedef structure that they implement. For instance, + /// in the antlr3baserecognizer.c file, you will find the function antlr3BaseRecognizerNew() + /// + + /// \defgroup pANTLR3_BASE_RECOGNIZER pANTLR3_BASE_RECOGNIZER Base Recognizer Implementation + /// \ingroup apiimplementations + /// + /// The base recognizer interface is implemented by all higher level recognizers + /// such as #pANTLR3_PARSER and provides methods common to all recognizers. + /// + /// \defgroup pANTLR3_RECOGNIZER_SHARED_STATE pANTLR3_RECOGNIZER_SHARED_STATE - Recognizer Shared State Implementation + /// \ingroup apiimplementations + /// + /// The recognizer shared state class does not have an implementation because it contains only + /// data fields, documented at #ANTLR3_RECOGNIZER_SHARED_STATE + /// + /// \defgroup pANTLR3_BITSET pANTLR3_BITSET - Bitset Implementation + /// \ingroup apiimplementations + /// \defgroup pANTLR3_TOKEN_FACTORY pANTLR3_TOKEN_FACTORY - Token Factory Implementation + /// \ingroup apiimplementations + /// \defgroup pANTLR3_COMMON_TOKEN pANTLR3_COMMON_TOKEN - Common Token Implementation + /// \ingroup apiimplementations + /// \defgroup pANTLR3_EXCEPTION pANTLR3_EXCEPTION - Exception Implementation + /// \ingroup apiimplementations + /// \defgroup pANTLR3_HASH_BUCKET pANTLR3_HASH_BUCKET - Hash Table Bucket Implementation + /// \ingroup apiimplementations + /// \defgroup pANTLR3_HASH_ENTRY pANTLR3_HASH_ENTRY - Hash Table Entry Implementation + /// \ingroup apiimplementations + /// \defgroup pANTLR3_HASH_ENUM pANTLR3_HASH_ENUM - Hash Table Enumerator Implementation + /// \ingroup apiimplementations + /// \defgroup pANTLR3_HASH_TABLE pANTLR3_HASH_TABLE - Hash Table Implementation + /// \ingroup apiimplementations + /// \defgroup pANTLR3_LIST pANTLR3_LIST - List Implementation + /// \ingroup apiimplementations + /// \defgroup pANTLR3_VECTOR_FACTORY pANTLR3_VECTOR_FACTORY - Vector Factory Implementation + /// \ingroup apiimplementations + /// \defgroup pANTLR3_VECTOR pANTLR3_VECTOR - Vector Implementation + /// \ingroup apiimplementations + /// \defgroup pANTLR3_STACK pANTLR3_STACK - Stack Implementation + /// \ingroup apiimplementations + /// \defgroup pANTLR3_INPUT_STREAM pANTLR3_INPUT_STREAM - Input Stream Implementation + /// \ingroup apiimplementations + /// \defgroup pANTLR3_LEX_STATE pANTLR3_LEX_STATE - Lexer State Implementation + /// \ingroup apiimplementations + /// \defgroup pANTLR3_STRING_FACTORY pANTLR3_STRING_FACTORY - String Factory Implementation + /// \ingroup apiimplementations + /// \defgroup pANTLR3_STRING pANTLR3_STRING - String Implementation + /// \ingroup apiimplementations + /// \defgroup pANTLR3_TOKEN_SOURCE pANTLR3_TOKEN_SOURCE - Token Source Implementation + /// \ingroup apiimplementations + /// \defgroup pANTLR3_TOKEN_STREAM pANTLR3_TOKEN_STREAM - Token Stream Implementation + /// \ingroup apiimplementations + /// \defgroup pANTLR3_COMMON_TOKEN_STREAM pANTLR3_COMMON_TOKEN_STREAM - Common Token Implementation + /// \ingroup apiimplementations + /// \defgroup pANTLR3_CYCLIC_DFA pANTLR3_CYCLIC_DFA - Cyclic DFA Implementation + /// \ingroup apiimplementations + /// \defgroup pANTLR3_LEXER pANTLR3_LEXER - Lexer Implementation + /// \ingroup apiimplementations + /// \defgroup pANTLR3_PARSER pANTLR3_PARSER - Parser Implementation + /// \ingroup apiimplementations + /// \defgroup pANTLR3_BASE_TREE pANTLR3_BASE_TREE - Base Tree Implementation + /// \ingroup apiimplementations + /// \defgroup pANTLR3_COMMON_TREE pANTLR3_COMMON_TREE - Common Tree Implementation + /// \ingroup apiimplementations + /// \defgroup pANTLR3_ARBORETUM pANTLR3_ARBORETUM - Tree Factory Implementation + /// \ingroup apiimplementations + /// \defgroup pANTLR3_PARSE_TREE pANTLR3_PARSE_TREE - Parse Tree Implementation + /// \ingroup apiimplementations + /// \defgroup pANTLR3_TREE_NODE_STREAM pANTLR3_TREE_NODE_STREAM - Tree Node Stream Implementation + /// \ingroup apiimplementations + /// \defgroup pANTLR3_COMMON_TREE_NODE_STREAM pANTLR3_COMMON_TREE_NODE_STREAM - Common Tree Node Stream Implementation + /// \ingroup apiimplementations + /// \defgroup pANTLR3_TREE_WALK_STATE pANTLR3_TREE_WALK_STATE - Tree Walk State Implementation + /// \ingroup apiimplementations + /// \defgroup pANTLR3_BASE_TREE_ADAPTOR pANTLR3_BASE_TREE_ADAPTOR - Base Tree Adaptor Implementation + /// \ingroup apiimplementations + /// \defgroup pANTLR3_COMMON_TREE_ADAPTOR pANTLR3_COMMON_TREE_ADAPTOR - Common Tree Adaptor Implementation + /// \ingroup apiimplementations + /// \defgroup pANTLR3_TREE_PARSER pANTLR3_TREE_PARSER - Tree ParserImplementation + /// \ingroup apiimplementations + /// \defgroup pANTLR3_INT_TRIE pANTLR3_INT_TRIE - Trie Implementation + /// \ingroup apiimplementations + /// \defgroup pANTLR3_REWRITE_RULE_ELEMENT_STREAM pANTLR3_REWRITE_RULE_ELEMENT_STREAM - Token Rewrite Stream Implementation + /// \ingroup apiimplementations + /// \defgroup pANTLR3_DEBUG_EVENT_LISTENER pANTLR3_DEBUG_EVENT_LISTENER - Debugger Implementation + /// \ingroup apiimplementations + \ No newline at end of file diff --git a/antlr/libantlr3c-3.4/doxygen/generate.dox b/antlr/libantlr3c-3.4/doxygen/generate.dox new file mode 100644 index 0000000..0173d78 --- /dev/null +++ b/antlr/libantlr3c-3.4/doxygen/generate.dox @@ -0,0 +1,57 @@ +/// \page generate Generating Code for the C Target +/// +/// \section generate Generating C +/// +/// Before discussing how we compile or call the generated C code, we need to know how to invoke the C code generator. +/// This is achieved within the grammar file itself, using the language option: +/// +/// \verbatim +options { language = C;} +\endverbatim +/// +/// The code generator consists of a single .java file within the standard ANTLR tool jar, and a code generation template, +/// used by the StringTemplate engine, which drives code generation for all language targets. In fact you can make copies of the C.stg +/// and AST.stg templates and make changes to them (though you are encouraged not to, as it is better to provide bug fixes or +/// enhancements which we are happy to receive requests for and will do out best to incorporate. +/// +/// If you are working in the Windows environment, with Visual Studio 2005 or later, you may wish to utilize the custom rulefile +/// provided in the C source code distribution under the ./vs2005 directory for this purpose. If you are using a pre-built +/// library then you can also download this rule file directly from the FishEye source code browser for ANTLR3. +/// +/// In order to use the rulefile, you must adopt the following suffixes for your grammar files, though they are otherwise optional: +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +///
Suffix Grammar should contain...
.g3l A lexer grammar specification only.
.g3p A parser grammar specification only.
.g3pl A combined lexer and parser specification.
.g3t A tree grammar specification.
+/// +/// You may also wish to use these suffixes if you are building your projects using Makefiles, as this makes the output deterministic. +/// However in this case a much better solution is probably to utilize the -depend option of the Antlr tool, which should tell your +/// Makefile what the grammar files generates, irrespective of its suffix. ANTLR does not care about the actual suffix you use for +/// your grammar file, so building for multiple platforms is relatively easy. +/// +/// NOTE: Your grammar source, regardless of suffix must be named the same as the grammar statement within it. Grammar xyz +/// must be contained within a file called xyz.anything +/// +/// + diff --git a/antlr/libantlr3c-3.4/doxygen/interop.dox b/antlr/libantlr3c-3.4/doxygen/interop.dox new file mode 100644 index 0000000..3401539 --- /dev/null +++ b/antlr/libantlr3c-3.4/doxygen/interop.dox @@ -0,0 +1,327 @@ +/// \page interop Interacting with the Generated Code +/// +/// \section intro Introduction +/// +/// The main way to interact with the generated code is via action code placed within { and +/// } characters in your rules. In general, you are advised to keep the code you embed within +/// these actions, and the grammar itself to an absolute minimum. Rather than embed code directly in your +/// grammar, you should construct an API, that is called from the actions within your grammar. This way +/// you will keep the grammar clean and maintainable and separate the code generators or other code +/// from the definition of the grammar itself. +/// +/// However, when you wish to call your API functions, or insert small pieces of code that do not +/// warrant external functions, you will need to access elements of tokens, return elements from +/// parser rules and perhaps the internals of the recognizer itself. The C runtime provides a number +/// of MACROs that you can use within your action code. It also provides a number of performant +/// structures that you may find useful for building symbol tables, lists, tries, stacks, arrays and so on (all +/// of which are managed so that your memory allocation problems are minimized.) +/// +/// \section rules Parameters and Returns from Parser Rules +/// +/// The C target does not differ from the Java target in any major ways here, and you should consult +/// the standard documentation for the use of parameters on rules and the returns clause. You should +/// be aware though, that the rules generate C function calls and therefore the input and returns +/// clauses are subject to the constraints of C scoping. +/// +/// You should note that if your parser rule returns more than a single entity, then the return +/// type of the generated rule function is a struct, which is returned by value. This is also the case +/// if your rule is part of a tree building grammar (uses the output=AST; option. +/// +/// Other than the notes above, you can use any pre-declared type as an input or output parameter +/// for your rule. +/// +/// \section memory Memory Management +/// +/// You are responsible for allocating and freeing any memory used by your own +/// constructs, ANTLR will track and release any memory allocated internally for tokens, trees, stacks, scopes +/// and so on. This memory is returned to the malloc pool when you call the free method of any +/// ANTLR3 produced structure. +/// +/// For performance reasons, and to avoid thrashing the malloc allocation system, memory for amy elements +/// of your generated parser is allocated in chunks and parcelled out by factories. For instance memory +/// for tokens is created as an array of tokens, and a token factory hands out the next available slot +/// to the lexer. When you free the lexer, the allocated memory is returned to the pool. The same applies +/// to 'strings' that contain the token text and various other text elements accessed within the lexer. +/// +/// The only side effect of this is that after your parse and analysis is complete, if you wish to retain +/// anything generated automatically, you must copy it before freeing the recognizer structures. In practice +/// it is usually practical to retain the recognizer context objects until your processing is complete or +/// to use your own allocation scheme for generating output etc. +/// +/// The advantage of using object factories is of course that memory leaks and accessing de-allocated +/// memory are bugs that rarely occur within the ANTLR3 C runtime. Further, allocating memory for +/// tokens, trees and so on is very fast. +/// +/// \section ctx The CTX Macro +/// +/// The CTX macro is a fundamental parameter that is passed as the first parameter to any generated function +/// concerned with your lexer, parser, or tree parser. The is is the context pointer for your generated +/// recognizer and is how you invoke the generated functions, and access the data embedded within your generated +/// recognizer. While you can use it to directly access stacks, scopes and so on, this is not really recommended +/// as you should use the $xxx references that are available generically within ANTLR grammars. +/// +/// The context pointer is used because this removes the need for any global/static variables at all, either +/// within the generated code, or the C runtime. This is of course fundamental to creating free threading +/// recognizers. Wherever a function call or rule call required the ctx parameter, you either reference it +/// via the CTX macro, or the ctx parameter is in fact the return type from calling the 'constructor' +/// function for your parser/lexer/tree parser (see code example in "How to build Generated Code" .) +/// +/// \section macros Pre-Defined convenience MACROs +/// +/// While the author is not fond of using C MACROs to hide code or structure access, in the case of generated +/// code, they serve two useful purposes. The first is to simplify the references to internal constructs, +/// the second is to facilitate the change of any internal interface without requiring you to port grammars +/// from earlier versions (just regenerate and recompile). As of release 3.1, these macros are stable and +/// will only change their usage interface in the event of bugs being discovered. You are encouraged to +/// use these macros in your code, rather than access the raw interface. +/// +/// \bNB: Macros that act like statements must be terminated with a ';'. The macro body does not +/// supply this, nor should it. Macros that call functions are declared with () even if they +/// have no parameters, macros that reference fields do not have a () declaration. +/// +/// \section lexermacros Lexer Macros +/// +/// There are a number of macros that are useful exclusively within lexer rules. There are additional +/// macros, common to all recognizer, and these are documented in the section Common Macros. +/// +/// \subsection lexer LEXER +/// +/// The LEXER macro returns a pointer to the base lexer object, which is of type #pANTLR3_LEXER. This is +/// not the pointer to your generated lexer, which is supplied by the CTX macro, +/// but to the common implementation of a lexer interface, +/// which is supplied to all generated lexers. +/// +/// \subsection lexstate LEXSTATE +/// +/// Provides a pointer to the lexer shared state structure, which is where the tokens for a +/// rule are constructed and the status elements of the lexer are kept. This pointer is of type +/// #pANTLR3_RECOGNIZER_SHARED_STATE.In general you should only access elements of this structure +/// if there is not already another MACRO or standard $xxxx antlr reference that refers to it. +/// +/// \subsection la LA(n) +/// +/// The LA macro returns the character at index n from the current input stream index. The return +/// type is #ANTLR3_UINT32. Hence LA(1) returns the character at the current input position (the +/// character that will be consumed next), LA(-1) returns the character that has just been consumed +/// and so on. The LA(n) macro is useful for constructing semantic predicates in lexer rules. The +/// reference LA(0) is undefined and will cause an error in your lexer. +/// +/// \subsection getcharindex GETCHARINDEX() +/// +/// The GETCHARINDEX macro returns the index of the current character position as a 0 based +/// offset from the start of the input stream. It returns a value type of #ANTLR3_UINT32. +/// +/// \subsection getline GETLINE() +/// +/// The GETLINE macro returns the line number of current character (LA(1) in the input +/// stream. It returns a value type of #ANTLR3_UINT32. Note that the line number is incremented +/// automatically by an input stream when it sees the input character '\n'. The character that causes +/// the line number to increment can be changed by calling the SetNewLineChar() method on the input +/// stream before invoking the lexer and after creating the input stream. +/// +/// \subsection gettext GETTEXT() +/// +/// The GETTEXT macro returns the text currently matched by the lexer rule. In general you should use the +/// generic $text reference in ANTLR to retrieve this. The return type is a reference type of #pANTLR3_STRING +/// which allows you to manipulate the text you have retrieved (\b NB this does not change the input stream +/// only the text you copy from the input stream when you use this MACRO or $text). +/// +/// The reference $text->chars or GETTEXT()->chars will reference a pointer to the '\\0' terminated character +/// string that the ANTLR3 #pANTLR3_STRING represents. String space is allocated automatically as well as +/// the structure that holds the string. The #pANTLR3_STRING_FACTORY associated with the lexer handles this +/// and when you close the lexer, it will automatically free any space allocated for strings and their structures. +/// +/// \subsection getcharpositioninline GETCHARPOSITIONINLINE() +/// +/// The GETCHARPOSITIONINLINE returns the zero based offset of character LA(1) +/// from the start of the current input line. See the macro GETLINE for details on what the +/// line number means. +/// +/// \subsection emit EMIT() +/// +/// The macro EMIT causes the text range currently matched to the lexer rule to be emitted +/// immediately as the token for the rule. Subsequent text is matched but ignored. The type used for the +/// the token is the name of the lexer rule or, if you have change this by using $type = XXX;, the type +/// XXX is used. +/// +/// \subsection emitnew EMITNEW(t) +/// +/// The macro EMITNEW causes the supplied token reference t to be used as the +/// token emitted by the rule. The parameter t must be of type #pANTLR3_COMMON_TOKEN. +/// +/// \subsection index INDEX() +/// +/// The INDEX macro returns the current input position according to the input stream. It is not +/// guaranteed to be the character offset in the input stream but is instead used as a value +/// for marking and rewinding to specific points in the input stream. Use the macro GETCHARINDEX() +/// to find out the position of the LA(1) in the input stream. +/// +/// \subsection pushstream PUSHSTREAM(str) +/// +/// The PUSHSTREAM macro, in conjunction with the POPSTREAM macro (called internally in the runtime usually) +/// can be used to stack many input streams to the lexer, and implement constructs such as the C pre-processor +/// \#include directive. +/// +/// An input stream that is pushed on to the stack becomes the current input stream for the lexer and +/// the state of the previous stream is automatically saved. The input stream will be automatically +/// popped from the stack when it is exhausted by the lexer. You may use the macro POPSTREAM +/// to return to the previous input stream prior to exhausting the currently stacked input stream. +/// +/// Here is an example of using the macro in a lexer to implement the C \#include pre-processor directive: +/// +/// \code +/// fragment +/// STRING_GUTS : (~('\\'|'"') )* ; +/// +/// LINE_COMMAND +/// : '#' (' ' | '\t')* +/// ( +/// 'include' (' ' | '\t')+ '"' file = STRING_GUTS '"' (' ' | '\t')* '\r'? '\n' +/// { +/// pANTLR3_STRING fName; +/// pANTLR3_INPUT_STREAM in; +/// +/// // Create an initial string, then take a substring +/// // We can do this by messing with the start and end +/// // pointers of tokens and so on. This shows a reasonable way to +/// // manipulate strings. +/// // +/// fName = $file.text; +/// printf("Including file '\%s'\n", fName->chars); +/// +/// // Create a new input stream and take advantage of built in stream stacking +/// // in C target runtime. +/// // +/// in = antlr38BitFileStreamNew(fName->chars); +/// PUSHSTREAM(in); +/// +/// // Note that the input stream is not closed when it EOFs, I don't bother +/// // to do it here, but it is up to you to track streams created like this +/// // and destroy them when the whole parse session is complete. Remember that you +/// // don't want to do this until all tokens have been manipulated all the way through +/// // your tree parsers etc as the token does not store the text it just refers +/// // back to the input stream and trying to get the text for it will abort if you +/// // close the input stream too early. +/// // +/// +/// } +/// | (('0'..'9')=>('0'..'9'))+ ~('\n'|'\r')* '\r'? '\n' +/// ) +/// {$channel=HIDDEN;} +/// ; +/// \endcode +/// +/// \subsection popstream POPSTREAM() +/// +/// Assuming that you have stacked an input stream using the PUSHSTREAM macro, you can +/// remove it from the stream stack and revert to the previous input stream. You should be careful +/// to pop the stream at an appropriate point in your lexer action, so you do not match characters +/// from one stream with those from another in the same rule (unless this is what you want to do) +/// +/// \subsection settext SETTEXT(str) +/// +/// A token manufactured by the lexer does not actually physically store the text from the +/// input stream to which it matches. The token string is instead created only if you ask for +/// the text. However if you wish to change the text that the token represents you can use +/// this macro to set it explicitly. Note that this does not change the input stream text +/// but associates the supplied #pANTLR3_STRING with the token. This string is then returned +/// when parser and tree parser reference the tokens via the $xxx.text reference. +/// +/// \subsection user1 USER1 USER2 USER3 and CUSTOM +/// +/// While you can create your own custom token class and have the lexer deal with this, this +/// is a lot of work compared to the trivial inheritance that can be achieved in the Java target. +/// In many cases though, all that is needed is the addition of a few data items such as an +/// integer or a pointer. Rather than require C programmers to create complicated structures +/// just to add a few data items, the C target provides a few custom fields in the standard +/// token, which will fulfil the needs of most lexers and parsers. +/// +/// The token fields user1, user2, and user3 are all value types of #ANTLR_UINT32. In the +/// parser you can reference these fields directly from the token: x=TOKNAME { $x->user1 ... +/// but when you are building the token in the lexer, you must assign to the fields using the +/// macros USER1, USER2, or USER3. As in: +/// +/// \code +/// LEXTOK: 'AAAAA' { USER1 = 99; } ; +/// \endcode +/// +/// +/// \section parsermacros Parser and Tree Parser Macros +/// +/// \subsection parser PARSER +/// +/// The PARSER macro returns a pointer to the base parser or tree parser object, which is of type #pANTLR3_PARSER +/// or #pANTLR3_TREE_PARSER . This is not the pointer to your generated parser, which is supplied by the CTX macro, +/// but to the common implementation of a parser or tree parser interface, which is supplied to all generated parsers. +/// +/// \subsection index INDEX() +/// +/// When used in the parser, the INDEX macro returns the position of the current +/// token ( LT(1) ) in the input token stream. It can be used for MARK and REWIND +/// operations. +/// +/// \subsection lt LT(n) and LA(n) +/// +/// In the parser, the macro LT(n) returns the #pANTLR3_COMMON_TOKEN at offset n from +/// the current token stream input position. The macro LA(n) returns the token type of the token +/// at position n. The value n cannot be zero, and such a reference will return +/// NULL and possibly cause an error. LA(1) is the token that is about to be +/// recognized and LA(-1) is the token that has just been recognized. Values of n that exceed the +/// limits of the token stream boundaries will return NULL. +/// +/// \subsection psrstate PSRSTATE +/// +/// Returns the shared state pointer of type #pANTLR3_RECOGNIZER_SHARED_STATE. This is not generally +/// useful to the grammar programmer as the useful elements have generic $xxx references built in to +/// ANTLR. +/// +/// \subsection adaptor ADAPTOR +/// +/// When building an AST via a parser, the work of constructing and manipulating trees is done +/// by a supplied adaptor class. The default class is usually fine for most tree operations but +/// if you wish to build your own specialized linked/tree structure, then you may need to reference +/// the adaptor you supply directly. The ADAPTOR macro returns the reference to the tree adaptor +/// which is always of type #pANTLR3_BASE_TREE_ADAPTOR, even if it is your custom adapter. +/// +/// \section commonmacros Macros Common to All Recognizers +/// +/// \subsection recognizer RECOGNIZER +/// +/// Returns a reference type of #pANTRL3_BASE_RECOGNIZER, which is the base functionality supplied +/// to all recognizers, whether lexers, parsers or tree parsers. You can override methods in this +/// interface by installing your own function pointers (once you know what you are doing). +/// +/// \subsection input INPUT +/// +/// Returns a reference to the input stream of the appropriate type for the recognizer. In a lexer +/// this macro returns a reference type of #pANTLR3_INPUT_STREAM, in a parser this is type +/// #pANTLR3_TOKEN_STREAM and in a tree parser this is type #pANTLR3_COMMON_TREE_NODE_STREAM. +/// You can of course provide your own implementations of any of these interfaces. +/// +/// \subsection mark MARK() +/// +/// This macro will cause the input stream for the current recognizer to be marked with a +/// checkpoint. It will return a value type of #ANTLR3_MARKER which you can use as the +/// parameter to a REWIND macro to return to the marked point in the input. +/// +/// If you know you will only ever rewind to the last MARK, then you can ignore the return +/// value of this macro and just use the REWINDLAST macro to return to the last MARK that +/// was set in the input stream. +/// +/// \subsection rewind REWIND(m) +/// +/// Rewinds the appropriate input stream back to the marked checkpoint returned from a prior +/// MARK macro call and supplied as the parameter m to the REWIND(m) +/// macro. +/// +/// \subsection rewindlast REWINDLAST() +/// +/// Rewinds the current input stream (character, tokens, tree nodes) back to the last checkpoint +/// marker created by a MARK macro call. Fails silently if there was no prior +/// MARK call. +/// +/// \subsection seek SEEK(n) +/// +/// Causes the input stream to position itself directly at offset n in the stream. Works for all +/// input stream types, both lexer, parser and tree parser. +/// diff --git a/antlr/libantlr3c-3.4/doxygen/knownissues.dox b/antlr/libantlr3c-3.4/doxygen/knownissues.dox new file mode 100644 index 0000000..733c405 --- /dev/null +++ b/antlr/libantlr3c-3.4/doxygen/knownissues.dox @@ -0,0 +1,3 @@ +/// \page knownissues Known Issues +/// +/// The following issues \ No newline at end of file diff --git a/antlr/libantlr3c-3.4/doxygen/mainpage.dox b/antlr/libantlr3c-3.4/doxygen/mainpage.dox new file mode 100644 index 0000000..ed52b5e --- /dev/null +++ b/antlr/libantlr3c-3.4/doxygen/mainpage.dox @@ -0,0 +1,104 @@ +// Main page documentation for ANTLR3C runtime. Contains +// doxygen things only. +// + +/// \mainpage ANTLR3 C Runtime API and Usage Guide. +/// +/// \section version Version 3.3.1 +/// +/// This documentation is specifically for the C rutime version 3.1.x.x, which is +/// specifically for use with version 3.1.x.x of the ANTLR recognizer generation +/// tool. While some of the documentation may well apply to prior or future versions +/// you should consult the manuals for the correct version whenever possible. +/// +/// \section chchchchangeesss Changes from 3.2 to 3.3.1 +/// +/// Some changes in 3.3.1 may require small changes in your invoking programs or +/// in the grammar itself. Please read about them here before emailing the user group, +/// where you will be told to come and read about them here, unless they were missed +/// from this list. +/// +/// - \subpage changes331 Check here for API changes +/// +/// \section intro Introduction +/// +/// The ANTLR3 recognizer generation tool is written in Java, but allows the generation +/// of code targeted for a number of other languages. Each target language provides a code +/// generation template for the tool and a runtime library for use by generated recognizers. +/// The C runtime tracks the Java runtime releases and in general when a new version of the +/// tool is released, a new version of the C runtime will be released at the same time. +/// +/// The documentation here is in three parts: +/// +/// - \subpage build Building the runtime itself from source code; +/// - \subpage generate How to tell ANTLR to generate code for the C target; +/// - \subpage buildrec How to build the generated code +/// - \subpage using Using the runtime and the libraries and so on; +/// - \subpage runtime The documentation of the runtime code and functions; +/// +/// \section background Background Information +/// +/// The ANTLR 3 C runtime and code generation templates were written by Jim Idle +/// (jimi|at|temporal-wave|dott/com) of Temporal Wave LLC. +/// +/// The C runtime and therefore the code generated to utilize the runtime reflects the object model of the +/// Java version of the runtime as closely as a language without class structures and inheritance can. +/// Compromises have only been made where performance would be adversely affected such as minimizing the +/// number of pointer to pointer to pointer to function type structures that could ensue through trying to +/// model inheritance too exactly. Other differences include the use of token and string factories to minimize +/// the number of calls to system functions such as calloc().This model was adopted so that overriding any +/// default implementation of a function is relatively simple for the grammar programmer. +/// +/// The generated code is free threading (subject to the systems calls used on any particular platform +/// being likewise free threading.) +/// +/// \subsection model Runtime Model +/// +/// As there is no such thing as an object reference in C, the runtime defines a number of typedef structs that reflect +/// the calling interface chosen by Terence Parr for the Java version of the same. The initialization of a parser, +/// lexer, input stream or other internal structure therefore consists of allocating the memory required for +/// an instance of the typedef struct that represents the interface, initializing any counters, and buffers etc, +/// then populating a number of pointers to functions that implement the equivalent of the methods in the Java class. +/// +/// The use and initialization of the C versions of a parser is therefore similar to the examples given for Java, +/// but with a bent towards C of course. You may need to be aware of memory allocation and freeing operations +/// in certain environments such as Windows, where you cannot allocate memory in one DLL and free it in another. +/// +/// The runtime provides a number of structures and interfaces that the author has found useful when writing action and +/// processing code within java parsers, and furthermore were required by the C runtime code if it was not to +/// depart too far from the logical layout of the Java model. These include the C equivalents of String, List, +/// Hashtable, Vector and Trie, implemented by pointers to structures. These are freely available for your own programming needs. +/// +/// A goal of the generated code was to minimize the tracking, allocation and freeing of memory for reasons of both +/// performance and reliability. In essence any memory used by a lexer, parser or tree parser is automatically tracked and +/// freed when the instance of it is released. There are therefore factory functions for tokens and so on such that they +/// can be allocated in blocks and parceled out as they are required. They are all then freed in one go, minimizing the +/// risk of memory leaks and alloc/free thrashing. This has only one side effect, being that if you wish to preserve some structure generated by +/// the lexer, parser or tree parser, then you must make a copy of it before freeing those structures, and track it yourself +/// after that. In practice, it is easy enough just not to release the antlr generated components until you are +/// finished with their results. +/// +/// \section targets Target Platforms +/// +/// The C project is constructed such that it will compile on any reasonable ANSI C compiler in either 64 or 32 bit mode, +/// with all warnings turned on. This is true of both the runtime code and the generated code and has been summarily tested +/// with Visual Studio .Net (2003, 2005 and 2008) and later versions of gcc on Redhat Linux, as well as on AIX 5.2/5.3, Solaris 9/10, +/// HPUX 11.xx, OSX (PowerPC and Intel) and Cygwin. +/// +/// \b Notes +/// - The C runtime is constructed such that the library can be integrated as an archive library, or a shared library/DLL. +/// - The C language target code generation templates are distributed with the source code for the ANTLR tool itself. +/// +/// \section performance Performance +/// +/// It is C :-). Basic testing of performance against the Java runtime, +/// using the JDK1.6 java source code, and the Java parser provided in the examples (which is a tough test as it includes +/// backtracking and memoization) show that the C runtime uses about half the memory and is between 2 and 3 times the speed. +/// Tests of non-backtracking, non-memoizing parsers, indicate results significantly better than this. +/// +/// \section examples Downloading Examples +/// +/// The downloads page of the ANTLR web site contains a downloadable +/// zip/tar of examples projects for use with the C runtime model. It contains .sln files and source code for a +/// number of example grammars and helps to see how to invoke and call the generated recognizers. +/// \ No newline at end of file diff --git a/antlr/libantlr3c-3.4/doxygen/runtime.dox b/antlr/libantlr3c-3.4/doxygen/runtime.dox new file mode 100644 index 0000000..2d23403 --- /dev/null +++ b/antlr/libantlr3c-3.4/doxygen/runtime.dox @@ -0,0 +1,35 @@ +/// \page runtime Navigating the C Runtime Documentation +/// +/// If you are familiar with Doxygen generated documentation, then the layout of the files, typedefs +/// and so on will be familiar to you. However there is also additional structure applied that helps +/// the programmer to see how the runtime is made up. +/// +/// \section modules Modules +/// +/// Under the Modules menu tree you will find the entry API Classes. This section is further +/// divided into typedefs and structs and the standard runtime supplied interface implementation +/// methods. +/// +/// The typedefs are the types that you declare in your code and which are returned by the +/// 'constructors' such as antlr38BitFileStreamNew(). The underlying structures document +/// the data elements of the type and what a function pointer installed in any particular +/// slot should do. +/// +/// The default implementations are the static methods within the default implementation file +/// for a 'class', which are installed by the runtime when a default instance of one the +/// typedefs (classes) is created. +/// +/// When navigating the source code, find the typedef you want to consult and inspect the documentation +/// for its function pointers, then look at the documentation for the default methods that implement +/// that 'method'. +/// +/// For example, under "API Typedefs and Structs" you will find "Base Recognizer Definition", which tells +/// you all the methods that belong to this interface. Under "API Implementation Functions", you will +/// find "Base Recognizer Implementation", which documents the actual functions that are installed +/// to implement the class methods. +/// +/// From here, the documentation should be obvious. If it is not, then you could try reading +/// the actual source code, but please don't email the author directly, use the ANTLR Interest +/// email group, which you should probably have signed up for if you have read this far into the +/// C runtime documentation. +/// \ No newline at end of file diff --git a/antlr/libantlr3c-3.4/doxygen/using.dox b/antlr/libantlr3c-3.4/doxygen/using.dox new file mode 100644 index 0000000..fb8424a --- /dev/null +++ b/antlr/libantlr3c-3.4/doxygen/using.dox @@ -0,0 +1,62 @@ +/// \page using Using the ANTLR3 C Target +/// +/// \section intro Introduction +/// +/// Using the ANTLR target involves gaining knowledge of a number of elements: +/// +/// -# Writing ANTLR grammars (not covered in this manual); +/// -# How ANTLR works (not covered in this manual); +/// -# How to use the \@sections with the C target +/// -# Interoperation with the runtime within rule actions; +/// -# Implementing custom versions of the standard library methods; +/// +/// If you are as yet unfamiliar with how ANTLR works in general, then +/// it is suggested that you read the various wiki pages concerned with +/// getting started. However there are a few things that you should note: +/// +/// - The lexer is independent of the parser. You \b cannot control the lexer from within the parser; +/// - The tree parser is independent of the parser. You \b cannot control the parser from within the tree parser(s); +/// - Each tree parser is independent of other tree parsers. +/// +/// This means that your lexer runs first and consumes all the input stream until +/// you stop it programmatically, or it reaches the end of the input stream. It produces +/// a complete stream of tokens, which the parser then consumes. +/// +/// \section Using \@sections in a C Targeted Grammar +/// +/// Within a grammar file there are a number of special sections you can add that cause the +/// code within them to be placed at strategic points in the generated code such as +/// before or after the #include statements in the .c file, within the generated header file +/// or within the constructor for the recognizer. +/// +/// Many of the \@sections used within a Java targeted grammar have some equivalent function within a +/// C targeted grammar, but their use may well be subtly different. There are also additional sections +/// that have meaning only within a grammar targeted for the C runtime. +/// +/// Detailed documentation of these sections is given here: \subpage atsections +/// +/// \section interop Interoperation Within Rule Actions +/// +/// Rule actions have a limited number of elements they can access by name, independently of the +/// target language generated. These are elements such as $line, $pos, $text and so on. Where the +/// $xxx returns a basic type such as \c int, then you can use these in C as you would in the Java +/// target, but where a reference returns a string, you will get a pointer to the C runtime +/// string implementation #pANTLR3_STRING. This will give you access to things like token text +/// but also provides some convenience methods such as #pANTLR3_STRING->substring() and #pANTLR3_STRING->toUTF8(). +/// +/// The generated code provides a number of C MACROs, which make it easier to access runtime +/// components. Always use these macros when available, to protect your action code from changes +/// to the underlying implementation. +/// +/// Detailed documentation of macros and rule action interoperation is given here: \subpage interop +/// +/// \section Custom Implementing Customized Methods +/// +/// Unless you wish to create your own tree structures using the built in ANTLR AST rewriting +/// notation, you will rarely need to override the default implementation of runtime methods. The +/// exception to this will be the syntax err reporting method, which is essentially a stub function +/// that you will usually want to provide your own implementation for. You should consider the built in function +/// displayRecognitionError() as an example of where to start as there can be no really useful +/// generic error message display. +/// +/// \ No newline at end of file diff --git a/antlr/libantlr3c-3.4/include/antlr3.h b/antlr/libantlr3c-3.4/include/antlr3.h new file mode 100644 index 0000000..2ead975 --- /dev/null +++ b/antlr/libantlr3c-3.4/include/antlr3.h @@ -0,0 +1,56 @@ +#ifndef _ANTLR3_H +#define _ANTLR3_H + +// [The "BSD licence"] +// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC +// http://www.temporal-wave.com +// http://www.linkedin.com/in/jimidle +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. The name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#endif diff --git a/antlr/libantlr3c-3.4/include/antlr3baserecognizer.h b/antlr/libantlr3c-3.4/include/antlr3baserecognizer.h new file mode 100644 index 0000000..0a269d4 --- /dev/null +++ b/antlr/libantlr3c-3.4/include/antlr3baserecognizer.h @@ -0,0 +1,371 @@ +/** \file + * Defines the basic structure to support recognizing by either a lexer, + * parser, or tree parser. + * \addtogroup ANTLR3_BASE_RECOGNIZER + * @{ + */ +#ifndef _ANTLR3_BASERECOGNIZER_H +#define _ANTLR3_BASERECOGNIZER_H + +// [The "BSD licence"] +// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC +// http://www.temporal-wave.com +// http://www.linkedin.com/in/jimidle +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. The name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include +#include +#include +#include +#include +#include +#include +#include + +/** Type indicator for a lexer recognizer + */ +#define ANTLR3_TYPE_LEXER 0x0001 + +/** Type indicator for a parser recognizer + */ +#define ANTLR3_TYPE_PARSER 0x0002 + +/** Type indicator for a tree parser recognizer + */ +#define ANTLR3_TYPE_TREE_PARSER 0x0004 + +#ifdef __cplusplus +extern "C" { +#endif + +/** \brief Base tracking context structure for all types of + * recognizers. + */ +typedef struct ANTLR3_BASE_RECOGNIZER_struct +{ + /// Whatever super structure is providing this interface needs a pointer to itself + /// so that this can be passed back to it whenever the api functions + /// are called back from here. + /// + void * super; + + /// Indicates the type of recognizer that we are an instance of. + /// The programmer may set this to anything of course, but the default + /// implementations of the interface only really understand the built in + /// types, so new error handlers etc would probably be required to as well. + /// + /// Valid types are: + /// + /// - #ANTLR3_TYPE_LEXER + /// - #ANTLR3_TYPE_PARSER + /// - #ANTLR3_TYPE_TREE_PARSER + /// + ANTLR3_UINT32 type; + + /// A pointer to the shared recognizer state, such that multiple + /// recognizers can use the same inputs streams and so on (in + /// the case of grammar inheritance for instance. + /// + pANTLR3_RECOGNIZER_SHARED_STATE state; + + /// If set to something other than NULL, then this structure is + /// points to an instance of the debugger interface. In general, the + /// debugger is only referenced internally in recovery/error operations + /// so that it does not cause overhead by having to check this pointer + /// in every function/method + /// + pANTLR3_DEBUG_EVENT_LISTENER debugger; + + + /// Pointer to a function that matches the current input symbol + /// against the supplied type. the function causes an error if a + /// match is not found and the default implementation will also + /// attempt to perform one token insertion or deletion if that is + /// possible with the input stream. You can override the default + /// implementation by installing a pointer to your own function + /// in this interface after the recognizer has initialized. This can + /// perform different recovery options or not recover at all and so on. + /// To ignore recovery altogether, see the comments in the default + /// implementation of this function in antlr3baserecognizer.c + /// + /// Note that errors are signalled by setting the error flag below + /// and creating a new exception structure and installing it in the + /// exception pointer below (you can chain these if you like and handle them + /// in some customized way). + /// + void * (*match) (struct ANTLR3_BASE_RECOGNIZER_struct * recognizer, + ANTLR3_UINT32 ttype, pANTLR3_BITSET_LIST follow); + + /// Pointer to a function that matches the next token/char in the input stream + /// regardless of what it actually is. + /// + void (*matchAny) (struct ANTLR3_BASE_RECOGNIZER_struct * recognizer); + + /// Pointer to a function that decides if the token ahead of the current one is the + /// one we were loking for, in which case the curernt one is very likely extraneous + /// and can be reported that way. + /// + ANTLR3_BOOLEAN + (*mismatchIsUnwantedToken) (struct ANTLR3_BASE_RECOGNIZER_struct * recognizer, pANTLR3_INT_STREAM input, ANTLR3_UINT32 ttype); + + /// Pointer to a function that decides if the current token is one that can logically + /// follow the one we were looking for, in which case the one we were looking for is + /// probably missing from the input. + /// + ANTLR3_BOOLEAN + (*mismatchIsMissingToken) (struct ANTLR3_BASE_RECOGNIZER_struct * recognizer, pANTLR3_INT_STREAM input, pANTLR3_BITSET_LIST follow); + + /** Pointer to a function that works out what to do when a token mismatch + * occurs, so that Tree parsers can behave differently to other recognizers. + */ + void (*mismatch) (struct ANTLR3_BASE_RECOGNIZER_struct * recognizer, + ANTLR3_UINT32 ttype, pANTLR3_BITSET_LIST follow); + + /** Pointer to a function to call to report a recognition problem. You may override + * this function with your own function, but refer to the standard implementation + * in antlr3baserecognizer.c for guidance. The function should recognize whether + * error recovery is in force, so that it does not print out more than one error messages + * for the same error. From the java comments in BaseRecognizer.java: + * + * This method sets errorRecovery to indicate the parser is recovering + * not parsing. Once in recovery mode, no errors are generated. + * To get out of recovery mode, the parser must successfully match + * a token (after a resync). So it will go: + * + * 1. error occurs + * 2. enter recovery mode, report error + * 3. consume until token found in resynch set + * 4. try to resume parsing + * 5. next match() will reset errorRecovery mode + */ + void (*reportError) (struct ANTLR3_BASE_RECOGNIZER_struct * recognizer); + + /** Pointer to a function that is called to display a recognition error message. You may + * override this function independently of (*reportError)() above as that function calls + * this one to do the actual exception printing. + */ + void (*displayRecognitionError) (struct ANTLR3_BASE_RECOGNIZER_struct * recognizer, pANTLR3_UINT8 * tokenNames); + + /// Get number of recognition errors (lexer, parser, tree parser). Each + /// recognizer tracks its own number. So parser and lexer each have + /// separate count. Does not count the spurious errors found between + /// an error and next valid token match + /// + /// \see reportError() + /// + ANTLR3_UINT32 + (*getNumberOfSyntaxErrors) (struct ANTLR3_BASE_RECOGNIZER_struct * recognizer); + + /** Pointer to a function that recovers from an error found in the input stream. + * Generally, this will be a #ANTLR3_EXCEPTION_NOVIABLE_ALT but it could also + * be from a mismatched token that the (*match)() could not recover from. + */ + void (*recover) (struct ANTLR3_BASE_RECOGNIZER_struct * recognizer); + + /** Pointer to a function that is a hook to listen to token consumption during error recovery. + * This is mainly used by the debug parser to send events to the listener. + */ + void (*beginResync) (struct ANTLR3_BASE_RECOGNIZER_struct * recognizer); + + /** Pointer to a function that is a hook to listen to token consumption during error recovery. + * This is mainly used by the debug parser to send events to the listener. + */ + void (*endResync) (struct ANTLR3_BASE_RECOGNIZER_struct * recognizer); + + /** Pointer to a function that is a hook to listen to token consumption during error recovery. + * This is mainly used by the debug parser to send events to the listener. + */ + void (*beginBacktrack) (struct ANTLR3_BASE_RECOGNIZER_struct * recognizer, ANTLR3_UINT32 level); + + /** Pointer to a function that is a hook to listen to token consumption during error recovery. + * This is mainly used by the debug parser to send events to the listener. + */ + void (*endBacktrack) (struct ANTLR3_BASE_RECOGNIZER_struct * recognizer, ANTLR3_UINT32 level, ANTLR3_BOOLEAN successful); + + /** Pointer to a function to computer the error recovery set for the current rule. + * \see antlr3ComputeErrorRecoverySet() for details. + */ + pANTLR3_BITSET (*computeErrorRecoverySet) (struct ANTLR3_BASE_RECOGNIZER_struct * recognizer); + + /** Pointer to a function that computes the context-sensitive FOLLOW set for the + * current rule. + * \see antlr3ComputeCSRuleFollow() for details. + */ + pANTLR3_BITSET (*computeCSRuleFollow) (struct ANTLR3_BASE_RECOGNIZER_struct * recognizer); + + /** Pointer to a function to combine follow bitsets. + * \see antlr3CombineFollows() for details. + */ + pANTLR3_BITSET (*combineFollows) (struct ANTLR3_BASE_RECOGNIZER_struct * recognizer, + ANTLR3_BOOLEAN exact); + + /** Pointer to a function that recovers from a mismatched token in the input stream. + * \see antlr3RecoverMismatch() for details. + */ + void * (*recoverFromMismatchedToken) + (struct ANTLR3_BASE_RECOGNIZER_struct * recognizer, + ANTLR3_UINT32 ttype, + pANTLR3_BITSET_LIST follow); + + /** Pointer to a function that recovers from a mismatched set in the token stream, in a similar manner + * to (*recoverFromMismatchedToken) + */ + void * (*recoverFromMismatchedSet) (struct ANTLR3_BASE_RECOGNIZER_struct * recognizer, + pANTLR3_BITSET_LIST follow); + + /** Pointer to common routine to handle single token insertion for recovery functions. + */ + ANTLR3_BOOLEAN (*recoverFromMismatchedElement) + (struct ANTLR3_BASE_RECOGNIZER_struct * recognizer, + pANTLR3_BITSET_LIST follow); + + /** Pointer to function that consumes input until the next token matches + * the given token. + */ + void (*consumeUntil) (struct ANTLR3_BASE_RECOGNIZER_struct * recognizer, + ANTLR3_UINT32 tokenType); + + /** Pointer to function that consumes input until the next token matches + * one in the given set. + */ + void (*consumeUntilSet) (struct ANTLR3_BASE_RECOGNIZER_struct * recognizer, + pANTLR3_BITSET set); + + /** Pointer to function that returns an ANTLR3_LIST of the strings that identify + * the rules in the parser that got you to this point. Can be overridden by installing your + * own function set. + * + * \todo Document how to override invocation stack functions. + */ + pANTLR3_STACK (*getRuleInvocationStack) (struct ANTLR3_BASE_RECOGNIZER_struct * recognizer); + pANTLR3_STACK (*getRuleInvocationStackNamed) (struct ANTLR3_BASE_RECOGNIZER_struct * recognizer, + pANTLR3_UINT8 name); + + /** Pointer to a function that converts an ANLR3_LIST of tokens to an ANTLR3_LIST of + * string token names. As this is mostly used in string template processing it may not be useful + * in the C runtime. + */ + pANTLR3_HASH_TABLE (*toStrings) (struct ANTLR3_BASE_RECOGNIZER_struct * recognizer, + pANTLR3_HASH_TABLE); + + /** Pointer to a function to return whether the rule has parsed input starting at the supplied + * start index before. If the rule has not parsed input starting from the supplied start index, + * then it will return ANTLR3_MEMO_RULE_UNKNOWN. If it has parsed from the suppled start point + * then it will return the point where it last stopped parsing after that start point. + */ + ANTLR3_MARKER (*getRuleMemoization) (struct ANTLR3_BASE_RECOGNIZER_struct * recognizer, + ANTLR3_INTKEY ruleIndex, + ANTLR3_MARKER ruleParseStart); + + /** Pointer to function that determines whether the rule has parsed input at the current index + * in the input stream + */ + ANTLR3_BOOLEAN (*alreadyParsedRule) (struct ANTLR3_BASE_RECOGNIZER_struct * recognizer, + ANTLR3_MARKER ruleIndex); + + /** Pointer to function that records whether the rule has parsed the input at a + * current position successfully or not. + */ + void (*memoize) (struct ANTLR3_BASE_RECOGNIZER_struct * recognizer, + ANTLR3_MARKER ruleIndex, + ANTLR3_MARKER ruleParseStart); + + /// Pointer to a function that returns the current input symbol. + /// The is placed into any label for the associated token ref; e.g., x=ID. Token + /// and tree parsers need to return different objects. Rather than test + /// for input stream type or change the IntStream interface, I use + /// a simple method to ask the recognizer to tell me what the current + /// input symbol is. + /// + /// This is ignored for lexers and the lexer implementation of this + /// function should return NULL. + /// + void * (*getCurrentInputSymbol) ( struct ANTLR3_BASE_RECOGNIZER_struct * recognizer, + pANTLR3_INT_STREAM istream); + + /// Conjure up a missing token during error recovery. + /// + /// The recognizer attempts to recover from single missing + /// symbols. But, actions might refer to that missing symbol. + /// For example, x=ID {f($x);}. The action clearly assumes + /// that there has been an identifier matched previously and that + /// $x points at that token. If that token is missing, but + /// the next token in the stream is what we want we assume that + /// this token is missing and we keep going. Because we + /// have to return some token to replace the missing token, + /// we have to conjure one up. This method gives the user control + /// over the tokens returned for missing tokens. Mostly, + /// you will want to create something special for identifier + /// tokens. For literals such as '{' and ',', the default + /// action in the parser or tree parser works. It simply creates + /// a CommonToken of the appropriate type. The text will be the token. + /// If you change what tokens must be created by the lexer, + /// override this method to create the appropriate tokens. + /// + void * (*getMissingSymbol) ( struct ANTLR3_BASE_RECOGNIZER_struct * recognizer, + pANTLR3_INT_STREAM istream, + pANTLR3_EXCEPTION e, + ANTLR3_UINT32 expectedTokenType, + pANTLR3_BITSET_LIST follow); + + /** Pointer to a function that returns whether the supplied grammar function + * will parse the current input stream or not. This is the way that syntactic + * predicates are evaluated. Unlike java, C is perfectly happy to invoke code + * via a pointer to a function (hence that's what all the ANTLR3 C interfaces + * do. + */ + ANTLR3_BOOLEAN (*synpred) ( struct ANTLR3_BASE_RECOGNIZER_struct * recognizer, void * ctx, + void (*predicate)(void * ctx)); + + /** Pointer to a function that can construct a generic exception structure + * with such information as the input stream can provide. + */ + void (*exConstruct) (struct ANTLR3_BASE_RECOGNIZER_struct * recognizer); + + /** Reset the recognizer + */ + void (*reset) (struct ANTLR3_BASE_RECOGNIZER_struct * recognizer); + + /** Pointer to a function that knows how to free the resources of a base recognizer. + */ + void (*free) (struct ANTLR3_BASE_RECOGNIZER_struct * recognizer); + +} + ANTLR3_BASE_RECOGNIZER; + +#ifdef __cplusplus +} +#endif + +#include +#include +#include + +/// @} +/// + +#endif /* _ANTLR3_BASERECOGNIZER_H */ + diff --git a/antlr/libantlr3c-3.4/include/antlr3basetree.h b/antlr/libantlr3c-3.4/include/antlr3basetree.h new file mode 100644 index 0000000..023c4c2 --- /dev/null +++ b/antlr/libantlr3c-3.4/include/antlr3basetree.h @@ -0,0 +1,143 @@ +/// \file +/// Definition of the ANTLR3 base tree. +/// + +#ifndef _ANTLR3_BASE_TREE_H +#define _ANTLR3_BASE_TREE_H + +// [The "BSD licence"] +// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC +// http://www.temporal-wave.com +// http://www.linkedin.com/in/jimidle +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. The name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/// A generic tree implementation with no payload. You must subclass to +/// actually have any user data. ANTLR v3 uses a list of children approach +/// instead of the child-sibling approach in v2. A flat tree (a list) is +/// an empty node whose children represent the list. An empty (as in it does not +/// have payload itself), but non-null node is called "nil". +/// +typedef struct ANTLR3_BASE_TREE_struct +{ + + /// Implementers of this interface sometimes require a pointer to their selves. + /// + void * super; + + /// Generic void pointer allows the grammar programmer to attach any structure they + /// like to a tree node, in many cases saving the need to create their own tree + /// and tree adaptors. ANTLR does not use this pointer, but will copy it for you and so on. + /// + void * u; + + /// The list of all the children that belong to this node. They are not part of the node + /// as they belong to the common tree node that implements this. + /// + pANTLR3_VECTOR children; + + /// This is used to store the current child index position while descending + /// and ascending trees as the tree walk progresses. + /// + ANTLR3_MARKER savedIndex; + + /// A string factory to produce strings for toString etc + /// + pANTLR3_STRING_FACTORY strFactory; + + /// A pointer to a function that returns the common token pointer + /// for the payload in the supplied tree. + /// + pANTLR3_COMMON_TOKEN (*getToken) (struct ANTLR3_BASE_TREE_struct * tree); + + void (*addChild) (struct ANTLR3_BASE_TREE_struct * tree, void * child); + + void (*addChildren) (struct ANTLR3_BASE_TREE_struct * tree, pANTLR3_LIST kids); + + void (*createChildrenList) (struct ANTLR3_BASE_TREE_struct * tree); + + void * (*deleteChild) (struct ANTLR3_BASE_TREE_struct * tree, ANTLR3_UINT32 i); + + void (*replaceChildren) (struct ANTLR3_BASE_TREE_struct * parent, ANTLR3_INT32 startChildIndex, ANTLR3_INT32 stopChildIndex, struct ANTLR3_BASE_TREE_struct * t); + + void * (*dupNode) (struct ANTLR3_BASE_TREE_struct * dupNode); + + void * (*dupTree) (struct ANTLR3_BASE_TREE_struct * tree); + + ANTLR3_UINT32 (*getCharPositionInLine) (struct ANTLR3_BASE_TREE_struct * tree); + + void * (*getChild) (struct ANTLR3_BASE_TREE_struct * tree, ANTLR3_UINT32 i); + + void (*setChildIndex) (struct ANTLR3_BASE_TREE_struct * tree, ANTLR3_INT32 ); + + ANTLR3_INT32 (*getChildIndex) (struct ANTLR3_BASE_TREE_struct * tree ); + + ANTLR3_UINT32 (*getChildCount) (struct ANTLR3_BASE_TREE_struct * tree); + + struct ANTLR3_BASE_TREE_struct * (*getParent) (struct ANTLR3_BASE_TREE_struct * tree); + + void (*setParent) (struct ANTLR3_BASE_TREE_struct * tree, struct ANTLR3_BASE_TREE_struct * parent); + + ANTLR3_UINT32 (*getType) (struct ANTLR3_BASE_TREE_struct * tree); + + void * (*getFirstChildWithType) (struct ANTLR3_BASE_TREE_struct * tree, ANTLR3_UINT32 type); + + ANTLR3_UINT32 (*getLine) (struct ANTLR3_BASE_TREE_struct * tree); + + pANTLR3_STRING (*getText) (struct ANTLR3_BASE_TREE_struct * tree); + + ANTLR3_BOOLEAN (*isNilNode) (struct ANTLR3_BASE_TREE_struct * tree); + + void (*setChild) (struct ANTLR3_BASE_TREE_struct * tree, ANTLR3_UINT32 i, void * child); + + pANTLR3_STRING (*toStringTree) (struct ANTLR3_BASE_TREE_struct * tree); + + pANTLR3_STRING (*toString) (struct ANTLR3_BASE_TREE_struct * tree); + + void (*freshenPACIndexesAll) (struct ANTLR3_BASE_TREE_struct * tree); + + void (*freshenPACIndexes) (struct ANTLR3_BASE_TREE_struct * tree, ANTLR3_UINT32 offset); + + void (*reuse) (struct ANTLR3_BASE_TREE_struct * tree); + + void (*free) (struct ANTLR3_BASE_TREE_struct * tree); + +} + ANTLR3_BASE_TREE; + +#ifdef __cplusplus +} +#endif + + +#endif diff --git a/antlr/libantlr3c-3.4/include/antlr3basetreeadaptor.h b/antlr/libantlr3c-3.4/include/antlr3basetreeadaptor.h new file mode 100644 index 0000000..bf9a72a --- /dev/null +++ b/antlr/libantlr3c-3.4/include/antlr3basetreeadaptor.h @@ -0,0 +1,152 @@ +/** \file + * Definition of the ANTLR3 base tree adaptor. + */ + +#ifndef _ANTLR3_BASE_TREE_ADAPTOR_H +#define _ANTLR3_BASE_TREE_ADAPTOR_H + +// [The "BSD licence"] +// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC +// http://www.temporal-wave.com +// http://www.linkedin.com/in/jimidle +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. The name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include +#include +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct ANTLR3_BASE_TREE_ADAPTOR_struct +{ + /** Pointer to any enclosing structure/interface that + * contains this structure. + */ + void * super; + + /** We need a string factory for creating imaginary tokens, we take this + * from the stream we are supplied to walk. + */ + pANTLR3_STRING_FACTORY strFactory; + + /* And we also need a token factory for creating imaginary tokens + * this is also taken from the input source. + */ + pANTLR3_TOKEN_FACTORY tokenFactory; + + /// If set to something other than NULL, then this structure is + /// points to an instance of the debugger interface. In general, the + /// debugger is only referenced internally in recovery/error operations + /// so that it does not cause overhead by having to check this pointer + /// in every function/method + /// + pANTLR3_DEBUG_EVENT_LISTENER debugger; + + void * (*nilNode) (struct ANTLR3_BASE_TREE_ADAPTOR_struct * adaptor); + + + void * (*dupTree) (struct ANTLR3_BASE_TREE_ADAPTOR_struct * adaptor, void * tree); + void * (*dupTreeTT) (struct ANTLR3_BASE_TREE_ADAPTOR_struct * adaptor, void * t, void * tree); + + void (*addChild) (struct ANTLR3_BASE_TREE_ADAPTOR_struct * adaptor, void * t, void * child); + void (*addChildToken) (struct ANTLR3_BASE_TREE_ADAPTOR_struct * adaptor, void * t, pANTLR3_COMMON_TOKEN child); + void (*setParent) (struct ANTLR3_BASE_TREE_ADAPTOR_struct * adaptor, void * child, void * parent); + void * (*getParent) (struct ANTLR3_BASE_TREE_ADAPTOR_struct * adaptor, void * child); + + void * (*errorNode) (struct ANTLR3_BASE_TREE_ADAPTOR_struct * adaptor, pANTLR3_TOKEN_STREAM tnstream, pANTLR3_COMMON_TOKEN startToken, pANTLR3_COMMON_TOKEN stopToken, pANTLR3_EXCEPTION e); + ANTLR3_BOOLEAN (*isNilNode) (struct ANTLR3_BASE_TREE_ADAPTOR_struct * adaptor, void * t); + + void * (*becomeRoot) (struct ANTLR3_BASE_TREE_ADAPTOR_struct * adaptor, void * newRoot, void * oldRoot); + + void * (*rulePostProcessing) (struct ANTLR3_BASE_TREE_ADAPTOR_struct * adaptor, void * root); + + void * (*becomeRootToken) (struct ANTLR3_BASE_TREE_ADAPTOR_struct * adaptor, void * newRoot, void * oldRoot); + + void * (*create) (struct ANTLR3_BASE_TREE_ADAPTOR_struct * adaptor, pANTLR3_COMMON_TOKEN payload); + void * (*createTypeToken) (struct ANTLR3_BASE_TREE_ADAPTOR_struct * adaptor, ANTLR3_UINT32 tokenType, pANTLR3_COMMON_TOKEN fromToken); + void * (*createTypeTokenText) (struct ANTLR3_BASE_TREE_ADAPTOR_struct * adaptor, ANTLR3_UINT32 tokenType, pANTLR3_COMMON_TOKEN fromToken, pANTLR3_UINT8 text); + void * (*createTypeText) (struct ANTLR3_BASE_TREE_ADAPTOR_struct * adaptor, ANTLR3_UINT32 tokenType, pANTLR3_UINT8 text); + + void * (*dupNode) (struct ANTLR3_BASE_TREE_ADAPTOR_struct * adaptor, void * treeNode); + + ANTLR3_UINT32 (*getType) (struct ANTLR3_BASE_TREE_ADAPTOR_struct * adaptor, void * t); + + void (*setType) (struct ANTLR3_BASE_TREE_ADAPTOR_struct * adaptor, void * t, ANTLR3_UINT32 type); + + pANTLR3_STRING (*getText) (struct ANTLR3_BASE_TREE_ADAPTOR_struct * adaptor, void * t); + + void (*setText) (struct ANTLR3_BASE_TREE_ADAPTOR_struct * adaptor, pANTLR3_STRING t); + void (*setText8) (struct ANTLR3_BASE_TREE_ADAPTOR_struct * adaptor, pANTLR3_UINT8 t); + + void * (*getChild) (struct ANTLR3_BASE_TREE_ADAPTOR_struct * adaptor, void * t, ANTLR3_UINT32 i); + void (*setChild) (struct ANTLR3_BASE_TREE_ADAPTOR_struct * adaptor, void * t, ANTLR3_UINT32 i, void * child); + void (*deleteChild) (struct ANTLR3_BASE_TREE_ADAPTOR_struct * adaptor, void * t, ANTLR3_UINT32 i); + void (*setChildIndex) (struct ANTLR3_BASE_TREE_ADAPTOR_struct * adaptor, void * t, ANTLR3_UINT32 i); + ANTLR3_INT32 (*getChildIndex) (struct ANTLR3_BASE_TREE_ADAPTOR_struct * adaptor, void * t); + + ANTLR3_UINT32 (*getChildCount) (struct ANTLR3_BASE_TREE_ADAPTOR_struct * adaptor, void *); + + ANTLR3_UINT32 (*getUniqueID) (struct ANTLR3_BASE_TREE_ADAPTOR_struct * adaptor, void *); + + pANTLR3_COMMON_TOKEN (*createToken) (struct ANTLR3_BASE_TREE_ADAPTOR_struct * adaptor, ANTLR3_UINT32 tokenType, pANTLR3_UINT8 text); + pANTLR3_COMMON_TOKEN (*createTokenFromToken) (struct ANTLR3_BASE_TREE_ADAPTOR_struct * adaptor, pANTLR3_COMMON_TOKEN fromToken); + pANTLR3_COMMON_TOKEN (*getToken) (struct ANTLR3_BASE_TREE_ADAPTOR_struct * adaptor, void * t); + + void (*setTokenBoundaries) (struct ANTLR3_BASE_TREE_ADAPTOR_struct * adaptor, void * t, pANTLR3_COMMON_TOKEN startToken, pANTLR3_COMMON_TOKEN stopToken); + + ANTLR3_MARKER (*getTokenStartIndex) (struct ANTLR3_BASE_TREE_ADAPTOR_struct * adaptor, void * t); + + ANTLR3_MARKER (*getTokenStopIndex) (struct ANTLR3_BASE_TREE_ADAPTOR_struct * adaptor, void * t); + + void (*setDebugEventListener)(struct ANTLR3_BASE_TREE_ADAPTOR_struct * adaptor, pANTLR3_DEBUG_EVENT_LISTENER debugger); + + /// Produce a DOT (see graphviz freeware suite) from a base tree + /// + pANTLR3_STRING (*makeDot) (struct ANTLR3_BASE_TREE_ADAPTOR_struct * adaptor, void * theTree); + + /// Replace from start to stop child index of parent with t, which might + /// be a list. Number of children may be different + /// after this call. + /// + /// If parent is null, don't do anything; must be at root of overall tree. + /// Can't replace whatever points to the parent externally. Do nothing. + /// + void (*replaceChildren) (struct ANTLR3_BASE_TREE_ADAPTOR_struct * adaptor, void * parent, ANTLR3_INT32 startChildIndex, ANTLR3_INT32 stopChildIndex, void * t); + + void (*free) (struct ANTLR3_BASE_TREE_ADAPTOR_struct * adaptor); + +} + ANTLR3_TREE_ADAPTOR, *pANTLR3_TREE_ADAPTOR; +#ifdef __cplusplus +} +#endif + +#endif diff --git a/antlr/libantlr3c-3.4/include/antlr3bitset.h b/antlr/libantlr3c-3.4/include/antlr3bitset.h new file mode 100644 index 0000000..7d816ab --- /dev/null +++ b/antlr/libantlr3c-3.4/include/antlr3bitset.h @@ -0,0 +1,119 @@ +/** + * \file + * Defines the basic structures of an ANTLR3 bitset. this is a C version of the + * cut down Bitset class provided with the java version of antlr 3. + * + * + */ +#ifndef _ANTLR3_BITSET_H +#define _ANTLR3_BITSET_H + +// [The "BSD licence"] +// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC +// http://www.temporal-wave.com +// http://www.linkedin.com/in/jimidle +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. The name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include +#include + +/** How many bits in the elements + */ +#define ANTLR3_BITSET_BITS 64 + +/** How many bits in a nible of bits + */ +#define ANTLR3_BITSET_NIBBLE 4 + +/** log2 of ANTLR3_BITSET_BITS 2^ANTLR3_BITSET_LOG_BITS = ANTLR3_BITSET_BITS + */ +#define ANTLR3_BITSET_LOG_BITS 6 + +/** We will often need to do a mod operator (i mod nbits). + * For powers of two, this mod operation is the + * same as: + * - (i & (nbits-1)). + * + * Since mod is relatively slow, we use an easily + * precomputed mod mask to do the mod instead. + */ +#define ANTLR3_BITSET_MOD_MASK ANTLR3_BITSET_BITS - 1 + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct ANTLR3_BITSET_LIST_struct +{ + /// Pointer to the allocated array of bits for this bit set, which + /// is an array of 64 bit elements (of the architecture). If we find a + /// machine/C compiler that does not know anything about 64 bit values + /// then it should be easy enough to produce a 32 bit (or less) version + /// of the bitset code. Note that the pointer here may be static if laid down + /// by the code generation, and it must be copied if it is to be manipulated + /// to perform followset calculations. + /// + pANTLR3_BITWORD bits; + + /// Length of the current bit set in ANTLR3_UINT64 units. + /// + ANTLR3_UINT32 length; +} + ANTLR3_BITSET_LIST; + +typedef struct ANTLR3_BITSET_struct +{ + /// The actual bits themselves + /// + ANTLR3_BITSET_LIST blist; + + pANTLR3_BITSET (*clone) (struct ANTLR3_BITSET_struct * inSet); + pANTLR3_BITSET (*bor) (struct ANTLR3_BITSET_struct * bitset1, struct ANTLR3_BITSET_struct * bitset2); + void (*borInPlace) (struct ANTLR3_BITSET_struct * bitset, struct ANTLR3_BITSET_struct * bitset2); + ANTLR3_UINT32 (*size) (struct ANTLR3_BITSET_struct * bitset); + void (*add) (struct ANTLR3_BITSET_struct * bitset, ANTLR3_INT32 bit); + void (*grow) (struct ANTLR3_BITSET_struct * bitset, ANTLR3_INT32 newSize); + ANTLR3_BOOLEAN (*equals) (struct ANTLR3_BITSET_struct * bitset1, struct ANTLR3_BITSET_struct * bitset2); + ANTLR3_BOOLEAN (*isMember) (struct ANTLR3_BITSET_struct * bitset, ANTLR3_UINT32 bit); + ANTLR3_UINT32 (*numBits) (struct ANTLR3_BITSET_struct * bitset); + void (*remove) (struct ANTLR3_BITSET_struct * bitset, ANTLR3_UINT32 bit); + ANTLR3_BOOLEAN (*isNilNode) (struct ANTLR3_BITSET_struct * bitset); + pANTLR3_INT32 (*toIntList) (struct ANTLR3_BITSET_struct * bitset); + + void (*free) (struct ANTLR3_BITSET_struct * bitset); + + +} + ANTLR3_BITSET; + +#ifdef __cplusplus +} +#endif + + + +#endif + diff --git a/antlr/libantlr3c-3.4/include/antlr3collections.h b/antlr/libantlr3c-3.4/include/antlr3collections.h new file mode 100644 index 0000000..7c73e36 --- /dev/null +++ b/antlr/libantlr3c-3.4/include/antlr3collections.h @@ -0,0 +1,513 @@ +#ifndef ANTLR3COLLECTIONS_H +#define ANTLR3COLLECTIONS_H + +// [The "BSD licence"] +// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC +// http://www.temporal-wave.com +// http://www.linkedin.com/in/jimidle +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. The name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include +#include + +#define ANTLR3_HASH_TYPE_INT 0 /**< Indicates the hashed file has integer keys */ +#define ANTLR3_HASH_TYPE_STR 1 /**< Indicates the hashed file has numeric keys */ + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct ANTLR3_HASH_KEY_struct +{ + ANTLR3_UINT8 type; /**< One of ##ANTLR3_HASH_TYPE_INT or ##ANTLR3_HASH_TYPE_STR */ + + union + { + pANTLR3_UINT8 sKey; /**< Used if type is ANTLR3_HASH_TYPE_STR */ + ANTLR3_INTKEY iKey; /**< used if type is ANTLR3_HASH_TYPE_INT */ + } + key; + +} ANTLR3_HASH_KEY, *pANTLR3_HASH_KEY; + +/** Internal structure representing an element in a hash bucket. + * Stores the original key so that duplicate keys can be rejected + * if necessary, and contains function can be supported. If the hash key + * could be unique I would have invented the perfect compression algorithm ;-) + */ +typedef struct ANTLR3_HASH_ENTRY_struct +{ + /** Key that created this particular entry + */ + ANTLR3_HASH_KEY keybase; + + /** Pointer to the data for this particular entry + */ + void * data; + + /** Pointer to routine that knows how to release the memory + * structure pointed at by data. If this is NULL then we assume + * that the data pointer does not need to be freed when the entry + * is deleted from the table. + */ + void (ANTLR3_CDECL *free)(void * data); + + /** Pointer to the next entry in this bucket if there + * is one. Sometimes different keys will hash to the same bucket (especially + * if the number of buckets is small). We could implement dual hashing algorithms + * to minimize this, but that seems over the top for what this is needed for. + */ + struct ANTLR3_HASH_ENTRY_struct * nextEntry; +} + ANTLR3_HASH_ENTRY; + +/** Internal structure of a hash table bucket, which tracks + * all keys that hash to the same bucket. + */ +typedef struct ANTLR3_HASH_BUCKET_struct +{ + /** Pointer to the first entry in the bucket (if any, it + * may be NULL). Duplicate entries are chained from + * here. + */ + pANTLR3_HASH_ENTRY entries; + +} + ANTLR3_HASH_BUCKET; + +/** Structure that tracks a hash table + */ +typedef struct ANTLR3_HASH_TABLE_struct +{ + /** Indicates whether the table allows duplicate keys + */ + int allowDups; + + /** Number of buckets available in this table + */ + ANTLR3_UINT32 modulo; + + /** Points to the memory where the array of buckets + * starts. + */ + pANTLR3_HASH_BUCKET buckets; + + /** How many elements currently exist in the table. + */ + ANTLR3_UINT32 count; + + /** Whether the hash table should strdup the keys it is given or not. + */ + ANTLR3_BOOLEAN doStrdup; + + /** Pointer to function to completely delete this table + */ + void (*free) (struct ANTLR3_HASH_TABLE_struct * table); + + /* String keyed hashtable functions */ + void (*del) (struct ANTLR3_HASH_TABLE_struct * table, void * key); + pANTLR3_HASH_ENTRY (*remove) (struct ANTLR3_HASH_TABLE_struct * table, void * key); + void * (*get) (struct ANTLR3_HASH_TABLE_struct * table, void * key); + ANTLR3_INT32 (*put) (struct ANTLR3_HASH_TABLE_struct * table, void * key, void * element, void (ANTLR3_CDECL *freeptr)(void *)); + + /* Integer based hash functions */ + void (*delI) (struct ANTLR3_HASH_TABLE_struct * table, ANTLR3_INTKEY key); + pANTLR3_HASH_ENTRY (*removeI) (struct ANTLR3_HASH_TABLE_struct * table, ANTLR3_INTKEY key); + void * (*getI) (struct ANTLR3_HASH_TABLE_struct * table, ANTLR3_INTKEY key); + ANTLR3_INT32 (*putI) (struct ANTLR3_HASH_TABLE_struct * table, ANTLR3_INTKEY key, void * element, void (ANTLR3_CDECL *freeptr)(void *)); + + ANTLR3_UINT32 (*size) (struct ANTLR3_HASH_TABLE_struct * table); +} + ANTLR3_HASH_TABLE; + + +/** Internal structure representing an enumeration of a table. + * This is returned by antlr3Enumeration() + * Allows the programmer to traverse the table in hash order without + * knowing what is in the actual table. + * + * Note that it is up to the caller to ensure that the table + * structure does not change in the hash bucket that is currently being + * enumerated as this structure just tracks the next pointers in the + * bucket series. + */ +typedef struct ANTLR3_HASH_ENUM_struct +{ + /* Pointer to the table we are enumerating + */ + pANTLR3_HASH_TABLE table; + + /* Bucket we are currently enumerating (if NULL then we are done) + */ + ANTLR3_UINT32 bucket; + + /* Next entry to return, if NULL, then move to next bucket if any + */ + pANTLR3_HASH_ENTRY entry; + + /* Interface + */ + int (*next) (struct ANTLR3_HASH_ENUM_struct * en, pANTLR3_HASH_KEY *key, void ** data); + void (*free) (struct ANTLR3_HASH_ENUM_struct * table); +} + ANTLR3_HASH_ENUM; + +/** Structure that represents a LIST collection + */ +typedef struct ANTLR3_LIST_struct +{ + /** Hash table that is storing the list elements + */ + pANTLR3_HASH_TABLE table; + + void (*free) (struct ANTLR3_LIST_struct * list); + void (*del) (struct ANTLR3_LIST_struct * list, ANTLR3_INTKEY key); + void * (*get) (struct ANTLR3_LIST_struct * list, ANTLR3_INTKEY key); + void * (*remove) (struct ANTLR3_LIST_struct * list, ANTLR3_INTKEY key); + ANTLR3_INT32 (*add) (struct ANTLR3_LIST_struct * list, void * element, void (ANTLR3_CDECL *freeptr)(void *)); + ANTLR3_INT32 (*put) (struct ANTLR3_LIST_struct * list, ANTLR3_INTKEY key, void * element, void (ANTLR3_CDECL *freeptr)(void *)); + ANTLR3_UINT32 (*size) (struct ANTLR3_LIST_struct * list); + +} + ANTLR3_LIST; + +/** Structure that represents a Stack collection + */ +typedef struct ANTLR3_STACK_struct +{ + /** List that supports the stack structure + */ + pANTLR3_VECTOR vector; + + /** Used for quick access to the top of the stack + */ + void * top; + void (*free) (struct ANTLR3_STACK_struct * stack); + void * (*pop) (struct ANTLR3_STACK_struct * stack); + void * (*get) (struct ANTLR3_STACK_struct * stack, ANTLR3_INTKEY key); + ANTLR3_BOOLEAN (*push) (struct ANTLR3_STACK_struct * stack, void * element, void (ANTLR3_CDECL *freeptr)(void *)); + ANTLR3_UINT32 (*size) (struct ANTLR3_STACK_struct * stack); + void * (*peek) (struct ANTLR3_STACK_struct * stack); + +} + ANTLR3_STACK; + +/* Structure that represents a vector element + */ +typedef struct ANTLR3_VECTOR_ELEMENT_struct +{ + void * element; + void (ANTLR3_CDECL *freeptr)(void *); +} + ANTLR3_VECTOR_ELEMENT, *pANTLR3_VECTOR_ELEMENT; + +#define ANTLR3_VECTOR_INTERNAL_SIZE 16 +/* Structure that represents a vector collection. A vector is a simple list + * that contains a pointer to the element and a pointer to a function that + * that can free the element if it is removed. It auto resizes but does not + * use hash techniques as it is referenced by a simple numeric index. It is not a + * sparse list, so if any element is deleted, then the ones following are moved + * down in memory and the count is adjusted. + */ +typedef struct ANTLR3_VECTOR_struct +{ + /** Array of pointers to vector elements + */ + pANTLR3_VECTOR_ELEMENT elements; + + /** Number of entries currently in the list; + */ + ANTLR3_UINT32 count; + + /** Many times, a vector holds just a few nodes in an AST and it + * is too much overhead to malloc the space for elements so + * at the expense of a few bytes of memory, we hold the first + * few elements internally. It means we must copy them when + * we grow beyond this initial size, but that is less overhead than + * the malloc/free callas we would otherwise require. + */ + ANTLR3_VECTOR_ELEMENT internal[ANTLR3_VECTOR_INTERNAL_SIZE]; + + /** Indicates if the structure was made by a factory, in which + * case only the factory can free the memory for the actual vector, + * though the vector free function is called and will recurse through its + * entries calling any free pointers for each entry. + */ + ANTLR3_BOOLEAN factoryMade; + + /** Total number of entries in elements at any point in time + */ + ANTLR3_UINT32 elementsSize; + + void (ANTLR3_CDECL *free) (struct ANTLR3_VECTOR_struct * vector); + void (*del) (struct ANTLR3_VECTOR_struct * vector, ANTLR3_UINT32 entry); + void * (*get) (struct ANTLR3_VECTOR_struct * vector, ANTLR3_UINT32 entry); + void * (*remove) (struct ANTLR3_VECTOR_struct * vector, ANTLR3_UINT32 entry); + void (*clear) (struct ANTLR3_VECTOR_struct * vector); + ANTLR3_BOOLEAN (*swap) (struct ANTLR3_VECTOR_struct *, ANTLR3_UINT32 entry1, ANTLR3_UINT32 entry2); + ANTLR3_UINT32 (*add) (struct ANTLR3_VECTOR_struct * vector, void * element, void (ANTLR3_CDECL *freeptr)(void *)); + ANTLR3_UINT32 (*set) (struct ANTLR3_VECTOR_struct * vector, ANTLR3_UINT32 entry, void * element, void (ANTLR3_CDECL *freeptr)(void *), ANTLR3_BOOLEAN freeExisting); + ANTLR3_UINT32 (*size) (struct ANTLR3_VECTOR_struct * vector); +} + ANTLR3_VECTOR; + +/** Default vector pool size if otherwise unspecified + */ +#define ANTLR3_FACTORY_VPOOL_SIZE 256 + +/** Structure that tracks vectors in a vector and auto deletes the vectors + * in the vector factory when closed. + */ +typedef struct ANTLR3_VECTOR_FACTORY_struct +{ + + /** List of all vector pools allocated so far + */ + pANTLR3_VECTOR *pools; + + /** Count of the vector pools allocated so far (current active pool) + */ + ANTLR3_INT32 thisPool; + + /** The next vector available in the pool + */ + ANTLR3_UINT32 nextVector; + + /** Trick to quickly initialize a new vector via memcpy and not a function call + */ + ANTLR3_VECTOR unTruc; + + /** Consumers from the factory can release a factory produced vector + * back to the factory so that it may be reused (and thus conserve memory) + * by another caller. The available vectors are stored here. Note that + * the only vectors avaible in the free chain are produced by this factory, so they + * need not be explicitly freed when the factory is closed. + */ + pANTLR3_STACK freeStack; + + /** Function to close the vector factory + */ + void (*close) (struct ANTLR3_VECTOR_FACTORY_struct * factory); + + /** Function to supply a new vector + */ + pANTLR3_VECTOR (*newVector) (struct ANTLR3_VECTOR_FACTORY_struct * factory); + + /// Function to return a vector to the factory for reuse + /// + void (*returnVector) (struct ANTLR3_VECTOR_FACTORY_struct * factory, pANTLR3_VECTOR vector); + +} +ANTLR3_VECTOR_FACTORY; + + +/* -------------- TRIE Interfaces ---------------- */ + + +/** Structure that holds the payload entry in an ANTLR3_INT_TRIE or ANTLR3_STRING_TRIE + */ +typedef struct ANTLR3_TRIE_ENTRY_struct +{ + ANTLR3_UINT32 type; + void (ANTLR3_CDECL *freeptr)(void *); + union + { + ANTLR3_INTKEY intVal; + void * ptr; + } data; + + struct ANTLR3_TRIE_ENTRY_struct * next; /* Allows duplicate entries for same key in insertion order */ +} +ANTLR3_TRIE_ENTRY, * pANTLR3_TRIE_ENTRY; + + +/** Structure that defines an element/node in an ANTLR3_INT_TRIE + */ +typedef struct ANTLR3_INT_TRIE_NODE_struct +{ + ANTLR3_UINT32 bitNum; /**< This is the left/right bit index for traversal along the nodes */ + ANTLR3_INTKEY key; /**< This is the actual key that the entry represents if it is a terminal node */ + pANTLR3_TRIE_ENTRY buckets; /**< This is the data bucket(s) that the key indexes, which may be NULL */ + struct ANTLR3_INT_TRIE_NODE_struct * leftN; /**< Pointer to the left node from here when sKey & bitNum = 0 */ + struct ANTLR3_INT_TRIE_NODE_struct * rightN; /**< Pointer to the right node from here when sKey & bitNum, = 1 */ +} + ANTLR3_INT_TRIE_NODE, * pANTLR3_INT_TRIE_NODE; + +/** Structure that defines an ANTLR3_INT_TRIE. For this particular implementation, + * as you might expect, the key is turned into a "string" by looking at bit(key, depth) + * of the integer key. Using 64 bit keys gives us a depth limit of 64 (or bit 0..63) + * and potentially a huge trie. This is the algorithm for a Patricia Trie. + * Note also that this trie [can] accept multiple entries for the same key and is + * therefore a kind of elastic bucket patricia trie. + * + * If you find this code useful, please feel free to 'steal' it for any purpose + * as covered by the BSD license under which ANTLR is issued. You can cut the code + * but as the ANTLR library is only about 50K (Windows Vista), you might find it + * easier to just link the library. Please keep all comments and licenses and so on + * in any version of this you create of course. + * + * Jim Idle. + * + */ +typedef struct ANTLR3_INT_TRIE_struct +{ + pANTLR3_INT_TRIE_NODE root; /* Root node of this integer trie */ + pANTLR3_INT_TRIE_NODE current; /* Used to traverse the TRIE with the next() method */ + ANTLR3_UINT32 count; /* Current entry count */ + ANTLR3_BOOLEAN allowDups; /* Whether this trie accepts duplicate keys */ + + + pANTLR3_TRIE_ENTRY (*get) (struct ANTLR3_INT_TRIE_struct * trie, ANTLR3_INTKEY key); + ANTLR3_BOOLEAN (*del) (struct ANTLR3_INT_TRIE_struct * trie, ANTLR3_INTKEY key); + ANTLR3_BOOLEAN (*add) (struct ANTLR3_INT_TRIE_struct * trie, ANTLR3_INTKEY key, ANTLR3_UINT32 type, ANTLR3_INTKEY intVal, void * data, void (ANTLR3_CDECL *freeptr)(void *)); + void (*free) (struct ANTLR3_INT_TRIE_struct * trie); + +} + ANTLR3_INT_TRIE; + +/** + * A topological sort system that given a set of dependencies of a node m on node n, + * can sort them in dependency order. This is a generally useful utility object + * that does not care what the things are it is sorting. Generally the set + * to be sorted will be numeric indexes into some other structure such as an ANTLR3_VECTOR. + * I have provided a sort method that given ANTLR3_VECTOR as an input will sort + * the vector entries in place, as well as a sort method that just returns an + * array of the sorted noded indexes, in case you are not sorting ANTLR3_VECTORS but + * some set of your own device. + * + * Of the two main algorithms that could be used, I chose to use the depth first + * search for unvisited nodes as a) This runs in linear time, and b) it is what + * we used in the ANTLR Tool to perform a topological sort of the input grammar files + * based on their dependencies. + */ +typedef struct ANTLR3_TOPO_struct +{ + /** + * A vector of vectors of edges, built by calling the addEdge method() + * to indicate that node number n depends on node number m. Each entry in the vector + * contains a bitset, which has a bit index set for each node upon which the + * entry node depends. + */ + pANTLR3_BITSET * edges; + + /** + * A vector used to build up the sorted output order. Note that + * as the vector contains UINT32 then the maximum node index is + * 'limited' to 2^32, as nodes should be zero based. + */ + pANTLR3_UINT32 sorted; + + /** + * A vector used to detect cycles in the edge dependecies. It is used + * as a stack and each time we descend a node to one of its edges we + * add the node into this stack. If we find a node that we have already + * visited in the stack, then it means there wasa cycle such as 9->8->1->9 + * as the only way a node can be on the stack is if we are currently + * descnding from it as we remove it from the stack as we exit from + * descending its dependencies + */ + pANTLR3_UINT32 cycle; + + /** + * A flag that indicates the algorithm found a cycle in the edges + * such as 9->8->1->9 + * If this flag is set after you have called one of the sort routines + * then the detected cycle will be contained in the cycle array and + * cycleLimit will point to the one after the last entry in the cycle. + */ + ANTLR3_BOOLEAN hasCycle; + + /** + * A watermark used to accumulate potential cycles in the cycle array. + * This should be zero when we are done. Check hasCycle after calling one + * of the sort methods and if it is ANTLR3_TRUE then you can find the cycle + * in cycle[0]...cycle[cycleMark-1] + */ + ANTLR3_UINT32 cycleMark; + + /** + * One more than the largest node index that is contained in edges/sorted. + */ + ANTLR3_UINT32 limit; + + /** + * The set of visited nodes as determined by a set entry in + * the bitmap. + */ + pANTLR3_BITSET visited; + + /** + * A method that adds an edge from one node to another. An edge + * of n -> m indicates that node n is dependent on node m. Note that + * while building these edges, it is perfectly OK to add nodes out of + * sequence. So, if you have edges: + * + * 3 -> 0 + * 2 -> 1 + * 1 -> 3 + * + * The you can add them in that order and so add node 3 before nodes 2 and 1 + * + */ + void (*addEdge) (struct ANTLR3_TOPO_struct * topo, ANTLR3_UINT32 edge, ANTLR3_UINT32 dependency); + + + /** + * A method that returns a pointer to an array of sorted node indexes. + * The array is sorted in topological sorted order. Note that the array + * is only as large as the largest node index you created an edge for. This means + * that if you had an input of 32 nodes, but that largest node with an edge + * was 16, then the returned array will be the sorted order of the first 16 + * nodes and the last 16 nodes of your array are basically fine as they are + * as they had no dependencies and do not need any particular sort order. + * + * NB: If the structure that contains the array is freed, then the sorted + * array will be freed too so you should use the value of limit to + * make a long term copy of this array if you do not want to keep the topo + * structure around as well. + */ + pANTLR3_UINT32 (*sortToArray) (struct ANTLR3_TOPO_struct * topo); + + /** + * A method that sorts the supplied ANTLR3_VECTOR in place based + * on the previously supplied edge data. + */ + void (*sortVector) (struct ANTLR3_TOPO_struct * topo, pANTLR3_VECTOR v); + + /** + * A method to free this structure and any associated memory. + */ + void (*free) (struct ANTLR3_TOPO_struct * topo); +} + ANTLR3_TOPO; + +#ifdef __cplusplus +} +#endif + +#endif + + diff --git a/antlr/libantlr3c-3.4/include/antlr3commontoken.h b/antlr/libantlr3c-3.4/include/antlr3commontoken.h new file mode 100644 index 0000000..c48068e --- /dev/null +++ b/antlr/libantlr3c-3.4/include/antlr3commontoken.h @@ -0,0 +1,367 @@ +/** \file + * \brief Defines the interface for a common token. + * + * All token streams should provide their tokens using an instance + * of this common token. A custom pointer is provided, wher you may attach + * a further structure to enhance the common token if you feel the need + * to do so. The C runtime will assume that a token provides implementations + * of the interface functions, but all of them may be rplaced by your own + * implementation if you require it. + */ +#ifndef _ANTLR3_COMMON_TOKEN_H +#define _ANTLR3_COMMON_TOKEN_H + +// [The "BSD licence"] +// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC +// http://www.temporal-wave.com +// http://www.linkedin.com/in/jimidle +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. The name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include + +/** How many tokens to allocate at once in the token factory + */ +#define ANTLR3_FACTORY_POOL_SIZE 1024 + +/* Base token types, which all lexer/parser tokens come after in sequence. + */ + +/** Indicator of an invalid token + */ +#define ANTLR3_TOKEN_INVALID 0 + +#define ANTLR3_EOR_TOKEN_TYPE 1 + +/** Imaginary token type to cause a traversal of child nodes in a tree parser + */ +#define ANTLR3_TOKEN_DOWN 2 + +/** Imaginary token type to signal the end of a stream of child nodes. + */ +#define ANTLR3_TOKEN_UP 3 + +/** First token that can be used by users/generated code + */ + +#define ANTLR3_MIN_TOKEN_TYPE ANTLR3_TOKEN_UP + 1 + +/** End of file token + */ +#define ANTLR3_TOKEN_EOF (ANTLR3_CHARSTREAM_EOF & 0xFFFFFFFF) + +/** Default channel for a token + */ +#define ANTLR3_TOKEN_DEFAULT_CHANNEL 0 + +/** Reserved channel number for a HIDDEN token - a token that + * is hidden from the parser. + */ +#define HIDDEN 99 + +#ifdef __cplusplus +extern "C" { +#endif + +// Indicates whether this token is carrying: +// +// State | Meaning +// ------+-------------------------------------- +// 0 | Nothing (neither rewrite text, nor setText) +// 1 | char * to user supplied rewrite text +// 2 | pANTLR3_STRING because of setText or similar action +// +#define ANTLR3_TEXT_NONE 0 +#define ANTLR3_TEXT_CHARP 1 +#define ANTLR3_TEXT_STRING 2 + +/** The definition of an ANTLR3 common token structure, which all implementations + * of a token stream should provide, installing any further structures in the + * custom pointer element of this structure. + * + * \remark + * Token streams are in essence provided by lexers or other programs that serve + * as lexers. + */ +typedef struct ANTLR3_COMMON_TOKEN_struct +{ + /** The actual type of this token + */ + ANTLR3_UINT32 type; + + /** Indicates that a token was produced from the token factory and therefore + * the the freeToken() method should not do anything itself because + * token factory is responsible for deleting it. + */ + ANTLR3_BOOLEAN factoryMade; + + /// A string factory that we can use if we ever need the text of a token + /// and need to manufacture a pANTLR3_STRING + /// + pANTLR3_STRING_FACTORY strFactory; + + /** The line number in the input stream where this token was derived from + */ + ANTLR3_UINT32 line; + + /** The offset into the input stream that the line in which this + * token resides starts. + */ + void * lineStart; + + /** The character position in the line that this token was derived from + */ + ANTLR3_INT32 charPosition; + + /** The virtual channel that this token exists in. + */ + ANTLR3_UINT32 channel; + + /** Pointer to the input stream that this token originated in. + */ + pANTLR3_INPUT_STREAM input; + + /** What the index of this token is, 0, 1, .., n-2, n-1 tokens + */ + ANTLR3_MARKER index; + + /** The character offset in the input stream where the text for this token + * starts. + */ + ANTLR3_MARKER start; + + /** The character offset in the input stream where the text for this token + * stops. + */ + ANTLR3_MARKER stop; + + /// Indicates whether this token is carrying: + /// + /// State | Meaning + /// ------+-------------------------------------- + /// 0 | Nothing (neither rewrite text, nor setText) + /// 1 | char * to user supplied rewrite text + /// 2 | pANTLR3_STRING because of setText or similar action + /// + /// Affects the union structure tokText below + /// (uses 32 bit so alignment is always good) + /// + ANTLR3_UINT32 textState; + + union + { + /// Pointer that is used when the token just has a pointer to + /// a char *, such as when a rewrite of an imaginary token supplies + /// a string in the grammar. No sense in constructing a pANTLR3_STRING just + /// for that, as mostly the text will not be accessed - if it is, then + /// we will build a pANTLR3_STRING for it a that point. + /// + pANTLR3_UCHAR chars; + + /// Some token types actually do carry around their associated text, hence + /// (*getText)() will return this pointer if it is not NULL + /// + pANTLR3_STRING text; + } + tokText; + + /** Because it is a bit more of a hassle to override an ANTLR3_COMMON_TOKEN + * as the standard structure for a token, a number of user programmable + * elements are allowed in a token. This is one of them. + */ + ANTLR3_UINT32 user1; + + /** Because it is a bit more of a hassle to override an ANTLR3_COMMON_TOKEN + * as the standard structure for a token, a number of user programmable + * elements are allowed in a token. This is one of them. + */ + ANTLR3_UINT32 user2; + + /** Because it is a bit more of a hassle to override an ANTLR3_COMMON_TOKEN + * as the standard structure for a token, a number of user programmable + * elements are allowed in a token. This is one of them. + */ + ANTLR3_UINT32 user3; + + /** Pointer to a custom element that the ANTLR3 programmer may define and install + */ + void * custom; + + /** Pointer to a function that knows how to free the custom structure when the + * token is destroyed. + */ + void (*freeCustom)(void * custom); + + /* ============================== + * API + */ + + /** Pointer to function that returns the text pointer of a token, use + * toString() if you want a pANTLR3_STRING version of the token. + */ + pANTLR3_STRING (*getText)(struct ANTLR3_COMMON_TOKEN_struct * token); + + /** Pointer to a function that 'might' be able to set the text associated + * with a token. Imaginary tokens such as an ANTLR3_CLASSIC_TOKEN may actually + * do this, however many tokens such as ANTLR3_COMMON_TOKEN do not actaully have + * strings associated with them but just point into the current input stream. These + * tokens will implement this function with a function that errors out (probably + * drastically. + */ + void (*setText)(struct ANTLR3_COMMON_TOKEN_struct * token, pANTLR3_STRING text); + + /** Pointer to a function that 'might' be able to set the text associated + * with a token. Imaginary tokens such as an ANTLR3_CLASSIC_TOKEN may actually + * do this, however many tokens such as ANTLR3_COMMON_TOKEN do not actully have + * strings associated with them but just point into the current input stream. These + * tokens will implement this function with a function that errors out (probably + * drastically. + */ + void (*setText8)(struct ANTLR3_COMMON_TOKEN_struct * token, pANTLR3_UINT8 text); + + /** Pointer to a function that returns the token type of this token + */ + ANTLR3_UINT32 (*getType)(struct ANTLR3_COMMON_TOKEN_struct * token); + + /** Pointer to a function that sets the type of this token + */ + void (*setType)(struct ANTLR3_COMMON_TOKEN_struct * token, ANTLR3_UINT32 ttype); + + /** Pointer to a function that gets the 'line' number where this token resides + */ + ANTLR3_UINT32 (*getLine)(struct ANTLR3_COMMON_TOKEN_struct * token); + + /** Pointer to a function that sets the 'line' number where this token reside + */ + void (*setLine)(struct ANTLR3_COMMON_TOKEN_struct * token, ANTLR3_UINT32 line); + + /** Pointer to a function that gets the offset in the line where this token exists + */ + ANTLR3_INT32 (*getCharPositionInLine) (struct ANTLR3_COMMON_TOKEN_struct * token); + + /** Pointer to a function that sets the offset in the line where this token exists + */ + void (*setCharPositionInLine) (struct ANTLR3_COMMON_TOKEN_struct * token, ANTLR3_INT32 pos); + + /** Pointer to a function that gets the channel that this token was placed in (parsers + * can 'tune' to these channels. + */ + ANTLR3_UINT32 (*getChannel) (struct ANTLR3_COMMON_TOKEN_struct * token); + + /** Pointer to a function that sets the channel that this token should belong to + */ + void (*setChannel) (struct ANTLR3_COMMON_TOKEN_struct * token, ANTLR3_UINT32 channel); + + /** Pointer to a function that returns an index 0...n-1 of the token in the token + * input stream. + */ + ANTLR3_MARKER (*getTokenIndex) (struct ANTLR3_COMMON_TOKEN_struct * token); + + /** Pointer to a function that can set the token index of this token in the token + * input stream. + */ + void (*setTokenIndex) (struct ANTLR3_COMMON_TOKEN_struct * token, ANTLR3_MARKER); + + /** Pointer to a function that gets the start index in the input stream for this token. + */ + ANTLR3_MARKER (*getStartIndex) (struct ANTLR3_COMMON_TOKEN_struct * token); + + /** Pointer to a function that sets the start index in the input stream for this token. + */ + void (*setStartIndex) (struct ANTLR3_COMMON_TOKEN_struct * token, ANTLR3_MARKER index); + + /** Pointer to a function that gets the stop index in the input stream for this token. + */ + ANTLR3_MARKER (*getStopIndex) (struct ANTLR3_COMMON_TOKEN_struct * token); + + /** Pointer to a function that sets the stop index in the input stream for this token. + */ + void (*setStopIndex) (struct ANTLR3_COMMON_TOKEN_struct * token, ANTLR3_MARKER index); + + /** Pointer to a function that returns this token as a text representation that can be + * printed with embedded control codes such as \n replaced with the printable sequence "\\n" + * This also yields a string structure that can be used more easily than the pointer to + * the input stream in certain situations. + */ + pANTLR3_STRING (*toString) (struct ANTLR3_COMMON_TOKEN_struct * token); +} + ANTLR3_COMMON_TOKEN; + +/** \brief ANTLR3 Token factory interface to create lots of tokens efficiently + * rather than creating and freeing lots of little bits of memory. + */ +typedef struct ANTLR3_TOKEN_FACTORY_struct +{ + /** Pointers to the array of tokens that this factory has produced so far + */ + pANTLR3_COMMON_TOKEN *pools; + + /** Current pool tokens we are allocating from + */ + ANTLR3_INT32 thisPool; + + /** Maximum pool count we have available + */ + ANTLR3_INT32 maxPool; + + /** The next token to throw out from the pool, will cause a new pool allocation + * if this exceeds the available tokenCount + */ + ANTLR3_UINT32 nextToken; + + /** Trick to initialize tokens and their API quickly, we set up this token when the + * factory is created, then just copy the memory it uses into the new token. + */ + ANTLR3_COMMON_TOKEN unTruc; + + /** Pointer to an input stream that is using this token factory (may be NULL) + * which will be assigned to the tokens automatically. + */ + pANTLR3_INPUT_STREAM input; + + /** Pointer to a function that returns a new token + */ + pANTLR3_COMMON_TOKEN (*newToken) (struct ANTLR3_TOKEN_FACTORY_struct * factory); + + /** Pointer to a function that resets the factory so you can reuse the pools it + * has laready allocated + */ + void (*reset) (struct ANTLR3_TOKEN_FACTORY_struct * factory); + + /** Pointer to a function that changes teh curent inptu stream so that + * new tokens are created with reference to their originating text. + */ + void (*setInputStream) (struct ANTLR3_TOKEN_FACTORY_struct * factory, pANTLR3_INPUT_STREAM input); + /** Pointer to a function the destroys the factory + */ + void (*close) (struct ANTLR3_TOKEN_FACTORY_struct * factory); +} + ANTLR3_TOKEN_FACTORY; + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/antlr/libantlr3c-3.4/include/antlr3commontree.h b/antlr/libantlr3c-3.4/include/antlr3commontree.h new file mode 100644 index 0000000..1516ecc --- /dev/null +++ b/antlr/libantlr3c-3.4/include/antlr3commontree.h @@ -0,0 +1,167 @@ +/** Interface for an ANTLR3 common tree which is what gets + * passed around by the AST producing parser. + */ + +#ifndef _ANTLR3_COMMON_TREE_H +#define _ANTLR3_COMMON_TREE_H + +// [The "BSD licence"] +// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC +// http://www.temporal-wave.com +// http://www.linkedin.com/in/jimidle +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. The name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct ANTLR3_COMMON_TREE_struct +{ + + /// Not used by ANTLR, but if a super structure is created above + /// this structure, it can be used to point to the start of the super + /// structure, where additional data and function pointers can be stored. + /// + void * super; + + /// Start token index that encases this tree + /// + ANTLR3_MARKER startIndex; + + /// End token that encases this tree + /// + ANTLR3_MARKER stopIndex; + + /// A single token, this is the payload for the tree + /// + pANTLR3_COMMON_TOKEN token; + + /// Points to the node that has this node as a child. + /// If this is NULL, then this is the root node. + /// + pANTLR3_COMMON_TREE parent; + + /// What index is this particular node in the child list it + /// belongs to? + /// + ANTLR3_INT32 childIndex; + + /// Pointer to the tree factory that manufactured this + /// token. This can be used by duplication methods and so on + /// to manufacture another auto-tracked common tree structure + /// + pANTLR3_ARBORETUM factory; + + /// An encapsulated BASE TREE structure (NOT a pointer) + /// that performs a lot of the dirty work of node management + /// To this we add just a few functions that are specific to the + /// payload. You can further abstract common tree so long + /// as you always have a baseTree pointer in the top structure + /// and copy it from the next one down. + /// So, lets say we have a structure JIMS_TREE. + /// It needs an ANTLR3_BASE_TREE that will support all the + /// general tree duplication stuff. + /// It needs a ANTLR3_COMMON_TREE structure embedded or completely + /// provides the equivalent interface. + /// It provides it's own methods and data. + /// To create a new one of these, the function provided to + /// the tree adaptor (see comments there) should allocate the + /// memory for a new JIMS_TREE structure, then call + /// antlr3InitCommonTree() + /// antlr3BaseTreeNew() + /// The interfaces for BASE_TREE and COMMON_TREE will then + /// be initialized. You then call and you can override them or just init + /// JIMS_TREE (note that the base tree in common tree will be ignored) + /// just the top level base tree is used). Codegen will take care of the rest. + /// + ANTLR3_BASE_TREE baseTree; + +} + ANTLR3_COMMON_TREE; + +/// \brief ANTLR3 Tree factory interface to create lots of trees efficiently +/// rather than creating and freeing lots of little bits of memory. +/// +typedef struct ANTLR3_ARBORETUM_struct +{ + /// Pointers to the array of tokens that this factory has produced so far + /// + pANTLR3_COMMON_TREE *pools; + + /// Current pool tokens we are allocating from + /// + ANTLR3_INT32 thisPool; + + /// The next token to throw out from the pool, will cause a new pool allocation + /// if this exceeds the available tokenCount + /// + ANTLR3_UINT32 nextTree; + + /// Trick to initialize tokens and their API quickly, we set up this token when the + /// factory is created, then just copy the memory it uses into the new token. + /// + ANTLR3_COMMON_TREE unTruc; + + /// Pointer to a vector factory that is used to create child list vectors + /// for any child nodes that need them. This means that we auto track the + /// vectors and auto free them when we close the factory. It also means + /// that all rewriting trees can use the same tree factory and the same + /// vector factory and we do not dup any nodes unless we must do so + /// explicitly because of context such as an empty rewrite stream and + /// ->IMAGINARY[ID] so on. This makes memory tracking much simpler and + /// tempts no errors. + /// + pANTLR3_VECTOR_FACTORY vFactory; + + /// A resuse stack for reclaiming Nil nodes that were used in rewrites + /// and are now dead. The nilNode() method will eat one of these before + /// creating a new node. + /// + pANTLR3_STACK nilStack; + + /// Pointer to a function that returns a new tree + /// + pANTLR3_BASE_TREE (*newTree) (struct ANTLR3_ARBORETUM_struct * factory); + pANTLR3_BASE_TREE (*newFromTree) (struct ANTLR3_ARBORETUM_struct * factory, pANTLR3_COMMON_TREE tree); + pANTLR3_BASE_TREE (*newFromToken) (struct ANTLR3_ARBORETUM_struct * factory, pANTLR3_COMMON_TOKEN token); + + /// Pointer to a function the destroys the factory + /// + void (*close) (struct ANTLR3_ARBORETUM_struct * factory); +} + ANTLR3_ARBORETUM; + +#ifdef __cplusplus +} +#endif + +#endif + + diff --git a/antlr/libantlr3c-3.4/include/antlr3commontreeadaptor.h b/antlr/libantlr3c-3.4/include/antlr3commontreeadaptor.h new file mode 100644 index 0000000..4827997 --- /dev/null +++ b/antlr/libantlr3c-3.4/include/antlr3commontreeadaptor.h @@ -0,0 +1,70 @@ +/** \file + * Definition of the ANTLR3 common tree adaptor. + */ + +#ifndef _ANTLR3_COMMON_TREE_ADAPTOR_H +#define _ANTLR3_COMMON_TREE_ADAPTOR_H + +// [The "BSD licence"] +// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC +// http://www.temporal-wave.com +// http://www.linkedin.com/in/jimidle +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. The name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include +#include +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct ANTLR3_COMMON_TREE_ADAPTOR_struct +{ + /** Any enclosing structure/class can use this pointer to point to its own interface. + */ + void * super; + + /** Base interface implementation, embedded structure + */ + ANTLR3_TREE_ADAPTOR baseAdaptor; + + /** Tree factory for producing new nodes as required without needing to track + * memory allocation per node. + */ + pANTLR3_ARBORETUM arboretum; + +} + ANTLR3_COMMON_TREE_ADAPTOR; + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/antlr/libantlr3c-3.4/include/antlr3commontreenodestream.h b/antlr/libantlr3c-3.4/include/antlr3commontreenodestream.h new file mode 100644 index 0000000..beb0534 --- /dev/null +++ b/antlr/libantlr3c-3.4/include/antlr3commontreenodestream.h @@ -0,0 +1,336 @@ +/// \file +/// Definition of the ANTLR3 common tree node stream. +/// + +#ifndef _ANTLR3_COMMON_TREE_NODE_STREAM__H +#define _ANTLR3_COMMON_TREE_NODE_STREAM__H + +// [The "BSD licence"] +// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC +// http://www.temporal-wave.com +// http://www.linkedin.com/in/jimidle +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. The name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include +#include +#include +#include +#include +#include + +/// Token buffer initial size settings ( will auto increase) +/// +#define DEFAULT_INITIAL_BUFFER_SIZE 100 +#define INITIAL_CALL_STACK_SIZE 10 + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct ANTLR3_TREE_NODE_STREAM_struct +{ + /// Any interface that implements this interface (is a + /// super structure containing this structure), may store the pointer + /// to itself here in the super pointer, which is not used by + /// the tree node stream. This will point to an implementation + /// of ANTLR3_COMMON_TREE_NODE_STREAM in this case. + /// + pANTLR3_COMMON_TREE_NODE_STREAM ctns; + + /// All input streams implement the ANTLR3_INT_STREAM interface... + /// + pANTLR3_INT_STREAM istream; + + /// Get tree node at current input pointer + i ahead where i=1 is next node. + /// i<0 indicates nodes in the past. So LT(-1) is previous node, but + /// implementations are not required to provide results for k < -1. + /// LT(0) is undefined. For i>=n, return null. + /// Return NULL for LT(0) and any index that results in an absolute address + /// that is negative (beyond the start of the list). + /// + /// This is analogous to the LT() method of the TokenStream, but this + /// returns a tree node instead of a token. Makes code gen identical + /// for both parser and tree grammars. :) + /// + pANTLR3_BASE_TREE (*_LT) (struct ANTLR3_TREE_NODE_STREAM_struct * tns, ANTLR3_INT32 k); + + /// Where is this stream pulling nodes from? This is not the name, but + /// the object that provides node objects. + /// + pANTLR3_BASE_TREE (*getTreeSource) (struct ANTLR3_TREE_NODE_STREAM_struct * tns); + + /// What adaptor can tell me how to interpret/navigate nodes and + /// trees. E.g., get text of a node. + /// + pANTLR3_BASE_TREE_ADAPTOR (*getTreeAdaptor) (struct ANTLR3_TREE_NODE_STREAM_struct * tns); + + /// As we flatten the tree, we use UP, DOWN nodes to represent + /// the tree structure. When debugging we need unique nodes + /// so we have to instantiate new ones. When doing normal tree + /// parsing, it's slow and a waste of memory to create unique + /// navigation nodes. Default should be false; + /// + void (*setUniqueNavigationNodes) (struct ANTLR3_TREE_NODE_STREAM_struct * tns, ANTLR3_BOOLEAN uniqueNavigationNodes); + + pANTLR3_STRING (*toString) (struct ANTLR3_TREE_NODE_STREAM_struct * tns); + + /// Return the text of all nodes from start to stop, inclusive. + /// If the stream does not buffer all the nodes then it can still + /// walk recursively from start until stop. You can always return + /// null or "" too, but users should not access $ruleLabel.text in + /// an action of course in that case. + /// + pANTLR3_STRING (*toStringSS) (struct ANTLR3_TREE_NODE_STREAM_struct * tns, pANTLR3_BASE_TREE start, pANTLR3_BASE_TREE stop); + + /// Return the text of all nodes from start to stop, inclusive, into the + /// supplied buffer. + /// If the stream does not buffer all the nodes then it can still + /// walk recursively from start until stop. You can always return + /// null or "" too, but users should not access $ruleLabel.text in + /// an action of course in that case. + /// + void (*toStringWork) (struct ANTLR3_TREE_NODE_STREAM_struct * tns, pANTLR3_BASE_TREE start, pANTLR3_BASE_TREE stop, pANTLR3_STRING buf); + + /// Release up any and all space the the interface allocate, including for this structure. + /// + void (*free) (struct ANTLR3_TREE_NODE_STREAM_struct * tns); + + /// Get a tree node at an absolute index i; 0..n-1. + /// If you don't want to buffer up nodes, then this method makes no + /// sense for you. + /// + pANTLR3_BASE_TREE (*get) (struct ANTLR3_TREE_NODE_STREAM_struct * tns, ANTLR3_INT32 i); + + // REWRITING TREES (used by tree parser) + + /// Replace from start to stop child index of parent with t, which might + /// be a list. Number of children may be different + /// after this call. The stream is notified because it is walking the + /// tree and might need to know you are monkeying with the underlying + /// tree. Also, it might be able to modify the node stream to avoid + /// restreaming for future phases. + /// + /// If parent is null, don't do anything; must be at root of overall tree. + /// Can't replace whatever points to the parent externally. Do nothing. + /// + void (*replaceChildren) (struct ANTLR3_TREE_NODE_STREAM_struct * tns, pANTLR3_BASE_TREE parent, ANTLR3_INT32 startChildIndex, ANTLR3_INT32 stopChildIndex, pANTLR3_BASE_TREE t); + +} + ANTLR3_TREE_NODE_STREAM; + +typedef struct ANTLR3_COMMON_TREE_NODE_STREAM_struct +{ + /// Any interface that implements this interface (is a + /// super structure containing this structure), may store the pointer + /// to itself here in the super pointer, which is not used by + /// the common tree node stream. + /// + void * super; + + /// Pointer to the tree node stream interface + /// + pANTLR3_TREE_NODE_STREAM tnstream; + + /// String factory for use by anything that wishes to create strings + /// such as a tree representation or some copy of the text etc. + /// + pANTLR3_STRING_FACTORY stringFactory; + + /// Dummy tree node that indicates a descent into a child + /// tree. Initialized by a call to create a new interface. + /// + ANTLR3_COMMON_TREE DOWN; + + /// Dummy tree node that indicates a descent up to a parent + /// tree. Initialized by a call to create a new interface. + /// + ANTLR3_COMMON_TREE UP; + + /// Dummy tree node that indicates the termination point of the + /// tree. Initialized by a call to create a new interface. + /// + ANTLR3_COMMON_TREE EOF_NODE; + + /// Dummy node that is returned if we need to indicate an invalid node + /// for any reason. + /// + ANTLR3_COMMON_TREE INVALID_NODE; + + /// The complete mapping from stream index to tree node. + /// This buffer includes pointers to DOWN, UP, and EOF nodes. + /// It is built upon ctor invocation. The elements are type + /// Object as we don't what the trees look like. + /// + /// Load upon first need of the buffer so we can set token types + /// of interest for reverseIndexing. Slows us down a wee bit to + /// do all of the if p==-1 testing everywhere though, though in C + /// you won't really be able to measure this. + /// + /// Must be freed when the tree node stream is torn down. + /// + pANTLR3_VECTOR nodes; + + /// If set to ANTLR3_TRUE then the navigation nodes UP, DOWN are + /// duplicated rather than reused within the tree. + /// + ANTLR3_BOOLEAN uniqueNavigationNodes; + + /// Which tree are we navigating ? + /// + pANTLR3_BASE_TREE root; + + /// Pointer to tree adaptor interface that manipulates/builds + /// the tree. + /// + pANTLR3_BASE_TREE_ADAPTOR adaptor; + + /// As we walk down the nodes, we must track parent nodes so we know + /// where to go after walking the last child of a node. When visiting + /// a child, push current node and current index (current index + /// is first stored in the tree node structure to avoid two stacks. + /// + pANTLR3_STACK nodeStack; + + /// The current index into the nodes vector of the current tree + /// we are parsing and possibly rewriting. + /// + ANTLR3_INT32 p; + + /// Which node are we currently visiting? + /// + pANTLR3_BASE_TREE currentNode; + + /// Which node did we last visit? Used for LT(-1) + /// + pANTLR3_BASE_TREE previousNode; + + /// Which child are we currently visiting? If -1 we have not visited + /// this node yet; next consume() request will set currentIndex to 0. + /// + ANTLR3_INT32 currentChildIndex; + + /// What node index did we just consume? i=0..n-1 for n node trees. + /// IntStream.next is hence 1 + this value. Size will be same. + /// + ANTLR3_MARKER absoluteNodeIndex; + + /// Buffer tree node stream for use with LT(i). This list grows + /// to fit new lookahead depths, but consume() wraps like a circular + /// buffer. + /// + pANTLR3_BASE_TREE * lookAhead; + + /// Number of elements available in the lookahead buffer at any point in + /// time. This is the current size of the array. + /// + ANTLR3_UINT32 lookAheadLength; + + /// lookAhead[head] is the first symbol of lookahead, LT(1). + /// + ANTLR3_UINT32 head; + + /// Add new lookahead at lookahead[tail]. tail wraps around at the + /// end of the lookahead buffer so tail could be less than head. + /// + ANTLR3_UINT32 tail; + + /// Calls to mark() may be nested so we have to track a stack of + /// them. The marker is an index into this stack. Index 0 is + /// the first marker. This is a List + /// + pANTLR3_VECTOR markers; + + // INTERFACE + // + void (*fill) (struct ANTLR3_COMMON_TREE_NODE_STREAM_struct * ctns, ANTLR3_INT32 k); + + void (*addLookahead) (struct ANTLR3_COMMON_TREE_NODE_STREAM_struct * ctns, pANTLR3_BASE_TREE node); + + ANTLR3_BOOLEAN (*hasNext) (struct ANTLR3_COMMON_TREE_NODE_STREAM_struct * ctns); + + pANTLR3_BASE_TREE (*next) (struct ANTLR3_COMMON_TREE_NODE_STREAM_struct * ctns); + + pANTLR3_BASE_TREE (*handleRootnode) (struct ANTLR3_COMMON_TREE_NODE_STREAM_struct * ctns); + + pANTLR3_BASE_TREE (*visitChild) (struct ANTLR3_COMMON_TREE_NODE_STREAM_struct * ctns, ANTLR3_UINT32 child); + + void (*addNavigationNode) (struct ANTLR3_COMMON_TREE_NODE_STREAM_struct * ctns, ANTLR3_UINT32 ttype); + + pANTLR3_BASE_TREE (*newDownNode) (struct ANTLR3_COMMON_TREE_NODE_STREAM_struct * ctns); + + pANTLR3_BASE_TREE (*newUpNode) (struct ANTLR3_COMMON_TREE_NODE_STREAM_struct * ctns); + + void (*walkBackToMostRecentNodeWithUnvisitedChildren) + (struct ANTLR3_COMMON_TREE_NODE_STREAM_struct * ctns); + + ANTLR3_BOOLEAN (*hasUniqueNavigationNodes) (struct ANTLR3_COMMON_TREE_NODE_STREAM_struct * ctns); + + ANTLR3_UINT32 (*getLookaheadSize) (struct ANTLR3_COMMON_TREE_NODE_STREAM_struct * ctns); + + void (*push) (struct ANTLR3_COMMON_TREE_NODE_STREAM_struct * ctns, ANTLR3_INT32 index); + + ANTLR3_INT32 (*pop) (struct ANTLR3_COMMON_TREE_NODE_STREAM_struct * ctns); + + void (*reset) (struct ANTLR3_COMMON_TREE_NODE_STREAM_struct * ctns); + + void (*free) (struct ANTLR3_COMMON_TREE_NODE_STREAM_struct * ctns); + + /// Indicates whether this node stream was derived from a prior + /// node stream to be used by a rewriting tree parser for instance. + /// If this flag is set to ANTLR3_TRUE, then when this stream is + /// closed it will not free the root tree as this tree always + /// belongs to the origniating node stream. + /// + ANTLR3_BOOLEAN isRewriter; + +} + ANTLR3_COMMON_TREE_NODE_STREAM; + +/** This structure is used to save the state information in the treenodestream + * when walking ahead with cyclic DFA or for syntactic predicates, + * we need to record the state of the tree node stream. This + * class wraps up the current state of the CommonTreeNodeStream. + * Calling mark() will push another of these on the markers stack. + */ +typedef struct ANTLR3_TREE_WALK_STATE_struct +{ + ANTLR3_UINT32 currentChildIndex; + ANTLR3_MARKER absoluteNodeIndex; + pANTLR3_BASE_TREE currentNode; + pANTLR3_BASE_TREE previousNode; + ANTLR3_UINT32 nodeStackSize; + pANTLR3_BASE_TREE * lookAhead; + ANTLR3_UINT32 lookAheadLength; + ANTLR3_UINT32 tail; + ANTLR3_UINT32 head; +} + ANTLR3_TREE_WALK_STATE; + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/antlr/libantlr3c-3.4/include/antlr3convertutf.h b/antlr/libantlr3c-3.4/include/antlr3convertutf.h new file mode 100644 index 0000000..79cc82c --- /dev/null +++ b/antlr/libantlr3c-3.4/include/antlr3convertutf.h @@ -0,0 +1,176 @@ +/* + * Copyright 2001-2004 Unicode, Inc. + * + * Disclaimer + * + * This source code is provided as is by Unicode, Inc. No claims are + * made as to fitness for any particular purpose. No warranties of any + * kind are expressed or implied. The recipient agrees to determine + * applicability of information provided. If this file has been + * purchased on magnetic or optical media from Unicode, Inc., the + * sole remedy for any claim will be exchange of defective media + * within 90 days of receipt. + * + * Limitations on Rights to Redistribute This Code + * + * Unicode, Inc. hereby grants the right to freely use the information + * supplied in this file in the creation of products supporting the + * Unicode Standard, and to make copies of this file in any form + * for internal or external distribution as long as this notice + * remains attached. + */ + +/* --------------------------------------------------------------------- + + Conversions between UTF32, UTF-16, and UTF-8. Header file. + + Several functions are included here, forming a complete set of + conversions between the three formats. UTF-7 is not included + here, but is handled in a separate source file. + + Each of these routines takes pointers to input buffers and output + buffers. The input buffers are const. + + Each routine converts the text between *sourceStart and sourceEnd, + putting the result into the buffer between *targetStart and + targetEnd. Note: the end pointers are *after* the last item: e.g. + *(sourceEnd - 1) is the last item. + + The return result indicates whether the conversion was successful, + and if not, whether the problem was in the source or target buffers. + (Only the first encountered problem is indicated.) + + After the conversion, *sourceStart and *targetStart are both + updated to point to the end of last text successfully converted in + the respective buffers. + + Input parameters: + sourceStart - pointer to a pointer to the source buffer. + The contents of this are modified on return so that + it points at the next thing to be converted. + targetStart - similarly, pointer to pointer to the target buffer. + sourceEnd, targetEnd - respectively pointers to the ends of the + two buffers, for overflow checking only. + + These conversion functions take a ConversionFlags argument. When this + flag is set to strict, both irregular sequences and isolated surrogates + will cause an error. When the flag is set to lenient, both irregular + sequences and isolated surrogates are converted. + + Whether the flag is strict or lenient, all illegal sequences will cause + an error return. This includes sequences such as: , , + or in UTF-8, and values above 0x10FFFF in UTF-32. Conformant code + must check for illegal sequences. + + When the flag is set to lenient, characters over 0x10FFFF are converted + to the replacement character; otherwise (when the flag is set to strict) + they constitute an error. + + Output parameters: + The value "sourceIllegal" is returned from some routines if the input + sequence is malformed. When "sourceIllegal" is returned, the source + value will point to the illegal value that caused the problem. E.g., + in UTF-8 when a sequence is malformed, it points to the start of the + malformed sequence. + + Author: Mark E. Davis, 1994. + Rev History: Rick McGowan, fixes & updates May 2001. + Fixes & updates, Sept 2001. + +------------------------------------------------------------------------ */ + +/* --------------------------------------------------------------------- + The following 4 definitions are compiler-specific. + The C standard does not guarantee that wchar_t has at least + 16 bits, so wchar_t is no less portable than unsigned short! + All should be unsigned values to avoid sign extension during + bit mask & shift operations. +------------------------------------------------------------------------ */ + + +// Changes for ANTLR3 - Jim Idle, January 2008. +// builtin types defined for Unicode types changed to +// aliases for the types that are system determined by +// ANTLR at compile time. +// +// typedef unsigned long UTF32; /* at least 32 bits */ +// typedef unsigned short UTF16; /* at least 16 bits */ +// typedef unsigned char UTF8; /* typically 8 bits */ +// typedef unsigned char Boolean; /* 0 or 1 */ + +#ifndef _ANTLR3_CONVERTUTF_H +#define _ANTLR3_CONVERTUTF_H + +#include + +typedef ANTLR3_UINT32 UTF32; /* at least 32 bits */ +typedef ANTLR3_UINT16 UTF16; /* at least 16 bits */ +typedef ANTLR3_UINT8 UTF8; /* typically 8 bits */ + +/* Some fundamental constants */ +#define UNI_REPLACEMENT_CHAR (UTF32)0x0000FFFD +#define UNI_MAX_BMP (UTF32)0x0000FFFF +#define UNI_MAX_UTF16 (UTF32)0x0010FFFF +#define UNI_MAX_UTF32 (UTF32)0x7FFFFFFF +#define UNI_MAX_LEGAL_UTF32 (UTF32)0x0010FFFF + +#define UNI_SUR_HIGH_START (UTF32)0xD800 +#define UNI_SUR_HIGH_END (UTF32)0xDBFF +#define UNI_SUR_LOW_START (UTF32)0xDC00 +#define UNI_SUR_LOW_END (UTF32)0xDFFF +#define false ANTLR3_FALSE +#define true ANTLR3_TRUE +#define halfShift ((UTF32)10) +#define halfBase ((UTF32)0x0010000UL) +#define halfMask ((UTF32)0x3FFUL) + +typedef enum { + conversionOK, /* conversion successful */ + sourceExhausted, /* partial character in source, but hit end */ + targetExhausted, /* insuff. room in target for conversion */ + sourceIllegal /* source sequence is illegal/malformed */ +} ConversionResult; + +typedef enum { + strictConversion = 0, + lenientConversion +} ConversionFlags; + +/* This is for C++ and does no harm in C */ +#ifdef __cplusplus +extern "C" { +#endif + +ConversionResult ConvertUTF8toUTF16 ( + const UTF8** sourceStart, const UTF8* sourceEnd, + UTF16** targetStart, UTF16* targetEnd, ConversionFlags flags); + +ConversionResult ConvertUTF16toUTF8 ( + const UTF16** sourceStart, const UTF16* sourceEnd, + UTF8** targetStart, UTF8* targetEnd, ConversionFlags flags); + +ConversionResult ConvertUTF8toUTF32 ( + const UTF8** sourceStart, const UTF8* sourceEnd, + UTF32** targetStart, UTF32* targetEnd, ConversionFlags flags); + +ConversionResult ConvertUTF32toUTF8 ( + const UTF32** sourceStart, const UTF32* sourceEnd, + UTF8** targetStart, UTF8* targetEnd, ConversionFlags flags); + +ConversionResult ConvertUTF16toUTF32 ( + const UTF16** sourceStart, const UTF16* sourceEnd, + UTF32** targetStart, UTF32* targetEnd, ConversionFlags flags); + +ConversionResult ConvertUTF32toUTF16 ( + const UTF32** sourceStart, const UTF32* sourceEnd, + UTF16** targetStart, UTF16* targetEnd, ConversionFlags flags); + +ANTLR3_BOOLEAN isLegalUTF8Sequence(const UTF8 *source, const UTF8 *sourceEnd); + +#ifdef __cplusplus +} +#endif + +#endif + +/* --------------------------------------------------------------------- */ diff --git a/antlr/libantlr3c-3.4/include/antlr3cyclicdfa.h b/antlr/libantlr3c-3.4/include/antlr3cyclicdfa.h new file mode 100644 index 0000000..78708a0 --- /dev/null +++ b/antlr/libantlr3c-3.4/include/antlr3cyclicdfa.h @@ -0,0 +1,97 @@ +/// Definition of a cyclic dfa structure such that it can be +/// initialized at compile time and have only a single +/// runtime function that can deal with all cyclic dfa +/// structures and show Java how it is done ;-) +/// +#ifndef ANTLR3_CYCLICDFA_H +#define ANTLR3_CYCLICDFA_H + +// [The "BSD licence"] +// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC +// http://www.temporal-wave.com +// http://www.linkedin.com/in/jimidle +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. The name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include +#include + +#ifdef __cplusplus +extern "C" { + +// If this header file is included as part of a generated recognizer that +// is being compiled as if it were C++, and this is Windows, then the const elements +// of the structure cause the C++ compiler to (rightly) point out that +// there can be no instantiation of the structure because it needs a constructor +// that can initialize the data, however these structures are not +// useful for C++ as they are pre-generated and static in the recognizer. +// So, we turn off those warnings, which are only at /W4 anyway. +// +#ifdef ANTLR3_WINDOWS +#pragma warning (push) +#pragma warning (disable : 4510) +#pragma warning (disable : 4512) +#pragma warning (disable : 4610) +#endif +#endif + +typedef struct ANTLR3_CYCLIC_DFA_struct +{ + /// Decision number that a particular static structure + /// represents. + /// + const ANTLR3_INT32 decisionNumber; + + /// What this decision represents + /// + const pANTLR3_UCHAR description; + + ANTLR3_INT32 (*specialStateTransition) (void * ctx, pANTLR3_BASE_RECOGNIZER recognizer, pANTLR3_INT_STREAM is, struct ANTLR3_CYCLIC_DFA_struct * dfa, ANTLR3_INT32 s); + + ANTLR3_INT32 (*specialTransition) (void * ctx, pANTLR3_BASE_RECOGNIZER recognizer, pANTLR3_INT_STREAM is, struct ANTLR3_CYCLIC_DFA_struct * dfa, ANTLR3_INT32 s); + + ANTLR3_INT32 (*predict) (void * ctx, pANTLR3_BASE_RECOGNIZER recognizer, pANTLR3_INT_STREAM is, struct ANTLR3_CYCLIC_DFA_struct * dfa); + + const ANTLR3_INT32 * const eot; + const ANTLR3_INT32 * const eof; + const ANTLR3_INT32 * const min; + const ANTLR3_INT32 * const max; + const ANTLR3_INT32 * const accept; + const ANTLR3_INT32 * const special; + const ANTLR3_INT32 * const * const transition; + +} + ANTLR3_CYCLIC_DFA; + +typedef ANTLR3_INT32 (*CDFA_SPECIAL_FUNC) (void * , pANTLR3_BASE_RECOGNIZER , pANTLR3_INT_STREAM , struct ANTLR3_CYCLIC_DFA_struct * , ANTLR3_INT32); + +#ifdef __cplusplus +} +#ifdef ANTLR3_WINDOWS +#pragma warning (pop) +#endif +#endif + +#endif diff --git a/antlr/libantlr3c-3.4/include/antlr3debugeventlistener.h b/antlr/libantlr3c-3.4/include/antlr3debugeventlistener.h new file mode 100644 index 0000000..c9cd6ce --- /dev/null +++ b/antlr/libantlr3c-3.4/include/antlr3debugeventlistener.h @@ -0,0 +1,398 @@ +/** + * \file + * The definition of all debugging events that a recognizer can trigger. + * + * \remark + * From the java implementation by Terence Parr... + * I did not create a separate AST debugging interface as it would create + * lots of extra classes and DebugParser has a dbg var defined, which makes + * it hard to change to ASTDebugEventListener. I looked hard at this issue + * and it is easier to understand as one monolithic event interface for all + * possible events. Hopefully, adding ST debugging stuff won't be bad. Leave + * for future. 4/26/2006. + */ + +#ifndef ANTLR3_DEBUG_EVENT_LISTENER_H +#define ANTLR3_DEBUG_EVENT_LISTENER_H + +// [The "BSD licence"] +// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC +// http://www.temporal-wave.com +// http://www.linkedin.com/in/jimidle +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. The name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include +#include +#include + + +/// Default debugging port +/// +#define DEFAULT_DEBUGGER_PORT 0xBFCC; + +#ifdef __cplusplus +extern "C" { +#endif + +/** The ANTLR3 debugging interface for communicating with ANLTR Works. Function comments + * mostly taken from the Java version. + */ +typedef struct ANTLR3_DEBUG_EVENT_LISTENER_struct +{ + /// The port number which the debug listener should listen on for a connection + /// + ANTLR3_UINT32 port; + + /// The socket structure we receive after a successful accept on the serverSocket + /// + SOCKET socket; + + /** The version of the debugging protocol supported by the providing + * instance of the debug event listener. + */ + int PROTOCOL_VERSION; + + /// The name of the grammar file that we are debugging + /// + pANTLR3_STRING grammarFileName; + + /// Indicates whether we have already connected or not + /// + ANTLR3_BOOLEAN initialized; + + /// Used to serialize the values of any particular token we need to + /// send back to the debugger. + /// + pANTLR3_STRING tokenString; + + + /// Allows the debug event system to access the adapter in use + /// by the recognizer, if this is a tree parser of some sort. + /// + pANTLR3_BASE_TREE_ADAPTOR adaptor; + + /// Wait for a connection from the debugger and initiate the + /// debugging session. + /// + ANTLR3_BOOLEAN (*handshake) (pANTLR3_DEBUG_EVENT_LISTENER delboy); + + /** The parser has just entered a rule. No decision has been made about + * which alt is predicted. This is fired AFTER init actions have been + * executed. Attributes are defined and available etc... + */ + void (*enterRule) (pANTLR3_DEBUG_EVENT_LISTENER delboy, const char * grammarFileName, const char * ruleName); + + /** Because rules can have lots of alternatives, it is very useful to + * know which alt you are entering. This is 1..n for n alts. + */ + void (*enterAlt) (pANTLR3_DEBUG_EVENT_LISTENER delboy, int alt); + + /** This is the last thing executed before leaving a rule. It is + * executed even if an exception is thrown. This is triggered after + * error reporting and recovery have occurred (unless the exception is + * not caught in this rule). This implies an "exitAlt" event. + */ + void (*exitRule) (pANTLR3_DEBUG_EVENT_LISTENER delboy, const char * grammarFileName, const char * ruleName); + + /** Track entry into any (...) subrule other EBNF construct + */ + void (*enterSubRule) (pANTLR3_DEBUG_EVENT_LISTENER delboy, int decisionNumber); + + void (*exitSubRule) (pANTLR3_DEBUG_EVENT_LISTENER delboy, int decisionNumber); + + /** Every decision, fixed k or arbitrary, has an enter/exit event + * so that a GUI can easily track what LT/consume events are + * associated with prediction. You will see a single enter/exit + * subrule but multiple enter/exit decision events, one for each + * loop iteration. + */ + void (*enterDecision) (pANTLR3_DEBUG_EVENT_LISTENER delboy, int decisionNumber); + + void (*exitDecision) (pANTLR3_DEBUG_EVENT_LISTENER delboy, int decisionNumber); + + /** An input token was consumed; matched by any kind of element. + * Trigger after the token was matched by things like match(), matchAny(). + */ + void (*consumeToken) (pANTLR3_DEBUG_EVENT_LISTENER delboy, pANTLR3_COMMON_TOKEN t); + + /** An off-channel input token was consumed. + * Trigger after the token was matched by things like match(), matchAny(). + * (unless of course the hidden token is first stuff in the input stream). + */ + void (*consumeHiddenToken) (pANTLR3_DEBUG_EVENT_LISTENER delboy, pANTLR3_COMMON_TOKEN t); + + /** Somebody (anybody) looked ahead. Note that this actually gets + * triggered by both LA and LT calls. The debugger will want to know + * which Token object was examined. Like consumeToken, this indicates + * what token was seen at that depth. A remote debugger cannot look + * ahead into a file it doesn't have so LT events must pass the token + * even if the info is redundant. + */ + void (*LT) (pANTLR3_DEBUG_EVENT_LISTENER delboy, int i, pANTLR3_COMMON_TOKEN t); + + /** The parser is going to look arbitrarily ahead; mark this location, + * the token stream's marker is sent in case you need it. + */ + void (*mark) (pANTLR3_DEBUG_EVENT_LISTENER delboy, ANTLR3_MARKER marker); + + /** After an arbitrarily long lookahead as with a cyclic DFA (or with + * any backtrack), this informs the debugger that stream should be + * rewound to the position associated with marker. + */ + void (*rewind) (pANTLR3_DEBUG_EVENT_LISTENER delboy, ANTLR3_MARKER marker); + + /** Rewind to the input position of the last marker. + * Used currently only after a cyclic DFA and just + * before starting a sem/syn predicate to get the + * input position back to the start of the decision. + * Do not "pop" the marker off the state. mark(i) + * and rewind(i) should balance still. + */ + void (*rewindLast) (pANTLR3_DEBUG_EVENT_LISTENER delboy); + + void (*beginBacktrack) (pANTLR3_DEBUG_EVENT_LISTENER delboy, int level); + + void (*endBacktrack) (pANTLR3_DEBUG_EVENT_LISTENER delboy, int level, ANTLR3_BOOLEAN successful); + + /** To watch a parser move through the grammar, the parser needs to + * inform the debugger what line/charPos it is passing in the grammar. + * For now, this does not know how to switch from one grammar to the + * other and back for island grammars etc... + * + * This should also allow breakpoints because the debugger can stop + * the parser whenever it hits this line/pos. + */ + void (*location) (pANTLR3_DEBUG_EVENT_LISTENER delboy, int line, int pos); + + /** A recognition exception occurred such as NoViableAltException. I made + * this a generic event so that I can alter the exception hierarchy later + * without having to alter all the debug objects. + * + * Upon error, the stack of enter rule/subrule must be properly unwound. + * If no viable alt occurs it is within an enter/exit decision, which + * also must be rewound. Even the rewind for each mark must be unwound. + * In the Java target this is pretty easy using try/finally, if a bit + * ugly in the generated code. The rewind is generated in DFA.predict() + * actually so no code needs to be generated for that. For languages + * w/o this "finally" feature (C++?), the target implementor will have + * to build an event stack or something. + * + * Across a socket for remote debugging, only the RecognitionException + * data fields are transmitted. The token object or whatever that + * caused the problem was the last object referenced by LT. The + * immediately preceding LT event should hold the unexpected Token or + * char. + * + * Here is a sample event trace for grammar: + * + * b : C ({;}A|B) // {;} is there to prevent A|B becoming a set + * | D + * ; + * + * The sequence for this rule (with no viable alt in the subrule) for + * input 'c c' (there are 3 tokens) is: + * + * commence + * LT(1) + * enterRule b + * location 7 1 + * enter decision 3 + * LT(1) + * exit decision 3 + * enterAlt1 + * location 7 5 + * LT(1) + * consumeToken [c/<4>,1:0] + * location 7 7 + * enterSubRule 2 + * enter decision 2 + * LT(1) + * LT(1) + * recognitionException NoViableAltException 2 1 2 + * exit decision 2 + * exitSubRule 2 + * beginResync + * LT(1) + * consumeToken [c/<4>,1:1] + * LT(1) + * endResync + * LT(-1) + * exitRule b + * terminate + */ + void (*recognitionException) (pANTLR3_DEBUG_EVENT_LISTENER delboy, pANTLR3_EXCEPTION e); + + /** Indicates the recognizer is about to consume tokens to resynchronize + * the parser. Any consume events from here until the recovered event + * are not part of the parse--they are dead tokens. + */ + void (*beginResync) (pANTLR3_DEBUG_EVENT_LISTENER delboy); + + /** Indicates that the recognizer has finished consuming tokens in order + * to resynchronize. There may be multiple beginResync/endResync pairs + * before the recognizer comes out of errorRecovery mode (in which + * multiple errors are suppressed). This will be useful + * in a gui where you want to probably grey out tokens that are consumed + * but not matched to anything in grammar. Anything between + * a beginResync/endResync pair was tossed out by the parser. + */ + void (*endResync) (pANTLR3_DEBUG_EVENT_LISTENER delboy); + + /** A semantic predicate was evaluate with this result and action text + */ + void (*semanticPredicate) (pANTLR3_DEBUG_EVENT_LISTENER delboy, ANTLR3_BOOLEAN result, const char * predicate); + + /** Announce that parsing has begun. Not technically useful except for + * sending events over a socket. A GUI for example will launch a thread + * to connect and communicate with a remote parser. The thread will want + * to notify the GUI when a connection is made. ANTLR parsers + * trigger this upon entry to the first rule (the ruleLevel is used to + * figure this out). + */ + void (*commence) (pANTLR3_DEBUG_EVENT_LISTENER delboy); + + /** Parsing is over; successfully or not. Mostly useful for telling + * remote debugging listeners that it's time to quit. When the rule + * invocation level goes to zero at the end of a rule, we are done + * parsing. + */ + void (*terminate) (pANTLR3_DEBUG_EVENT_LISTENER delboy); + + /// Retrieve acknowledge response from the debugger. in fact this + /// response is never used at the moment. So we just read whatever + /// is in the socket buffer and throw it away. + /// + void (*ack) (pANTLR3_DEBUG_EVENT_LISTENER delboy); + + // T r e e P a r s i n g + + /** Input for a tree parser is an AST, but we know nothing for sure + * about a node except its type and text (obtained from the adaptor). + * This is the analog of the consumeToken method. The ID is usually + * the memory address of the node. + * If the type is UP or DOWN, then + * the ID is not really meaningful as it's fixed--there is + * just one UP node and one DOWN navigation node. + * + * Note that unlike the Java version, the node type of the C parsers + * is always fixed as pANTLR3_BASE_TREE because all such structures + * contain a super pointer to their parent, which is generally COMMON_TREE and within + * that there is a super pointer that can point to a user type that encapsulates it. + * Almost akin to saying that it is an interface pointer except we don't need to + * know what the interface is in full, just those bits that are the base. + * @param t + */ + void (*consumeNode) (pANTLR3_DEBUG_EVENT_LISTENER delboy, pANTLR3_BASE_TREE t); + + /** The tree parser looked ahead. If the type is UP or DOWN, + * then the ID is not really meaningful as it's fixed--there is + * just one UP node and one DOWN navigation node. + */ + void (*LTT) (pANTLR3_DEBUG_EVENT_LISTENER delboy, int i, pANTLR3_BASE_TREE t); + + + // A S T E v e n t s + + /** A nil was created (even nil nodes have a unique ID... + * they are not "null" per se). As of 4/28/2006, this + * seems to be uniquely triggered when starting a new subtree + * such as when entering a subrule in automatic mode and when + * building a tree in rewrite mode. + * + * If you are receiving this event over a socket via + * RemoteDebugEventSocketListener then only t.ID is set. + */ + void (*nilNode) (pANTLR3_DEBUG_EVENT_LISTENER delboy, pANTLR3_BASE_TREE t); + + /** If a syntax error occurs, recognizers bracket the error + * with an error node if they are building ASTs. This event + * notifies the listener that this is the case + */ + void (*errorNode) (pANTLR3_DEBUG_EVENT_LISTENER delboy, pANTLR3_BASE_TREE t); + + /** Announce a new node built from token elements such as type etc... + * + * If you are receiving this event over a socket via + * RemoteDebugEventSocketListener then only t.ID, type, text are + * set. + */ + void (*createNode) (pANTLR3_DEBUG_EVENT_LISTENER delboy, pANTLR3_BASE_TREE t); + + /** Announce a new node built from an existing token. + * + * If you are receiving this event over a socket via + * RemoteDebugEventSocketListener then only node.ID and token.tokenIndex + * are set. + */ + void (*createNodeTok) (pANTLR3_DEBUG_EVENT_LISTENER delboy, pANTLR3_BASE_TREE node, pANTLR3_COMMON_TOKEN token); + + /** Make a node the new root of an existing root. See + * + * Note: the newRootID parameter is possibly different + * than the TreeAdaptor.becomeRoot() newRoot parameter. + * In our case, it will always be the result of calling + * TreeAdaptor.becomeRoot() and not root_n or whatever. + * + * The listener should assume that this event occurs + * only when the current subrule (or rule) subtree is + * being reset to newRootID. + * + * If you are receiving this event over a socket via + * RemoteDebugEventSocketListener then only IDs are set. + * + * @see org.antlr.runtime.tree.TreeAdaptor.becomeRoot() + */ + void (*becomeRoot) (pANTLR3_DEBUG_EVENT_LISTENER delboy, pANTLR3_BASE_TREE newRoot, pANTLR3_BASE_TREE oldRoot); + + /** Make childID a child of rootID. + * + * If you are receiving this event over a socket via + * RemoteDebugEventSocketListener then only IDs are set. + * + * @see org.antlr.runtime.tree.TreeAdaptor.addChild() + */ + void (*addChild) (pANTLR3_DEBUG_EVENT_LISTENER delboy, pANTLR3_BASE_TREE root, pANTLR3_BASE_TREE child); + + /** Set the token start/stop token index for a subtree root or node. + * + * If you are receiving this event over a socket via + * RemoteDebugEventSocketListener then only t.ID is set. + */ + void (*setTokenBoundaries) (pANTLR3_DEBUG_EVENT_LISTENER delboy, pANTLR3_BASE_TREE t, ANTLR3_MARKER tokenStartIndex, ANTLR3_MARKER tokenStopIndex); + + /// Free up the resources allocated to this structure + /// + void (*free) (pANTLR3_DEBUG_EVENT_LISTENER delboy); + +} + ANTLR3_DEBUG_EVENT_LISTENER; + +#ifdef __cplusplus +} +#endif + +#endif + diff --git a/antlr/libantlr3c-3.4/include/antlr3defs.h b/antlr/libantlr3c-3.4/include/antlr3defs.h new file mode 100644 index 0000000..2435b02 --- /dev/null +++ b/antlr/libantlr3c-3.4/include/antlr3defs.h @@ -0,0 +1,632 @@ +/** \file + * Basic type and constant definitions for ANTLR3 Runtime. + */ +#ifndef _ANTLR3DEFS_H +#define _ANTLR3DEFS_H + +// [The "BSD licence"] +// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC +// http://www.temporal-wave.com +// http://www.linkedin.com/in/jimidle +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. The name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/* Following are for generated code, they are not referenced internally!!! + */ +#if !defined(ANTLR3_HUGE) && !defined(ANTLR3_AVERAGE) && !defined(ANTLR3_SMALL) +#define ANTLR3_AVERAGE +#endif + +#ifdef ANTLR3_HUGE +#ifndef ANTLR3_SIZE_HINT +#define ANTLR3_SIZE_HINT 2049 +#endif +#ifndef ANTLR3_LIST_SIZE_HINT +#define ANTLR3_LIST_SIZE_HINT 127 +#endif +#endif + +#ifdef ANTLR3_AVERAGE +#ifndef ANTLR3_SIZE_HINT +#define ANTLR3_SIZE_HINT 1025 +#define ANTLR3_LIST_SIZE_HINT 63 +#endif +#endif + +#ifdef ANTLR3_SMALL +#ifndef ANTLR3_SIZE_HINT +#define ANTLR3_SIZE_HINT 211 +#define ANTLR3_LIST_SIZE_HINT 31 +#endif +#endif + +// Definitions that indicate the encoding scheme character streams and strings etc +// +/// Indicates Big Endian for encodings where this makes sense +/// +#define ANTLR3_BE 1 + +/// Indicates Little Endian for encoidngs where this makes sense +/// +#define ANTLR3_LE 2 + +/// General latin-1 or other 8 bit encoding scheme such as straight ASCII +/// +#define ANTLR3_ENC_8BIT 4 + +/// UTF-8 encoding scheme +/// +#define ANTLR3_ENC_UTF8 8 + +/// UTF-16 encoding scheme (which also covers UCS2 as that does not have surrogates) +/// +#define ANTLR3_ENC_UTF16 16 +#define ANTLR3_ENC_UTF16BE 16 + ANTLR3_BE +#define ANTLR3_ENC_UTF16LE 16 + ANTLR3_LE + +/// UTF-32 encoding scheme (basically straight 32 bit) +/// +#define ANTLR3_ENC_UTF32 32 +#define ANTLR3_ENC_UTF32BE 32 + ANTLR3_BE +#define ANTLR3_ENC_UTF32LE 32 + ANTLR3_LE + +/// Input is 8 bit EBCDIC (which we convert to 8 bit ASCII on the fly +/// +#define ANTLR3_ENC_EBCDIC 64 + +/* Common definitions come first + */ +#include + +/* Work out what operating system/compiler this is. We just do this once + * here and use an internal symbol after this. + */ +#ifdef _WIN64 + +# ifndef ANTLR3_WINDOWS +# define ANTLR3_WINDOWS +# endif +# define ANTLR3_WIN64 +# define ANTLR3_USE_64BIT + +#else + +#ifdef _WIN32 +# ifndef ANTLR3_WINDOWS +# define ANTLR3_WINDOWS +# endif + +#define ANTLR3_WIN32 +#endif + +#endif + +#ifdef ANTLR3_WINDOWS + +#ifndef WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN +#endif + +/* Allow VC 8 (vs2005) and above to use 'secure' versions of various functions such as sprintf + */ +#ifndef _CRT_SECURE_NO_DEPRECATE +#define _CRT_SECURE_NO_DEPRECATE +#endif + +#include +#include +#include +#include +#include +#include +#include + +#define ANTLR3_API __declspec(dllexport) +#define ANTLR3_CDECL __cdecl +#define ANTLR3_FASTCALL __fastcall + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef __MINGW32__ +// Standard Windows types +// +typedef INT32 ANTLR3_CHAR, *pANTLR3_CHAR; +typedef UINT32 ANTLR3_UCHAR, *pANTLR3_UCHAR; + +typedef INT8 ANTLR3_INT8, *pANTLR3_INT8; +typedef INT16 ANTLR3_INT16, *pANTLR3_INT16; +typedef INT32 ANTLR3_INT32, *pANTLR3_INT32; +typedef INT64 ANTLR3_INT64, *pANTLR3_INT64; +typedef UINT8 ANTLR3_UINT8, *pANTLR3_UINT8; +typedef UINT16 ANTLR3_UINT16, *pANTLR3_UINT16; +typedef UINT32 ANTLR3_UINT32, *pANTLR3_UINT32; +typedef UINT64 ANTLR3_UINT64, *pANTLR3_UINT64; +typedef UINT64 ANTLR3_BITWORD, *pANTLR3_BITWORD; +typedef UINT8 ANTLR3_BOOLEAN, *pANTLR3_BOOLEAN; + +#else +// Mingw uses stdint.h and fails to define standard Microsoft typedefs +// such as UINT16, hence we must use stdint.h for Mingw. +// +#include +typedef int32_t ANTLR3_CHAR, *pANTLR3_CHAR; +typedef uint32_t ANTLR3_UCHAR, *pANTLR3_UCHAR; + +typedef int8_t ANTLR3_INT8, *pANTLR3_INT8; +typedef int16_t ANTLR3_INT16, *pANTLR3_INT16; +typedef int32_t ANTLR3_INT32, *pANTLR3_INT32; +typedef int64_t ANTLR3_INT64, *pANTLR3_INT64; + +typedef uint8_t ANTLR3_UINT8, *pANTLR3_UINT8; +typedef uint16_t ANTLR3_UINT16, *pANTLR3_UINT16; +typedef uint32_t ANTLR3_UINT32, *pANTLR3_UINT32; +typedef uint64_t ANTLR3_UINT64, *pANTLR3_UINT64; +typedef uint64_t ANTLR3_BITWORD, *pANTLR3_BITWORD; + +typedef uint8_t ANTLR3_BOOLEAN, *pANTLR3_BOOLEAN; + +#endif + + + +#define ANTLR3_UINT64_LIT(lit) lit##ULL + +#define ANTLR3_INLINE __inline + +typedef FILE * ANTLR3_FDSC; +typedef struct stat ANTLR3_FSTAT_STRUCT; + +#ifdef ANTLR3_USE_64BIT +#define ANTLR3_FUNC_PTR(ptr) (void *)((ANTLR3_UINT64)(ptr)) +#define ANTLR3_UINT64_CAST(ptr) (ANTLR3_UINT64)(ptr)) +#define ANTLR3_UINT32_CAST(ptr) (ANTLR3_UINT32)((ANTLR3_UINT64)(ptr)) +typedef ANTLR3_INT64 ANTLR3_MARKER; +typedef ANTLR3_UINT64 ANTLR3_INTKEY; +#else +#define ANTLR3_FUNC_PTR(ptr) (void *)((ANTLR3_UINT32)(ptr)) +#define ANTLR3_UINT64_CAST(ptr) (ANTLR3_UINT64)((ANTLR3_UINT32)(ptr)) +#define ANTLR3_UINT32_CAST(ptr) (ANTLR3_UINT32)(ptr) +typedef ANTLR3_INT32 ANTLR3_MARKER; +typedef ANTLR3_UINT32 ANTLR3_INTKEY; +#endif + +#ifdef ANTLR3_WIN32 +#endif + +#ifdef ANTLR3_WIN64 +#endif + + +typedef int ANTLR3_SALENT; // Type used for size of accept structure +typedef struct sockaddr_in ANTLR3_SOCKADDRT, * pANTLR3_SOCKADDRT; // Type used for socket address declaration +typedef struct sockaddr ANTLR3_SOCKADDRC, * pANTLR3_SOCKADDRC; // Type used for cast on accept() + +#define ANTLR3_CLOSESOCKET closesocket + +#ifdef __cplusplus +} +#endif + +/* Warnings that are over-zealous such as complaining about strdup, we + * can turn off. + */ + +/* Don't complain about "deprecated" functions such as strdup + */ +#pragma warning( disable : 4996 ) + +#else + +/* Include configure generated header file + */ +#include + +#include + +#if HAVE_STDINT_H +# include +#endif + +#if HAVE_SYS_TYPES_H +# include +#endif + +#if HAVE_SYS_STAT_H +# include +#endif + +#if STDC_HEADERS +# include +# include +# include +#else +# if HAVE_STDLIB_H +# include +# endif +# if HAVE_STDARG_H +# include +# endif +#endif + +#if HAVE_STRING_H +# if !STDC_HEADERS && HAVE_MEMORY_H +# include +# endif +# include +#endif + +#if HAVE_STRINGS_H +# include +#endif + +#if HAVE_INTTYPES_H +# include +#endif + +#if HAVE_UNISTD_H +# include +#endif + +#ifdef HAVE_NETINET_IN_H +#include +#endif + +#ifdef HAVE_SOCKET_H +# include +#else +# if HAVE_SYS_SOCKET_H +# include +# endif +#endif + +#ifdef HAVE_NETINET_TCP_H +#include +#endif + +#ifdef HAVE_ARPA_NAMESER_H +#include /* DNS HEADER struct */ +#endif + +#ifdef HAVE_NETDB_H +#include +#endif + + +#ifdef HAVE_SYS_RESOLVE_H +#include +#endif + +#ifdef HAVE_RESOLVE_H +#include +#endif + + +#ifdef HAVE_MALLOC_H +# include +#else +# ifdef HAVE_SYS_MALLOC_H +# include +# endif +#endif + +#ifdef HAVE_CTYPE_H +# include +#endif + +/* Some platforms define a macro, index() in string.h. AIX is + * one of these for instance. We must get rid of that definition + * as we use ->index all over the place. defining macros like this in system header + * files is a really bad idea, but I doubt that IBM will listen to me ;-) + */ +#ifdef index +#undef index +#endif + +#define _stat stat + +// SOCKET not defined on Unix +// +typedef int SOCKET; + +#define ANTLR3_API +#define ANTLR3_CDECL +#define ANTLR3_FASTCALL + +#ifdef __hpux + + // HPUX is always different usually for no good reason. Tru64 should have kicked it + // into touch and everyone knows it ;-) + // + typedef struct sockaddr_in ANTLR3_SOCKADDRT, * pANTLR3_SOCKADDRT; // Type used for socket address declaration + typedef void * pANTLR3_SOCKADDRC; // Type used for cast on accept() + typedef int ANTLR3_SALENT; + +#else + +# if defined(_AIX) || __GNUC__ > 3 + + typedef socklen_t ANTLR3_SALENT; + +# else + + typedef size_t ANTLR3_SALENT; + +# endif + + typedef struct sockaddr_in ANTLR3_SOCKADDRT, * pANTLR3_SOCKADDRT; // Type used for socket address declaration + typedef struct sockaddr * pANTLR3_SOCKADDRC; // Type used for cast on accept() + +#endif + +#define INVALID_SOCKET ((SOCKET)-1) +#define ANTLR3_CLOSESOCKET close + +#ifdef __cplusplus +extern "C" { +#endif + +/* Inherit type definitions for autoconf + */ +typedef int32_t ANTLR3_CHAR, *pANTLR3_CHAR; +typedef uint32_t ANTLR3_UCHAR, *pANTLR3_UCHAR; + +typedef int8_t ANTLR3_INT8, *pANTLR3_INT8; +typedef int16_t ANTLR3_INT16, *pANTLR3_INT16; +typedef int32_t ANTLR3_INT32, *pANTLR3_INT32; +typedef int64_t ANTLR3_INT64, *pANTLR3_INT64; + +typedef uint8_t ANTLR3_UINT8, *pANTLR3_UINT8; +typedef uint16_t ANTLR3_UINT16, *pANTLR3_UINT16; +typedef uint32_t ANTLR3_UINT32, *pANTLR3_UINT32; +typedef uint64_t ANTLR3_UINT64, *pANTLR3_UINT64; +typedef uint64_t ANTLR3_BITWORD, *pANTLR3_BITWORD; + +typedef uint32_t ANTLR3_BOOLEAN, *pANTLR3_BOOLEAN; + +#define ANTLR3_INLINE inline +#define ANTLR3_API + +typedef FILE * ANTLR3_FDSC; +typedef struct stat ANTLR3_FSTAT_STRUCT; + +#ifdef ANTLR3_USE_64BIT +#define ANTLR3_FUNC_PTR(ptr) (void *)((ANTLR3_UINT64)(ptr)) +#define ANTLR3_UINT64_CAST(ptr) (ANTLR3_UINT64)(ptr)) +#define ANTLR3_UINT32_CAST(ptr) (ANTLR3_UINT32)((ANTLR3_UINT64)(ptr)) +typedef ANTLR3_INT64 ANTLR3_MARKER; +typedef ANTLR3_UINT64 ANTLR3_INTKEY; +#else +#define ANTLR3_FUNC_PTR(ptr) (void *)((ANTLR3_UINT32)(ptr)) +#define ANTLR3_UINT64_CAST(ptr) (ANTLR3_UINT64)((ANTLR3_UINT32)(ptr)) +#define ANTLR3_UINT32_CAST(ptr) (ANTLR3_UINT32)(ptr) +typedef ANTLR3_INT32 ANTLR3_MARKER; +typedef ANTLR3_UINT32 ANTLR3_INTKEY; +#endif +#define ANTLR3_UINT64_LIT(lit) lit##ULL + +#ifdef __cplusplus +} +#endif + +#endif + +#ifdef ANTLR3_USE_64BIT +#define ANTLR3_TRIE_DEPTH 63 +#else +#define ANTLR3_TRIE_DEPTH 31 +#endif +/* Pre declare the typedefs for all the interfaces, then + * they can be inter-dependant and we will let the linker + * sort it out for us. + */ +#include + +// Include the unicode.org conversion library header. +// +#include + +/* Prototypes + */ +#ifndef ANTLR3_MALLOC +/// Default definition of ANTLR3_MALLOC. You can override this before including +/// antlr3.h if you wish to use your own implementation. +/// +#define ANTLR3_MALLOC(request) malloc ((size_t)(request)) +#endif + +#ifndef ANTLR3_CALLOC +/// Default definition of ANTLR3_CALLOC. You can override this before including +/// antlr3.h if you wish to use your own implementation. +/// +#define ANTLR3_CALLOC(numEl, elSize) calloc (numEl, (size_t)(elSize)) +#endif + +#ifndef ANTLR3_REALLOC +/// Default definition of ANTLR3_REALLOC. You can override this before including +/// antlr3.h if you wish to use your own implementation. +/// +#define ANTLR3_REALLOC(current, request) realloc ((void *)(current), (size_t)(request)) +#endif +#ifndef ANTLR3_FREE +/// Default definition of ANTLR3_FREE. You can override this before including +/// antlr3.h if you wish to use your own implementation. +/// +#define ANTLR3_FREE(ptr) free ((void *)(ptr)) +#endif +#ifndef ANTLR3_FREE_FUNC +/// Default definition of ANTLR3_FREE_FUNC. You can override this before including +/// antlr3.h if you wish to use your own implementation. +/// +#define ANTLR3_FREE_FUNC free +#endif +#ifndef ANTLR3_STRDUP +/// Default definition of ANTLR3_STRDUP. You can override this before including +/// antlr3.h if you wish to use your own implementation. +/// +#define ANTLR3_STRDUP(instr) (pANTLR3_UINT8)(strdup ((const char *)(instr))) +#endif +#ifndef ANTLR3_MEMCPY +/// Default definition of ANTLR3_MEMCPY. You can override this before including +/// antlr3.h if you wish to use your own implementation. +/// +#define ANTLR3_MEMCPY(target, source, size) memcpy((void *)(target), (const void *)(source), (size_t)(size)) +#endif +#ifndef ANTLR3_MEMMOVE +/// Default definition of ANTLR3_MEMMOVE. You can override this before including +/// antlr3.h if you wish to use your own implementation. +/// +#define ANTLR3_MEMMOVE(target, source, size) memmove((void *)(target), (const void *)(source), (size_t)(size)) +#endif +#ifndef ANTLR3_MEMSET +/// Default definition of ANTLR3_MEMSET. You can override this before including +/// antlr3.h if you wish to use your own implementation. +/// +#define ANTLR3_MEMSET(target, byte, size) memset((void *)(target), (int)(byte), (size_t)(size)) +#endif + +#ifndef ANTLR3_PRINTF +/// Default definition of printf, set this to something other than printf before including antlr3.h +/// if your system does not have a printf. Note that you can define this to be // +/// without harming the runtime. +/// +#define ANTLR3_PRINTF printf +#endif + +#ifndef ANTLR3_FPRINTF +/// Default definition of fprintf, set this to something other than fprintf before including antlr3.h +/// if your system does not have a fprintf. Note that you can define this to be // +/// without harming the runtime. +/// +#define ANTLR3_FPRINTF fprintf +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +ANTLR3_API pANTLR3_INT_TRIE antlr3IntTrieNew (ANTLR3_UINT32 depth); + +ANTLR3_API pANTLR3_BITSET antlr3BitsetNew (ANTLR3_UINT32 numBits); +ANTLR3_API pANTLR3_BITSET antlr3BitsetOf (ANTLR3_INT32 bit, ...); +ANTLR3_API pANTLR3_BITSET antlr3BitsetList (pANTLR3_HASH_TABLE list); +ANTLR3_API pANTLR3_BITSET antlr3BitsetCopy (pANTLR3_BITSET_LIST blist); +ANTLR3_API pANTLR3_BITSET antlr3BitsetLoad (pANTLR3_BITSET_LIST blist); +ANTLR3_API void antlr3BitsetSetAPI (pANTLR3_BITSET bitset); + + +ANTLR3_API pANTLR3_BASE_RECOGNIZER antlr3BaseRecognizerNew (ANTLR3_UINT32 type, ANTLR3_UINT32 sizeHint, pANTLR3_RECOGNIZER_SHARED_STATE state); +ANTLR3_API void antlr3RecognitionExceptionNew (pANTLR3_BASE_RECOGNIZER recognizer); +ANTLR3_API void antlr3MTExceptionNew (pANTLR3_BASE_RECOGNIZER recognizer); +ANTLR3_API void antlr3MTNExceptionNew (pANTLR3_BASE_RECOGNIZER recognizer); +ANTLR3_API pANTLR3_HASH_TABLE antlr3HashTableNew (ANTLR3_UINT32 sizeHint); +ANTLR3_API ANTLR3_UINT32 antlr3Hash (void * key, ANTLR3_UINT32 keylen); +ANTLR3_API pANTLR3_HASH_ENUM antlr3EnumNew (pANTLR3_HASH_TABLE table); +ANTLR3_API pANTLR3_LIST antlr3ListNew (ANTLR3_UINT32 sizeHint); +ANTLR3_API pANTLR3_VECTOR_FACTORY antlr3VectorFactoryNew (ANTLR3_UINT32 sizeHint); +ANTLR3_API pANTLR3_VECTOR antlr3VectorNew (ANTLR3_UINT32 sizeHint); +ANTLR3_API pANTLR3_STACK antlr3StackNew (ANTLR3_UINT32 sizeHint); +ANTLR3_API void antlr3SetVectorApi (pANTLR3_VECTOR vector, ANTLR3_UINT32 sizeHint); +ANTLR3_API ANTLR3_UCHAR antlr3c8toAntlrc (ANTLR3_INT8 inc); +ANTLR3_API pANTLR3_TOPO antlr3TopoNew(); + +ANTLR3_API pANTLR3_EXCEPTION antlr3ExceptionNew (ANTLR3_UINT32 exception, void * name, void * message, ANTLR3_BOOLEAN freeMessage); + + +ANTLR3_API pANTLR3_INPUT_STREAM antlr3FileStreamNew (pANTLR3_UINT8 fileName, ANTLR3_UINT32 encoding); +ANTLR3_API pANTLR3_INPUT_STREAM antlr3StringStreamNew (pANTLR3_UINT8 data, ANTLR3_UINT32 encoding, ANTLR3_UINT32 size, pANTLR3_UINT8 name); + +ANTLR3_API pANTLR3_INT_STREAM antlr3IntStreamNew (void); + +ANTLR3_API pANTLR3_STRING_FACTORY antlr3StringFactoryNew (ANTLR3_UINT32 encoding); + +ANTLR3_API pANTLR3_COMMON_TOKEN antlr3CommonTokenNew (ANTLR3_UINT32 ttype); +ANTLR3_API pANTLR3_TOKEN_FACTORY antlr3TokenFactoryNew (pANTLR3_INPUT_STREAM input); +ANTLR3_API void antlr3SetTokenAPI (pANTLR3_COMMON_TOKEN token); + +ANTLR3_API pANTLR3_LEXER antlr3LexerNewStream (ANTLR3_UINT32 sizeHint, pANTLR3_INPUT_STREAM input, pANTLR3_RECOGNIZER_SHARED_STATE state); +ANTLR3_API pANTLR3_LEXER antlr3LexerNew (ANTLR3_UINT32 sizeHint, pANTLR3_RECOGNIZER_SHARED_STATE state); +ANTLR3_API pANTLR3_PARSER antlr3ParserNewStreamDbg (ANTLR3_UINT32 sizeHint, pANTLR3_TOKEN_STREAM tstream, pANTLR3_DEBUG_EVENT_LISTENER dbg, pANTLR3_RECOGNIZER_SHARED_STATE state); +ANTLR3_API pANTLR3_PARSER antlr3ParserNewStream (ANTLR3_UINT32 sizeHint, pANTLR3_TOKEN_STREAM tstream, pANTLR3_RECOGNIZER_SHARED_STATE state); +ANTLR3_API pANTLR3_PARSER antlr3ParserNew (ANTLR3_UINT32 sizeHint, pANTLR3_RECOGNIZER_SHARED_STATE state); + +ANTLR3_API pANTLR3_COMMON_TOKEN_STREAM antlr3CommonTokenStreamSourceNew (ANTLR3_UINT32 hint, pANTLR3_TOKEN_SOURCE source); +ANTLR3_API pANTLR3_COMMON_TOKEN_STREAM antlr3CommonTokenStreamNew (ANTLR3_UINT32 hint); +ANTLR3_API pANTLR3_COMMON_TOKEN_STREAM antlr3CommonTokenDebugStreamSourceNew (ANTLR3_UINT32 hint, pANTLR3_TOKEN_SOURCE source, pANTLR3_DEBUG_EVENT_LISTENER debugger); + +ANTLR3_API pANTLR3_BASE_TREE_ADAPTOR ANTLR3_TREE_ADAPTORNew (pANTLR3_STRING_FACTORY strFactory); +ANTLR3_API pANTLR3_BASE_TREE_ADAPTOR ANTLR3_TREE_ADAPTORDebugNew (pANTLR3_STRING_FACTORY strFactory, pANTLR3_DEBUG_EVENT_LISTENER debugger); +ANTLR3_API pANTLR3_COMMON_TREE antlr3CommonTreeNew (void); +ANTLR3_API pANTLR3_COMMON_TREE antlr3CommonTreeNewFromTree (pANTLR3_COMMON_TREE tree); +ANTLR3_API pANTLR3_COMMON_TREE antlr3CommonTreeNewFromToken (pANTLR3_COMMON_TOKEN tree); +ANTLR3_API pANTLR3_ARBORETUM antlr3ArboretumNew (pANTLR3_STRING_FACTORY factory); +ANTLR3_API void antlr3SetCTAPI (pANTLR3_COMMON_TREE tree); +ANTLR3_API pANTLR3_BASE_TREE antlr3BaseTreeNew (pANTLR3_BASE_TREE tree); + +ANTLR3_API void antlr3BaseTreeAdaptorInit (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_DEBUG_EVENT_LISTENER debugger); + +ANTLR3_API pANTLR3_TREE_PARSER antlr3TreeParserNewStream (ANTLR3_UINT32 sizeHint, pANTLR3_COMMON_TREE_NODE_STREAM ctnstream, pANTLR3_RECOGNIZER_SHARED_STATE state); + +ANTLR3_API ANTLR3_INT32 antlr3dfaspecialTransition (void * ctx, pANTLR3_BASE_RECOGNIZER rec, pANTLR3_INT_STREAM is, pANTLR3_CYCLIC_DFA dfa, ANTLR3_INT32 s); +ANTLR3_API ANTLR3_INT32 antlr3dfaspecialStateTransition (void * ctx, pANTLR3_BASE_RECOGNIZER rec, pANTLR3_INT_STREAM is, pANTLR3_CYCLIC_DFA dfa, ANTLR3_INT32 s); +ANTLR3_API ANTLR3_INT32 antlr3dfapredict (void * ctx, pANTLR3_BASE_RECOGNIZER rec, pANTLR3_INT_STREAM is, pANTLR3_CYCLIC_DFA cdfa); + +ANTLR3_API pANTLR3_COMMON_TREE_NODE_STREAM antlr3CommonTreeNodeStreamNewTree (pANTLR3_BASE_TREE tree, ANTLR3_UINT32 hint); +ANTLR3_API pANTLR3_COMMON_TREE_NODE_STREAM antlr3CommonTreeNodeStreamNew (pANTLR3_STRING_FACTORY strFactory, ANTLR3_UINT32 hint); +ANTLR3_API pANTLR3_COMMON_TREE_NODE_STREAM antlr3UnbufTreeNodeStreamNewTree (pANTLR3_BASE_TREE tree, ANTLR3_UINT32 hint); +ANTLR3_API pANTLR3_COMMON_TREE_NODE_STREAM antlr3UnbufTreeNodeStreamNew (pANTLR3_STRING_FACTORY strFactory, ANTLR3_UINT32 hint); +ANTLR3_API pANTLR3_COMMON_TREE_NODE_STREAM antlr3CommonTreeNodeStreamNewStream (pANTLR3_COMMON_TREE_NODE_STREAM inStream); +ANTLR3_API pANTLR3_TREE_NODE_STREAM antlr3TreeNodeStreamNew (); +ANTLR3_API void fillBufferExt (pANTLR3_COMMON_TOKEN_STREAM tokenStream); + +ANTLR3_API pANTLR3_REWRITE_RULE_TOKEN_STREAM + antlr3RewriteRuleTOKENStreamNewAE (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_RECOGNIZER rec, pANTLR3_UINT8 description); +ANTLR3_API pANTLR3_REWRITE_RULE_TOKEN_STREAM + antlr3RewriteRuleTOKENStreamNewAEE (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_RECOGNIZER rec, pANTLR3_UINT8 description, void * oneElement); +ANTLR3_API pANTLR3_REWRITE_RULE_TOKEN_STREAM + antlr3RewriteRuleTOKENStreamNewAEV (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_RECOGNIZER rec, pANTLR3_UINT8 description, pANTLR3_VECTOR vector); + +ANTLR3_API pANTLR3_REWRITE_RULE_NODE_STREAM + antlr3RewriteRuleNODEStreamNewAE (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_RECOGNIZER rec, pANTLR3_UINT8 description); +ANTLR3_API pANTLR3_REWRITE_RULE_NODE_STREAM + antlr3RewriteRuleNODEStreamNewAEE (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_RECOGNIZER rec, pANTLR3_UINT8 description, void * oneElement); +ANTLR3_API pANTLR3_REWRITE_RULE_NODE_STREAM + antlr3RewriteRuleNODEStreamNewAEV (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_RECOGNIZER rec, pANTLR3_UINT8 description, pANTLR3_VECTOR vector); + +ANTLR3_API pANTLR3_REWRITE_RULE_SUBTREE_STREAM + antlr3RewriteRuleSubtreeStreamNewAE (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_RECOGNIZER rec, pANTLR3_UINT8 description); +ANTLR3_API pANTLR3_REWRITE_RULE_SUBTREE_STREAM + antlr3RewriteRuleSubtreeStreamNewAEE(pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_RECOGNIZER rec, pANTLR3_UINT8 description, void * oneElement); +ANTLR3_API pANTLR3_REWRITE_RULE_SUBTREE_STREAM + antlr3RewriteRuleSubtreeStreamNewAEV(pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_RECOGNIZER rec, pANTLR3_UINT8 description, pANTLR3_VECTOR vector); + +ANTLR3_API pANTLR3_DEBUG_EVENT_LISTENER antlr3DebugListenerNew(); + +#ifdef __cplusplus +} +#endif + +#endif /* _ANTLR3DEFS_H */ diff --git a/antlr/libantlr3c-3.4/include/antlr3encodings.h b/antlr/libantlr3c-3.4/include/antlr3encodings.h new file mode 100644 index 0000000..f706735 --- /dev/null +++ b/antlr/libantlr3c-3.4/include/antlr3encodings.h @@ -0,0 +1,38 @@ +#ifndef _ANTLR3_ENCODINGS_H +#define _ANTLR3_ENCODINGS_H + +// [The "BSD licence"] +// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC +// http://www.temporal-wave.com +// http://www.linkedin.com/in/jimidle +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. The name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include + + + +#endif + diff --git a/antlr/libantlr3c-3.4/include/antlr3errors.h b/antlr/libantlr3c-3.4/include/antlr3errors.h new file mode 100644 index 0000000..4419ee3 --- /dev/null +++ b/antlr/libantlr3c-3.4/include/antlr3errors.h @@ -0,0 +1,53 @@ +#ifndef _ANTLR3ERRORS_H +#define _ANTLR3ERRORS_H + +// [The "BSD licence"] +// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC +// http://www.temporal-wave.com +// http://www.linkedin.com/in/jimidle +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. The name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#define ANTLR3_SUCCESS 0 +#define ANTLR3_FAIL 1 + +#define ANTLR3_TRUE 1 +#define ANTLR3_FALSE 0 + +/** Indicates end of character stream and is an invalid Unicode code point. */ +#define ANTLR3_CHARSTREAM_EOF 0xFFFFFFFF + +/** Indicates memoizing on a rule failed. + */ +#define MEMO_RULE_FAILED 0xFFFFFFFE +#define MEMO_RULE_UNKNOWN 0xFFFFFFFF + + +#define ANTLR3_ERR_BASE 0 +#define ANTLR3_ERR_NOMEM (ANTLR3_ERR_BASE + 1) +#define ANTLR3_ERR_NOFILE (ANTLR3_ERR_BASE + 2) +#define ANTLR3_ERR_HASHDUP (ANTLR3_ERR_BASE + 3) + +#endif /* _ANTLR3ERRORS_H */ diff --git a/antlr/libantlr3c-3.4/include/antlr3exception.h b/antlr/libantlr3c-3.4/include/antlr3exception.h new file mode 100644 index 0000000..8fab8da --- /dev/null +++ b/antlr/libantlr3c-3.4/include/antlr3exception.h @@ -0,0 +1,218 @@ +/** \file + * Contains the definition of a basic ANTLR3 exception structure created + * by a recognizer when errors are found/predicted. + */ +#ifndef _ANTLR3_EXCEPTION_H +#define _ANTLR3_EXCEPTION_H + +// [The "BSD licence"] +// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC +// http://www.temporal-wave.com +// http://www.linkedin.com/in/jimidle +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. The name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include + +/** Indicates that the recognizer received a token + * in the input that was not predicted. + */ +#define ANTLR3_RECOGNITION_EXCEPTION 1 + +/** Name of exception #ANTLR3_RECOGNITION_EXCEPTION + */ +#define ANTLR3_RECOGNITION_EX_NAME "org.antlr.runtime.RecognitionException" + +/** Indicates that the recognizer was expecting one token and found a + * a different one. + */ +#define ANTLR3_MISMATCHED_TOKEN_EXCEPTION 2 + +/** Name of #ANTLR3_MISMATCHED_TOKEN_EXCEPTION + */ +#define ANTLR3_MISMATCHED_EX_NAME "org.antlr.runtime.MismatchedTokenException" + +/** Recognizer could not find a valid alternative from the input + */ +#define ANTLR3_NO_VIABLE_ALT_EXCEPTION 3 + +/** Name of #ANTLR3_NO_VIABLE_ALT_EXCEPTION + */ +#define ANTLR3_NO_VIABLE_ALT_NAME "org.antlr.runtime.NoViableAltException" + +/* Character in a set was not found + */ +#define ANTLR3_MISMATCHED_SET_EXCEPTION 4 + +/* Name of #ANTLR3_MISMATCHED_SET_EXCEPTION + */ +#define ANTLR3_MISMATCHED_SET_NAME "org.antlr.runtime.MismatchedSetException" + +/* A rule predicting at least n elements found less than that, + * such as: WS: " "+; + */ +#define ANTLR3_EARLY_EXIT_EXCEPTION 5 + +/* Name of #ANTLR3_EARLY_EXIT_EXCEPTION + */ +#define ANTLR3_EARLY_EXIT_NAME "org.antlr.runtime.EarlyExitException" + +#define ANTLR3_FAILED_PREDICATE_EXCEPTION 6 +#define ANTLR3_FAILED_PREDICATE_NAME "org.antlr.runtime.FailedPredicateException" + +#define ANTLR3_MISMATCHED_TREE_NODE_EXCEPTION 7 +#define ANTLR3_MISMATCHED_TREE_NODE_NAME "org.antlr.runtime.MismatchedTreeNodeException" + +#define ANTLR3_REWRITE_EARLY_EXCEPTION 8 +#define ANTLR3_REWRITE_EARLY_EXCEPTION_NAME "org.antlr.runtime.tree.RewriteEarlyExitException" + +#define ANTLR3_UNWANTED_TOKEN_EXCEPTION 9 +#define ANTLR3_UNWANTED_TOKEN_EXCEPTION_NAME "org.antlr.runtime.UnwantedTokenException" + +#define ANTLR3_MISSING_TOKEN_EXCEPTION 10 +#define ANTLR3_MISSING_TOKEN_EXCEPTION_NAME "org.antlr.runtime.MissingTokenException" + +#ifdef __cplusplus +extern "C" { +#endif + +/** Base structure for an ANTLR3 exception tracker + */ +typedef struct ANTLR3_EXCEPTION_struct +{ + /// Set to one of the exception type defines: + /// + /// - #ANTLR3_RECOGNITION_EXCEPTION + /// - #ANTLR3_MISMATCHED_TOKEN_EXCEPTION + /// - #ANTLR3_NO_VIABLE_ALT_EXCEPTION + /// - #ANTLR3_MISMATCHED_SET_EXCEPTION + /// - #ANTLR3_EARLY_EXIT_EXCEPTION + /// - #ANTLR3_FAILED_PREDICATE_EXCEPTION + /// - #ANTLR3_EARLY_EXIT_EXCEPTION + /// + ANTLR3_UINT32 type; + + /** The string name of the exception + */ + void * name; + + /** The printable message that goes with this exception, in your preferred + * encoding format. ANTLR just uses ASCII by default but you can ignore these + * messages or convert them to another format or whatever of course. They are + * really internal messages that you then decide how to print out in a form that + * the users of your product will understand, as they are unlikely to know what + * to do with "Recognition exception at: [[TOK_GERUND..... " ;-) + */ + void * message; + + /** Name of the file/input source for reporting. Note that this may be NULL!! + */ + pANTLR3_STRING streamName; + + /** If set to ANTLR3_TRUE, this indicates that the message element of this structure + * should be freed by calling ANTLR3_FREE() when the exception is destroyed. + */ + ANTLR3_BOOLEAN freeMessage; + + /** Indicates the index of the 'token' we were looking at when the + * exception occurred. + */ + ANTLR3_MARKER index; + + /** Indicates what the current token/tree was when the error occurred. Since not + * all input streams will be able to retrieve the nth token, we track it here + * instead. This is for parsers, and even tree parsers may set this. + */ + void * token; + + /** Indicates the token we were expecting to see next when the error occurred + */ + ANTLR3_UINT32 expecting; + + /** Indicates a set of tokens that we were expecting to see one of when the + * error occurred. It is a following bitset list, so you can use load it and use ->toIntList() on it + * to generate an array of integer tokens that it represents. + */ + pANTLR3_BITSET_LIST expectingSet; + + /** If this is a tree parser exception then the node is set to point to the node + * that caused the issue. + */ + void * node; + + /** The current character when an error occurred - for lexers. + */ + ANTLR3_UCHAR c; + + /** Track the line at which the error occurred in case this is + * generated from a lexer. We need to track this since the + * unexpected char doesn't carry the line info. + */ + ANTLR3_UINT32 line; + + /** Character position in the line where the error occurred. + */ + ANTLR3_INT32 charPositionInLine; + + /** decision number for NVE + */ + ANTLR3_UINT32 decisionNum; + + /** State for NVE + */ + ANTLR3_UINT32 state; + + /** Rule name for failed predicate exception + */ + void * ruleName; + + /** Pointer to the next exception in the chain (if any) + */ + struct ANTLR3_EXCEPTION_struct * nextException; + + /** Pointer to the input stream that this exception occurred in. + */ + pANTLR3_INT_STREAM input; + + /** Pointer for you, the programmer to add anything you like to an exception. + */ + void * custom; + + /** Pointer to a routine that is called to free the custom exception structure + * when the exception is destroyed. Set to NULL if nothing should be done. + */ + void (*freeCustom) (void * custom); + void (*print) (struct ANTLR3_EXCEPTION_struct * ex); + void (*freeEx) (struct ANTLR3_EXCEPTION_struct * ex); + +} + ANTLR3_EXCEPTION; + +#ifdef __cplusplus +} +#endif + + +#endif diff --git a/antlr/libantlr3c-3.4/include/antlr3filestream.h b/antlr/libantlr3c-3.4/include/antlr3filestream.h new file mode 100644 index 0000000..b06eb45 --- /dev/null +++ b/antlr/libantlr3c-3.4/include/antlr3filestream.h @@ -0,0 +1,50 @@ +#ifndef _ANTLR3_FILESTREAM_H +#define _ANTLR3_FILESTREAM_H + +// [The "BSD licence"] +// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC +// http://www.temporal-wave.com +// http://www.linkedin.com/in/jimidle +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. The name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +ANTLR3_API ANTLR3_FDSC antlr3Fopen (pANTLR3_UINT8 filename, const char * mode); +ANTLR3_API void antlr3Fclose (ANTLR3_FDSC fd); + +ANTLR3_API ANTLR3_UINT32 antlr3Fsize (pANTLR3_UINT8 filename); +ANTLR3_API ANTLR3_UINT32 antlr3read8Bit (pANTLR3_INPUT_STREAM input, pANTLR3_UINT8 fileName); +ANTLR3_API ANTLR3_UINT32 antlr3Fread (ANTLR3_FDSC fdsc, ANTLR3_UINT32 count, void * data); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/antlr/libantlr3c-3.4/include/antlr3input.h b/antlr/libantlr3c-3.4/include/antlr3input.h new file mode 100644 index 0000000..3b01ae6 --- /dev/null +++ b/antlr/libantlr3c-3.4/include/antlr3input.h @@ -0,0 +1,281 @@ +/** \file + * Defines the basic structures used to manipulate character + * streams from any input source. Any character size and encoding + * can in theory be used, so long as a set of functinos is provided that + * can return a 32 bit Integer representation of their characters amd efficiently mark and revert + * to specific offsets into their input streams. + */ +#ifndef _ANTLR3_INPUT_H +#define _ANTLR3_INPUT_H + +// [The "BSD licence"] +// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC +// http://www.temporal-wave.com +// http://www.linkedin.com/in/jimidle +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. The name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + + + +/// Master context structure for an ANTLR3 C runtime based input stream. +/// \ingroup apistructures +/// +typedef struct ANTLR3_INPUT_STREAM_struct +{ + /** Interfaces that provide streams must all provide + * a generic ANTLR3_INT_STREAM interface and an ANTLR3_INPUT_STREAM + * is no different. + */ + pANTLR3_INT_STREAM istream; + + /** Whatever super structure is providing the INPUT stream needs a pointer to itself + * so that this can be passed back to it whenever the api functions + * are called back from this interface. + */ + void * super; + + /** Pointer the start of the input string, characters may be + * taken as offsets from here and in original input format encoding. + */ + void * data; + + /** Indicates if the data pointer was allocated by us, and so should be freed + * when the stream dies. + */ + int isAllocated; + + /** String factory for this input stream + */ + pANTLR3_STRING_FACTORY strFactory; + + + /** Pointer to the next character to be consumed from the input data + * This is cast to point at the encoding of the original file that + * was read by the functions installed as pointer in this input stream + * context instance at file/string/whatever load time. + */ + void * nextChar; + + /** Number of characters that can be consumed at this point in time. + * Mostly this is just what is left in the pre-read buffer, but if the + * input source is a stream such as a socket or something then we may + * call special read code to wait for more input. + */ + ANTLR3_UINT32 sizeBuf; + + /** The line number we are traversing in the input file. This gets incremented + * by a newline() call in the lexer grammar actions. + */ + ANTLR3_UINT32 line; + + /** Pointer into the input buffer where the current line + * started. + */ + void * currentLine; + + /** The offset within the current line of the current character + */ + ANTLR3_INT32 charPositionInLine; + + /** Tracks how deep mark() calls are nested + */ + ANTLR3_UINT32 markDepth; + + /** List of mark() points in the input stream + */ + pANTLR3_VECTOR markers; + + /** File name string, set to pointer to memory if + * you set it manually as it will be free()d + */ + pANTLR3_STRING fileName; + + /** File number, needs to be set manually to some file index of your devising. + */ + ANTLR3_UINT32 fileNo; + + /* API */ + + + /** Pointer to function that closes the input stream + */ + void (*close) (struct ANTLR3_INPUT_STREAM_struct * input); + void (*free) (struct ANTLR3_INPUT_STREAM_struct * input); + + /** Pointer to function that resets the input stream + */ + void (*reset) (struct ANTLR3_INPUT_STREAM_struct * input); + + /** Pointer to a function that reuses and resets an input stream by + * supplying a new 'source' + */ + void (*reuse) (struct ANTLR3_INPUT_STREAM_struct * input, pANTLR3_UINT8 inString, ANTLR3_UINT32 size, pANTLR3_UINT8 name); + + /** + * Pointer to function that installs a version of LA that always + * returns upper case. Only valid for character streams and creates a case + * insensitive lexer if the lexer tokens are described in upper case. The + * tokens will preserve case in the token text. + */ + void (*setUcaseLA) (pANTLR3_INPUT_STREAM input, ANTLR3_BOOLEAN flag); + + /** Pointer to function to return input stream element at 1 based + * offset from nextChar. Same as _LA for char stream, but token + * streams etc. have one of these that does other stuff of course. + */ + void * (*_LT) (struct ANTLR3_INPUT_STREAM_struct * input, ANTLR3_INT32 lt); + + /** Pointer to function to return the total size of the input buffer. For streams + * this may be just the total we have available so far. This means of course that + * the input stream must be careful to accumulate enough input so that any backtracking + * can be satisfied. + */ + ANTLR3_UINT32 (*size) (struct ANTLR3_INPUT_STREAM_struct * input); + + /** Pointer to function to return a substring of the input stream. String is returned in allocated + * memory and is in same encoding as the input stream itself, NOT internal ANTLR3_UCHAR form. + */ + pANTLR3_STRING (*substr) (struct ANTLR3_INPUT_STREAM_struct * input, ANTLR3_MARKER start, ANTLR3_MARKER stop); + + /** Pointer to function to return the current line number in the input stream + */ + ANTLR3_UINT32 (*getLine) (struct ANTLR3_INPUT_STREAM_struct * input); + + /** Pointer to function to return the current line buffer in the input stream + * The pointer returned is directly into the input stream so you must copy + * it if you wish to manipulate it without damaging the input stream. Encoding + * is obviously in the same form as the input stream. + * \remark + * - Note taht this function wil lbe inaccurate if setLine is called as there + * is no way at the moment to position the input stream at a particular line + * number offset. + */ + void * (*getLineBuf) (struct ANTLR3_INPUT_STREAM_struct * input); + + /** Pointer to function to return the current offset in the current input stream line + */ + ANTLR3_UINT32 (*getCharPositionInLine) (struct ANTLR3_INPUT_STREAM_struct * input); + + /** Pointer to function to set the current line number in the input stream + */ + void (*setLine) (struct ANTLR3_INPUT_STREAM_struct * input, ANTLR3_UINT32 line); + + /** Pointer to function to set the current position in the current line. + */ + void (*setCharPositionInLine) (struct ANTLR3_INPUT_STREAM_struct * input, ANTLR3_UINT32 position); + + /** Pointer to function to override the default newline character that the input stream + * looks for to trigger the line/offset and line buffer recording information. + * \remark + * - By default the chracter '\n' will be installed as the newline trigger character. When this + * character is seen by the consume() function then the current line number is incremented and the + * current line offset is reset to 0. The Pointer for the line of input we are consuming + * is updated to point to the next character after this one in the input stream (which means it + * may become invalid if the last newline character in the file is seen (so watch out). + * - If for some reason you do not want the counters and pointers to be restee, you can set the + * chracter to some impossible character such as '\0' or whatever. + * - This is a single character only, so choose the last character in a sequence of two or more. + * - This is only a simple aid to error reporting - if you have a complicated binary input structure + * it may not be adequate, but you can always override every function in the input stream with your + * own of course, and can even write your own complete input stream set if you like. + * - It is your responsiblity to set a valid character for the input stream type. There is no point + * setting this to 0xFFFFFFFF if the input stream is 8 bit ASCII, as this will just be truncated and never + * trigger as the comparison will be (INT32)0xFF == (INT32)0xFFFFFFFF + */ + void (*SetNewLineChar) (struct ANTLR3_INPUT_STREAM_struct * input, ANTLR3_UINT32 newlineChar); + + /// Character that automatically causes an internal line count + /// increment. + /// + ANTLR3_UCHAR newlineChar; + + /// Indicates the size, in 8 bit units, of a single character. Note that + /// the C runtime does not deal with surrogates as this would be + /// slow and complicated. If this is a UTF-8 stream then this field + /// will be set to 0. Generally you are best working internally with 32 bit characters + /// as this is the most efficient. + /// + ANTLR3_UINT8 charByteSize; + + /// Indicates the encoding scheme used in this input stream + /// + ANTLR3_UINT32 encoding; +} + + ANTLR3_INPUT_STREAM; + + +/** \brief Structure for track lex input states as part of mark() + * and rewind() of lexer. + */ +typedef struct ANTLR3_LEX_STATE_struct +{ + /** Pointer to the next character to be consumed from the input data + * This is cast to point at the encoding of the original file that + * was read by the functions installed as pointer in this input stream + * context instance at file/string/whatever load time. + */ + void * nextChar; + + /** The line number we are traversing in the input file. This gets incremented + * by a newline() call in the lexer grammer actions. + */ + ANTLR3_UINT32 line; + + /** Pointer into the input buffer where the current line + * started. + */ + void * currentLine; + + /** The offset within the current line of the current character + */ + ANTLR3_INT32 charPositionInLine; + +} + ANTLR3_LEX_STATE; + +/* Prototypes + */ +void antlr38BitSetupStream (pANTLR3_INPUT_STREAM input); +void antlr3UTF16SetupStream (pANTLR3_INPUT_STREAM input, ANTLR3_BOOLEAN machineBigEndian, ANTLR3_BOOLEAN inputBigEndian); +void antlr3UTF32SetupStream (pANTLR3_INPUT_STREAM input, ANTLR3_BOOLEAN machineBigEndian, ANTLR3_BOOLEAN inputBigEndian); +void antlr3UTF8SetupStream (pANTLR3_INPUT_STREAM input); +void antlr3EBCDICSetupStream (pANTLR3_INPUT_STREAM input); +void antlr3GenericSetupStream (pANTLR3_INPUT_STREAM input); +#ifdef __cplusplus +} +#endif + +#endif /* _ANTLR3_INPUT_H */ diff --git a/antlr/libantlr3c-3.4/include/antlr3interfaces.h b/antlr/libantlr3c-3.4/include/antlr3interfaces.h new file mode 100644 index 0000000..160e04d --- /dev/null +++ b/antlr/libantlr3c-3.4/include/antlr3interfaces.h @@ -0,0 +1,239 @@ +/** \file + * Declarations for all the antlr3 C runtime interfaces/classes. This + * allows the structures that define the interfaces to contain pointers to + * each other without trying to sort out the cyclic interdependencies that + * would otherwise result. + */ +#ifndef _ANTLR3_INTERFACES_H +#define _ANTLR3_INTERFACES_H + +// [The "BSD licence"] +// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC +// http://www.temporal-wave.com +// http://www.linkedin.com/in/jimidle +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. The name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct ANTLR3_INT_STREAM_struct *pANTLR3_INT_STREAM; + +/// Pointer to an instantiation of the 'class' #ANTLR3_BASE_RECOGNIZER +/// \ingroup ANTLR3_BASE_RECOGNIZER +/// +typedef struct ANTLR3_BASE_RECOGNIZER_struct *pANTLR3_BASE_RECOGNIZER; +/// Pointer to an instantiation of 'class' #ANTLR3_RECOGNIZER_SHARED_STATE +/// \ingroup ANTLR3_RECOGNIZER_SHARED_STATE +/// +typedef struct ANTLR3_RECOGNIZER_SHARED_STATE_struct *pANTLR3_RECOGNIZER_SHARED_STATE; + +/// Pointer to an instantiation of 'class' #ANTLR3_BITSET_LIST +/// \ingroup ANTLR3_BITSET_LIST +/// +typedef struct ANTLR3_BITSET_LIST_struct *pANTLR3_BITSET_LIST; + +/// Pointer to an instantiation of 'class' #ANTLR3_BITSET +/// \ingroup ANTLR3_BITSET +/// +typedef struct ANTLR3_BITSET_struct *pANTLR3_BITSET; + +/// Pointer to an instantiation of 'class' #ANTLR3_TOKEN_FACTORY +/// \ingroup ANTLR3_TOKEN_FACTORY +/// +typedef struct ANTLR3_TOKEN_FACTORY_struct *pANTLR3_TOKEN_FACTORY; +/// Pointer to an instantiation of 'class' #ANTLR3_COMMON_TOKEN +/// \ingroup ANTLR3_COMMON_TOKEN +/// +typedef struct ANTLR3_COMMON_TOKEN_struct *pANTLR3_COMMON_TOKEN; + +/// Pointer to an instantiation of 'class' #ANTLR3_EXCEPTION +/// \ingroup ANTLR3_EXCEPTION +/// +typedef struct ANTLR3_EXCEPTION_struct *pANTLR3_EXCEPTION; + +/// Pointer to an instantiation of 'class' #ANTLR3_HASH_BUCKET +/// \ingroup ANTLR3_HASH_BUCKET +/// +typedef struct ANTLR3_HASH_BUCKET_struct *pANTLR3_HASH_BUCKET; +/// Pointer to an instantiation of 'class' #ANTLR3_HASH_ENTRY +/// \ingroup ANTLR3_HASH_ENTRY +/// +typedef struct ANTLR3_HASH_ENTRY_struct *pANTLR3_HASH_ENTRY; +/// Pointer to an instantiation of 'class' #ANTLR3_HASH_ENUM +/// \ingroup ANTLR3_HASH_ENUM +/// +typedef struct ANTLR3_HASH_ENUM_struct *pANTLR3_HASH_ENUM; +/// Pointer to an instantiation of 'class' #ANTLR3_HASH_TABLE +/// \ingroup ANTLR3_HASH_TABLE +/// +typedef struct ANTLR3_HASH_TABLE_struct *pANTLR3_HASH_TABLE; + +/// Pointer to an instantiation of 'class' #ANTLR3_LIST +/// \ingroup ANTLR3_LIST +/// +typedef struct ANTLR3_LIST_struct *pANTLR3_LIST; +/// Pointer to an instantiation of 'class' #ANTLR3_VECTOR_FACTORY +/// \ingroup ANTLR3_VECTOR_FACTORY +/// +typedef struct ANTLR3_VECTOR_FACTORY_struct *pANTLR3_VECTOR_FACTORY; +/// Pointer to an instantiation of 'class' #ANTLR3_VECTOR +/// \ingroup ANTLR3_VECTOR +/// +typedef struct ANTLR3_VECTOR_struct *pANTLR3_VECTOR; +/// Pointer to an instantiation of 'class' #ANTLR3_STACK +/// \ingroup ANTLR3_STACK +/// +typedef struct ANTLR3_STACK_struct *pANTLR3_STACK; + +/// Pointer to an instantiation of 'class' #ANTLR3_TOPO +/// \ingroup ANTLR3_TOPO +/// +typedef struct ANTLR3_TOPO_struct *pANTLR3_TOPO; + +/// Pointer to an instantiation of 'class' #ANTLR3_INPUT_STREAM +/// \ingroup ANTLR3_INPUT_STREAM +/// +typedef struct ANTLR3_INPUT_STREAM_struct *pANTLR3_INPUT_STREAM; +/// Pointer to an instantiation of 'class' #ANTLR3_LEX_STATE +/// \ingroup ANTLR3_LEX_STATE +/// +typedef struct ANTLR3_LEX_STATE_struct *pANTLR3_LEX_STATE; + +/// Pointer to an instantiation of 'class' #ANTLR3_STRING_FACTORY +/// \ingroup ANTLR3_STRING_FACTORY +/// +typedef struct ANTLR3_STRING_FACTORY_struct *pANTLR3_STRING_FACTORY; +/// Pointer to an instantiation of 'class' #ANTLR3_STRING +/// \ingroup ANTLR3_STRING +/// +typedef struct ANTLR3_STRING_struct *pANTLR3_STRING; + +/// Pointer to an instantiation of 'class' #ANTLR3_TOKEN_SOURCE +/// \ingroup ANTLR3_TOKEN_SOURCE +/// +typedef struct ANTLR3_TOKEN_SOURCE_struct *pANTLR3_TOKEN_SOURCE; +/// Pointer to an instantiation of 'class' #ANTLR3_TOKEN_STREAM +/// \ingroup ANTLR3_TOKEN_STREAM +/// +typedef struct ANTLR3_TOKEN_STREAM_struct *pANTLR3_TOKEN_STREAM; +/// Pointer to an instantiation of 'class' #ANTLR3_COMMON_TOKEN_STREAM +/// \ingroup ANTLR3_COMMON_TOKEN_STREAM +/// +typedef struct ANTLR3_COMMON_TOKEN_STREAM_struct *pANTLR3_COMMON_TOKEN_STREAM; + +/// Pointer to an instantiation of 'class' #ANTLR3_CYCLIC_DFA +/// \ingroup ANTLR3_CYCLIC_DFA +/// +typedef struct ANTLR3_CYCLIC_DFA_struct *pANTLR3_CYCLIC_DFA; + +/// Pointer to an instantiation of 'class' #ANTLR3_LEXER +/// \ingroup ANTLR3_LEXER +/// +typedef struct ANTLR3_LEXER_struct *pANTLR3_LEXER; +/// Pointer to an instantiation of 'class' #ANTLR3_PARSER +/// \ingroup ANTLR3_PARSER +/// +typedef struct ANTLR3_PARSER_struct *pANTLR3_PARSER; + +/// Pointer to an instantiation of 'class' #ANTLR3_BASE_TREE +/// \ingroup ANTLR3_BASE_TREE +/// +typedef struct ANTLR3_BASE_TREE_struct *pANTLR3_BASE_TREE; +/// Pointer to an instantiation of 'class' #ANTLR3_COMMON_TREE +/// \ingroup ANTLR3_COMMON_TREE +/// +typedef struct ANTLR3_COMMON_TREE_struct *pANTLR3_COMMON_TREE; +/// Pointer to an instantiation of 'class' #ANTLR3_ARBORETUM +/// \ingroup ANTLR3_ARBORETUM +/// +typedef struct ANTLR3_ARBORETUM_struct *pANTLR3_ARBORETUM; +/// Pointer to an instantiation of 'class' #ANTLR3_PARSE_TREE +/// \ingroup ANTLR3_PARSE_TREE +/// +typedef struct ANTLR3_PARSE_TREE_struct *pANTLR3_PARSE_TREE; + +/// Pointer to an instantiation of 'class' #ANTLR3_TREE_NODE_STREAM +/// \ingroup ANTLR3_TREE_NODE_STREAM +/// +typedef struct ANTLR3_TREE_NODE_STREAM_struct *pANTLR3_TREE_NODE_STREAM; +/// Pointer to an instantiation of 'class' #ANTLR3_COMMON_TREE_NODE_STREAM +/// \ingroup ANTLR3_COMMON_TREE_NODE_STREAM +/// +typedef struct ANTLR3_COMMON_TREE_NODE_STREAM_struct *pANTLR3_COMMON_TREE_NODE_STREAM; +/// Pointer to an instantiation of 'class' #ANTLR3_TREE_WALK_STATE +/// \ingroup ANTLR3_TREE_WALK_STATE +/// +typedef struct ANTLR3_TREE_WALK_STATE_struct *pANTLR3_TREE_WALK_STATE; + +/// Pointer to an instantiation of 'class' #ANTLR3_BASE_TREE_ADAPTOR +/// \ingroup ANTLR3_BASE_TREE_ADAPTOR +/// +typedef struct ANTLR3_BASE_TREE_ADAPTOR_struct *pANTLR3_BASE_TREE_ADAPTOR; +/// Pointer to an instantiation of 'class' #ANTLR3_COMMON_TREE_ADAPTOR +/// \ingroup ANTLR3_COMMON_TREE_ADAPTOR +/// +typedef struct ANTLR3_COMMON_TREE_ADAPTOR_struct *pANTLR3_COMMON_TREE_ADAPTOR; + +/// Pointer to an instantiation of 'class' #ANTLR3_TREE_PARSER +/// \ingroup ANTLR3_TREE_PARSER +/// +typedef struct ANTLR3_TREE_PARSER_struct *pANTLR3_TREE_PARSER; + +/// Pointer to an instantiation of 'class' #ANTLR3_INT_TRIE +/// \ingroup ANTLR3_INT_TRIE +/// +typedef struct ANTLR3_INT_TRIE_struct *pANTLR3_INT_TRIE; + +/// Pointer to an instantiation of 'class' #ANTLR3_REWRITE_RULE_ELEMENT_STREAM +/// \ingroup ANTLR3_REWRITE_RULE_ELEMENT_STREAM +/// +typedef struct ANTLR3_REWRITE_RULE_ELEMENT_STREAM_struct *pANTLR3_REWRITE_RULE_ELEMENT_STREAM; +/// Pointer to an instantiation of 'class' #ANTLR3_REWRITE_RULE_ELEMENT_STREAM +/// \ingroup ANTLR3_REWRITE_RULE_ELEMENT_STREAM +/// +typedef struct ANTLR3_REWRITE_RULE_ELEMENT_STREAM_struct *pANTLR3_REWRITE_RULE_TOKEN_STREAM; + +/// Pointer to an instantiation of 'class' #ANTLR3_REWRITE_RULE_SUBSTREE_STREAM +/// \ingroup ANTLR3_REWRITE_RULE_SUBTREE_STREAM +/// +typedef struct ANTLR3_REWRITE_RULE_ELEMENT_STREAM_struct *pANTLR3_REWRITE_RULE_SUBTREE_STREAM; + +/// Pointer to an instantiation of 'class' #ANTLR3_REWRITE_RULE_NODE_STREAM +/// \ingroup ANTLR3_REWRITE_RULE_NODE_STREAM +/// +typedef struct ANTLR3_REWRITE_RULE_ELEMENT_STREAM_struct *pANTLR3_REWRITE_RULE_NODE_STREAM; + +/// Pointer to an instantiation of 'class' #ANTLR3_DEBUG_EVENT_LISTENER +/// \ingroup ANTLR3_DEBUG_EVENT_LISTENER +/// +typedef struct ANTLR3_DEBUG_EVENT_LISTENER_struct *pANTLR3_DEBUG_EVENT_LISTENER; + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/antlr/libantlr3c-3.4/include/antlr3intstream.h b/antlr/libantlr3c-3.4/include/antlr3intstream.h new file mode 100644 index 0000000..21bac5b --- /dev/null +++ b/antlr/libantlr3c-3.4/include/antlr3intstream.h @@ -0,0 +1,205 @@ +/** \file + * Defines the the class interface for an antlr3 INTSTREAM. + * + * Certain functionality (such as DFAs for instance) abstract the stream of tokens + * or characters in to a steam of integers. Hence this structure should be included + * in any stream that is able to provide the output as a stream of integers (which is anything + * basically. + * + * There are no specific implementations of the methods in this interface in general. Though + * for purposes of casting and so on, it may be necesssary to implement a function with + * the signature in this interface which abstracts the base immplementation. In essence though + * the base stream provides a pointer to this interface, within which it installs its + * normal match() functions and so on. Interaces such as DFA are then passed the pANTLR3_INT_STREAM + * and can treat any input as an int stream. + * + * For instance, a lexer implements a pANTLR3_BASE_RECOGNIZER, within which there is a pANTLR3_INT_STREAM. + * However, a pANTLR3_INPUT_STREAM also provides a pANTLR3_INT_STREAM, which it has constructed from + * it's normal interface when it was created. This is then pointed at by the pANTLR_BASE_RECOGNIZER + * when it is intialized with a pANTLR3_INPUT_STREAM. + * + * Similarly if a pANTLR3_BASE_RECOGNIZER is initialized with a pANTLR3_TOKEN_STREAM, then the + * pANTLR3_INT_STREAM is taken from the pANTLR3_TOKEN_STREAM. + * + * If a pANTLR3_BASE_RECOGNIZER is initialized with a pANTLR3_TREENODE_STREAM, then guess where + * the pANTLR3_INT_STREAM comes from? + * + * Note that because the context pointer points to the actual interface structure that is providing + * the ANTLR3_INT_STREAM it is defined as a (void *) in this interface. There is no direct implementation + * of an ANTLR3_INT_STREAM (unless someone did not understand what I was doing here =;?P + */ +#ifndef _ANTLR3_INTSTREAM_H +#define _ANTLR3_INTSTREAM_H + +// [The "BSD licence"] +// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC +// http://www.temporal-wave.com +// http://www.linkedin.com/in/jimidle +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. The name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include +#include + +/** Type indicator for a character stream + * \remark if a custom stream is created but it can be treated as + * a char stream, then you may OR in this value to your type indicator + */ +#define ANTLR3_CHARSTREAM 0x0001 + +/** Type indicator for a Token stream + * \remark if a custom stream is created but it can be treated as + * a token stream, then you may OR in this value to your type indicator + */ +#define ANTLR3_TOKENSTREAM 0x0002 + +/** Type indicator for a common tree node stream + * \remark if a custom stream is created but it can be treated as + * a common tree node stream, then you may OR in this value to your type indicator + */ +#define ANTLR3_COMMONTREENODE 0x0004 + +/** Type mask for input stream so we can switch in the above types + * \remark DO NOT USE 0x0000 as a stream type! + */ +#define ANTLR3_INPUT_MASK 0x0007 + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct ANTLR3_INT_STREAM_struct +{ + /** Input stream type indicator. Sometimes useful for error reporting etc. + */ + ANTLR3_UINT32 type; + + /** Potentially useful in error reporting and so on, this string is + * an identification of the input source. It may be NULL, so anything + * attempting to access it needs to check this and substitute a sensible + * default. + */ + pANTLR3_STRING streamName; + + /** Pointer to the super structure that contains this interface. This + * will usually be a token stream or a tree stream. + */ + void * super; + + /** Last marker position allocated + */ + ANTLR3_MARKER lastMarker; + + // Return a string that identifies the input source + // + pANTLR3_STRING (*getSourceName) (struct ANTLR3_INT_STREAM_struct * intStream); + + /** Consume the next 'ANTR3_UINT32' in the stream + */ + void (*consume) (struct ANTLR3_INT_STREAM_struct * intStream); + + /** Get ANTLR3_UINT32 at current input pointer + i ahead where i=1 is next ANTLR3_UINT32 + */ + ANTLR3_UINT32 (*_LA) (struct ANTLR3_INT_STREAM_struct * intStream, ANTLR3_INT32 i); + + /** Tell the stream to start buffering if it hasn't already. Return + * current input position, index(), or some other marker so that + * when passed to rewind() you get back to the same spot. + * rewind(mark()) should not affect the input cursor. + */ + ANTLR3_MARKER (*mark) (struct ANTLR3_INT_STREAM_struct * intStream); + + /** Return the current input symbol index 0..n where n indicates the + * last symbol has been read. + */ + ANTLR3_MARKER (*index) (struct ANTLR3_INT_STREAM_struct * intStream); + + /** Reset the stream so that next call to index would return marker. + * The marker will usually be index() but it doesn't have to be. It's + * just a marker to indicate what state the stream was in. This is + * essentially calling release() and seek(). If there are markers + * created after this marker argument, this routine must unroll them + * like a stack. Assume the state the stream was in when this marker + * was created. + */ + void (*rewind) (struct ANTLR3_INT_STREAM_struct * intStream, ANTLR3_MARKER marker); + + /** Reset the stream to the last marker position, witouh destryoing the + * last marker position. + */ + void (*rewindLast) (struct ANTLR3_INT_STREAM_struct * intStream); + + /** You may want to commit to a backtrack but don't want to force the + * stream to keep bookkeeping objects around for a marker that is + * no longer necessary. This will have the same behavior as + * rewind() except it releases resources without the backward seek. + */ + void (*release) (struct ANTLR3_INT_STREAM_struct * intStream, ANTLR3_MARKER mark); + + /** Set the input cursor to the position indicated by index. This is + * normally used to seek ahead in the input stream. No buffering is + * required to do this unless you know your stream will use seek to + * move backwards such as when backtracking. + * + * This is different from rewind in its multi-directional + * requirement and in that its argument is strictly an input cursor (index). + * + * For char streams, seeking forward must update the stream state such + * as line number. For seeking backwards, you will be presumably + * backtracking using the mark/rewind mechanism that restores state and + * so this method does not need to update state when seeking backwards. + * + * Currently, this method is only used for efficient backtracking, but + * in the future it may be used for incremental parsing. + */ + void (*seek) (struct ANTLR3_INT_STREAM_struct * intStream, ANTLR3_MARKER index); + + /** Only makes sense for streams that buffer everything up probably, but + * might be useful to display the entire stream or for testing. + */ + ANTLR3_UINT32 (*size) (struct ANTLR3_INT_STREAM_struct * intStream); + + /** Because the indirect call, though small in individual cases can + * mount up if there are thousands of tokens (very large input streams), callers + * of size can optionally use this cached size field. + */ + ANTLR3_UINT32 cachedSize; + + /** Frees any resources that were allocated for the implementation of this + * interface. Usually this is just releasing the memory allocated + * for the structure itself, but it may of course do anything it need to + * so long as it does not stamp on anything else. + */ + void (*free) (struct ANTLR3_INT_STREAM_struct * stream); + +} + ANTLR3_INT_STREAM; + +#ifdef __cplusplus +} +#endif + +#endif + diff --git a/antlr/libantlr3c-3.4/include/antlr3lexer.h b/antlr/libantlr3c-3.4/include/antlr3lexer.h new file mode 100644 index 0000000..6cc10ef --- /dev/null +++ b/antlr/libantlr3c-3.4/include/antlr3lexer.h @@ -0,0 +1,193 @@ +/** \file + * Base interface for any ANTLR3 lexer. + * + * An ANLTR3 lexer builds from two sets of components: + * + * - The runtime components that provide common functionality such as + * traversing character streams, building tokens for output and so on. + * - The generated rules and struutre of the actual lexer, which call upon the + * runtime components. + * + * A lexer class contains a character input stream, a base recognizer interface + * (which it will normally implement) and a token source interface (which it also + * implements. The Tokensource interface is called by a token consumer (such as + * a parser, but in theory it can be anything that wants a set of abstract + * tokens in place of a raw character stream. + * + * So then, we set up a lexer in a sequence akin to: + * + * - Create a character stream (something which implements ANTLR3_INPUT_STREAM) + * and initialize it. + * - Create a lexer interface and tell it where it its input stream is. + * This will cause the creation of a base recognizer class, which it will + * override with its own implementations of some methods. The lexer creator + * can also then in turn override anything it likes. + * - The lexer token source interface is then passed to some interface that + * knows how to use it, byte calling for a next token. + * - When a next token is called, let ze lexing begin. + * + */ +#ifndef _ANTLR3_LEXER +#define _ANTLR3_LEXER + +// [The "BSD licence"] +// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC +// http://www.temporal-wave.com +// http://www.linkedin.com/in/jimidle +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. The name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +/* Definitions + */ +#define ANTLR3_STRING_TERMINATOR 0xFFFFFFFF + +#include +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct ANTLR3_LEXER_struct +{ + /** If there is a super structure that is implementing the + * lexer, then a pointer to it can be stored here in case + * implementing functions are overridden by this super structure. + */ + void * super; + + /** A generated lexer has an mTokens() function, which needs + * the context pointer of the generated lexer, not the base lexer interface + * this is stored here and initialized by the generated code (or manually + * if this is a manually built lexer. + */ + void * ctx; + + /** A pointer to the character stream whence this lexer is receiving + * characters. + * TODO: I may come back to this and implement charstream outside + * the input stream as per the java implementation. + */ + pANTLR3_INPUT_STREAM input; + + /** Pointer to the implementation of a base recognizer, which the lexer + * creates and then overrides with its own lexer oriented functions (the + * default implementation is parser oriented). This also contains a + * token source interface, which the lexer instance will provide to anything + * that needs it, which is anything else that implements a base recognizer, + * such as a parser. + */ + pANTLR3_BASE_RECOGNIZER rec; + + /** Pointer to a function that sets the charstream source for the lexer and + * causes it to be reset. + */ + void (*setCharStream) (struct ANTLR3_LEXER_struct * lexer, pANTLR3_INPUT_STREAM input); + + /** Pointer to a function that switches the current character input stream to + * a new one, saving the old one, which we will revert to at the end of this + * new one. + */ + void (*pushCharStream) (struct ANTLR3_LEXER_struct * lexer, pANTLR3_INPUT_STREAM input); + + /** Pointer to a function that abandons the current input stream, whether it + * is empty or not and reverts to the previous stacked input stream. + */ + void (*popCharStream) (struct ANTLR3_LEXER_struct * lexer); + + /** Pointer to a function that emits the supplied token as the next token in + * the stream. + */ + void (*emitNew) (struct ANTLR3_LEXER_struct * lexer, pANTLR3_COMMON_TOKEN token); + + /** Pointer to a function that constructs a new token from the lexer stored information + */ + pANTLR3_COMMON_TOKEN (*emit) (struct ANTLR3_LEXER_struct * lexer); + + /** Pointer to the user provided (either manually or through code generation + * function that causes the lexer rules to run the lexing rules and produce + * the next token if there iss one. This is called from nextToken() in the + * pANTLR3_TOKEN_SOURCE. Note that the input parameter for this funciton is + * the generated lexer context (stored in ctx in this interface) it is a generated + * function and expects the context to be the generated lexer. + */ + void (*mTokens) (void * ctx); + + /** Pointer to a function that attempts to match and consume the specified string from the input + * stream. Note that strings muse be passed as terminated arrays of ANTLR3_UCHAR. Strings are terminated + * with 0xFFFFFFFF, which is an invalid UTF32 character + */ + ANTLR3_BOOLEAN (*matchs) (struct ANTLR3_LEXER_struct * lexer, ANTLR3_UCHAR * string); + + /** Pointer to a function that matches and consumes the specified character from the input stream. + * The input stream is required to provide characters via LA() as UTF32 characters. The default lexer + * implementation is source encoding agnostic and so input streams do not generally need to + * override the default implmentation. + */ + ANTLR3_BOOLEAN (*matchc) (struct ANTLR3_LEXER_struct * lexer, ANTLR3_UCHAR c); + + /** Pointer to a function that matches any character in the supplied range (I suppose it could be a token range too + * but this would only be useful if the tokens were in tsome guaranteed order which is + * only going to happen with a hand crafted token set). + */ + ANTLR3_BOOLEAN (*matchRange) (struct ANTLR3_LEXER_struct * lexer, ANTLR3_UCHAR low, ANTLR3_UCHAR high); + + /** Pointer to a function that matches the next token/char in the input stream + * regardless of what it actaully is. + */ + void (*matchAny) (struct ANTLR3_LEXER_struct * lexer); + + /** Pointer to a function that recovers from an error found in the input stream. + * Generally, this will be a #ANTLR3_EXCEPTION_NOVIABLE_ALT but it could also + * be from a mismatched token that the (*match)() could not recover from. + */ + void (*recover) (struct ANTLR3_LEXER_struct * lexer); + + /** Pointer to function to return the current line number in the input stream + */ + ANTLR3_UINT32 (*getLine) (struct ANTLR3_LEXER_struct * lexer); + ANTLR3_MARKER (*getCharIndex) (struct ANTLR3_LEXER_struct * lexer); + ANTLR3_UINT32 (*getCharPositionInLine)(struct ANTLR3_LEXER_struct * lexer); + + /** Pointer to function to return the text so far for the current token being generated + */ + pANTLR3_STRING (*getText) (struct ANTLR3_LEXER_struct * lexer); + + + /** Pointer to a function that knows how to free the resources of a lexer + */ + void (*free) (struct ANTLR3_LEXER_struct * lexer); + +} + ANTLR3_LEXER; + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/antlr/libantlr3c-3.4/include/antlr3memory.h b/antlr/libantlr3c-3.4/include/antlr3memory.h new file mode 100644 index 0000000..5e2d4c9 --- /dev/null +++ b/antlr/libantlr3c-3.4/include/antlr3memory.h @@ -0,0 +1,36 @@ +#ifndef _ANTLR3MEMORY_H +#define _ANTLR3MEMORY_H + +// [The "BSD licence"] +// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC +// http://www.temporal-wave.com +// http://www.linkedin.com/in/jimidle +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. The name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include + + +#endif /* _ANTLR3MEMORY_H */ diff --git a/antlr/libantlr3c-3.4/include/antlr3parser.h b/antlr/libantlr3c-3.4/include/antlr3parser.h new file mode 100644 index 0000000..95b7d18 --- /dev/null +++ b/antlr/libantlr3c-3.4/include/antlr3parser.h @@ -0,0 +1,93 @@ +/** \file + * Base implementation of an ANTLR3 parser. + * + * + */ +#ifndef _ANTLR3_PARSER_H +#define _ANTLR3_PARSER_H + +// [The "BSD licence"] +// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC +// http://www.temporal-wave.com +// http://www.linkedin.com/in/jimidle +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. The name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** This is the main interface for an ANTLR3 parser. + */ +typedef struct ANTLR3_PARSER_struct +{ + /** All superstructure implementers of this interface require a pointer to their selves, + * which they can reference using the super pointer here. + */ + void * super; + + /** A pointer to the base recognizer, where most of the parser functions actually + * live because they are shared between parser and tree parser and this is the + * easier way than copying the interface all over the place. Macros hide this + * for the generated code so it is easier on the eye (though not the debugger ;-). + */ + pANTLR3_BASE_RECOGNIZER rec; + + /** A provider of a tokenstream interface, for the parser to consume + * tokens from. + */ + pANTLR3_TOKEN_STREAM tstream; + + /** A pointer to a function that installs a debugger object (it also + * installs the debugging versions of the parser methods. This means that + * a non debug parser incurs no overhead because of the debugging stuff. + */ + void (*setDebugListener) (struct ANTLR3_PARSER_struct * parser, pANTLR3_DEBUG_EVENT_LISTENER dbg); + + /** A pointer to a function that installs a token stream + * for the parser. + */ + void (*setTokenStream) (struct ANTLR3_PARSER_struct * parser, pANTLR3_TOKEN_STREAM); + + /** A pointer to a function that returns the token stream for this + * parser. + */ + pANTLR3_TOKEN_STREAM (*getTokenStream) (struct ANTLR3_PARSER_struct * parser); + + /** Pointer to a function that knows how to free resources of an ANTLR3 parser. + */ + void (*free) (struct ANTLR3_PARSER_struct * parser); + +} + ANTLR3_PARSER; + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/antlr/libantlr3c-3.4/include/antlr3parsetree.h b/antlr/libantlr3c-3.4/include/antlr3parsetree.h new file mode 100644 index 0000000..0e8c157 --- /dev/null +++ b/antlr/libantlr3c-3.4/include/antlr3parsetree.h @@ -0,0 +1,85 @@ +/** \file + * Abstraction of Common tree to provide payload and string representation of node. + * + * \todo May not need this in the end + */ + +#ifndef ANTLR3_PARSETREE_H +#define ANTLR3_PARSETREE_H + +// [The "BSD licence"] +// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC +// http://www.temporal-wave.com +// http://www.linkedin.com/in/jimidle +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. The name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct ANTLR3_PARSE_TREE_struct +{ + /** Any interface that implements methods in this interface + * may need to point back to itself using this pointer to its + * super structure. + */ + void * super; + + /** The payload that the parse tree node passes around + */ + void * payload; + + /** An encapsulated BASE TREE strcuture (NOT a pointer) + * that perfoms a lot of the dirty work of node management + */ + ANTLR3_BASE_TREE baseTree; + + /** How to dup this node + */ + pANTLR3_BASE_TREE (*dupNode) (struct ANTLR3_PARSE_TREE_struct * tree); + + /** Return the type of this node + */ + ANTLR3_UINT32 (*getType) (struct ANTLR3_PARSE_TREE_struct * tree); + + /** Return the string representation of the payload (must be installed + * when the payload is added and point to a function that knwos how to + * manifest a pANTLR3_STRING from a node. + */ + pANTLR3_STRING (*toString) (struct ANTLR3_PARSE_TREE_struct * payload); + + void (*free) (struct ANTLR3_PARSE_TREE_struct * tree); + +} + ANTLR3_PARSE_TREE; + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/antlr/libantlr3c-3.4/include/antlr3recognizersharedstate.h b/antlr/libantlr3c-3.4/include/antlr3recognizersharedstate.h new file mode 100644 index 0000000..9e024d8 --- /dev/null +++ b/antlr/libantlr3c-3.4/include/antlr3recognizersharedstate.h @@ -0,0 +1,218 @@ +/** \file + * While the C runtime does not need to model the state of + * multiple lexers and parsers in the same way as the Java runtime does + * it is no overhead to reflect that model. In fact the + * C runtime has always been able to share recognizer state. + * + * This 'class' therefore defines all the elements of a recognizer + * (either lexer, parser or tree parser) that are need to + * track the current recognition state. Multiple recognizers + * may then share this state, for instance when one grammar + * imports another. + */ + +#ifndef _ANTLR3_RECOGNIZER_SHARED_STATE_H +#define _ANTLR3_RECOGNIZER_SHARED_STATE_H + +// [The "BSD licence"] +// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC +// http://www.temporal-wave.com +// http://www.linkedin.com/in/jimidle +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. The name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** All the data elements required to track the current state + * of any recognizer (lexer, parser, tree parser). + * May be share between multiple recognizers such that + * grammar inheritance is easily supported. + */ +typedef struct ANTLR3_RECOGNIZER_SHARED_STATE_struct +{ + /** If set to ANTLR3_TRUE then the recognizer has an exception + * condition (this is tested by the generated code for the rules of + * the grammar). + */ + ANTLR3_BOOLEAN error; + + /** Points to the first in a possible chain of exceptions that the + * recognizer has discovered. + */ + pANTLR3_EXCEPTION exception; + + /** Track around a hint from the creator of the recognizer as to how big this + * thing is going to get, as the actress said to the bishop. This allows us + * to tune hash tables accordingly. This might not be the best place for this + * in the end but we will see. + */ + ANTLR3_UINT32 sizeHint; + + /** Track the set of token types that can follow any rule invocation. + * Stack structure, to support: List. + */ + pANTLR3_STACK following; + + + /** This is true when we see an error and before having successfully + * matched a token. Prevents generation of more than one error message + * per error. + */ + ANTLR3_BOOLEAN errorRecovery; + + /** The index into the input stream where the last error occurred. + * This is used to prevent infinite loops where an error is found + * but no token is consumed during recovery...another error is found, + * ad nauseam. This is a failsafe mechanism to guarantee that at least + * one token/tree node is consumed for two errors. + */ + ANTLR3_MARKER lastErrorIndex; + + /** In lieu of a return value, this indicates that a rule or token + * has failed to match. Reset to false upon valid token match. + */ + ANTLR3_BOOLEAN failed; + + /** When the recognizer terminates, the error handling functions + * will have incremented this value if any error occurred (that was displayed). It can then be + * used by the grammar programmer without having to use static globals. + */ + ANTLR3_UINT32 errorCount; + + /** If 0, no backtracking is going on. Safe to exec actions etc... + * If >0 then it's the level of backtracking. + */ + ANTLR3_INT32 backtracking; + + /** ANTLR3_VECTOR of ANTLR3_LIST for rule memoizing. + * Tracks the stop token index for each rule. ruleMemo[ruleIndex] is + * the memoization table for ruleIndex. For key ruleStartIndex, you + * get back the stop token for associated rule or MEMO_RULE_FAILED. + * + * This is only used if rule memoization is on. + */ + pANTLR3_INT_TRIE ruleMemo; + + /** Pointer to an array of token names + * that are generally useful in error reporting. The generated parsers install + * this pointer. The table it points to is statically allocated as 8 bit ascii + * at parser compile time - grammar token names are thus restricted in character + * sets, which does not seem to terrible. + */ + pANTLR3_UINT8 * tokenNames; + + /** User programmable pointer that can be used for instance as a place to + * store some tracking structure specific to the grammar that would not normally + * be available to the error handling functions. + */ + void * userp; + + /** The goal of all lexer rules/methods is to create a token object. + * This is an instance variable as multiple rules may collaborate to + * create a single token. For example, NUM : INT | FLOAT ; + * In this case, you want the INT or FLOAT rule to set token and not + * have it reset to a NUM token in rule NUM. + */ + pANTLR3_COMMON_TOKEN token; + + /** The goal of all lexer rules being to create a token, then a lexer + * needs to build a token factory to create them. + */ + pANTLR3_TOKEN_FACTORY tokFactory; + + /** A lexer is a source of tokens, produced by all the generated (or + * hand crafted if you like) matching rules. As such it needs to provide + * a token source interface implementation. + */ + pANTLR3_TOKEN_SOURCE tokSource; + + /** The channel number for the current token + */ + ANTLR3_UINT32 channel; + + /** The token type for the current token + */ + ANTLR3_UINT32 type; + + /** The input line (where it makes sense) on which the first character of the current + * token resides. + */ + ANTLR3_INT32 tokenStartLine; + + /** The character position of the first character of the current token + * within the line specified by tokenStartLine + */ + ANTLR3_INT32 tokenStartCharPositionInLine; + + /** What character index in the stream did the current token start at? + * Needed, for example, to get the text for current token. Set at + * the start of nextToken. + */ + ANTLR3_MARKER tokenStartCharIndex; + + /** Text for the current token. This can be overridden by setting this + * variable directly or by using the SETTEXT() macro (preferred) in your + * lexer rules. + */ + pANTLR3_STRING text; + + /** User controlled variables that will be installed in a newly created + * token. + */ + ANTLR3_UINT32 user1, user2, user3; + void * custom; + + /** Input stream stack, which allows the C programmer to switch input streams + * easily and allow the standard nextToken() implementation to deal with it + * as this is a common requirement. + */ + pANTLR3_STACK streams; + + /// A stack of token/tree rewrite streams that are available for use + /// by a parser or tree parser that is using rewrites to generate + /// an AST. This saves each rule in the recongizer from having to + /// allocate and deallocate rewtire streams on entry and exit. As + /// the parser recurses throgh the rules it will reach a steady state + /// of the maximum number of allocated streams, which instead of + /// deallocating them at rule exit, it will place on this stack for + /// reuse. The streams are then all finally freed when this stack + /// is freed. + /// + pANTLR3_VECTOR rStreams; + +} + ANTLR3_RECOGNIZER_SHARED_STATE; + +#ifdef __cplusplus +} +#endif + +#endif + + diff --git a/antlr/libantlr3c-3.4/include/antlr3rewritestreams.h b/antlr/libantlr3c-3.4/include/antlr3rewritestreams.h new file mode 100644 index 0000000..bf83fe9 --- /dev/null +++ b/antlr/libantlr3c-3.4/include/antlr3rewritestreams.h @@ -0,0 +1,180 @@ +#ifndef ANTLR3REWRITESTREAM_H +#define ANTLR3REWRITESTREAM_H + +// [The "BSD licence"] +// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC +// http://www.temporal-wave.com +// http://www.linkedin.com/in/jimidle +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. The name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/// A generic list of elements tracked in an alternative to be used in +/// a -> rewrite rule. +/// +/// In the C implementation, all tree oriented streams return a pointer to +/// the same type: pANTLR3_BASE_TREE. Anything that has subclassed from this +/// still passes this type, within which there is a super pointer, which points +/// to it's own data and methods. Hence we do not need to implement this as +/// the equivalent of an abstract class, but just fill in the appropriate interface +/// as usual with this model. +/// +/// Once you start next()ing, do not try to add more elements. It will +/// break the cursor tracking I believe. +/// +/// +/// \see #pANTLR3_REWRITE_RULE_NODE_STREAM +/// \see #pANTLR3_REWRITE_RULE_ELEMENT_STREAM +/// \see #pANTLR3_REWRITE_RULE_SUBTREE_STREAM +/// +/// TODO: add mechanism to detect/puke on modification after reading from stream +/// +typedef struct ANTLR3_REWRITE_RULE_ELEMENT_STREAM_struct +{ + + /// Cursor 0..n-1. If singleElement!=NULL, cursor is 0 until you next(), + /// which bumps it to 1 meaning no more elements. + /// + ANTLR3_UINT32 cursor; + + /// Track single elements w/o creating a list. Upon 2nd add, alloc list + /// + void * singleElement; + + /// The list of tokens or subtrees we are tracking + /// + pANTLR3_VECTOR elements; + + /// Indicates whether we should free the vector or it was supplied to us + /// + ANTLR3_BOOLEAN freeElements; + + /// The element or stream description; usually has name of the token or + /// rule reference that this list tracks. Can include rulename too, but + /// the exception would track that info. + /// + void * elementDescription; + + /// Pointer to the tree adaptor in use for this stream + /// + pANTLR3_BASE_TREE_ADAPTOR adaptor; + + /// Once a node / subtree has been used in a stream, it must be dup'ed + /// from then on. Streams are reset after sub rules so that the streams + /// can be reused in future sub rules. So, reset must set a dirty bit. + /// If dirty, then next() always returns a dup. + /// + ANTLR3_BOOLEAN dirty; + + // Pointer to the recognizer shared state to which this stream belongs + // + pANTLR3_BASE_RECOGNIZER rec; + + // Methods + + /// Reset the condition of this stream so that it appears we have + /// not consumed any of its elements. Elements themselves are untouched. + /// + void (*reset) (struct ANTLR3_REWRITE_RULE_ELEMENT_STREAM_struct * stream); + + /// Add a new pANTLR3_BASE_TREE to this stream + /// + void (*add) (struct ANTLR3_REWRITE_RULE_ELEMENT_STREAM_struct * stream, void *el, void (ANTLR3_CDECL *freePtr)(void *)); + + /// Return the next element in the stream. If out of elements, throw + /// an exception unless size()==1. If size is 1, then return elements[0]. + /// + void * (*next) (struct ANTLR3_REWRITE_RULE_ELEMENT_STREAM_struct * stream); + pANTLR3_BASE_TREE (*nextTree) (struct ANTLR3_REWRITE_RULE_ELEMENT_STREAM_struct * stream); + void * (*nextToken) (struct ANTLR3_REWRITE_RULE_ELEMENT_STREAM_struct * stream); + void * (*_next) (struct ANTLR3_REWRITE_RULE_ELEMENT_STREAM_struct * stream); + + /// When constructing trees, sometimes we need to dup a token or AST + /// subtree. Dup'ing a token means just creating another AST node + /// around it. For trees, you must call the adaptor.dupTree(). + /// + void * (*dup) (struct ANTLR3_REWRITE_RULE_ELEMENT_STREAM_struct * stream, void * el); + + /// Ensure stream emits trees; tokens must be converted to AST nodes. + /// AST nodes can be passed through unmolested. + /// + pANTLR3_BASE_TREE (*toTree) (struct ANTLR3_REWRITE_RULE_ELEMENT_STREAM_struct * stream, void * el); + + /// Returns ANTLR3_TRUE if there is a next element available + /// + ANTLR3_BOOLEAN (*hasNext) (struct ANTLR3_REWRITE_RULE_ELEMENT_STREAM_struct * stream); + + /// Treat next element as a single node even if it's a subtree. + /// This is used instead of next() when the result has to be a + /// tree root node. Also prevents us from duplicating recently-added + /// children; e.g., ^(type ID)+ adds ID to type and then 2nd iteration + /// must dup the type node, but ID has been added. + /// + /// Referencing to a rule result twice is ok; dup entire tree as + /// we can't be adding trees; e.g., expr expr. + /// + pANTLR3_BASE_TREE (*nextNode) (struct ANTLR3_REWRITE_RULE_ELEMENT_STREAM_struct * stream); + + /// Number of elements available in the stream + /// + ANTLR3_UINT32 (*size) (struct ANTLR3_REWRITE_RULE_ELEMENT_STREAM_struct * stream); + + /// Returns the description string if there is one available (check for NULL). + /// + void * (*getDescription) (struct ANTLR3_REWRITE_RULE_ELEMENT_STREAM_struct * stream); + + void (*free) (struct ANTLR3_REWRITE_RULE_ELEMENT_STREAM_struct * stream); + +} + ANTLR3_REWRITE_RULE_ELEMENT_STREAM; + +/// This is an implementation of a token stream, which is basically an element +/// stream that deals with tokens only. +/// +typedef struct ANTLR3_REWRITE_RULE_ELEMENT_STREAM_struct ANTLR3_REWRITE_RULE_TOKEN_STREAM; + +/// This is an implementation of a subtree stream which is a set of trees +/// modelled as an element stream. +/// +typedef struct ANTLR3_REWRITE_RULE_ELEMENT_STREAM_struct ANTLR3_REWRITE_RULE_SUBTREE_STREAM; + +/// This is an implementation of a node stream, which is basically an element +/// stream that deals with tree nodes only. +/// +typedef struct ANTLR3_REWRITE_RULE_ELEMENT_STREAM_struct ANTLR3_REWRITE_RULE_NODE_STREAM; + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/antlr/libantlr3c-3.4/include/antlr3string.h b/antlr/libantlr3c-3.4/include/antlr3string.h new file mode 100644 index 0000000..4a96e76 --- /dev/null +++ b/antlr/libantlr3c-3.4/include/antlr3string.h @@ -0,0 +1,272 @@ +/** \file + * Simple string interface allows indiscriminate allocation of strings + * such that they can be allocated all over the place and released in + * one chunk via a string factory - saves lots of hassle in remembering what + * strings were allocated where. + */ +#ifndef _ANTLR3_STRING_H +#define _ANTLR3_STRING_H + +// [The "BSD licence"] +// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC +// http://www.temporal-wave.com +// http://www.linkedin.com/in/jimidle +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. The name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** Base string class tracks the allocations and provides simple string + * tracking functions. Mostly you can work directly on the string for things + * that don't reallocate it, like strchr() etc. Perhaps someone will want to provide implementations for UTF8 + * and so on. + */ +typedef struct ANTLR3_STRING_struct +{ + + /** The factory that created this string + */ + pANTLR3_STRING_FACTORY factory; + + /** Pointer to the current string value (starts at NULL unless + * the string allocator is told to create it with a pre known size. + */ + pANTLR3_UINT8 chars; + + /** Current length of the string up to and not including, the trailing '\0' + * Note that the actual allocation (->size) + * is always at least one byte more than this to accommodate trailing '\0' + */ + ANTLR3_UINT32 len; + + /** Current size of the string in bytes including the trailing '\0' + */ + ANTLR3_UINT32 size; + + /** Index of string (allocation number) in case someone wants + * to explicitly release it. + */ + ANTLR3_UINT32 index; + + /** Occasionally it is useful to know what the encoding of the string + * actually is, hence it is stored here as one the ANTLR3_ENCODING_ values + */ + ANTLR3_UINT8 encoding; + + /** Pointer to function that sets the string value to a specific string in the default encoding + * for this string. For instance, if this is 8 bit, then this function is the same as set8 + * but if the encoding is UTF16, then the pointer is assumed to point to UTF16 characters, not + * 8 bit. + */ + pANTLR3_UINT8 (*set) (struct ANTLR3_STRING_struct * string, const char * chars); + + /** Pointer to function that sets the string value to a specific 8 bit string in the default encoding + * for this string. For instance, if this is an 8 bit string, then this function is the same as set8 + * but if the encoding is UTF16, then the pointer is assumed to point to 8 bit characters that must + * be converted to UTF16 characters on the fly. + */ + pANTLR3_UINT8 (*set8) (struct ANTLR3_STRING_struct * string, const char * chars); + + /** Pointer to function adds a raw char * type pointer in the default encoding + * for this string. For instance, if this is 8 bit, then this function is the same as append8 + * but if the encoding is UTF16, then the pointer is assumed to point to UTF16 characters not + * 8 bit. + */ + pANTLR3_UINT8 (*append) (struct ANTLR3_STRING_struct * string, const char * newbit); + + /** Pointer to function adds a raw char * type pointer in the default encoding + * for this string. For instance, if this is a UTF16 string, then this function assumes the pointer + * points to 8 bit characters that must be converted on the fly. + */ + pANTLR3_UINT8 (*append8) (struct ANTLR3_STRING_struct * string, const char * newbit); + + /** Pointer to function that inserts the supplied string at the specified + * offset in the current string in the default encoding for this string. For instance, if this is an 8 + * bit string, then this is the same as insert8, but if this is a UTF16 string, then the pointer + * must point to UTF16 characters. + */ + pANTLR3_UINT8 (*insert) (struct ANTLR3_STRING_struct * string, ANTLR3_UINT32 point, const char * newbit); + + /** Pointer to function that inserts the supplied string at the specified + * offset in the current string in the default encoding for this string. For instance, if this is a UTF16 string + * then the pointer is assumed to point at 8 bit characteres that must be converted on the fly. + */ + pANTLR3_UINT8 (*insert8) (struct ANTLR3_STRING_struct * string, ANTLR3_UINT32 point, const char * newbit); + + /** Pointer to function that sets the string value to a copy of the supplied string (strings must be in the + * same encoding. + */ + pANTLR3_UINT8 (*setS) (struct ANTLR3_STRING_struct * string, struct ANTLR3_STRING_struct * chars); + + /** Pointer to function appends a copy of the characters contained in another string. Strings must be in the + * same encoding. + */ + pANTLR3_UINT8 (*appendS) (struct ANTLR3_STRING_struct * string, struct ANTLR3_STRING_struct * newbit); + + /** Pointer to function that inserts a copy of the characters in the supplied string at the specified + * offset in the current string. strings must be in the same encoding. + */ + pANTLR3_UINT8 (*insertS) (struct ANTLR3_STRING_struct * string, ANTLR3_UINT32 point, struct ANTLR3_STRING_struct * newbit); + + /** Pointer to function that inserts the supplied integer in string form at the specified + * offset in the current string. + */ + pANTLR3_UINT8 (*inserti) (struct ANTLR3_STRING_struct * string, ANTLR3_UINT32 point, ANTLR3_INT32 i); + + /** Pointer to function that adds a single character to the end of the string, in the encoding of the + * string - 8 bit, UTF16, utf-8 etc. Input is a single UTF32 (32 bits wide integer) character. + */ + pANTLR3_UINT8 (*addc) (struct ANTLR3_STRING_struct * string, ANTLR3_UINT32 c); + + /** Pointer to function that adds the stringified representation of an integer + * to the string. + */ + pANTLR3_UINT8 (*addi) (struct ANTLR3_STRING_struct * string, ANTLR3_INT32 i); + + /** Pointer to function that compares the text of a string to the supplied + * 8 bit character string and returns a result a la strcmp() + */ + ANTLR3_UINT32 (*compare8) (struct ANTLR3_STRING_struct * string, const char * compStr); + + /** Pointer to a function that compares the text of a string with the supplied character string + * (which is assumed to be in the same encoding as the string itself) and returns a result + * a la strcmp() + */ + ANTLR3_UINT32 (*compare) (struct ANTLR3_STRING_struct * string, const char * compStr); + + /** Pointer to a function that compares the text of a string with the supplied string + * (which is assumed to be in the same encoding as the string itself) and returns a result + * a la strcmp() + */ + ANTLR3_UINT32 (*compareS) (struct ANTLR3_STRING_struct * string, struct ANTLR3_STRING_struct * compStr); + + /** Pointer to a function that returns the character indexed at the supplied + * offset as a 32 bit character. + */ + ANTLR3_UCHAR (*charAt) (struct ANTLR3_STRING_struct * string, ANTLR3_UINT32 offset); + + /** Pointer to a function that returns a substring of the supplied string a la .subString(s,e) + * in the Java language. + */ + struct ANTLR3_STRING_struct * + (*subString) (struct ANTLR3_STRING_struct * string, ANTLR3_UINT32 startIndex, ANTLR3_UINT32 endIndex); + + /** Pointer to a function that returns the integer representation of any numeric characters + * at the beginning of the string + */ + ANTLR3_INT32 (*toInt32) (struct ANTLR3_STRING_struct * string); + + /** Pointer to a function that yields an 8 bit string regardless of the encoding of the supplied + * string. This is useful when you want to use the text of a token in some way that requires an 8 bit + * value, such as the key for a hashtable. The function is required to produce a usable string even + * if the text given as input has characters that do not fit in 8 bit space, it will replace them + * with some arbitrary character such as '?' + */ + struct ANTLR3_STRING_struct * + (*to8) (struct ANTLR3_STRING_struct * string); + + /// Pointer to a function that yields a UT8 encoded string of the current string, + /// regardless of the current encoding of the string. Because there is currently no UTF8 + /// handling in the string class, it creates therefore, a string that is useful only for read only + /// applications as it will not contain methods that deal with UTF8 at the moment. + /// + struct ANTLR3_STRING_struct * + (*toUTF8) (struct ANTLR3_STRING_struct * string); + +} + ANTLR3_STRING; + +/** Definition of the string factory interface, which creates and tracks + * strings for you of various shapes and sizes. + */ +typedef struct ANTLR3_STRING_FACTORY_struct +{ + /** List of all the strings that have been allocated by the factory + */ + pANTLR3_VECTOR strings; + + /* Index of next string that we allocate + */ + ANTLR3_UINT32 index; + + /** Pointer to function that manufactures an empty string + */ + pANTLR3_STRING (*newRaw) (struct ANTLR3_STRING_FACTORY_struct * factory); + + /** Pointer to function that manufactures a raw string with no text in it but space for size + * characters. + */ + pANTLR3_STRING (*newSize) (struct ANTLR3_STRING_FACTORY_struct * factory, ANTLR3_UINT32 size); + + /** Pointer to function that manufactures a string from a given pointer and length. The pointer is assumed + * to point to characters in the same encoding as the string type, hence if this is a UTF16 string the + * pointer should point to UTF16 characters. + */ + pANTLR3_STRING (*newPtr) (struct ANTLR3_STRING_FACTORY_struct * factory, pANTLR3_UINT8 string, ANTLR3_UINT32 size); + + /** Pointer to function that manufactures a string from a given pointer and length. The pointer is assumed to + * point at 8 bit characters which must be converted on the fly to the encoding of the actual string. + */ + pANTLR3_STRING (*newPtr8) (struct ANTLR3_STRING_FACTORY_struct * factory, pANTLR3_UINT8 string, ANTLR3_UINT32 size); + + /** Pointer to function that manufactures a string from a given pointer and works out the length. The pointer is + * assumed to point to characters in the same encoding as the string itself, i.e. UTF16 if a UTF16 + * string and so on. + */ + pANTLR3_STRING (*newStr) (struct ANTLR3_STRING_FACTORY_struct * factory, pANTLR3_UINT8 string); + + /** Pointer to function that manufactures a string from a given pointer and length. The pointer should + * point to 8 bit characters regardless of the actual encoding of the string. The 8 bit characters + * will be converted to the actual string encoding on the fly. + */ + pANTLR3_STRING (*newStr8) (struct ANTLR3_STRING_FACTORY_struct * factory, pANTLR3_UINT8 string); + + /** Pointer to function that deletes the string altogether + */ + void (*destroy) (struct ANTLR3_STRING_FACTORY_struct * factory, pANTLR3_STRING string); + + /** Pointer to function that returns a copy of the string in printable form without any control + * characters in it. + */ + pANTLR3_STRING (*printable)(struct ANTLR3_STRING_FACTORY_struct * factory, pANTLR3_STRING string); + + /** Pointer to function that closes the factory + */ + void (*close) (struct ANTLR3_STRING_FACTORY_struct * factory); + +} + ANTLR3_STRING_FACTORY; + +#ifdef __cplusplus +} +#endif + +#endif + diff --git a/antlr/libantlr3c-3.4/include/antlr3tokenstream.h b/antlr/libantlr3c-3.4/include/antlr3tokenstream.h new file mode 100644 index 0000000..a5137ad --- /dev/null +++ b/antlr/libantlr3c-3.4/include/antlr3tokenstream.h @@ -0,0 +1,303 @@ +/** \file + * Defines the interface for an ANTLR3 common token stream. Custom token streams should create + * one of these and then override any functions by installing their own pointers + * to implement the various functions. + */ +#ifndef _ANTLR3_TOKENSTREAM_H +#define _ANTLR3_TOKENSTREAM_H + +// [The "BSD licence"] +// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC +// http://www.temporal-wave.com +// http://www.linkedin.com/in/jimidle +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. The name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include +#include +#include +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** Definition of a token source, which has a pointer to a function that + * returns the next token (using a token factory if it is going to be + * efficient) and a pointer to an ANTLR3_INPUT_STREAM. This is slightly + * different to the Java interface because we have no way to implement + * multiple interfaces without defining them in the interface structure + * or casting (void *), which is too convoluted. + */ +typedef struct ANTLR3_TOKEN_SOURCE_struct +{ + /** Pointer to a function that returns the next token in the stream. + */ + pANTLR3_COMMON_TOKEN (*nextToken)(struct ANTLR3_TOKEN_SOURCE_struct * tokenSource); + + /** Whoever is providing tokens, needs to provide a string factory too + */ + pANTLR3_STRING_FACTORY strFactory; + + /** A special pre-allocated token, which signifies End Of Tokens. Because this must + * be set up with the current input index and so on, we embed the structure and + * return the address of it. It is marked as factoryMade, so that it is never + * attempted to be freed. + */ + ANTLR3_COMMON_TOKEN eofToken; + + /// A special pre-allocated token, which is returned by mTokens() if the + /// lexer rule said to just skip the generated token altogether. + /// Having this single token stops us wasting memory by have the token factory + /// actually create something that we are going to SKIP(); anyway. + /// + ANTLR3_COMMON_TOKEN skipToken; + + /** Whatever is supplying the token source interface, needs a pointer to + * itself so that this pointer can be passed to it when the nextToken + * function is called. + */ + void * super; + + /** When the token source is constructed, it is populated with the file + * name from whence the tokens were produced by the lexer. This pointer is a + * copy of the one supplied by the CharStream (and may be NULL) so should + * not be manipulated other than to copy or print it. + */ + pANTLR3_STRING fileName; +} + ANTLR3_TOKEN_SOURCE; + +/** Definition of the ANTLR3 common token stream interface. + * \remark + * Much of the documentation for this interface is stolen from Ter's Java implementation. + */ +typedef struct ANTLR3_TOKEN_STREAM_struct +{ + /** Pointer to the token source for this stream + */ + pANTLR3_TOKEN_SOURCE tokenSource; + + /** Whatever is providing this interface needs a pointer to itself + * so that this can be passed back to it whenever the api functions + * are called. + */ + void * super; + + /** All input streams implement the ANTLR3_INT_STREAM interface... + */ + pANTLR3_INT_STREAM istream; + + /// Debugger interface, is this is a debugging token stream + /// + pANTLR3_DEBUG_EVENT_LISTENER debugger; + + /// Indicates the initial stream state for dbgConsume() + /// + ANTLR3_BOOLEAN initialStreamState; + + /** Get Token at current input pointer + i ahead where i=1 is next Token. + * i<0 indicates tokens in the past. So -1 is previous token and -2 is + * two tokens ago. LT(0) is undefined. For i>=n, return Token.EOFToken. + * Return null for LT(0) and any index that results in an absolute address + * that is negative. + */ + pANTLR3_COMMON_TOKEN (*_LT) (struct ANTLR3_TOKEN_STREAM_struct * tokenStream, ANTLR3_INT32 k); + + /** Get a token at an absolute index i; 0..n-1. This is really only + * needed for profiling and debugging and token stream rewriting. + * If you don't want to buffer up tokens, then this method makes no + * sense for you. Naturally you can't use the rewrite stream feature. + * I believe DebugTokenStream can easily be altered to not use + * this method, removing the dependency. + */ + pANTLR3_COMMON_TOKEN (*get) (struct ANTLR3_TOKEN_STREAM_struct * tokenStream, ANTLR3_UINT32 i); + + /** Where is this stream pulling tokens from? This is not the name, but + * a pointer into an interface that contains a ANTLR3_TOKEN_SOURCE interface. + * The Token Source interface contains a pointer to the input stream and a pointer + * to a function that returns the next token. + */ + pANTLR3_TOKEN_SOURCE (*getTokenSource) (struct ANTLR3_TOKEN_STREAM_struct * tokenStream); + + /** Function that installs a token source for teh stream + */ + void (*setTokenSource) (struct ANTLR3_TOKEN_STREAM_struct * tokenStream, + pANTLR3_TOKEN_SOURCE tokenSource); + + /** Return the text of all the tokens in the stream, as the old tramp in + * Leeds market used to say; "Get the lot!" + */ + pANTLR3_STRING (*toString) (struct ANTLR3_TOKEN_STREAM_struct * tokenStream); + + /** Return the text of all tokens from start to stop, inclusive. + * If the stream does not buffer all the tokens then it can just + * return an empty ANTLR3_STRING or NULL; Grammars should not access $ruleLabel.text in + * an action in that case. + */ + pANTLR3_STRING (*toStringSS) (struct ANTLR3_TOKEN_STREAM_struct * tokenStream, ANTLR3_UINT32 start, ANTLR3_UINT32 stop); + + /** Because the user is not required to use a token with an index stored + * in it, we must provide a means for two token objects themselves to + * indicate the start/end location. Most often this will just delegate + * to the other toString(int,int). This is also parallel with + * the pTREENODE_STREAM->toString(Object,Object). + */ + pANTLR3_STRING (*toStringTT) (struct ANTLR3_TOKEN_STREAM_struct * tokenStream, pANTLR3_COMMON_TOKEN start, pANTLR3_COMMON_TOKEN stop); + + + /** Function that sets the token stream into debugging mode + */ + void (*setDebugListener) (struct ANTLR3_TOKEN_STREAM_struct * tokenStream, pANTLR3_DEBUG_EVENT_LISTENER debugger); + + + + /** Function that knows how to free the memory for an ANTLR3_TOKEN_STREAM + */ + void (*free) (struct ANTLR3_TOKEN_STREAM_struct * tokenStream); +} + ANTLR3_TOKEN_STREAM; + +/** Common token stream is an implementation of ANTLR_TOKEN_STREAM for the default + * parsers and recognizers. You may of course build your own implementation if + * you are so inclined. + */ +typedef struct ANTLR3_COMMON_TOKEN_STREAM_struct +{ + /** The ANTLR3_TOKEN_STREAM interface implementation, which also includes + * the intstream implementation. We could duplicate the pANTLR_INT_STREAM + * in this interface and initialize it to a copy, but this could be confusing + * it just results in one more level of indirection and I think that with + * judicial use of 'const' later, the optimizer will do decent job. + */ + pANTLR3_TOKEN_STREAM tstream; + + /** Whatever is supplying the COMMON_TOKEN_STREAM needs a pointer to itself + * so that this can be accessed by any of the API functions which it implements. + */ + void * super; + + /** Records every single token pulled from the source indexed by the token index. + * There might be more efficient ways to do this, such as referencing directly in to + * the token factory pools, but for now this is convenient and the ANTLR3_LIST is not + * a huge overhead as it only stores pointers anyway, but allows for iterations and + * so on. + */ + pANTLR3_VECTOR tokens; + + /** Override map of tokens. If a token type has an entry in here, then + * the pointer in the table points to an int, being the override channel number + * that should always be used for this token type. + */ + pANTLR3_LIST channelOverrides; + + /** Discared set. If a token has an entry in this table, then it is thrown + * away (data pointer is always NULL). + */ + pANTLR3_LIST discardSet; + + /* The channel number that this token stream is tuned to. For instance, whitespace + * is usually tuned to channel 99, which no token stream would normally tune to and + * so it is thrown away. + */ + ANTLR3_UINT32 channel; + + /** If this flag is set to ANTLR3_TRUE, then tokens that the stream sees that are not + * in the channel that this stream is tuned to, are not tracked in the + * tokens table. When set to false, ALL tokens are added to the tracking. + */ + ANTLR3_BOOLEAN discardOffChannel; + + /** The index into the tokens list of the current token (the next one that will be + * consumed. p = -1 indicates that the token list is empty. + */ + ANTLR3_INT32 p; + + /** A simple filter mechanism whereby you can tell this token stream + * to force all tokens of type ttype to be on channel. For example, + * when interpreting, we cannot exec actions so we need to tell + * the stream to force all WS and NEWLINE to be a different, ignored + * channel. + */ + void (*setTokenTypeChannel) (struct ANTLR3_COMMON_TOKEN_STREAM_struct * tokenStream, + ANTLR3_UINT32 ttype, ANTLR3_UINT32 channel); + + /** Add a particular token type to the discard set. If a token is found to belong + * to this set, then it is skipped/thrown away + */ + void (*discardTokenType) (struct ANTLR3_COMMON_TOKEN_STREAM_struct * tokenStream, ANTLR3_INT32 ttype); + + /** Signal to discard off channel tokens from here on in. + */ + void (*discardOffChannelToks)(struct ANTLR3_COMMON_TOKEN_STREAM_struct * tokenStream, ANTLR3_BOOLEAN discard); + + /** Function that returns a pointer to the ANTLR3_LIST of all tokens + * in the stream (this causes the buffer to fill if we have not get any yet) + */ + pANTLR3_VECTOR (*getTokens) (struct ANTLR3_COMMON_TOKEN_STREAM_struct * tokenStream); + + /** Function that returns all the tokens between a start and a stop index. + * TODO: This is a new list (Ack! Maybe this is a reason to have factories for LISTS and HASHTABLES etc :-( come back to this) + */ + pANTLR3_LIST (*getTokenRange) (struct ANTLR3_COMMON_TOKEN_STREAM_struct * tokenStream, ANTLR3_UINT32 start, ANTLR3_UINT32 stop); + + /** Function that returns all the tokens indicated by the specified bitset, within a range of tokens + */ + pANTLR3_LIST (*getTokensSet) (struct ANTLR3_COMMON_TOKEN_STREAM_struct * tokenStream, + ANTLR3_UINT32 start, ANTLR3_UINT32 stop, pANTLR3_BITSET types); + + /** Function that returns all the tokens indicated by being a member of the supplied List + */ + pANTLR3_LIST (*getTokensList) (struct ANTLR3_COMMON_TOKEN_STREAM_struct * tokenStream, + ANTLR3_UINT32 start, ANTLR3_UINT32 stop, pANTLR3_LIST list); + + /** Function that returns all tokens of a certain type within a range. + */ + pANTLR3_LIST (*getTokensType) (struct ANTLR3_COMMON_TOKEN_STREAM_struct * tokenStream, + ANTLR3_UINT32 start, ANTLR3_UINT32 stop, ANTLR3_UINT32 type); + + /** Function that resets the token stream so that it can be reused, but + * but that does not free up any resources, such as the token factory + * the factory pool and so on. This prevents the need to keep freeing + * and reallocating the token pools if the thing you are building is + * a multi-shot dameon or somethign like that. It is much faster to + * just reuse all the vectors. + */ + void (*reset) (struct ANTLR3_COMMON_TOKEN_STREAM_struct * tokenStream); + + /** Function that knows how to free an ANTLR3_COMMON_TOKEN_STREAM + */ + void (*free) (struct ANTLR3_COMMON_TOKEN_STREAM_struct * tokenStream); +} + ANTLR3_COMMON_TOKEN_STREAM; + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/antlr/libantlr3c-3.4/include/antlr3treeparser.h b/antlr/libantlr3c-3.4/include/antlr3treeparser.h new file mode 100644 index 0000000..8ee0e58 --- /dev/null +++ b/antlr/libantlr3c-3.4/include/antlr3treeparser.h @@ -0,0 +1,81 @@ +#ifndef ANTLR3TREEPARSER_H +#define ANTLR3TREEPARSER_H + +// [The "BSD licence"] +// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC +// http://www.temporal-wave.com +// http://www.linkedin.com/in/jimidle +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. The name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/** Internal structure representing an element in a hash bucket. + * Stores the original key so that duplicate keys can be rejected + * if necessary, and contains function can be supported If the hash key + * could be unique I would have invented the perfect compression algorithm ;-) + */ +typedef struct ANTLR3_TREE_PARSER_struct +{ + /** Pointer to any super class + */ + void * super; + + /** A pointer to the base recognizer, where most of the parser functions actually + * live because they are shared between parser and tree parser and this is the + * easier way than copying the interface all over the place. Macros hide this + * for the generated code so it is easier on the eye (though not the debugger ;-). + */ + pANTLR3_BASE_RECOGNIZER rec; + + /** Pointer to the common tree node stream for the parser + */ + pANTLR3_COMMON_TREE_NODE_STREAM ctnstream; + + /** Set the input stream and reset the parser + */ + void (*setTreeNodeStream) (struct ANTLR3_TREE_PARSER_struct * parser, pANTLR3_COMMON_TREE_NODE_STREAM input); + + /** Return a pointer to the input stream + */ + pANTLR3_COMMON_TREE_NODE_STREAM (*getTreeNodeStream) (struct ANTLR3_TREE_PARSER_struct * parser); + + /** Pointer to a function that knows how to free resources of an ANTLR3 tree parser. + */ + void (*free) (struct ANTLR3_TREE_PARSER_struct * parser); +} + ANTLR3_TREE_PARSER; + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/antlr/libantlr3c-3.4/install-sh b/antlr/libantlr3c-3.4/install-sh new file mode 100755 index 0000000..6781b98 --- /dev/null +++ b/antlr/libantlr3c-3.4/install-sh @@ -0,0 +1,520 @@ +#!/bin/sh +# install - install a program, script, or datafile + +scriptversion=2009-04-28.21; # UTC + +# This originates from X11R5 (mit/util/scripts/install.sh), which was +# later released in X11R6 (xc/config/util/install.sh) with the +# following copyright and license. +# +# Copyright (C) 1994 X Consortium +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- +# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# Except as contained in this notice, the name of the X Consortium shall not +# be used in advertising or otherwise to promote the sale, use or other deal- +# ings in this Software without prior written authorization from the X Consor- +# tium. +# +# +# FSF changes to this file are in the public domain. +# +# Calling this script install-sh is preferred over install.sh, to prevent +# `make' implicit rules from creating a file called install from it +# when there is no Makefile. +# +# This script is compatible with the BSD install script, but was written +# from scratch. + +nl=' +' +IFS=" "" $nl" + +# set DOITPROG to echo to test this script + +# Don't use :- since 4.3BSD and earlier shells don't like it. +doit=${DOITPROG-} +if test -z "$doit"; then + doit_exec=exec +else + doit_exec=$doit +fi + +# Put in absolute file names if you don't have them in your path; +# or use environment vars. + +chgrpprog=${CHGRPPROG-chgrp} +chmodprog=${CHMODPROG-chmod} +chownprog=${CHOWNPROG-chown} +cmpprog=${CMPPROG-cmp} +cpprog=${CPPROG-cp} +mkdirprog=${MKDIRPROG-mkdir} +mvprog=${MVPROG-mv} +rmprog=${RMPROG-rm} +stripprog=${STRIPPROG-strip} + +posix_glob='?' +initialize_posix_glob=' + test "$posix_glob" != "?" || { + if (set -f) 2>/dev/null; then + posix_glob= + else + posix_glob=: + fi + } +' + +posix_mkdir= + +# Desired mode of installed file. +mode=0755 + +chgrpcmd= +chmodcmd=$chmodprog +chowncmd= +mvcmd=$mvprog +rmcmd="$rmprog -f" +stripcmd= + +src= +dst= +dir_arg= +dst_arg= + +copy_on_change=false +no_target_directory= + +usage="\ +Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE + or: $0 [OPTION]... SRCFILES... DIRECTORY + or: $0 [OPTION]... -t DIRECTORY SRCFILES... + or: $0 [OPTION]... -d DIRECTORIES... + +In the 1st form, copy SRCFILE to DSTFILE. +In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. +In the 4th, create DIRECTORIES. + +Options: + --help display this help and exit. + --version display version info and exit. + + -c (ignored) + -C install only if different (preserve the last data modification time) + -d create directories instead of installing files. + -g GROUP $chgrpprog installed files to GROUP. + -m MODE $chmodprog installed files to MODE. + -o USER $chownprog installed files to USER. + -s $stripprog installed files. + -t DIRECTORY install into DIRECTORY. + -T report an error if DSTFILE is a directory. + +Environment variables override the default commands: + CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG + RMPROG STRIPPROG +" + +while test $# -ne 0; do + case $1 in + -c) ;; + + -C) copy_on_change=true;; + + -d) dir_arg=true;; + + -g) chgrpcmd="$chgrpprog $2" + shift;; + + --help) echo "$usage"; exit $?;; + + -m) mode=$2 + case $mode in + *' '* | *' '* | *' +'* | *'*'* | *'?'* | *'['*) + echo "$0: invalid mode: $mode" >&2 + exit 1;; + esac + shift;; + + -o) chowncmd="$chownprog $2" + shift;; + + -s) stripcmd=$stripprog;; + + -t) dst_arg=$2 + 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-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/antlr/libantlr3c-3.4/libtool b/antlr/libantlr3c-3.4/libtool new file mode 100755 index 0000000..2172935 --- /dev/null +++ b/antlr/libantlr3c-3.4/libtool @@ -0,0 +1,9239 @@ +#! /bin/bash + +# libtool - Provide generalized library-building support services. +# Generated automatically by config.status (libantlr3c) 3.4 +# Libtool was configured on host pc-4w14-0: +# NOTE: Changes made to this file will be lost: look at ltmain.sh. +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +# 2006, 2007, 2008, 2009, 2010 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=2.2.10 +macro_revision=1.3175 + +# Whether or not to build shared libraries. +build_libtool_libs=yes + +# Whether or not to build static libraries. +build_old_libs=yes + +# What type of objects to build. +pic_mode=default + +# Whether or not to optimize for fast installation. +fast_install=yes + +# Shell to use when invoking shell scripts. +SHELL="/bin/bash" + +# An echo program that protects backslashes. +ECHO="printf %s\\n" + +# The host system. +host_alias= +host=x86_64-unknown-linux-gnu +host_os=linux-gnu + +# The build system. +build_alias= +build=x86_64-unknown-linux-gnu +build_os=linux-gnu + +# A sed program that does not truncate output. +SED="/bin/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="/bin/grep" + +# An ERE matcher. +EGREP="/bin/grep -E" + +# A literal string matcher. +FGREP="/bin/grep -F" + +# A BSD- or MS-compatible name lister. +NM="/usr/bin/nm -B" + +# Whether we need soft or hard links. +LN_S="ln -s" + +# What is the maximum length of a command? +max_cmd_len=1572864 + +# Object file suffix (normally "o"). +objext=o + +# Executable file suffix (normally ""). +exeext= + +# whether the shell understands "unset". +lt_unset=unset + +# turn spaces into newlines. +SP2NL="tr \\040 \\012" + +# turn newlines into spaces. +NL2SP="tr \\015\\012 \\040\\040" + +# An object symbol dumper. +OBJDUMP="objdump" + +# Method to check whether dependent libraries are shared objects. +deplibs_check_method="pass_all" + +# Command to use when deplibs_check_method == "file_magic". +file_magic_cmd="\$MAGIC_CMD" + +# The archiver. +AR="ar" +AR_FLAGS="cru" + +# A symbol stripping program. +STRIP="strip" + +# Commands used to install an old-style archive. +RANLIB="ranlib" +old_postinstall_cmds="chmod 644 \$oldlib~\$RANLIB \$oldlib" +old_postuninstall_cmds="" + +# Whether to use a lock for old archive extraction. +lock_old_archive_extraction=no + +# A C compiler. +LTCC="gcc" + +# LTCC compiler flags. +LTCFLAGS="-m32 -O2 -Wall" + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe="sed -n -e 's/^.*[ ]\\([ABCDGIRSTW][ABCDGIRSTW]*\\)[ ][ ]*\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2 \\2/p'" + +# Transform the output of nm in a proper C declaration. +global_symbol_to_cdecl="sed -n -e 's/^T .* \\(.*\\)\$/extern int \\1();/p' -e 's/^[ABCDGIRSTW]* .* \\(.*\\)\$/extern char \\1;/p'" + +# Transform the output of nm in a C name address pair. +global_symbol_to_c_name_address="sed -n -e 's/^: \\([^ ]*\\) \$/ {\\\"\\1\\\", (void *) 0},/p' -e 's/^[ABCDGIRSTW]* \\([^ ]*\\) \\([^ ]*\\)\$/ {\"\\2\", (void *) \\&\\2},/p'" + +# Transform the output of nm in a C name address pair when lib prefix is needed. +global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \\([^ ]*\\) \$/ {\\\"\\1\\\", (void *) 0},/p' -e 's/^[ABCDGIRSTW]* \\([^ ]*\\) \\(lib[^ ]*\\)\$/ {\"\\2\", (void *) \\&\\2},/p' -e 's/^[ABCDGIRSTW]* \\([^ ]*\\) \\([^ ]*\\)\$/ {\"lib\\2\", (void *) \\&\\2},/p'" + +# The name of the directory that contains temporary libtool files. +objdir=.libs + +# Used to examine libraries when file_magic_cmd begins with "file". +MAGIC_CMD=file + +# Must we lock files when doing compilation? +need_locks="no" + +# Tool to manipulate archived DWARF debug symbol files on Mac OS X. +DSYMUTIL="" + +# Tool to change global to local symbols on Mac OS X. +NMEDIT="" + +# Tool to manipulate fat objects and archives on Mac OS X. +LIPO="" + +# ldd/readelf like tool for Mach-O binaries on Mac OS X. +OTOOL="" + +# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. +OTOOL64="" + +# Old archive suffix (normally "a"). +libext=a + +# Shared library suffix (normally ".so"). +shrext_cmds=".so" + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds="" + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at link time. +variables_saved_for_relink="PATH LD_LIBRARY_PATH LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" + +# Do we need the "lib" prefix for modules? +need_lib_prefix=no + +# Do we need a version for libraries? +need_version=no + +# Library versioning type. +version_type=linux + +# Shared library runtime path variable. +runpath_var=LD_RUN_PATH + +# Shared library path variable. +shlibpath_var=LD_LIBRARY_PATH + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=no + +# Format of library name prefix. +libname_spec="lib\$name" + +# 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="\${libname}\${release}\${shared_ext}\$versuffix \${libname}\${release}\${shared_ext}\$major \$libname\${shared_ext}" + +# The coded name of the library, if different from the real name. +soname_spec="\${libname}\${release}\${shared_ext}\$major" + +# Permission mode override for installation of shared libraries. +install_override_mode="" + +# Command to use after installation of a shared archive. +postinstall_cmds="" + +# Command to use after uninstallation of a shared archive. +postuninstall_cmds="" + +# Commands used to finish a libtool library installation in a directory. +finish_cmds="PATH=\\\"\\\$PATH:/sbin\\\" ldconfig -n \$libdir" + +# As "finish_cmds", except a single script fragment to be evaled but +# not shown. +finish_eval="" + +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=yes + +# Compile-time system search path for libraries. +sys_lib_search_path_spec="/usr/lib/gcc/x86_64-linux-gnu/4.6 /usr/lib/x86_64-linux-gnu /usr/lib /lib/x86_64-linux-gnu /lib " + +# Run-time system search path for libraries. +sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib /usr/local/lib /lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu /lib32 /usr/lib32 " + +# Whether dlopen is supported. +dlopen_support=unknown + +# Whether dlopen of programs is supported. +dlopen_self=unknown + +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=unknown + +# Commands to strip libraries. +old_striplib="strip --strip-debug" +striplib="strip --strip-unneeded" + + +# The linker used to build libraries. +LD="/usr/bin/ld -m elf_x86_64" + +# How to create reloadable object files. +reload_flag=" -r" +reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs" + +# Commands used to build an old-style archive. +old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs~\$RANLIB \$oldlib" + +# A language specific compiler. +CC="gcc" + +# Is the compiler the GNU compiler? +with_gcc=yes + +# Compiler flag to turn off builtin functions. +no_builtin_flag=" -fno-builtin" + +# How to pass a linker flag through the compiler. +wl="-Wl," + +# Additional compiler flags for building library objects. +pic_flag=" -fPIC -DPIC" + +# Compiler flag to prevent dynamic linking. +link_static_flag="-static" + +# Does compiler simultaneously support -c and -o options? +compiler_c_o="yes" + +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=no + +# Whether or not to disallow shared libs when runtime libs are static. +allow_libtool_libs_with_static_runtimes=no + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec="\${wl}--export-dynamic" + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive" + +# Whether the compiler copes with passing no objects directly. +compiler_needs_object="no" + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds="" + +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds="" + +# Commands used to build a shared archive. +archive_cmds="\$CC -shared \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname -o \$lib" +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 -shared \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname \${wl}-version-script \${wl}\$output_objdir/\$libname.ver -o \$lib" + +# Commands used to build a loadable module if different from building +# a shared archive. +module_cmds="" +module_expsym_cmds="" + +# Whether we are building with GNU ld or not. +with_gnu_ld="yes" + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag="" + +# Flag that enforces no undefined symbols. +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="\${wl}-rpath \${wl}\$libdir" + +# 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="" + +# Whether we need a single "-rpath" flag with a separated argument. +hardcode_libdir_separator="" + +# Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes +# DIR into the resulting binary. +hardcode_direct=no + +# 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=no + +# Set to "yes" if using the -LDIR flag during linking hardcodes DIR +# into the resulting binary. +hardcode_minus_L=no + +# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR +# into the resulting binary. +hardcode_shlibpath_var=unsupported + +# 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=no + +# Set to yes if linker adds runtime paths of dependent libraries +# to runtime path list. +inherit_rpath=no + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=unknown + +# Fix the shell variable $srcfile for the compiler. +fix_srcfile_path="" + +# Set to "yes" if exported symbols are required. +always_export_symbols=no + +# The commands to list exported symbols. +export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | \$SED 's/.* //' | sort | uniq > \$export_symbols" + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms="_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*" + +# Symbols that must always be exported. +include_expsyms="" + +# Commands necessary for linking programs (against libraries) with templates. +prelink_cmds="" + +# Specify filename containing input files. +file_list_spec="" + +# How to hardcode a shared library path into an executable. +hardcode_action=immediate + +# ### END LIBTOOL CONFIG + +# Generated from ltmain.m4sh. + +# libtool (GNU libtool) 2.2.10 +# Written by Gordon Matzigkeit , 1996 + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, +# 2007, 2008, 2009, 2010 Free Software Foundation, Inc. +# This is free software; see the source for copying conditions. There is NO +# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +# GNU Libtool is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# As a special exception to the GNU General Public License, +# if you distribute this file as part of a program or library that +# is built using GNU Libtool, you may include this file under the +# same distribution terms that you use for the rest of that program. +# +# GNU Libtool is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNU Libtool; see the file COPYING. If not, a copy +# can be downloaded from http://www.gnu.org/licenses/gpl.html, +# or obtained by writing to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +# Usage: $progname [OPTION]... [MODE-ARG]... +# +# Provide generalized library-building support services. +# +# --config show all configuration variables +# --debug enable verbose shell tracing +# -n, --dry-run display commands without modifying any files +# --features display basic configuration information and exit +# --mode=MODE use operation mode MODE +# --preserve-dup-deps don't remove duplicate dependency libraries +# --quiet, --silent don't print informational messages +# --no-quiet, --no-silent +# print informational messages (default) +# --tag=TAG use configuration variables from tag TAG +# -v, --verbose print more informational messages than default +# --no-verbose don't print the extra informational messages +# --version print version information +# -h, --help, --help-all print short, long, or detailed help message +# +# MODE must be one of the following: +# +# clean remove files from the build directory +# compile compile a source file into a libtool object +# execute automatically set library path, then run a program +# finish complete the installation of libtool libraries +# install install libraries or executables +# link create a library or an executable +# uninstall remove libraries from an installed directory +# +# MODE-ARGS vary depending on the MODE. When passed as first option, +# `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that. +# Try `$progname --help --mode=MODE' for a more detailed description of MODE. +# +# When reporting a bug, please describe a test case to reproduce it and +# include the following information: +# +# host-triplet: $host +# shell: $SHELL +# compiler: $LTCC +# compiler flags: $LTCFLAGS +# linker: $LD (gnu? $with_gnu_ld) +# $progname: (GNU libtool) 2.2.10 +# automake: $automake_version +# autoconf: $autoconf_version +# +# Report bugs to . + +PROGRAM=libtool +PACKAGE=libtool +VERSION=2.2.10 +TIMESTAMP="" +package_revision=1.3175 + +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac +fi +BIN_SH=xpg4; export BIN_SH # for Tru64 +DUALCASE=1; export DUALCASE # for MKS sh + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +$1 +_LTECHO_EOF' +} + +# NLS nuisances: We save the old values to restore during execute mode. +lt_user_locale= +lt_safe_locale= +for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES +do + eval "if test \"\${$lt_var+set}\" = set; then + save_$lt_var=\$$lt_var + $lt_var=C + export $lt_var + lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\" + lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\" + fi" +done +LC_ALL=C +LANGUAGE=C +export LANGUAGE LC_ALL + +$lt_unset CDPATH + + +# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh +# is ksh but when the shell is invoked as "sh" and the current value of +# the _XPG environment variable is not equal to 1 (one), the special +# positional parameter $0, within a function call, is the name of the +# function. +progpath="$0" + + + +: ${CP="cp -f"} +test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'} +: ${EGREP="/bin/grep -E"} +: ${FGREP="/bin/grep -F"} +: ${GREP="/bin/grep"} +: ${LN_S="ln -s"} +: ${MAKE="make"} +: ${MKDIR="mkdir"} +: ${MV="mv -f"} +: ${RM="rm -f"} +: ${SED="/bin/sed"} +: ${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 "${1}" | $SED -e "$dirname"` + if test "X$func_dirname_result" = "X${1}"; then + func_dirname_result="${3}" + else + func_dirname_result="$func_dirname_result${2}" + fi + func_basename_result=`$ECHO "${1}" | $SED -e "$basename"` +} + +# Generated shell functions inserted here. + +# 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} +} + + +# func_append var value +# Append VALUE to the end of shell variable VAR. +func_append () +{ + eval "$1+=\$2" +} +# Generated shell functions inserted here. + +# These SED scripts presuppose an absolute path with a trailing slash. +pathcar='s,^/\([^/]*\).*$,\1,' +pathcdr='s,^/[^/]*,,' +removedotparts=':dotsl + s@/\./@/@g + t dotsl + s,/\.$,/,' +collapseslashes='s@/\{1,\}@/@g' +finalslash='s,/*$,/,' + +# func_normal_abspath PATH +# Remove doubled-up and trailing slashes, "." path components, +# and cancel out any ".." path components in PATH after making +# it an absolute path. +# value returned in "$func_normal_abspath_result" +func_normal_abspath () +{ + # Start from root dir and reassemble the path. + func_normal_abspath_result= + func_normal_abspath_tpath=$1 + func_normal_abspath_altnamespace= + case $func_normal_abspath_tpath in + "") + # Empty path, that just means $cwd. + func_stripname '' '/' "`pwd`" + func_normal_abspath_result=$func_stripname_result + return + ;; + # The next three entries are used to spot a run of precisely + # two leading slashes without using negated character classes; + # we take advantage of case's first-match behaviour. + ///*) + # Unusual form of absolute path, do nothing. + ;; + //*) + # Not necessarily an ordinary path; POSIX reserves leading '//' + # and for example Cygwin uses it to access remote file shares + # over CIFS/SMB, so we conserve a leading double slash if found. + func_normal_abspath_altnamespace=/ + ;; + /*) + # Absolute path, do nothing. + ;; + *) + # Relative path, prepend $cwd. + func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath + ;; + esac + # Cancel out all the simple stuff to save iterations. We also want + # the path to end with a slash for ease of parsing, so make sure + # there is one (and only one) here. + func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"` + while :; do + # Processed it all yet? + if test "$func_normal_abspath_tpath" = / ; then + # If we ascended to the root using ".." the result may be empty now. + if test -z "$func_normal_abspath_result" ; then + func_normal_abspath_result=/ + fi + break + fi + func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$pathcar"` + func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$pathcdr"` + # Figure out what to do with it + case $func_normal_abspath_tcomponent in + "") + # Trailing empty path component, ignore it. + ;; + ..) + # Parent dir; strip last assembled component from result. + func_dirname "$func_normal_abspath_result" + func_normal_abspath_result=$func_dirname_result + ;; + *) + # Actual path component, append it. + func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent + ;; + esac + done + # Restore leading double-slash if one was found on entry. + func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result +} + +# func_relative_path SRCDIR DSTDIR +# generates a relative path from SRCDIR to DSTDIR, with a trailing +# slash if non-empty, suitable for immediately appending a filename +# without needing to append a separator. +# value returned in "$func_relative_path_result" +func_relative_path () +{ + func_relative_path_result= + func_normal_abspath "$1" + func_relative_path_tlibdir=$func_normal_abspath_result + func_normal_abspath "$2" + func_relative_path_tbindir=$func_normal_abspath_result + + # Ascend the tree starting from libdir + while :; do + # check if we have found a prefix of bindir + case $func_relative_path_tbindir in + $func_relative_path_tlibdir) + # found an exact match + func_relative_path_tcancelled= + break + ;; + $func_relative_path_tlibdir*) + # found a matching prefix + func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" + func_relative_path_tcancelled=$func_stripname_result + if test -z "$func_relative_path_result"; then + func_relative_path_result=. + fi + break + ;; + *) + func_dirname $func_relative_path_tlibdir + func_relative_path_tlibdir=${func_dirname_result} + if test "x$func_relative_path_tlibdir" = x ; then + # Have to descend all the way to the root! + func_relative_path_result=../$func_relative_path_result + func_relative_path_tcancelled=$func_relative_path_tbindir + break + fi + func_relative_path_result=../$func_relative_path_result + ;; + esac + done + + # Now calculate path; take care to avoid doubling-up slashes. + func_stripname '' '/' "$func_relative_path_result" + func_relative_path_result=$func_stripname_result + func_stripname '/' '/' "$func_relative_path_tcancelled" + if test "x$func_stripname_result" != x ; then + func_relative_path_result=${func_relative_path_result}/${func_stripname_result} + fi + + # Normalisation. If bindir is libdir, return empty string, + # else relative path ending with a slash; either way, target + # file name can be directly appended. + if test ! -z "$func_relative_path_result"; then + func_stripname './' '' "$func_relative_path_result/" + func_relative_path_result=$func_stripname_result + fi +} + +# The name of this program: +func_dirname_and_basename "$progpath" +progname=$func_basename_result + +# Make sure we have an absolute path for reexecution: +case $progpath in + [\\/]*|[A-Za-z]:\\*) ;; + *[\\/]*) + progdir=$func_dirname_result + progdir=`cd "$progdir" && pwd` + progpath="$progdir/$progname" + ;; + *) + save_IFS="$IFS" + IFS=: + 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_echo_all arg... +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "$*" +} + +# func_error arg... +# Echo program name prefixed message to standard error. +func_error () +{ + $ECHO "$progname${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 "$my_directory_path" | $SED -e "$dirname"` + done + my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'` + + save_mkdir_p_IFS="$IFS"; IFS=':' + for my_dir in $my_dir_list; do + IFS="$save_mkdir_p_IFS" + # mkdir can fail with a `File exist' error if two processes + # try to create one of the directories concurrently. Don't + # stop in that case! + $MKDIR "$my_dir" 2>/dev/null || : + done + IFS="$save_mkdir_p_IFS" + + # Bail out if we (or some other process) failed to create a directory. + test -d "$my_directory_path" || \ + func_fatal_error "Failed to create \`$1'" + fi +} + + +# func_mktempdir [string] +# Make a temporary directory that won't clash with other running +# libtool processes, and avoids race conditions if possible. If +# given, STRING is the basename for that directory. +func_mktempdir () +{ + my_template="${TMPDIR-/tmp}/${1-$progname}" + + if test "$opt_dry_run" = ":"; then + # Return a directory name, but don't create it in dry-run mode + my_tmpdir="${my_template}-$$" + else + + # If mktemp works, use that first and foremost + my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` + + if test ! -d "$my_tmpdir"; then + # Failing that, at least try and use $RANDOM to avoid a race + my_tmpdir="${my_template}-${RANDOM-0}$$" + + save_mktempdir_umask=`umask` + umask 0077 + $MKDIR "$my_tmpdir" + umask $save_mktempdir_umask + fi + + # If we're not in dry-run mode, bomb out on failure + test -d "$my_tmpdir" || \ + func_fatal_error "cannot create temporary directory \`$my_tmpdir'" + fi + + $ECHO "$my_tmpdir" +} + + +# func_quote_for_eval arg +# Aesthetically quote ARG to be evaled later. +# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT +# is double-quoted, suitable for a subsequent eval, whereas +# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters +# which are still active within double quotes backslashified. +func_quote_for_eval () +{ + case $1 in + *[\\\`\"\$]*) + func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;; + *) + func_quote_for_eval_unquoted_result="$1" ;; + esac + + case $func_quote_for_eval_unquoted_result in + # Double-quote args containing shell metacharacters to delay + # word splitting, command substitution and and variable + # expansion for a subsequent eval. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\"" + ;; + *) + func_quote_for_eval_result="$func_quote_for_eval_unquoted_result" + esac +} + + +# func_quote_for_expand arg +# Aesthetically quote ARG to be evaled later; same as above, +# but do not quote variable references. +func_quote_for_expand () +{ + case $1 in + *[\\\`\"]*) + my_arg=`$ECHO "$1" | $SED \ + -e "$double_quote_subst" -e "$sed_double_backslash"` ;; + *) + my_arg="$1" ;; + esac + + case $my_arg in + # Double-quote args containing shell metacharacters to delay + # word splitting and command substitution for a subsequent eval. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + my_arg="\"$my_arg\"" + ;; + esac + + func_quote_for_expand_result="$my_arg" +} + + +# func_show_eval cmd [fail_exp] +# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is +# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP +# is given, then evaluate it. +func_show_eval () +{ + my_cmd="$1" + my_fail_exp="${2-:}" + + ${opt_silent-false} || { + func_quote_for_expand "$my_cmd" + eval "func_echo $func_quote_for_expand_result" + } + + if ${opt_dry_run-false}; then :; else + eval "$my_cmd" + my_status=$? + if test "$my_status" -eq 0; then :; else + eval "(exit $my_status); $my_fail_exp" + fi + fi +} + + +# func_show_eval_locale cmd [fail_exp] +# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is +# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP +# is given, then evaluate it. Use the saved locale for evaluation. +func_show_eval_locale () +{ + my_cmd="$1" + my_fail_exp="${2-:}" + + ${opt_silent-false} || { + func_quote_for_expand "$my_cmd" + eval "func_echo $func_quote_for_expand_result" + } + + if ${opt_dry_run-false}; then :; else + eval "$lt_user_locale + $my_cmd" + my_status=$? + eval "$lt_safe_locale" + if test "$my_status" -eq 0; then :; else + eval "(exit $my_status); $my_fail_exp" + fi + fi +} + + +# func_version +# Echo version message to standard output and exit. +func_version () +{ + $SED -n '/(C)/!b go + :more + /\./!{ + N + s/\n# / / + b more + } + :go + /^# '$PROGRAM' (GNU /,/# warranty; / { + s/^# // + s/^# *$// + s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/ + p + }' < "$progpath" + exit $? +} + +# func_usage +# Echo short help message to standard output and exit. +func_usage () +{ + $SED -n '/^# Usage:/,/^# *.*--help/ { + s/^# // + s/^# *$// + s/\$progname/'$progname'/ + p + }' < "$progpath" + echo + $ECHO "run \`$progname --help | more' for full usage" + exit $? +} + +# func_help [NOEXIT] +# Echo long help message to standard output and exit, +# unless 'noexit' is passed as argument. +func_help () +{ + $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" + ret=$? + if test -z "$1"; then + exit $ret + fi +} + +# func_missing_arg argname +# Echo program name prefixed message to standard error and set global +# exit_cmd. +func_missing_arg () +{ + func_error "missing argument for $1." + exit_cmd=exit +} + +exit_cmd=: + + + + + + +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=: + opt_verbose=false + ;; + + --no-quiet|--no-silent) + preserve_args="$preserve_args $opt" + opt_silent=false + ;; + + --verbose| -v) preserve_args="$preserve_args $opt" + opt_silent=false + opt_verbose=: + ;; + + --no-verbose) preserve_args="$preserve_args $opt" + opt_verbose=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=: ;; + --help-all) opt_help=': help-all' ;; + --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 + CC_expanded=`func_echo_all $CC` + CC_quoted_expanded=`func_echo_all $CC_quoted` + case $@ in + # Blanks in the command may have been stripped by the calling shell, + # but not from the CC environment variable when configure was run. + " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ + " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; + # Blanks at the start of $base_compile will cause this to fail + # if we don't check for them as well. + *) + for z in $available_tags; do + if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then + # Evaluate the configuration. + eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" + CC_quoted= + for arg in $CC; do + # Double-quote args containing other shell metacharacters. + func_quote_for_eval "$arg" + CC_quoted="$CC_quoted $func_quote_for_eval_result" + done + CC_expanded=`func_echo_all $CC` + CC_quoted_expanded=`func_echo_all $CC_quoted` + case "$@ " in + " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ + " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) + # The compiler in the base compile command matches + # the one in the tagged configuration. + # Assume this is the tagged configuration we want. + tagname=$z + break + ;; + esac + fi + done + # If $tagname still isn't set, then no tagged configuration + # was found and let the user know that the "--tag" command + # line option must be used. + if test -z "$tagname"; then + func_echo "unable to infer tagged configuration" + func_fatal_error "specify a tag with \`--tag'" +# else +# func_verbose "using $tagname tagged configuration" + fi + ;; + esac + fi +} + + + +# func_write_libtool_object output_name pic_name nonpic_name +# Create a libtool object file (analogous to a ".la" file), +# but don't create it if we're doing a dry run. +func_write_libtool_object () +{ + write_libobj=${1} + if test "$build_libtool_libs" = yes; then + write_lobj=\'${2}\' + else + write_lobj=none + fi + + if test "$build_old_libs" = yes; then + write_oldobj=\'${3}\' + else + write_oldobj=none + fi + + $opt_dry_run || { + cat >${write_libobj}T <?"'"'"' &()|`$[]' \ + && func_warning "libobj name \`$libobj' may not contain shell special characters." + func_dirname_and_basename "$obj" "/" "" + objname="$func_basename_result" + xdir="$func_dirname_result" + lobj=${xdir}$objdir/$objname + + test -z "$base_compile" && \ + func_fatal_help "you must specify a compilation command" + + # Delete any leftover library objects. + if test "$build_old_libs" = yes; then + removelist="$obj $lobj $libobj ${libobj}T" + else + removelist="$lobj $libobj ${libobj}T" + fi + + # On Cygwin there's no "real" PIC flag so we must build both object types + case $host_os in + cygwin* | mingw* | pw32* | os2* | cegcc*) + pic_mode=default + ;; + esac + if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then + # non-PIC code in shared libraries is not supported + pic_mode=default + fi + + # Calculate the filename of the output object if compiler does + # not support -o with -c + if test "$compiler_c_o" = no; then + output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext} + lockfile="$output_obj.lock" + else + output_obj= + need_locks=no + lockfile= + fi + + # Lock this critical section if it is needed + # We use this script file to make the link, it avoids creating a new file + if test "$need_locks" = yes; then + until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do + func_echo "Waiting for $lockfile to be removed" + sleep 2 + done + elif test "$need_locks" = warn; then + if test -f "$lockfile"; then + $ECHO "\ +*** ERROR, $lockfile exists and contains: +`cat $lockfile 2>/dev/null` + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support \`-c' and \`-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $opt_dry_run || $RM $removelist + exit $EXIT_FAILURE + fi + 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 build PIC objects only + -prefer-non-pic try to build non-PIC objects only + -shared do not build a \`.o' file suitable for static linking + -static only build a \`.o' file suitable for static linking + -Wc,FLAG pass FLAG directly to the compiler + +COMPILE-COMMAND is a command to be used in creating a \`standard' object file +from the given SOURCEFILE. + +The output file name is determined by removing the directory component from +SOURCEFILE, then substituting the C source code suffix \`.c' with the +library object suffix, \`.lo'." + ;; + + execute) + $ECHO \ +"Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... + +Automatically set library path, then run a program. + +This mode accepts the following additional options: + + -dlopen FILE add the directory containing FILE to the library path + +This mode sets the library path environment variable according to \`-dlopen' +flags. + +If any of the ARGS are libtool executable wrappers, then they are translated +into their corresponding uninstalled binary, and any of their required library +directories are added to the library path. + +Then, COMMAND is executed, with ARGS as arguments." + ;; + + finish) + $ECHO \ +"Usage: $progname [OPTION]... --mode=finish [LIBDIR]... + +Complete the installation of libtool libraries. + +Each LIBDIR is a directory that contains libtool libraries. + +The commands that this mode executes may require superuser privileges. Use +the \`--dry-run' option if you just want to see what would be executed." + ;; + + install) + $ECHO \ +"Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... + +Install executables or libraries. + +INSTALL-COMMAND is the installation command. The first component should be +either the \`install' or \`cp' program. + +The following components of INSTALL-COMMAND are treated specially: + + -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation + +The rest of the components are interpreted as arguments to that command (only +BSD-compatible install options are recognized)." + ;; + + link) + $ECHO \ +"Usage: $progname [OPTION]... --mode=link LINK-COMMAND... + +Link object files or libraries together to form another library, or to +create an executable program. + +LINK-COMMAND is a command using the C compiler that you would use to create +a program from several object files. + +The following components of LINK-COMMAND are treated specially: + + -all-static do not do any dynamic linking at all + -avoid-version do not add a version suffix if possible + -bindir BINDIR specify path to binaries directory (for systems where + libraries must be found in the PATH setting at runtime) + -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime + -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols + -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) + -export-symbols SYMFILE + try to export only the symbols listed in SYMFILE + -export-symbols-regex REGEX + try to export only the symbols matching REGEX + -LLIBDIR search LIBDIR for required installed libraries + -lNAME OUTPUT-FILE requires the installed library libNAME + -module build a library that can dlopened + -no-fast-install disable the fast-install mode + -no-install link a not-installable executable + -no-undefined declare that a library does not refer to external symbols + -o OUTPUT-FILE create OUTPUT-FILE from the specified objects + -objectlist FILE Use a list of object files found in FILE to specify objects + -precious-files-regex REGEX + don't remove output files matching REGEX + -release RELEASE specify package release information + -rpath LIBDIR the created library will eventually be installed in LIBDIR + -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries + -shared only do dynamic linking of libtool libraries + -shrext SUFFIX override the standard shared library file extension + -static do not do any dynamic linking of uninstalled libtool libraries + -static-libtool-libs + do not do any dynamic linking of libtool libraries + -version-info CURRENT[:REVISION[:AGE]] + specify library version info [each variable defaults to 0] + -weak LIBNAME declare that the target provides the LIBNAME interface + -Wc,FLAG + -Xcompiler FLAG pass linker-specific FLAG directly to the compiler + -Wl,FLAG + -Xlinker FLAG pass linker-specific FLAG directly to the linker + -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) + +All other options (arguments beginning with \`-') are ignored. + +Every other argument is treated as a filename. Files ending in \`.la' are +treated as uninstalled libtool libraries, other files are standard or library +object files. + +If the OUTPUT-FILE ends in \`.la', then a libtool library is created, +only library objects (\`.lo' files) may be specified, and \`-rpath' is +required, except when creating a convenience library. + +If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created +using \`ar' and \`ranlib', or on Windows using \`lib'. + +If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file +is created, otherwise an executable program is created." + ;; + + uninstall) + $ECHO \ +"Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... + +Remove libraries from an installation directory. + +RM is the name of the program to use to delete files associated with each FILE +(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed +to RM. + +If FILE is a libtool library, all the files associated with it are deleted. +Otherwise, only FILE itself is deleted using RM." + ;; + + *) + func_fatal_help "invalid operation mode \`$mode'" + ;; + esac + + echo + $ECHO "Try \`$progname --help' for more information about other modes." +} + +# Now that we've collected a possible --mode arg, show help if necessary +if $opt_help; then + if test "$opt_help" = :; then + func_mode_help + else + { + func_help noexit + for mode in compile link execute install finish uninstall clean; do + func_mode_help + done + } | sed -n '1p; 2,$s/^Usage:/ or: /p' + { + func_help noexit + for mode in compile link execute install finish uninstall clean; do + echo + func_mode_help + done + } | + sed '1d + /^When reporting/,/^Report/{ + H + d + } + $x + /information about other modes/d + /more detailed .*MODE/d + s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' + fi + exit $? +fi + + +# func_mode_execute arg... +func_mode_execute () +{ + $opt_debug + # The first argument is the command name. + cmd="$nonopt" + test -z "$cmd" && \ + func_fatal_help "you must specify a COMMAND" + + # Handle -dlopen flags immediately. + for file in $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 + -* | *.la | *.lo ) ;; + *) + # Do a test to see if this is really a libtool program. + if func_ltwrapper_script_p "$file"; then + func_source "$file" + # Transform arg to wrapped name. + file="$progdir/$program" + elif func_ltwrapper_executable_p "$file"; then + func_ltwrapper_scriptname "$file" + func_source "$func_ltwrapper_scriptname_result" + # Transform arg to wrapped name. + file="$progdir/$program" + fi + ;; + esac + # Quote arguments (to preserve shell metacharacters). + func_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 "----------------------------------------------------------------------" + 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 "----------------------------------------------------------------------" + 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. + case $nonopt in *shtool*) :;; *) false;; esac; then + # Aesthetically quote it. + func_quote_for_eval "$nonopt" + install_prog="$func_quote_for_eval_result " + arg=$1 + shift + else + install_prog= + arg=$nonopt + fi + + # The real first argument should be the name of the installation program. + # Aesthetically quote it. + func_quote_for_eval "$arg" + install_prog="$install_prog$func_quote_for_eval_result" + install_shared_prog=$install_prog + case " $install_prog " in + *[\\\ /]cp\ *) install_cp=: ;; + *) install_cp=false ;; + esac + + # We need to accept at least all the BSD install flags. + dest= + files= + opts= + prev= + install_type= + isdir=no + stripme= + no_mode=: + for arg + do + arg2= + if test -n "$dest"; then + files="$files $dest" + dest=$arg + continue + fi + + case $arg in + -d) isdir=yes ;; + -f) + if $install_cp; then :; else + prev=$arg + fi + ;; + -g | -m | -o) + prev=$arg + ;; + -s) + stripme=" -s" + continue + ;; + -*) + ;; + *) + # If the previous option needed an argument, then skip it. + if test -n "$prev"; then + if test "x$prev" = x-m && test -n "$install_override_mode"; then + arg2=$install_override_mode + no_mode=false + fi + prev= + else + dest=$arg + continue + fi + ;; + esac + + # Aesthetically quote the argument. + func_quote_for_eval "$arg" + install_prog="$install_prog $func_quote_for_eval_result" + if test -n "$arg2"; then + func_quote_for_eval "$arg2" + fi + install_shared_prog="$install_shared_prog $func_quote_for_eval_result" + done + + test -z "$install_prog" && \ + func_fatal_help "you must specify an install program" + + test -n "$prev" && \ + func_fatal_help "the \`$prev' option requires an argument" + + if test -n "$install_override_mode" && $no_mode; then + if $install_cp; then :; else + func_quote_for_eval "$install_override_mode" + install_shared_prog="$install_shared_prog -m $func_quote_for_eval_result" + fi + fi + + if test -z "$files"; then + if test -z "$dest"; then + func_fatal_help "no file or destination specified" + else + func_fatal_help "you must specify a destination" + fi + fi + + # Strip any trailing slash from the destination. + func_stripname '' '/' "$dest" + dest=$func_stripname_result + + # Check to see that the destination is a directory. + test -d "$dest" && isdir=yes + if test "$isdir" = yes; then + destdir="$dest" + destname= + else + func_dirname_and_basename "$dest" "" "." + destdir="$func_dirname_result" + destname="$func_basename_result" + + # Not a directory, so check to see that there is only one file specified. + set dummy $files; shift + test "$#" -gt 1 && \ + func_fatal_help "\`$dest' is not a directory" + fi + case $destdir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + for file in $files; do + case $file in + *.lo) ;; + *) + func_fatal_help "\`$destdir' must be an absolute directory name" + ;; + esac + done + ;; + esac + + # This variable tells wrapper scripts just to set variables rather + # than running their programs. + libtool_install_magic="$magic" + + staticlibs= + future_libdirs= + current_libdirs= + for file in $files; do + + # Do each installation. + case $file in + *.$libext) + # Do the static libraries later. + 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 "$destdir" | $SED -e "s%$libdir\$%%"` + + # Don't allow the user to place us outside of our expected + # location b/c this prevents finding dependent libraries that + # are installed to the same prefix. + # At present, this check doesn't affect windows .dll's that + # are installed into $libdir/../bin (currently, that works fine) + # but it's something to keep an eye on. + test "$inst_prefix_dir" = "$destdir" && \ + func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir" + + if test -n "$inst_prefix_dir"; then + # Stick the inst_prefix_dir data into the link command. + relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` + else + relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` + fi + + func_warning "relinking \`$file'" + func_show_eval "$relink_command" \ + 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"' + fi + + # See the names of the shared library. + set dummy $library_names; shift + if test -n "$1"; then + realname="$1" + shift + + srcname="$realname" + test -n "$relink_command" && srcname="$realname"T + + # Install the shared library and build the symlinks. + func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ + 'exit $?' + tstripme="$stripme" + case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + case $realname in + *.dll.a) + tstripme="" + ;; + esac + ;; + esac + if test -n "$tstripme" && test -n "$striplib"; then + func_show_eval "$striplib $destdir/$realname" 'exit $?' + fi + + if test "$#" -gt 0; then + # Delete the old symlinks, and create new ones. + # Try `ln -sf' first, because the `ln' binary might depend on + # the symlink we replace! Solaris /bin/ln does not understand -f, + # so we also need to try rm && ln -s. + for linkname + do + test "$linkname" != "$realname" \ + && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" + done + fi + + # Do each command in the postinstall commands. + lib="$destdir/$realname" + func_execute_cmds "$postinstall_cmds" 'exit $?' + fi + + # Install the pseudo-library for information purposes. + func_basename "$file" + name="$func_basename_result" + instname="$dir/$name"i + func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' + + # Maybe install the static library, too. + test -n "$old_library" && 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 "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test + if test -n "$libdir" && test ! -f "$libfile"; then + func_warning "\`$lib' has not been installed in \`$libdir'" + finalize=no + fi + done + + relink_command= + func_source "$wrapper" + + outputname= + if test "$fast_install" = no && test -n "$relink_command"; then + $opt_dry_run || { + if test "$finalize" = yes; then + tmpdir=`func_mktempdir` + func_basename "$file$stripped_ext" + file="$func_basename_result" + outputname="$tmpdir/$file" + # Replace the output file specification. + relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` + + $opt_silent || { + func_quote_for_expand "$relink_command" + eval "func_echo $func_quote_for_expand_result" + } + if eval "$relink_command"; then : + else + func_error "error: relink \`$file' with the above command before installing it" + $opt_dry_run || ${RM}r "$tmpdir" + continue + fi + file="$outputname" + else + func_warning "cannot relink \`$file'" + fi + } + else + # Install the binary that we compiled earlier. + file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` + fi + fi + + # remove .exe since cygwin /usr/bin/install will append another + # one anyway + case $install_prog,$host in + */usr/bin/install*,*cygwin*) + case $file:$destfile in + *.exe:*.exe) + # this is ok + ;; + *.exe:*) + destfile=$destfile.exe + ;; + *:*.exe) + func_stripname '' '.exe' "$destfile" + destfile=$func_stripname_result + ;; + esac + ;; + esac + func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' + $opt_dry_run || if test -n "$outputname"; then + ${RM}r "$tmpdir" + fi + ;; + esac + done + + for file in $staticlibs; do + func_basename "$file" + name="$func_basename_result" + + # Set up the ranlib parameters. + oldlib="$destdir/$name" + + func_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 + +#if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) +#pragma GCC diagnostic ignored \"-Wstrict-prototypes\" +#endif + +/* External symbol declarations for the compiler. */\ +" + + if test "$dlself" = yes; then + func_verbose "generating symbol list for \`$output'" + + $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" + + # Add our own program objects to the symbol list. + progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` + for progfile in $progfiles; do + func_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 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 "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` + else + compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` + fi + ;; + *) + compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` + ;; + esac + ;; + *) + func_fatal_error "unknown suffix for \`$my_dlsyms'" + ;; + esac + else + # We keep going just in case the user didn't refer to + # lt_preloaded_symbols. The linker will fail if global_symbol_pipe + # really was required. + + # Nullify the symbol file. + compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` + fi +} + +# func_win32_libid arg +# return the library type of file 'arg' +# +# Need a lot of goo to handle *both* DLLs and import libs +# Has to be a shell function in order to 'eat' the argument +# that is supplied when $file_magic_command is called. +# Despite the name, also deal with 64 bit binaries. +func_win32_libid () +{ + $opt_debug + win32_libid_type="unknown" + win32_fileres=`file -L $1 2>/dev/null` + case $win32_fileres in + *ar\ archive\ import\ library*) # definitely import + win32_libid_type="x86 archive import" + ;; + *ar\ archive*) # could be an import, or static + # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. + if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | + $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then + 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" + if test "$lock_old_archive_extraction" = yes; then + lockfile=$f_ex_an_ar_oldlib.lock + until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do + func_echo "Waiting for $lockfile to be removed" + sleep 2 + done + fi + func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ + 'stat=$?; rm -f "$lockfile"; exit $stat' + if test "$lock_old_archive_extraction" = yes; then + $opt_dry_run || rm -f "$lockfile" + fi + if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then + : + else + func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" + fi +} + + +# func_extract_archives gentop oldlib ... +func_extract_archives () +{ + $opt_debug + my_gentop="$1"; shift + my_oldlibs=${1+"$@"} + my_oldobjs="" + my_xlib="" + my_xabs="" + my_xdir="" + + for my_xlib in $my_oldlibs; do + # Extract the objects. + case $my_xlib in + [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; + *) my_xabs=`pwd`"/$my_xlib" ;; + esac + func_basename "$my_xlib" + my_xlib="$func_basename_result" + my_xlib_u=$my_xlib + while :; do + case " $extracted_archives " in + *" $my_xlib_u "*) + func_arith $extracted_serial + 1 + extracted_serial=$func_arith_result + my_xlib_u=lt$extracted_serial-$my_xlib ;; + *) break ;; + esac + done + extracted_archives="$extracted_archives $my_xlib_u" + my_xdir="$my_gentop/$my_xlib_u" + + func_mkdir_p "$my_xdir" + + case $host in + *-darwin*) + func_verbose "Extracting $my_xabs" + # Do not bother doing anything if just a dry run + $opt_dry_run || { + darwin_orig_dir=`pwd` + cd $my_xdir || exit $? + darwin_archive=$my_xabs + darwin_curdir=`pwd` + darwin_base_archive=`basename "$darwin_archive"` + darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` + if test -n "$darwin_arches"; then + darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` + darwin_arch= + func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" + for darwin_arch in $darwin_arches ; do + func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}" + $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" + cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" + func_extract_an_archive "`pwd`" "${darwin_base_archive}" + cd "$darwin_curdir" + $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" + done # $darwin_arches + ## Okay now we've a bunch of thin objects, gotta fatten them up :) + darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u` + darwin_file= + darwin_files= + for darwin_file in $darwin_filelist; do + darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` + $LIPO -create -output "$darwin_file" $darwin_files + done # $darwin_filelist + $RM -rf unfat-$$ + cd "$darwin_orig_dir" + else + cd $darwin_orig_dir + func_extract_an_archive "$my_xdir" "$my_xabs" + fi # $darwin_arches + } # !$opt_dry_run + ;; + *) + func_extract_an_archive "$my_xdir" "$my_xabs" + ;; + esac + my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` + done + + func_extract_archives_result="$my_oldobjs" +} + + +# func_emit_wrapper [arg=no] +# +# Emit a libtool wrapper script on stdout. +# Don't directly open a file because we may want to +# incorporate the script contents within a cygwin/mingw +# wrapper executable. Must ONLY be called from within +# func_mode_link because it depends on a number of variables +# set therein. +# +# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR +# variable will take. If 'yes', then the emitted script +# will assume that the directory in which it is stored is +# the $objdir directory. This is a cygwin/mingw-specific +# behavior. +func_emit_wrapper () +{ + func_emit_wrapper_arg1=${1-no} + + $ECHO "\ +#! $SHELL + +# $output - temporary wrapper script for $objdir/$outputname +# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION +# +# The $output program cannot be directly executed until all the libtool +# libraries that it depends on are installed. +# +# This wrapper script should never be moved out of the build directory. +# If it is, it will not operate correctly. + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +sed_quote_subst='$sed_quote_subst' + +# Be Bourne compatible +if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac +fi +BIN_SH=xpg4; export BIN_SH # for Tru64 +DUALCASE=1; export DUALCASE # for MKS sh + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +relink_command=\"$relink_command\" + +# This environment variable determines our operation mode. +if test \"\$libtool_install_magic\" = \"$magic\"; then + # install mode needs the following variables: + generated_by_libtool_version='$macro_version' + notinst_deplibs='$notinst_deplibs' +else + # When we are sourced in execute mode, \$file and \$ECHO are already set. + if test \"\$libtool_execute_magic\" != \"$magic\"; then + file=\"\$0\"" + + qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` + $ECHO "\ + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$1 +_LTECHO_EOF' +} + ECHO=\"$qECHO\" + fi + +# Very basic option parsing. These options are (a) specific to +# the libtool wrapper, (b) are identical between the wrapper +# /script/ and the wrapper /executable/ which is used only on +# windows platforms, and (c) all begin with the string "--lt-" +# (application programs are unlikely to have options which match +# this pattern). +# +# There are only two supported options: --lt-debug and +# --lt-dump-script. There is, deliberately, no --lt-help. +# +# The first argument to this parsing function should be the +# script's $0 value, followed by "$@". +lt_option_debug= +func_parse_lt_options () +{ + lt_script_arg0=\$0 + shift + for lt_opt + do + case \"\$lt_opt\" in + --lt-debug) lt_option_debug=1 ;; + --lt-dump-script) + lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` + test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. + lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` + cat \"\$lt_dump_D/\$lt_dump_F\" + exit 0 + ;; + --lt-*) + \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 + exit 1 + ;; + esac + done + + # Print the debug banner immediately: + if test -n \"\$lt_option_debug\"; then + echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2 + fi +} + +# Used when --lt-debug. Prints its arguments to stdout +# (redirection is the responsibility of the caller) +func_lt_dump_args () +{ + lt_dump_args_N=1; + for lt_arg + do + \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\" + lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` + done +} + +# Core function for launching the target application +func_exec_program_core () +{ +" + case $host in + # Backslashes separate directories on plain windows + *-*-mingw | *-*-os2* | *-cegcc*) + $ECHO "\ + if test -n \"\$lt_option_debug\"; then + \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2 + func_lt_dump_args \${1+\"\$@\"} 1>&2 + fi + exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} +" + ;; + + *) + $ECHO "\ + if test -n \"\$lt_option_debug\"; then + \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2 + func_lt_dump_args \${1+\"\$@\"} 1>&2 + fi + exec \"\$progdir/\$program\" \${1+\"\$@\"} +" + ;; + esac + $ECHO "\ + \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 + exit 1 +} + +# A function to encapsulate launching the target application +# Strips options in the --lt-* namespace from \$@ and +# launches target application with the remaining arguments. +func_exec_program () +{ + for lt_wr_arg + do + case \$lt_wr_arg in + --lt-*) ;; + *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; + esac + shift + done + func_exec_program_core \${1+\"\$@\"} +} + + # Parse options + func_parse_lt_options \"\$0\" \${1+\"\$@\"} + + # Find the directory that this script lives in. + thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` + test \"x\$thisdir\" = \"x\$file\" && thisdir=. + + # Follow symbolic links until we get to the real thisdir. + file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\` + while test -n \"\$file\"; do + destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` + + # If there was a directory component, then change thisdir. + if test \"x\$destdir\" != \"x\$file\"; then + case \"\$destdir\" in + [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; + *) thisdir=\"\$thisdir/\$destdir\" ;; + esac + fi + + file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` + file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` + done + + # Usually 'no', except on cygwin/mingw when embedded into + # the cwrapper. + WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 + if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then + # special case for '.' + if test \"\$thisdir\" = \".\"; then + thisdir=\`pwd\` + fi + # remove .libs from thisdir + case \"\$thisdir\" in + *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; + $objdir ) thisdir=. ;; + esac + fi + + # Try to get the absolute directory name. + absdir=\`cd \"\$thisdir\" && pwd\` + test -n \"\$absdir\" && thisdir=\"\$absdir\" +" + + if test "$fast_install" = yes; then + $ECHO "\ + program=lt-'$outputname'$exeext + progdir=\"\$thisdir/$objdir\" + + if test ! -f \"\$progdir/\$program\" || + { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ + test \"X\$file\" != \"X\$progdir/\$program\"; }; then + + file=\"\$\$-\$program\" + + if test ! -d \"\$progdir\"; then + $MKDIR \"\$progdir\" + else + $RM \"\$progdir/\$file\" + fi" + + $ECHO "\ + + # relink executable if necessary + if test -n \"\$relink_command\"; then + if relink_command_output=\`eval \$relink_command 2>&1\`; then : + else + $ECHO \"\$relink_command_output\" >&2 + $RM \"\$progdir/\$file\" + exit 1 + fi + fi + + $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || + { $RM \"\$progdir/\$program\"; + $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } + $RM \"\$progdir/\$file\" + fi" + else + $ECHO "\ + program='$outputname' + progdir=\"\$thisdir/$objdir\" +" + fi + + $ECHO "\ + + if test -f \"\$progdir/\$program\"; then" + + # Export our shlibpath_var if we have one. + if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then + $ECHO "\ + # Add our own library path to $shlibpath_var + $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" + + # Some systems cannot cope with colon-terminated $shlibpath_var + # The second colon is a workaround for a bug in BeOS R4 sed + $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` + + export $shlibpath_var +" + fi + + # 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. + func_exec_program \${1+\"\$@\"} + fi + else + # The program doesn't exist. + \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 + \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 + \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 + exit 1 + fi +fi\ +" +} + + +# func_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 + func_to_host_path_result=`( cmd //c echo "$1" ) 2>/dev/null | + $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"` + ;; + *cygwin* ) + func_to_host_path_result=`cygpath -w "$1" | + $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_stripname : : "$1" + func_to_host_pathlist_tmp1=$func_stripname_result + case $build in + *mingw* ) # Actually, msys. + # Awkward: cmd appends spaces to result. + func_to_host_pathlist_result=` + ( cmd //c echo "$func_to_host_pathlist_tmp1" ) 2>/dev/null | + $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"` + ;; + *cygwin* ) + func_to_host_pathlist_result=`cygpath -w -p "$func_to_host_pathlist_tmp1" | + $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_append func_to_host_pathlist_result ";$func_to_host_path_result" + fi + fi + fi + 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_append 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 < +#include +#ifdef _MSC_VER +# include +# include +# include +#else +# include +# include +# ifdef __CYGWIN__ +# include +# endif +#endif +#include +#include +#include +#include +#include +#include +#include +#include + +/* declarations of non-ANSI functions */ +#if defined(__MINGW32__) +# ifdef __STRICT_ANSI__ +int _putenv (const char *); +# endif +#elif defined(__CYGWIN__) +# ifdef __STRICT_ANSI__ +char *realpath (const char *, char *); +int putenv (char *); +int setenv (const char *, const char *, int); +# endif +/* #elif defined (other platforms) ... */ +#endif + +/* portability defines, excluding path handling macros */ +#if defined(_MSC_VER) +# define setmode _setmode +# define stat _stat +# define chmod _chmod +# define getcwd _getcwd +# define putenv _putenv +# define S_IXUSR _S_IEXEC +# ifndef _INTPTR_T_DEFINED +# define _INTPTR_T_DEFINED +# define intptr_t int +# endif +#elif defined(__MINGW32__) +# define setmode _setmode +# define stat _stat +# define chmod _chmod +# define getcwd _getcwd +# define putenv _putenv +#elif defined(__CYGWIN__) +# define HAVE_SETENV +# define FOPEN_WB "wb" +/* #elif defined (other platforms) ... */ +#endif + +#if defined(PATH_MAX) +# define LT_PATHMAX PATH_MAX +#elif defined(MAXPATHLEN) +# define LT_PATHMAX MAXPATHLEN +#else +# define LT_PATHMAX 1024 +#endif + +#ifndef S_IXOTH +# define S_IXOTH 0 +#endif +#ifndef S_IXGRP +# define S_IXGRP 0 +#endif + +/* path handling portability macros */ +#ifndef DIR_SEPARATOR +# define DIR_SEPARATOR '/' +# define PATH_SEPARATOR ':' +#endif + +#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ + defined (__OS2__) +# define HAVE_DOS_BASED_FILE_SYSTEM +# define FOPEN_WB "wb" +# ifndef DIR_SEPARATOR_2 +# define DIR_SEPARATOR_2 '\\' +# endif +# ifndef PATH_SEPARATOR_2 +# define PATH_SEPARATOR_2 ';' +# endif +#endif + +#ifndef DIR_SEPARATOR_2 +# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) +#else /* DIR_SEPARATOR_2 */ +# define IS_DIR_SEPARATOR(ch) \ + (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) +#endif /* DIR_SEPARATOR_2 */ + +#ifndef PATH_SEPARATOR_2 +# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) +#else /* PATH_SEPARATOR_2 */ +# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) +#endif /* PATH_SEPARATOR_2 */ + +#ifndef FOPEN_WB +# define FOPEN_WB "w" +#endif +#ifndef _O_BINARY +# define _O_BINARY 0 +#endif + +#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) +#define XFREE(stale) do { \ + if (stale) { free ((void *) stale); stale = 0; } \ +} while (0) + +#if defined(LT_DEBUGWRAPPER) +static int lt_debug = 1; +#else +static int lt_debug = 0; +#endif + +const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ + +void *xmalloc (size_t num); +char *xstrdup (const char *string); +const char *base_name (const char *name); +char *find_executable (const char *wrapper); +char *chase_symlinks (const char *pathspec); +int make_executable (const char *path); +int check_executable (const char *path); +char *strendzap (char *str, const char *pat); +void lt_debugprintf (const char *file, int line, const char *fmt, ...); +void lt_fatal (const char *file, int line, const char *message, ...); +static const char *nonnull (const char *s); +static const char *nonempty (const char *s); +void lt_setenv (const char *name, const char *value); +char *lt_extend_str (const char *orig_value, const char *add, int to_end); +void lt_update_exe_path (const char *name, const char *value); +void lt_update_lib_path (const char *name, const char *value); +char **prepare_spawn (char **argv); +void lt_dump_script (FILE *f); +EOF + + cat <= 0) + && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) + return 1; + else + return 0; +} + +int +make_executable (const char *path) +{ + int rval = 0; + struct stat st; + + lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", + nonempty (path)); + if ((!path) || (!*path)) + return 0; + + if (stat (path, &st) >= 0) + { + rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); + } + return rval; +} + +/* Searches for the full path of the wrapper. Returns + newly allocated full path name if found, NULL otherwise + Does not chase symlinks, even on platforms that support them. +*/ +char * +find_executable (const char *wrapper) +{ + int has_slash = 0; + const char *p; + const char *p_next; + /* static buffer for getcwd */ + char tmp[LT_PATHMAX + 1]; + int tmp_len; + char *concat_name; + + lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", + nonempty (wrapper)); + + if ((wrapper == NULL) || (*wrapper == '\0')) + return NULL; + + /* Absolute path? */ +#if defined (HAVE_DOS_BASED_FILE_SYSTEM) + if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') + { + concat_name = xstrdup (wrapper); + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + } + else + { +#endif + if (IS_DIR_SEPARATOR (wrapper[0])) + { + concat_name = xstrdup (wrapper); + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + } +#if defined (HAVE_DOS_BASED_FILE_SYSTEM) + } +#endif + + for (p = wrapper; *p; p++) + if (*p == '/') + { + has_slash = 1; + break; + } + if (!has_slash) + { + /* no slashes; search PATH */ + const char *path = getenv ("PATH"); + if (path != NULL) + { + for (p = path; *p; p = p_next) + { + const char *q; + size_t p_len; + for (q = p; *q; q++) + if (IS_PATH_SEPARATOR (*q)) + break; + p_len = q - p; + p_next = (*q == '\0' ? q : q + 1); + if (p_len == 0) + { + /* empty path: current directory */ + if (getcwd (tmp, LT_PATHMAX) == NULL) + lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", + nonnull (strerror (errno))); + tmp_len = strlen (tmp); + concat_name = + XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); + memcpy (concat_name, tmp, tmp_len); + concat_name[tmp_len] = '/'; + strcpy (concat_name + tmp_len + 1, wrapper); + } + else + { + concat_name = + XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); + memcpy (concat_name, p, p_len); + concat_name[p_len] = '/'; + strcpy (concat_name + p_len + 1, wrapper); + } + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + } + } + /* not found in PATH; assume curdir */ + } + /* Relative path | not found in path: prepend cwd */ + if (getcwd (tmp, LT_PATHMAX) == NULL) + lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", + nonnull (strerror (errno))); + tmp_len = strlen (tmp); + concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); + memcpy (concat_name, tmp, tmp_len); + concat_name[tmp_len] = '/'; + strcpy (concat_name + tmp_len + 1, wrapper); + + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + return NULL; +} + +char * +chase_symlinks (const char *pathspec) +{ +#ifndef S_ISLNK + return xstrdup (pathspec); +#else + char buf[LT_PATHMAX]; + struct stat s; + char *tmp_pathspec = xstrdup (pathspec); + char *p; + int has_symlinks = 0; + while (strlen (tmp_pathspec) && !has_symlinks) + { + lt_debugprintf (__FILE__, __LINE__, + "checking path component for symlinks: %s\n", + tmp_pathspec); + if (lstat (tmp_pathspec, &s) == 0) + { + if (S_ISLNK (s.st_mode) != 0) + { + has_symlinks = 1; + break; + } + + /* search backwards for last DIR_SEPARATOR */ + p = tmp_pathspec + strlen (tmp_pathspec) - 1; + while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) + p--; + if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) + { + /* no more DIR_SEPARATORS left */ + break; + } + *p = '\0'; + } + else + { + lt_fatal (__FILE__, __LINE__, + "error accessing file \"%s\": %s", + tmp_pathspec, nonnull (strerror (errno))); + } + } + XFREE (tmp_pathspec); + + if (!has_symlinks) + { + return xstrdup (pathspec); + } + + tmp_pathspec = realpath (pathspec, buf); + if (tmp_pathspec == 0) + { + lt_fatal (__FILE__, __LINE__, + "could not follow symlinks for %s", pathspec); + } + return xstrdup (tmp_pathspec); +#endif +} + +char * +strendzap (char *str, const char *pat) +{ + size_t len, patlen; + + assert (str != NULL); + assert (pat != NULL); + + len = strlen (str); + patlen = strlen (pat); + + if (patlen <= len) + { + str += len - patlen; + if (strcmp (str, pat) == 0) + *str = '\0'; + } + return str; +} + +void +lt_debugprintf (const char *file, int line, const char *fmt, ...) +{ + va_list args; + if (lt_debug) + { + (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); + va_start (args, fmt); + (void) vfprintf (stderr, fmt, args); + va_end (args); + } +} + +static void +lt_error_core (int exit_status, const char *file, + int line, const char *mode, + const char *message, va_list ap) +{ + fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); + vfprintf (stderr, message, ap); + fprintf (stderr, ".\n"); + + if (exit_status >= 0) + exit (exit_status); +} + +void +lt_fatal (const char *file, int line, const char *message, ...) +{ + va_list ap; + va_start (ap, message); + lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); + va_end (ap); +} + +static const char * +nonnull (const char *s) +{ + return s ? s : "(null)"; +} + +static const char * +nonempty (const char *s) +{ + return (s && !*s) ? "(empty)" : nonnull (s); +} + +void +lt_setenv (const char *name, const char *value) +{ + lt_debugprintf (__FILE__, __LINE__, + "(lt_setenv) setting '%s' to '%s'\n", + nonnull (name), nonnull (value)); + { +#ifdef HAVE_SETENV + /* always make a copy, for consistency with !HAVE_SETENV */ + char *str = xstrdup (value); + setenv (name, str, 1); +#else + int len = strlen (name) + 1 + strlen (value) + 1; + char *str = XMALLOC (char, len); + sprintf (str, "%s=%s", name, value); + if (putenv (str) != EXIT_SUCCESS) + { + XFREE (str); + } +#endif + } +} + +char * +lt_extend_str (const char *orig_value, const char *add, int to_end) +{ + char *new_value; + if (orig_value && *orig_value) + { + int orig_value_len = strlen (orig_value); + int add_len = strlen (add); + new_value = XMALLOC (char, add_len + orig_value_len + 1); + if (to_end) + { + strcpy (new_value, orig_value); + strcpy (new_value + orig_value_len, add); + } + else + { + strcpy (new_value, add); + strcpy (new_value + add_len, orig_value); + } + } + else + { + new_value = xstrdup (add); + } + return new_value; +} + +void +lt_update_exe_path (const char *name, const char *value) +{ + lt_debugprintf (__FILE__, __LINE__, + "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", + nonnull (name), nonnull (value)); + + if (name && *name && value && *value) + { + char *new_value = lt_extend_str (getenv (name), value, 0); + /* some systems can't cope with a ':'-terminated path #' */ + int len = strlen (new_value); + while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1])) + { + new_value[len-1] = '\0'; + } + lt_setenv (name, new_value); + XFREE (new_value); + } +} + +void +lt_update_lib_path (const char *name, const char *value) +{ + lt_debugprintf (__FILE__, __LINE__, + "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", + nonnull (name), nonnull (value)); + + if (name && *name && value && *value) + { + char *new_value = lt_extend_str (getenv (name), value, 0); + lt_setenv (name, new_value); + XFREE (new_value); + } +} + +EOF + case $host_os in + mingw*) + cat <<"EOF" + +/* Prepares an argument vector before calling spawn(). + Note that spawn() does not by itself call the command interpreter + (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : + ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); + GetVersionEx(&v); + v.dwPlatformId == VER_PLATFORM_WIN32_NT; + }) ? "cmd.exe" : "command.com"). + Instead it simply concatenates the arguments, separated by ' ', and calls + CreateProcess(). We must quote the arguments since Win32 CreateProcess() + interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a + special way: + - Space and tab are interpreted as delimiters. They are not treated as + delimiters if they are surrounded by double quotes: "...". + - Unescaped double quotes are removed from the input. Their only effect is + that within double quotes, space and tab are treated like normal + characters. + - Backslashes not followed by double quotes are not special. + - But 2*n+1 backslashes followed by a double quote become + n backslashes followed by a double quote (n >= 0): + \" -> " + \\\" -> \" + \\\\\" -> \\" + */ +#define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" +#define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" +char ** +prepare_spawn (char **argv) +{ + size_t argc; + char **new_argv; + size_t i; + + /* Count number of arguments. */ + for (argc = 0; argv[argc] != NULL; argc++) + ; + + /* Allocate new argument vector. */ + new_argv = XMALLOC (char *, argc + 1); + + /* Put quoted arguments into the new argument vector. */ + for (i = 0; i < argc; i++) + { + const char *string = argv[i]; + + if (string[0] == '\0') + new_argv[i] = xstrdup ("\"\""); + else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) + { + int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); + size_t length; + unsigned int backslashes; + const char *s; + char *quoted_string; + char *p; + + length = 0; + backslashes = 0; + if (quote_around) + length++; + for (s = string; *s != '\0'; s++) + { + char c = *s; + if (c == '"') + length += backslashes + 1; + length++; + if (c == '\\') + backslashes++; + else + backslashes = 0; + } + if (quote_around) + length += backslashes + 1; + + quoted_string = XMALLOC (char, length + 1); + + p = quoted_string; + backslashes = 0; + if (quote_around) + *p++ = '"'; + for (s = string; *s != '\0'; s++) + { + char c = *s; + if (c == '"') + { + unsigned int j; + for (j = backslashes + 1; j > 0; j--) + *p++ = '\\'; + } + *p++ = c; + if (c == '\\') + backslashes++; + else + backslashes = 0; + } + if (quote_around) + { + unsigned int j; + for (j = backslashes; j > 0; j--) + *p++ = '\\'; + *p++ = '"'; + } + *p = '\0'; + + new_argv[i] = quoted_string; + } + else + new_argv[i] = (char *) string; + } + new_argv[argc] = NULL; + + return new_argv; +} +EOF + ;; + esac + + cat <<"EOF" +void lt_dump_script (FILE* f) +{ +EOF + func_emit_wrapper yes | + $SED -e 's/\([\\"]\)/\\\1/g' \ + -e 's/^/ fputs ("/' -e 's/$/\\n", f);/' + + cat <<"EOF" +} +EOF +} +# end: func_emit_cwrapperexe_src + +# func_win32_import_lib_p ARG +# True if ARG is an import lib, as indicated by $file_magic_cmd +func_win32_import_lib_p () +{ + $opt_debug + case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in + *import*) : ;; + *) false ;; + esac +} + +# func_mode_link arg... +func_mode_link () +{ + $opt_debug + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + # It is impossible to link a dll without this setting, and + # we shouldn't force the makefile maintainer to figure out + # which system we are compiling for in order to pass an extra + # flag for every libtool invocation. + # allow_undefined=no + + # FIXME: Unfortunately, there are problems with the above when trying + # to make a dll which has undefined symbols, in which case not + # even a static library is built. For now, we need to specify + # -no-undefined on the libtool link line when we can be certain + # that all symbols are satisfied, otherwise we get a static library. + allow_undefined=yes + ;; + *) + allow_undefined=yes + ;; + esac + libtool_args=$nonopt + base_compile="$nonopt $@" + compile_command=$nonopt + finalize_command=$nonopt + + compile_rpath= + finalize_rpath= + compile_shlibpath= + finalize_shlibpath= + convenience= + old_convenience= + deplibs= + old_deplibs= + compiler_flags= + linker_flags= + dllsearchpath= + lib_search_path=`pwd` + inst_prefix_dir= + new_inherited_linker_flags= + + avoid_version=no + bindir= + dlfiles= + dlprefiles= + dlself=no + export_dynamic=no + export_symbols= + export_symbols_regex= + generated= + libobjs= + ltlibs= + module=no + no_install=no + objs= + non_pic_objects= + precious_files_regex= + prefer_static_libs=no + preload=no + prev= + prevarg= + release= + rpath= + xrpath= + perm_rpath= + temp_rpath= + thread_safe=no + vinfo= + vinfo_number=no + weak_libs= + single_module="${wl}-single_module" + func_infer_tag $base_compile + + # We need to know -static, to get the right output filenames. + for arg + do + case $arg in + -shared) + test "$build_libtool_libs" != yes && \ + func_fatal_configuration "can not build a shared library" + build_old_libs=no + break + ;; + -all-static | -static | -static-libtool-libs) + case $arg in + -all-static) + if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then + func_warning "complete static linking is impossible in this configuration" + fi + if test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=yes + ;; + -static) + if test -z "$pic_flag" && test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=built + ;; + -static-libtool-libs) + if test -z "$pic_flag" && test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=yes + ;; + esac + build_libtool_libs=no + build_old_libs=yes + break + ;; + esac + done + + # See if our shared archives depend on static archives. + test -n "$old_archive_from_new_cmds" && build_old_libs=yes + + # Go through the arguments, transforming them on the way. + while test "$#" -gt 0; do + arg="$1" + shift + func_quote_for_eval "$arg" + qarg=$func_quote_for_eval_unquoted_result + func_append libtool_args " $func_quote_for_eval_result" + + # If the previous option needs an argument, assign it. + if test -n "$prev"; then + case $prev in + output) + func_append compile_command " @OUTPUT@" + func_append finalize_command " @OUTPUT@" + ;; + esac + + case $prev in + bindir) + bindir="$arg" + prev= + continue + ;; + dlfiles|dlprefiles) + if test "$preload" = no; then + # Add the symbol object into the linking commands. + func_append compile_command " @SYMFILE@" + func_append finalize_command " @SYMFILE@" + preload=yes + fi + case $arg in + *.la | *.lo) ;; # We handle these cases below. + force) + if test "$dlself" = no; then + dlself=needless + export_dynamic=yes + fi + prev= + continue + ;; + self) + if test "$prev" = dlprefiles; then + dlself=yes + elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then + dlself=yes + else + dlself=needless + export_dynamic=yes + fi + prev= + continue + ;; + *) + if test "$prev" = dlfiles; then + 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 + ;; + + -bindir) + prev=bindir + continue + ;; + + -dlopen) + prev=dlfiles + continue + ;; + + -dlpreopen) + prev=dlprefiles + continue + ;; + + -export-dynamic) + export_dynamic=yes + continue + ;; + + -export-symbols | -export-symbols-regex) + if test -n "$export_symbols" || test -n "$export_symbols_regex"; then + func_fatal_error "more than one -exported-symbols argument is not allowed" + fi + if test "X$arg" = "X-export-symbols"; then + prev=expsyms + else + prev=expsyms_regex + fi + continue + ;; + + -framework) + prev=framework + continue + ;; + + -inst-prefix-dir) + prev=inst_prefix + continue + ;; + + # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* + # so, if we see these flags be careful not to treat them like -L + -L[A-Z][A-Z]*:*) + case $with_gcc/$host in + no/*-*-irix* | /*-*-irix*) + func_append compile_command " $arg" + func_append finalize_command " $arg" + ;; + esac + continue + ;; + + -L*) + func_stripname '-L' '' "$arg" + 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 "$dir" | $SED '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* | *-*-haiku*) + # These systems don't actually have a C or math library (as such) + continue + ;; + *-*-os2*) + # These systems don't actually have a C library (as such) + test "X$arg" = "X-lc" && continue + ;; + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + # Do not include libc due to us having libc/libc_r. + test "X$arg" = "X-lc" && continue + ;; + *-*-rhapsody* | *-*-darwin1.[012]) + # Rhapsody C and math libraries are in the System framework + 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 $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" + ;; + + # Flags to be passed through unchanged, with rationale: + # -64, -mips[0-9] enable 64-bit mode for the SGI compiler + # -r[0-9][0-9]* specify processor for the SGI compiler + # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler + # +DA*, +DD* enable 64-bit mode for the HP compiler + # -q* compiler args for the IBM compiler + # -m*, -t[45]*, -txscale* architecture-specific flags for GCC + # -F/path path to uninstalled frameworks, gcc on darwin + # -p, -pg, --coverage, -fprofile-* profiling flags for GCC + # @file GCC response files + # -tp=* Portland pgcc target processor selection + -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ + -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*) + 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 \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\` + else + shlib_search_path= + fi + eval sys_lib_search_path=\"$sys_lib_search_path_spec\" + eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" + + func_dirname "$output" "/" "" + output_objdir="$func_dirname_result$objdir" + # 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 + func_basename "$deplib" + deplib_base=$func_basename_result + 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 \"$deplib\"" 2>/dev/null | $SED 10q \ + | $EGREP "$match_pattern_regex" > /dev/null; then + valid_a_lib=yes + fi + ;; + pass_all) + valid_a_lib=yes + ;; + esac + if test "$valid_a_lib" != yes; then + echo + $ECHO "*** Warning: Trying to link with static lib archive $deplib." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have" + echo "*** because the file extensions .$libext of this argument makes me believe" + echo "*** that it is just a static archive that I should not use here." + else + echo + $ECHO "*** Warning: Linking the shared library $output against the" + $ECHO "*** static library $deplib is not portable!" + deplibs="$deplib $deplibs" + fi + ;; + esac + continue + ;; + prog) + if test "$pass" != link; then + deplibs="$deplib $deplibs" + else + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + fi + continue + ;; + esac # linkmode + ;; # *.$libext + *.lo | *.$objext) + if test "$pass" = conv; then + deplibs="$deplib $deplibs" + elif test "$linkmode" = prog; then + if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then + # If there is no dlopen support or we're linking statically, + # we need to preload. + 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 "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'` + for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do + case " $new_inherited_linker_flags " in + *" $tmp_inherited_linker_flag "*) ;; + *) new_inherited_linker_flags="$new_inherited_linker_flags $tmp_inherited_linker_flag";; + esac + done + fi + dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + if test "$linkmode,$pass" = "lib,link" || + test "$linkmode,$pass" = "prog,scan" || + { test "$linkmode" != prog && test "$linkmode" != lib; }; then + test -n "$dlopen" && 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 + path= + 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 " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + fi + fi + dependency_libs="$newdependency_libs" + if test "$pass" = dlpreopen; then + # Link the dlpreopened libraries before other libraries + for deplib in $save_deplibs; do + deplibs="$deplib $deplibs" + done + fi + if test "$pass" != dlopen; then + if test "$pass" != conv; then + # Make sure lib_search_path contains only unique directories. + lib_search_path= + for dir in $newlib_search_path; do + case "$lib_search_path " in + *" $dir "*) ;; + *) 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|qnx|sunos) + current="$number_major" + revision="$number_minor" + age="0" + ;; + irix|nonstopux) + func_arith $number_major + $number_minor + current=$func_arith_result + age="$number_minor" + revision="$number_minor" + lt_irix_increment=no + ;; + esac + ;; + no) + current="$1" + revision="$2" + age="$3" + ;; + esac + + # Check that each of the things are valid numbers. + case $current in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + func_error "CURRENT \`$current' must be a nonnegative integer" + func_fatal_error "\`$vinfo' is not valid version information" + ;; + esac + + case $revision in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + func_error "REVISION \`$revision' must be a nonnegative integer" + func_fatal_error "\`$vinfo' is not valid version information" + ;; + esac + + case $age in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + func_error "AGE \`$age' must be a nonnegative integer" + func_fatal_error "\`$vinfo' is not valid version information" + ;; + esac + + if test "$age" -gt "$current"; then + func_error "AGE \`$age' is greater than the current interface number \`$current'" + func_fatal_error "\`$vinfo' is not valid version information" + fi + + # Calculate the version variables. + major= + versuffix= + verstring= + case $version_type in + none) ;; + + darwin) + # Like Linux, but with the current version available in + # verstring for coding it into the library header + func_arith $current - $age + major=.$func_arith_result + versuffix="$major.$age.$revision" + # Darwin ld doesn't like 0 for these options... + func_arith $current + 1 + minor_current=$func_arith_result + xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" + verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" + ;; + + freebsd-aout) + major=".$current" + versuffix=".$current.$revision"; + ;; + + freebsd-elf) + major=".$current" + versuffix=".$current" + ;; + + irix | nonstopux) + if test "X$lt_irix_increment" = "Xno"; then + func_arith $current - $age + else + func_arith $current - $age + 1 + fi + major=$func_arith_result + + case $version_type in + nonstopux) verstring_prefix=nonstopux ;; + *) verstring_prefix=sgi ;; + esac + verstring="$verstring_prefix$major.$revision" + + # Add in all the interfaces that we are compatible with. + loop=$revision + while test "$loop" -ne 0; do + func_arith $revision - $loop + iface=$func_arith_result + func_arith $loop - 1 + loop=$func_arith_result + verstring="$verstring_prefix$major.$iface:$verstring" + done + + # Before this point, $major must not contain `.'. + major=.$major + versuffix="$major.$revision" + ;; + + linux) + 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 "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP` + fi + + # Eliminate all temporary directories. + #for path in $notinst_path; do + # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` + # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` + # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"` + #done + + if test -n "$xrpath"; then + # If the user specified any rpath flags, then add them. + temp_xrpath= + for libdir in $xrpath; do + 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* | *-*-haiku*) + # 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 </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 "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";; + esac + done + if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | + $SED -e 10q | + $EGREP "$file_magic_regex" > /dev/null; then + 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 \"$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 + ;; + *) + # Add a -L argument. + newdeplibs="$newdeplibs $a_deplib" + ;; + esac + done # Gone through all deplibs. + ;; + none | unknown | *) + newdeplibs="" + tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + for i in $predeps $postdeps ; do + # can't use Xsed below, because $i might contain '/' + tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"` + done + fi + case $tmp_deplibs in + *[!\ \ ]*) + echo + if test "X$deplibs_check_method" = "Xnone"; then + echo "*** Warning: inter-library dependencies are not supported in this platform." + else + echo "*** Warning: inter-library dependencies are not known to be supported." + fi + echo "*** All declared inter-library dependencies are being dropped." + droppeddeps=yes + ;; + esac + ;; + esac + versuffix=$versuffix_save + major=$major_save + release=$release_save + libname=$libname_save + name=$name_save + + case $host in + *-*-rhapsody* | *-*-darwin1.[012]) + # On Rhapsody replace the C library with the System framework + newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` + ;; + esac + + if test "$droppeddeps" = yes; then + if test "$module" = yes; then + echo + echo "*** Warning: libtool could not satisfy all declared inter-library" + $ECHO "*** dependencies of module $libname. Therefore, libtool will create" + echo "*** a static module, that should work as long as the dlopening" + echo "*** application is linked with the -dlopen flag." + if test -z "$global_symbol_pipe"; then + echo + echo "*** However, this would only work if libtool was able to extract symbol" + echo "*** lists from a program, using \`nm' or equivalent, but libtool could" + echo "*** not find such a program. So, this module is probably useless." + echo "*** \`nm' from GNU binutils and a full rebuild may help." + fi + if test "$build_old_libs" = no; then + oldlibs="$output_objdir/$libname.$libext" + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + else + echo "*** The inter-library dependencies that have been dropped here will be" + echo "*** automatically added whenever a program is linked with this library" + echo "*** or is declared to -dlopen it." + + if test "$allow_undefined" = no; then + echo + echo "*** Since this library must not contain undefined symbols," + echo "*** because either the platform does not support them or" + echo "*** it was explicitly requested with -no-undefined," + echo "*** libtool will only create a static version of it." + if test "$build_old_libs" = no; then + oldlibs="$output_objdir/$libname.$libext" + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + fi + fi + fi + # Done checking deplibs! + deplibs=$newdeplibs + fi + # Time to change all our "foo.ltframework" stuff back to "-framework foo" + case $host in + *-*-darwin*) + newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + ;; + esac + + # move library search paths that coincide with paths to not yet + # installed libraries to the beginning of the library search list + new_libs= + for path in $notinst_path; do + case " $new_libs " in + *" -L$path/$objdir "*) ;; + *) + case " $deplibs " in + *" -L$path/$objdir "*) + 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 "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP` + test "X$libobjs" = "X " && libobjs= + + delfiles= + if test -n "$export_symbols" && test -n "$include_expsyms"; then + $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" + export_symbols="$output_objdir/$libname.uexp" + 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 "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' + fi + + if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then + # The given exports_symbols file has to be filtered, so filter it. + func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" + # FIXME: $output_objdir/$libname.filter potentially contains lots of + # 's' commands which not all seds can handle. GNU sed should be fine + # though. Also, the filter scales superlinearly with the number of + # global variables. join(1) would be nice here, but unfortunately + # isn't a blessed tool. + $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter + 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 + func_basename "$output" + output_la=$func_basename_result + + # Clear the reloadable object creation command queue and + # initialize k to one. + test_cmds= + concat_cmds= + objlist= + last_robj= + k=1 + + if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then + output=${output_objdir}/${output_la}.lnkscript + func_verbose "creating GNU ld script: $output" + echo 'INPUT (' > $output + for obj in $save_libobjs + do + $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. + reload_objs=$objlist + eval concat_cmds=\"$reload_cmds\" + else + # All subsequent reloadable object files will link in + # the last one created. + reload_objs="$objlist $last_robj" + eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" + fi + last_robj=$output_objdir/$output_la-${k}.$objext + func_arith $k + 1 + k=$func_arith_result + output=$output_objdir/$output_la-${k}.$objext + objlist=" $obj" + func_len " $last_robj" + func_arith $len0 + $func_len_result + len=$func_arith_result + fi + done + # Handle the remaining objects by creating one last + # reloadable object file. All subsequent reloadable object + # files will link in the last one created. + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ + reload_objs="$objlist $last_robj" + eval concat_cmds=\"\${concat_cmds}$reload_cmds\" + if test -n "$last_robj"; then + eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\" + fi + 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 "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' + fi + + if test -n "$orig_export_symbols"; then + # The given exports_symbols file has to be filtered, so filter it. + func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" + # FIXME: $output_objdir/$libname.filter potentially contains lots of + # 's' commands which not all seds can handle. GNU sed should be fine + # though. Also, the filter scales superlinearly with the number of + # global variables. join(1) would be nice here, but unfortunately + # isn't a blessed tool. + $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter + 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 "$tmp_whole_archive_flags" | $SED '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 "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test + + output="$obj" + func_execute_cmds "$reload_cmds" 'exit $?' + + # Exit if we aren't doing a library object file. + if test -z "$libobj"; then + if test -n "$gentop"; then + func_show_eval '${RM}r "$gentop"' + fi + + exit $EXIT_SUCCESS + fi + + if test "$build_libtool_libs" != yes; then + if test -n "$gentop"; then + func_show_eval '${RM}r "$gentop"' + fi + + # Create an invalid libtool object if no PIC, so that we don't + # accidentally link it into a program. + # $show "echo timestamp > $libobj" + # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? + exit $EXIT_SUCCESS + fi + + if test -n "$pic_flag" || test "$pic_mode" != default; then + # Only do commands if we really have different PIC objects. + reload_objs="$libobjs $reload_conv_objs" + output="$libobj" + func_execute_cmds "$reload_cmds" 'exit $?' + fi + + if test -n "$gentop"; then + func_show_eval '${RM}r "$gentop"' + fi + + exit $EXIT_SUCCESS + ;; + + prog) + case $host in + *cygwin*) func_stripname '' '.exe' "$output" + output=$func_stripname_result.exe;; + esac + test -n "$vinfo" && \ + func_warning "\`-version-info' is ignored for programs" + + test -n "$release" && \ + func_warning "\`-release' is ignored for programs" + + test "$preload" = yes \ + && test "$dlopen_support" = unknown \ + && test "$dlopen_self" = unknown \ + && test "$dlopen_self_static" = unknown && \ + func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support." + + case $host in + *-*-rhapsody* | *-*-darwin1.[012]) + # On Rhapsody replace the C library is the System framework + compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` + finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` + ;; + esac + + case $host in + *-*-darwin*) + # Don't allow lazy linking, it breaks C++ global constructors + # But is supposedly fixed on 10.4 or later (yay!). + if test "$tagname" = CXX ; then + case ${MACOSX_DEPLOYMENT_TARGET-10.0} in + 10.[0123]) + 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 " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + ;; + esac + + + # move library search paths that coincide with paths to not yet + # installed libraries to the beginning of the library search list + new_libs= + for path in $notinst_path; do + case " $new_libs " in + *" -L$path/$objdir "*) ;; + *) + case " $compile_deplibs " in + *" -L$path/$objdir "*) + 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 "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` + finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` + fi + + func_generate_dlsyms "$outputname" "@PROGRAM@" "no" + + # template prelinking step + if test -n "$prelink_cmds"; then + func_execute_cmds "$prelink_cmds" 'exit $?' + fi + + wrappers_required=yes + case $host in + *cegcc* | *mingw32ce*) + # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. + wrappers_required=no + ;; + *cygwin* | *mingw* ) + if test "$build_libtool_libs" != yes; then + wrappers_required=no + fi + ;; + *) + if test "$need_relink" = no || test "$build_libtool_libs" != yes; then + wrappers_required=no + fi + ;; + esac + if test "$wrappers_required" = no; then + # Replace the output file specification. + compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` + link_command="$compile_command$compile_rpath" + + # We have no uninstalled library dependencies, so finalize right now. + exit_status=0 + func_show_eval "$link_command" 'exit_status=$?' + + # 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 "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` + # Delete the old output file. + $opt_dry_run || $RM $output + # Link the executable and exit + func_show_eval "$link_command" 'exit $?' + exit $EXIT_SUCCESS + fi + + if test "$hardcode_action" = relink; then + # Fast installation is not supported + link_command="$compile_var$compile_command$compile_rpath" + relink_command="$finalize_var$finalize_command$finalize_rpath" + + func_warning "this platform does not like uninstalled shared libraries" + func_warning "\`$output' will be relinked during installation" + else + if test "$fast_install" != no; then + link_command="$finalize_var$compile_command$finalize_rpath" + if test "$fast_install" = yes; then + relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` + else + # fast_install is set to needless + relink_command= + fi + else + link_command="$compile_var$compile_command$compile_rpath" + relink_command="$finalize_var$finalize_command$finalize_rpath" + fi + fi + + # Replace the output file specification. + link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` + + # Delete the old output files. + $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname + + func_show_eval "$link_command" 'exit $?' + + # Now create the wrapper script. + func_verbose "creating $output" + + # Quote the relink command for shipping. + if test -n "$relink_command"; then + # Preserve any variables that may affect compiler behavior + for var in $variables_saved_for_relink; do + if eval test -z \"\${$var+set}\"; then + relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" + elif eval var_value=\$$var; test -z "$var_value"; then + relink_command="$var=; export $var; $relink_command" + else + func_quote_for_eval "$var_value" + relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" + fi + done + relink_command="(cd `pwd`; $relink_command)" + relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` + fi + + # Only actually do things if not in dry run mode. + $opt_dry_run || { + # win32 will think the script is a binary if it has + # a .exe suffix, so we strip it off here. + case $output in + *.exe) func_stripname '' '.exe' "$output" + output=$func_stripname_result ;; + esac + # test for cygwin because mv fails w/o .exe extensions + case $host in + *cygwin*) + exeext=.exe + func_stripname '' '.exe' "$outputname" + outputname=$func_stripname_result ;; + *) exeext= ;; + esac + case $host in + *cygwin* | *mingw* ) + func_dirname_and_basename "$output" "" "." + output_name=$func_basename_result + output_path=$func_dirname_result + cwrappersource="$output_path/$objdir/lt-$output_name.c" + cwrapper="$output_path/$output_name.exe" + $RM $cwrappersource $cwrapper + trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 + + func_emit_cwrapperexe_src > $cwrappersource + + # The wrapper executable is built using the $host compiler, + # because it contains $host paths and files. If cross- + # compiling, it, like the target executable, must be + # executed on the $host or under an emulation environment. + $opt_dry_run || { + $LTCC $LTCFLAGS -o $cwrapper $cwrappersource + $STRIP $cwrapper + } + + # Now, create the wrapper script for func_source use: + func_ltwrapper_scriptname $cwrapper + $RM $func_ltwrapper_scriptname_result + trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 + $opt_dry_run || { + # note: this script will not be executed, so do not chmod. + if test "x$build" = "x$host" ; then + $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result + else + func_emit_wrapper no > $func_ltwrapper_scriptname_result + fi + } + ;; + * ) + $RM $output + trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 + + func_emit_wrapper no > $output + chmod +x $output + ;; + esac + } + exit $EXIT_SUCCESS + ;; + esac + + # See if we need to build an old-fashioned archive. + for oldlib in $oldlibs; do + + if test "$build_libtool_libs" = convenience; then + oldobjs="$libobjs_save $symfileobj" + addlibs="$convenience" + build_libtool_libs=no + else + if test "$build_libtool_libs" = module; then + oldobjs="$libobjs_save" + build_libtool_libs=no + else + oldobjs="$old_deplibs $non_pic_objects" + if test "$preload" = yes && test -f "$symfileobj"; then + 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 "$relink_command" | $SED "$sed_quote_subst"` + if test "$hardcode_automatic" = yes ; then + relink_command= + fi + + # Only create the output if not a dry run. + $opt_dry_run || { + for installed in no yes; do + if test "$installed" = yes; then + if test -z "$install_libdir"; then + break + fi + output="$output_objdir/$outputname"i + # Replace all uninstalled libtool libraries with the installed ones + newdependency_libs= + for deplib in $dependency_libs; do + case $deplib in + *.la) + func_basename "$deplib" + name="$func_basename_result" + 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 + # In fact, it would be nice if we could use this code for all target + # systems that can't hard-code library paths into their executables + # and that have no shared library path variable independent of PATH, + # but it turns out we can't easily determine that from inspecting + # libtool variables, so we have to hard-code the OSs to which it + # applies here; at the moment, that means platforms that use the PE + # object format with DLL files. See the long comment at the top of + # tests/bindir.at for full details. + tdlname=$dlname + case $host,$output,$installed,$module,$dlname in + *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) + # If a -bindir argument was supplied, place the dll there. + if test "x$bindir" != x ; + then + func_relative_path "$install_libdir" "$bindir" + tdlname=$func_relative_path_result$dlname + else + # Otherwise fall back on heuristic. + tdlname=../bin/$dlname + fi + ;; + esac + $ECHO > $output "\ +# $outputname - a libtool library file +# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION +# +# Please DO NOT delete this file! +# It is necessary for linking the library. + +# The name that we can dlopen(3). +dlname='$tdlname' + +# Names of this library. +library_names='$library_names' + +# The name of the static archive. +old_library='$old_library' + +# Linker flags that can not go in dependency_libs. +inherited_linker_flags='$new_inherited_linker_flags' + +# Libraries that this one depends upon. +dependency_libs='$dependency_libs' + +# Names of additional weak libraries provided by this library +weak_library_names='$weak_libs' + +# Version information for $libname. +current=$current +age=$age +revision=$revision + +# Is this an already installed library? +installed=$installed + +# Should we warn about portability when linking against -modules? +shouldnotlink=$module + +# Files to dlopen/dlpreopen +dlopen='$dlfiles' +dlpreopen='$dlprefiles' + +# Directory that this library needs to be installed in: +libdir='$install_libdir'" + if test "$installed" = no && test "$need_relink" = yes; then + $ECHO >> $output "\ +relink_command=\"$relink_command\"" + fi + done + } + + # Do a symbolic link so that the libtool archive can be found in + # LD_LIBRARY_PATH before the program is installed. + func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' + ;; + esac + exit $EXIT_SUCCESS +} + +{ test "$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/antlr/libantlr3c-3.4/ltmain.sh b/antlr/libantlr3c-3.4/ltmain.sh new file mode 100755 index 0000000..d8efb57 --- /dev/null +++ b/antlr/libantlr3c-3.4/ltmain.sh @@ -0,0 +1,8745 @@ +# Generated from ltmain.m4sh. + +# libtool (GNU libtool) 2.2.10 +# Written by Gordon Matzigkeit , 1996 + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, +# 2007, 2008, 2009, 2010 Free Software Foundation, Inc. +# This is free software; see the source for copying conditions. There is NO +# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +# GNU Libtool is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# As a special exception to the GNU General Public License, +# if you distribute this file as part of a program or library that +# is built using GNU Libtool, you may include this file under the +# same distribution terms that you use for the rest of that program. +# +# GNU Libtool is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNU Libtool; see the file COPYING. If not, a copy +# can be downloaded from http://www.gnu.org/licenses/gpl.html, +# or obtained by writing to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +# Usage: $progname [OPTION]... [MODE-ARG]... +# +# Provide generalized library-building support services. +# +# --config show all configuration variables +# --debug enable verbose shell tracing +# -n, --dry-run display commands without modifying any files +# --features display basic configuration information and exit +# --mode=MODE use operation mode MODE +# --preserve-dup-deps don't remove duplicate dependency libraries +# --quiet, --silent don't print informational messages +# --no-quiet, --no-silent +# print informational messages (default) +# --tag=TAG use configuration variables from tag TAG +# -v, --verbose print more informational messages than default +# --no-verbose don't print the extra informational messages +# --version print version information +# -h, --help, --help-all print short, long, or detailed help message +# +# MODE must be one of the following: +# +# clean remove files from the build directory +# compile compile a source file into a libtool object +# execute automatically set library path, then run a program +# finish complete the installation of libtool libraries +# install install libraries or executables +# link create a library or an executable +# uninstall remove libraries from an installed directory +# +# MODE-ARGS vary depending on the MODE. When passed as first option, +# `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that. +# Try `$progname --help --mode=MODE' for a more detailed description of MODE. +# +# When reporting a bug, please describe a test case to reproduce it and +# include the following information: +# +# host-triplet: $host +# shell: $SHELL +# compiler: $LTCC +# compiler flags: $LTCFLAGS +# linker: $LD (gnu? $with_gnu_ld) +# $progname: (GNU libtool) 2.2.10 +# automake: $automake_version +# autoconf: $autoconf_version +# +# Report bugs to . + +PROGRAM=libtool +PACKAGE=libtool +VERSION=2.2.10 +TIMESTAMP="" +package_revision=1.3175 + +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac +fi +BIN_SH=xpg4; export BIN_SH # for Tru64 +DUALCASE=1; export DUALCASE # for MKS sh + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +$1 +_LTECHO_EOF' +} + +# NLS nuisances: We save the old values to restore during execute mode. +lt_user_locale= +lt_safe_locale= +for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES +do + eval "if test \"\${$lt_var+set}\" = set; then + save_$lt_var=\$$lt_var + $lt_var=C + export $lt_var + lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\" + lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\" + fi" +done +LC_ALL=C +LANGUAGE=C +export LANGUAGE LC_ALL + +$lt_unset CDPATH + + +# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh +# is ksh but when the shell is invoked as "sh" and the current value of +# the _XPG environment variable is not equal to 1 (one), the special +# positional parameter $0, within a function call, is the name of the +# function. +progpath="$0" + + + +: ${CP="cp -f"} +test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'} +: ${EGREP="/bin/grep -E"} +: ${FGREP="/bin/grep -F"} +: ${GREP="/bin/grep"} +: ${LN_S="ln -s"} +: ${MAKE="make"} +: ${MKDIR="mkdir"} +: ${MV="mv -f"} +: ${RM="rm -f"} +: ${SED="/bin/sed"} +: ${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 "${1}" | $SED -e "$dirname"` + if test "X$func_dirname_result" = "X${1}"; then + func_dirname_result="${3}" + else + func_dirname_result="$func_dirname_result${2}" + fi + func_basename_result=`$ECHO "${1}" | $SED -e "$basename"` +} + +# Generated shell functions inserted here. + +# These SED scripts presuppose an absolute path with a trailing slash. +pathcar='s,^/\([^/]*\).*$,\1,' +pathcdr='s,^/[^/]*,,' +removedotparts=':dotsl + s@/\./@/@g + t dotsl + s,/\.$,/,' +collapseslashes='s@/\{1,\}@/@g' +finalslash='s,/*$,/,' + +# func_normal_abspath PATH +# Remove doubled-up and trailing slashes, "." path components, +# and cancel out any ".." path components in PATH after making +# it an absolute path. +# value returned in "$func_normal_abspath_result" +func_normal_abspath () +{ + # Start from root dir and reassemble the path. + func_normal_abspath_result= + func_normal_abspath_tpath=$1 + func_normal_abspath_altnamespace= + case $func_normal_abspath_tpath in + "") + # Empty path, that just means $cwd. + func_stripname '' '/' "`pwd`" + func_normal_abspath_result=$func_stripname_result + return + ;; + # The next three entries are used to spot a run of precisely + # two leading slashes without using negated character classes; + # we take advantage of case's first-match behaviour. + ///*) + # Unusual form of absolute path, do nothing. + ;; + //*) + # Not necessarily an ordinary path; POSIX reserves leading '//' + # and for example Cygwin uses it to access remote file shares + # over CIFS/SMB, so we conserve a leading double slash if found. + func_normal_abspath_altnamespace=/ + ;; + /*) + # Absolute path, do nothing. + ;; + *) + # Relative path, prepend $cwd. + func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath + ;; + esac + # Cancel out all the simple stuff to save iterations. We also want + # the path to end with a slash for ease of parsing, so make sure + # there is one (and only one) here. + func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"` + while :; do + # Processed it all yet? + if test "$func_normal_abspath_tpath" = / ; then + # If we ascended to the root using ".." the result may be empty now. + if test -z "$func_normal_abspath_result" ; then + func_normal_abspath_result=/ + fi + break + fi + func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$pathcar"` + func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ + -e "$pathcdr"` + # Figure out what to do with it + case $func_normal_abspath_tcomponent in + "") + # Trailing empty path component, ignore it. + ;; + ..) + # Parent dir; strip last assembled component from result. + func_dirname "$func_normal_abspath_result" + func_normal_abspath_result=$func_dirname_result + ;; + *) + # Actual path component, append it. + func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent + ;; + esac + done + # Restore leading double-slash if one was found on entry. + func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result +} + +# func_relative_path SRCDIR DSTDIR +# generates a relative path from SRCDIR to DSTDIR, with a trailing +# slash if non-empty, suitable for immediately appending a filename +# without needing to append a separator. +# value returned in "$func_relative_path_result" +func_relative_path () +{ + func_relative_path_result= + func_normal_abspath "$1" + func_relative_path_tlibdir=$func_normal_abspath_result + func_normal_abspath "$2" + func_relative_path_tbindir=$func_normal_abspath_result + + # Ascend the tree starting from libdir + while :; do + # check if we have found a prefix of bindir + case $func_relative_path_tbindir in + $func_relative_path_tlibdir) + # found an exact match + func_relative_path_tcancelled= + break + ;; + $func_relative_path_tlibdir*) + # found a matching prefix + func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" + func_relative_path_tcancelled=$func_stripname_result + if test -z "$func_relative_path_result"; then + func_relative_path_result=. + fi + break + ;; + *) + func_dirname $func_relative_path_tlibdir + func_relative_path_tlibdir=${func_dirname_result} + if test "x$func_relative_path_tlibdir" = x ; then + # Have to descend all the way to the root! + func_relative_path_result=../$func_relative_path_result + func_relative_path_tcancelled=$func_relative_path_tbindir + break + fi + func_relative_path_result=../$func_relative_path_result + ;; + esac + done + + # Now calculate path; take care to avoid doubling-up slashes. + func_stripname '' '/' "$func_relative_path_result" + func_relative_path_result=$func_stripname_result + func_stripname '/' '/' "$func_relative_path_tcancelled" + if test "x$func_stripname_result" != x ; then + func_relative_path_result=${func_relative_path_result}/${func_stripname_result} + fi + + # Normalisation. If bindir is libdir, return empty string, + # else relative path ending with a slash; either way, target + # file name can be directly appended. + if test ! -z "$func_relative_path_result"; then + func_stripname './' '' "$func_relative_path_result/" + func_relative_path_result=$func_stripname_result + fi +} + +# The name of this program: +func_dirname_and_basename "$progpath" +progname=$func_basename_result + +# Make sure we have an absolute path for reexecution: +case $progpath in + [\\/]*|[A-Za-z]:\\*) ;; + *[\\/]*) + progdir=$func_dirname_result + progdir=`cd "$progdir" && pwd` + progpath="$progdir/$progname" + ;; + *) + save_IFS="$IFS" + IFS=: + 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_echo_all arg... +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "$*" +} + +# func_error arg... +# Echo program name prefixed message to standard error. +func_error () +{ + $ECHO "$progname${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 "$my_directory_path" | $SED -e "$dirname"` + done + my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'` + + save_mkdir_p_IFS="$IFS"; IFS=':' + for my_dir in $my_dir_list; do + IFS="$save_mkdir_p_IFS" + # mkdir can fail with a `File exist' error if two processes + # try to create one of the directories concurrently. Don't + # stop in that case! + $MKDIR "$my_dir" 2>/dev/null || : + done + IFS="$save_mkdir_p_IFS" + + # Bail out if we (or some other process) failed to create a directory. + test -d "$my_directory_path" || \ + func_fatal_error "Failed to create \`$1'" + fi +} + + +# func_mktempdir [string] +# Make a temporary directory that won't clash with other running +# libtool processes, and avoids race conditions if possible. If +# given, STRING is the basename for that directory. +func_mktempdir () +{ + my_template="${TMPDIR-/tmp}/${1-$progname}" + + if test "$opt_dry_run" = ":"; then + # Return a directory name, but don't create it in dry-run mode + my_tmpdir="${my_template}-$$" + else + + # If mktemp works, use that first and foremost + my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` + + if test ! -d "$my_tmpdir"; then + # Failing that, at least try and use $RANDOM to avoid a race + my_tmpdir="${my_template}-${RANDOM-0}$$" + + save_mktempdir_umask=`umask` + umask 0077 + $MKDIR "$my_tmpdir" + umask $save_mktempdir_umask + fi + + # If we're not in dry-run mode, bomb out on failure + test -d "$my_tmpdir" || \ + func_fatal_error "cannot create temporary directory \`$my_tmpdir'" + fi + + $ECHO "$my_tmpdir" +} + + +# func_quote_for_eval arg +# Aesthetically quote ARG to be evaled later. +# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT +# is double-quoted, suitable for a subsequent eval, whereas +# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters +# which are still active within double quotes backslashified. +func_quote_for_eval () +{ + case $1 in + *[\\\`\"\$]*) + func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;; + *) + func_quote_for_eval_unquoted_result="$1" ;; + esac + + case $func_quote_for_eval_unquoted_result in + # Double-quote args containing shell metacharacters to delay + # word splitting, command substitution and and variable + # expansion for a subsequent eval. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\"" + ;; + *) + func_quote_for_eval_result="$func_quote_for_eval_unquoted_result" + esac +} + + +# func_quote_for_expand arg +# Aesthetically quote ARG to be evaled later; same as above, +# but do not quote variable references. +func_quote_for_expand () +{ + case $1 in + *[\\\`\"]*) + my_arg=`$ECHO "$1" | $SED \ + -e "$double_quote_subst" -e "$sed_double_backslash"` ;; + *) + my_arg="$1" ;; + esac + + case $my_arg in + # Double-quote args containing shell metacharacters to delay + # word splitting and command substitution for a subsequent eval. + # Many Bourne shells cannot handle close brackets correctly + # in scan sets, so we specify it separately. + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") + my_arg="\"$my_arg\"" + ;; + esac + + func_quote_for_expand_result="$my_arg" +} + + +# func_show_eval cmd [fail_exp] +# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is +# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP +# is given, then evaluate it. +func_show_eval () +{ + my_cmd="$1" + my_fail_exp="${2-:}" + + ${opt_silent-false} || { + func_quote_for_expand "$my_cmd" + eval "func_echo $func_quote_for_expand_result" + } + + if ${opt_dry_run-false}; then :; else + eval "$my_cmd" + my_status=$? + if test "$my_status" -eq 0; then :; else + eval "(exit $my_status); $my_fail_exp" + fi + fi +} + + +# func_show_eval_locale cmd [fail_exp] +# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is +# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP +# is given, then evaluate it. Use the saved locale for evaluation. +func_show_eval_locale () +{ + my_cmd="$1" + my_fail_exp="${2-:}" + + ${opt_silent-false} || { + func_quote_for_expand "$my_cmd" + eval "func_echo $func_quote_for_expand_result" + } + + if ${opt_dry_run-false}; then :; else + eval "$lt_user_locale + $my_cmd" + my_status=$? + eval "$lt_safe_locale" + if test "$my_status" -eq 0; then :; else + eval "(exit $my_status); $my_fail_exp" + fi + fi +} + + +# func_version +# Echo version message to standard output and exit. +func_version () +{ + $SED -n '/(C)/!b go + :more + /\./!{ + N + s/\n# / / + b more + } + :go + /^# '$PROGRAM' (GNU /,/# warranty; / { + s/^# // + s/^# *$// + s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/ + p + }' < "$progpath" + exit $? +} + +# func_usage +# Echo short help message to standard output and exit. +func_usage () +{ + $SED -n '/^# Usage:/,/^# *.*--help/ { + s/^# // + s/^# *$// + s/\$progname/'$progname'/ + p + }' < "$progpath" + echo + $ECHO "run \`$progname --help | more' for full usage" + exit $? +} + +# func_help [NOEXIT] +# Echo long help message to standard output and exit, +# unless 'noexit' is passed as argument. +func_help () +{ + $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" + ret=$? + if test -z "$1"; then + exit $ret + fi +} + +# func_missing_arg argname +# Echo program name prefixed message to standard error and set global +# exit_cmd. +func_missing_arg () +{ + func_error "missing argument for $1." + exit_cmd=exit +} + +exit_cmd=: + + + + + + +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=: + opt_verbose=false + ;; + + --no-quiet|--no-silent) + preserve_args="$preserve_args $opt" + opt_silent=false + ;; + + --verbose| -v) preserve_args="$preserve_args $opt" + opt_silent=false + opt_verbose=: + ;; + + --no-verbose) preserve_args="$preserve_args $opt" + opt_verbose=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=: ;; + --help-all) opt_help=': help-all' ;; + --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 + CC_expanded=`func_echo_all $CC` + CC_quoted_expanded=`func_echo_all $CC_quoted` + case $@ in + # Blanks in the command may have been stripped by the calling shell, + # but not from the CC environment variable when configure was run. + " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ + " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; + # Blanks at the start of $base_compile will cause this to fail + # if we don't check for them as well. + *) + for z in $available_tags; do + if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then + # Evaluate the configuration. + eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" + CC_quoted= + for arg in $CC; do + # Double-quote args containing other shell metacharacters. + func_quote_for_eval "$arg" + CC_quoted="$CC_quoted $func_quote_for_eval_result" + done + CC_expanded=`func_echo_all $CC` + CC_quoted_expanded=`func_echo_all $CC_quoted` + case "$@ " in + " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ + " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) + # The compiler in the base compile command matches + # the one in the tagged configuration. + # Assume this is the tagged configuration we want. + tagname=$z + break + ;; + esac + fi + done + # If $tagname still isn't set, then no tagged configuration + # was found and let the user know that the "--tag" command + # line option must be used. + if test -z "$tagname"; then + func_echo "unable to infer tagged configuration" + func_fatal_error "specify a tag with \`--tag'" +# else +# func_verbose "using $tagname tagged configuration" + fi + ;; + esac + fi +} + + + +# func_write_libtool_object output_name pic_name nonpic_name +# Create a libtool object file (analogous to a ".la" file), +# but don't create it if we're doing a dry run. +func_write_libtool_object () +{ + write_libobj=${1} + if test "$build_libtool_libs" = yes; then + write_lobj=\'${2}\' + else + write_lobj=none + fi + + if test "$build_old_libs" = yes; then + write_oldobj=\'${3}\' + else + write_oldobj=none + fi + + $opt_dry_run || { + cat >${write_libobj}T <?"'"'"' &()|`$[]' \ + && func_warning "libobj name \`$libobj' may not contain shell special characters." + func_dirname_and_basename "$obj" "/" "" + objname="$func_basename_result" + xdir="$func_dirname_result" + lobj=${xdir}$objdir/$objname + + test -z "$base_compile" && \ + func_fatal_help "you must specify a compilation command" + + # Delete any leftover library objects. + if test "$build_old_libs" = yes; then + removelist="$obj $lobj $libobj ${libobj}T" + else + removelist="$lobj $libobj ${libobj}T" + fi + + # On Cygwin there's no "real" PIC flag so we must build both object types + case $host_os in + cygwin* | mingw* | pw32* | os2* | cegcc*) + pic_mode=default + ;; + esac + if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then + # non-PIC code in shared libraries is not supported + pic_mode=default + fi + + # Calculate the filename of the output object if compiler does + # not support -o with -c + if test "$compiler_c_o" = no; then + output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext} + lockfile="$output_obj.lock" + else + output_obj= + need_locks=no + lockfile= + fi + + # Lock this critical section if it is needed + # We use this script file to make the link, it avoids creating a new file + if test "$need_locks" = yes; then + until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do + func_echo "Waiting for $lockfile to be removed" + sleep 2 + done + elif test "$need_locks" = warn; then + if test -f "$lockfile"; then + $ECHO "\ +*** ERROR, $lockfile exists and contains: +`cat $lockfile 2>/dev/null` + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support \`-c' and \`-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $opt_dry_run || $RM $removelist + exit $EXIT_FAILURE + fi + 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 build PIC objects only + -prefer-non-pic try to build non-PIC objects only + -shared do not build a \`.o' file suitable for static linking + -static only build a \`.o' file suitable for static linking + -Wc,FLAG pass FLAG directly to the compiler + +COMPILE-COMMAND is a command to be used in creating a \`standard' object file +from the given SOURCEFILE. + +The output file name is determined by removing the directory component from +SOURCEFILE, then substituting the C source code suffix \`.c' with the +library object suffix, \`.lo'." + ;; + + execute) + $ECHO \ +"Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... + +Automatically set library path, then run a program. + +This mode accepts the following additional options: + + -dlopen FILE add the directory containing FILE to the library path + +This mode sets the library path environment variable according to \`-dlopen' +flags. + +If any of the ARGS are libtool executable wrappers, then they are translated +into their corresponding uninstalled binary, and any of their required library +directories are added to the library path. + +Then, COMMAND is executed, with ARGS as arguments." + ;; + + finish) + $ECHO \ +"Usage: $progname [OPTION]... --mode=finish [LIBDIR]... + +Complete the installation of libtool libraries. + +Each LIBDIR is a directory that contains libtool libraries. + +The commands that this mode executes may require superuser privileges. Use +the \`--dry-run' option if you just want to see what would be executed." + ;; + + install) + $ECHO \ +"Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... + +Install executables or libraries. + +INSTALL-COMMAND is the installation command. The first component should be +either the \`install' or \`cp' program. + +The following components of INSTALL-COMMAND are treated specially: + + -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation + +The rest of the components are interpreted as arguments to that command (only +BSD-compatible install options are recognized)." + ;; + + link) + $ECHO \ +"Usage: $progname [OPTION]... --mode=link LINK-COMMAND... + +Link object files or libraries together to form another library, or to +create an executable program. + +LINK-COMMAND is a command using the C compiler that you would use to create +a program from several object files. + +The following components of LINK-COMMAND are treated specially: + + -all-static do not do any dynamic linking at all + -avoid-version do not add a version suffix if possible + -bindir BINDIR specify path to binaries directory (for systems where + libraries must be found in the PATH setting at runtime) + -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime + -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols + -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) + -export-symbols SYMFILE + try to export only the symbols listed in SYMFILE + -export-symbols-regex REGEX + try to export only the symbols matching REGEX + -LLIBDIR search LIBDIR for required installed libraries + -lNAME OUTPUT-FILE requires the installed library libNAME + -module build a library that can dlopened + -no-fast-install disable the fast-install mode + -no-install link a not-installable executable + -no-undefined declare that a library does not refer to external symbols + -o OUTPUT-FILE create OUTPUT-FILE from the specified objects + -objectlist FILE Use a list of object files found in FILE to specify objects + -precious-files-regex REGEX + don't remove output files matching REGEX + -release RELEASE specify package release information + -rpath LIBDIR the created library will eventually be installed in LIBDIR + -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries + -shared only do dynamic linking of libtool libraries + -shrext SUFFIX override the standard shared library file extension + -static do not do any dynamic linking of uninstalled libtool libraries + -static-libtool-libs + do not do any dynamic linking of libtool libraries + -version-info CURRENT[:REVISION[:AGE]] + specify library version info [each variable defaults to 0] + -weak LIBNAME declare that the target provides the LIBNAME interface + -Wc,FLAG + -Xcompiler FLAG pass linker-specific FLAG directly to the compiler + -Wl,FLAG + -Xlinker FLAG pass linker-specific FLAG directly to the linker + -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) + +All other options (arguments beginning with \`-') are ignored. + +Every other argument is treated as a filename. Files ending in \`.la' are +treated as uninstalled libtool libraries, other files are standard or library +object files. + +If the OUTPUT-FILE ends in \`.la', then a libtool library is created, +only library objects (\`.lo' files) may be specified, and \`-rpath' is +required, except when creating a convenience library. + +If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created +using \`ar' and \`ranlib', or on Windows using \`lib'. + +If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file +is created, otherwise an executable program is created." + ;; + + uninstall) + $ECHO \ +"Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... + +Remove libraries from an installation directory. + +RM is the name of the program to use to delete files associated with each FILE +(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed +to RM. + +If FILE is a libtool library, all the files associated with it are deleted. +Otherwise, only FILE itself is deleted using RM." + ;; + + *) + func_fatal_help "invalid operation mode \`$mode'" + ;; + esac + + echo + $ECHO "Try \`$progname --help' for more information about other modes." +} + +# Now that we've collected a possible --mode arg, show help if necessary +if $opt_help; then + if test "$opt_help" = :; then + func_mode_help + else + { + func_help noexit + for mode in compile link execute install finish uninstall clean; do + func_mode_help + done + } | sed -n '1p; 2,$s/^Usage:/ or: /p' + { + func_help noexit + for mode in compile link execute install finish uninstall clean; do + echo + func_mode_help + done + } | + sed '1d + /^When reporting/,/^Report/{ + H + d + } + $x + /information about other modes/d + /more detailed .*MODE/d + s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' + fi + exit $? +fi + + +# func_mode_execute arg... +func_mode_execute () +{ + $opt_debug + # The first argument is the command name. + cmd="$nonopt" + test -z "$cmd" && \ + func_fatal_help "you must specify a COMMAND" + + # Handle -dlopen flags immediately. + for file in $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 + -* | *.la | *.lo ) ;; + *) + # Do a test to see if this is really a libtool program. + if func_ltwrapper_script_p "$file"; then + func_source "$file" + # Transform arg to wrapped name. + file="$progdir/$program" + elif func_ltwrapper_executable_p "$file"; then + func_ltwrapper_scriptname "$file" + func_source "$func_ltwrapper_scriptname_result" + # Transform arg to wrapped name. + file="$progdir/$program" + fi + ;; + esac + # Quote arguments (to preserve shell metacharacters). + func_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 "----------------------------------------------------------------------" + 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 "----------------------------------------------------------------------" + 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. + case $nonopt in *shtool*) :;; *) false;; esac; then + # Aesthetically quote it. + func_quote_for_eval "$nonopt" + install_prog="$func_quote_for_eval_result " + arg=$1 + shift + else + install_prog= + arg=$nonopt + fi + + # The real first argument should be the name of the installation program. + # Aesthetically quote it. + func_quote_for_eval "$arg" + install_prog="$install_prog$func_quote_for_eval_result" + install_shared_prog=$install_prog + case " $install_prog " in + *[\\\ /]cp\ *) install_cp=: ;; + *) install_cp=false ;; + esac + + # We need to accept at least all the BSD install flags. + dest= + files= + opts= + prev= + install_type= + isdir=no + stripme= + no_mode=: + for arg + do + arg2= + if test -n "$dest"; then + files="$files $dest" + dest=$arg + continue + fi + + case $arg in + -d) isdir=yes ;; + -f) + if $install_cp; then :; else + prev=$arg + fi + ;; + -g | -m | -o) + prev=$arg + ;; + -s) + stripme=" -s" + continue + ;; + -*) + ;; + *) + # If the previous option needed an argument, then skip it. + if test -n "$prev"; then + if test "x$prev" = x-m && test -n "$install_override_mode"; then + arg2=$install_override_mode + no_mode=false + fi + prev= + else + dest=$arg + continue + fi + ;; + esac + + # Aesthetically quote the argument. + func_quote_for_eval "$arg" + install_prog="$install_prog $func_quote_for_eval_result" + if test -n "$arg2"; then + func_quote_for_eval "$arg2" + fi + install_shared_prog="$install_shared_prog $func_quote_for_eval_result" + done + + test -z "$install_prog" && \ + func_fatal_help "you must specify an install program" + + test -n "$prev" && \ + func_fatal_help "the \`$prev' option requires an argument" + + if test -n "$install_override_mode" && $no_mode; then + if $install_cp; then :; else + func_quote_for_eval "$install_override_mode" + install_shared_prog="$install_shared_prog -m $func_quote_for_eval_result" + fi + fi + + if test -z "$files"; then + if test -z "$dest"; then + func_fatal_help "no file or destination specified" + else + func_fatal_help "you must specify a destination" + fi + fi + + # Strip any trailing slash from the destination. + func_stripname '' '/' "$dest" + dest=$func_stripname_result + + # Check to see that the destination is a directory. + test -d "$dest" && isdir=yes + if test "$isdir" = yes; then + destdir="$dest" + destname= + else + func_dirname_and_basename "$dest" "" "." + destdir="$func_dirname_result" + destname="$func_basename_result" + + # Not a directory, so check to see that there is only one file specified. + set dummy $files; shift + test "$#" -gt 1 && \ + func_fatal_help "\`$dest' is not a directory" + fi + case $destdir in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + for file in $files; do + case $file in + *.lo) ;; + *) + func_fatal_help "\`$destdir' must be an absolute directory name" + ;; + esac + done + ;; + esac + + # This variable tells wrapper scripts just to set variables rather + # than running their programs. + libtool_install_magic="$magic" + + staticlibs= + future_libdirs= + current_libdirs= + for file in $files; do + + # Do each installation. + case $file in + *.$libext) + # Do the static libraries later. + 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 "$destdir" | $SED -e "s%$libdir\$%%"` + + # Don't allow the user to place us outside of our expected + # location b/c this prevents finding dependent libraries that + # are installed to the same prefix. + # At present, this check doesn't affect windows .dll's that + # are installed into $libdir/../bin (currently, that works fine) + # but it's something to keep an eye on. + test "$inst_prefix_dir" = "$destdir" && \ + func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir" + + if test -n "$inst_prefix_dir"; then + # Stick the inst_prefix_dir data into the link command. + relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` + else + relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` + fi + + func_warning "relinking \`$file'" + func_show_eval "$relink_command" \ + 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"' + fi + + # See the names of the shared library. + set dummy $library_names; shift + if test -n "$1"; then + realname="$1" + shift + + srcname="$realname" + test -n "$relink_command" && srcname="$realname"T + + # Install the shared library and build the symlinks. + func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ + 'exit $?' + tstripme="$stripme" + case $host_os in + cygwin* | mingw* | pw32* | cegcc*) + case $realname in + *.dll.a) + tstripme="" + ;; + esac + ;; + esac + if test -n "$tstripme" && test -n "$striplib"; then + func_show_eval "$striplib $destdir/$realname" 'exit $?' + fi + + if test "$#" -gt 0; then + # Delete the old symlinks, and create new ones. + # Try `ln -sf' first, because the `ln' binary might depend on + # the symlink we replace! Solaris /bin/ln does not understand -f, + # so we also need to try rm && ln -s. + for linkname + do + test "$linkname" != "$realname" \ + && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" + done + fi + + # Do each command in the postinstall commands. + lib="$destdir/$realname" + func_execute_cmds "$postinstall_cmds" 'exit $?' + fi + + # Install the pseudo-library for information purposes. + func_basename "$file" + name="$func_basename_result" + instname="$dir/$name"i + func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' + + # Maybe install the static library, too. + test -n "$old_library" && 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 "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test + if test -n "$libdir" && test ! -f "$libfile"; then + func_warning "\`$lib' has not been installed in \`$libdir'" + finalize=no + fi + done + + relink_command= + func_source "$wrapper" + + outputname= + if test "$fast_install" = no && test -n "$relink_command"; then + $opt_dry_run || { + if test "$finalize" = yes; then + tmpdir=`func_mktempdir` + func_basename "$file$stripped_ext" + file="$func_basename_result" + outputname="$tmpdir/$file" + # Replace the output file specification. + relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` + + $opt_silent || { + func_quote_for_expand "$relink_command" + eval "func_echo $func_quote_for_expand_result" + } + if eval "$relink_command"; then : + else + func_error "error: relink \`$file' with the above command before installing it" + $opt_dry_run || ${RM}r "$tmpdir" + continue + fi + file="$outputname" + else + func_warning "cannot relink \`$file'" + fi + } + else + # Install the binary that we compiled earlier. + file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` + fi + fi + + # remove .exe since cygwin /usr/bin/install will append another + # one anyway + case $install_prog,$host in + */usr/bin/install*,*cygwin*) + case $file:$destfile in + *.exe:*.exe) + # this is ok + ;; + *.exe:*) + destfile=$destfile.exe + ;; + *:*.exe) + func_stripname '' '.exe' "$destfile" + destfile=$func_stripname_result + ;; + esac + ;; + esac + func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' + $opt_dry_run || if test -n "$outputname"; then + ${RM}r "$tmpdir" + fi + ;; + esac + done + + for file in $staticlibs; do + func_basename "$file" + name="$func_basename_result" + + # Set up the ranlib parameters. + oldlib="$destdir/$name" + + func_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 + +#if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) +#pragma GCC diagnostic ignored \"-Wstrict-prototypes\" +#endif + +/* External symbol declarations for the compiler. */\ +" + + if test "$dlself" = yes; then + func_verbose "generating symbol list for \`$output'" + + $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" + + # Add our own program objects to the symbol list. + progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` + for progfile in $progfiles; do + func_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 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 "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` + else + compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` + fi + ;; + *) + compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` + ;; + esac + ;; + *) + func_fatal_error "unknown suffix for \`$my_dlsyms'" + ;; + esac + else + # We keep going just in case the user didn't refer to + # lt_preloaded_symbols. The linker will fail if global_symbol_pipe + # really was required. + + # Nullify the symbol file. + compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` + finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` + fi +} + +# func_win32_libid arg +# return the library type of file 'arg' +# +# Need a lot of goo to handle *both* DLLs and import libs +# Has to be a shell function in order to 'eat' the argument +# that is supplied when $file_magic_command is called. +# Despite the name, also deal with 64 bit binaries. +func_win32_libid () +{ + $opt_debug + win32_libid_type="unknown" + win32_fileres=`file -L $1 2>/dev/null` + case $win32_fileres in + *ar\ archive\ import\ library*) # definitely import + win32_libid_type="x86 archive import" + ;; + *ar\ archive*) # could be an import, or static + # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. + if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | + $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then + 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" + if test "$lock_old_archive_extraction" = yes; then + lockfile=$f_ex_an_ar_oldlib.lock + until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do + func_echo "Waiting for $lockfile to be removed" + sleep 2 + done + fi + func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ + 'stat=$?; rm -f "$lockfile"; exit $stat' + if test "$lock_old_archive_extraction" = yes; then + $opt_dry_run || rm -f "$lockfile" + fi + if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then + : + else + func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" + fi +} + + +# func_extract_archives gentop oldlib ... +func_extract_archives () +{ + $opt_debug + my_gentop="$1"; shift + my_oldlibs=${1+"$@"} + my_oldobjs="" + my_xlib="" + my_xabs="" + my_xdir="" + + for my_xlib in $my_oldlibs; do + # Extract the objects. + case $my_xlib in + [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; + *) my_xabs=`pwd`"/$my_xlib" ;; + esac + func_basename "$my_xlib" + my_xlib="$func_basename_result" + my_xlib_u=$my_xlib + while :; do + case " $extracted_archives " in + *" $my_xlib_u "*) + func_arith $extracted_serial + 1 + extracted_serial=$func_arith_result + my_xlib_u=lt$extracted_serial-$my_xlib ;; + *) break ;; + esac + done + extracted_archives="$extracted_archives $my_xlib_u" + my_xdir="$my_gentop/$my_xlib_u" + + func_mkdir_p "$my_xdir" + + case $host in + *-darwin*) + func_verbose "Extracting $my_xabs" + # Do not bother doing anything if just a dry run + $opt_dry_run || { + darwin_orig_dir=`pwd` + cd $my_xdir || exit $? + darwin_archive=$my_xabs + darwin_curdir=`pwd` + darwin_base_archive=`basename "$darwin_archive"` + darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` + if test -n "$darwin_arches"; then + darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` + darwin_arch= + func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" + for darwin_arch in $darwin_arches ; do + func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}" + $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" + cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" + func_extract_an_archive "`pwd`" "${darwin_base_archive}" + cd "$darwin_curdir" + $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" + done # $darwin_arches + ## Okay now we've a bunch of thin objects, gotta fatten them up :) + darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u` + darwin_file= + darwin_files= + for darwin_file in $darwin_filelist; do + darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` + $LIPO -create -output "$darwin_file" $darwin_files + done # $darwin_filelist + $RM -rf unfat-$$ + cd "$darwin_orig_dir" + else + cd $darwin_orig_dir + func_extract_an_archive "$my_xdir" "$my_xabs" + fi # $darwin_arches + } # !$opt_dry_run + ;; + *) + func_extract_an_archive "$my_xdir" "$my_xabs" + ;; + esac + my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` + done + + func_extract_archives_result="$my_oldobjs" +} + + +# func_emit_wrapper [arg=no] +# +# Emit a libtool wrapper script on stdout. +# Don't directly open a file because we may want to +# incorporate the script contents within a cygwin/mingw +# wrapper executable. Must ONLY be called from within +# func_mode_link because it depends on a number of variables +# set therein. +# +# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR +# variable will take. If 'yes', then the emitted script +# will assume that the directory in which it is stored is +# the $objdir directory. This is a cygwin/mingw-specific +# behavior. +func_emit_wrapper () +{ + func_emit_wrapper_arg1=${1-no} + + $ECHO "\ +#! $SHELL + +# $output - temporary wrapper script for $objdir/$outputname +# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION +# +# The $output program cannot be directly executed until all the libtool +# libraries that it depends on are installed. +# +# This wrapper script should never be moved out of the build directory. +# If it is, it will not operate correctly. + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +sed_quote_subst='$sed_quote_subst' + +# Be Bourne compatible +if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac +fi +BIN_SH=xpg4; export BIN_SH # for Tru64 +DUALCASE=1; export DUALCASE # for MKS sh + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +relink_command=\"$relink_command\" + +# This environment variable determines our operation mode. +if test \"\$libtool_install_magic\" = \"$magic\"; then + # install mode needs the following variables: + generated_by_libtool_version='$macro_version' + notinst_deplibs='$notinst_deplibs' +else + # When we are sourced in execute mode, \$file and \$ECHO are already set. + if test \"\$libtool_execute_magic\" != \"$magic\"; then + file=\"\$0\"" + + qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` + $ECHO "\ + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$1 +_LTECHO_EOF' +} + ECHO=\"$qECHO\" + fi + +# Very basic option parsing. These options are (a) specific to +# the libtool wrapper, (b) are identical between the wrapper +# /script/ and the wrapper /executable/ which is used only on +# windows platforms, and (c) all begin with the string "--lt-" +# (application programs are unlikely to have options which match +# this pattern). +# +# There are only two supported options: --lt-debug and +# --lt-dump-script. There is, deliberately, no --lt-help. +# +# The first argument to this parsing function should be the +# script's $0 value, followed by "$@". +lt_option_debug= +func_parse_lt_options () +{ + lt_script_arg0=\$0 + shift + for lt_opt + do + case \"\$lt_opt\" in + --lt-debug) lt_option_debug=1 ;; + --lt-dump-script) + lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` + test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. + lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` + cat \"\$lt_dump_D/\$lt_dump_F\" + exit 0 + ;; + --lt-*) + \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 + exit 1 + ;; + esac + done + + # Print the debug banner immediately: + if test -n \"\$lt_option_debug\"; then + echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2 + fi +} + +# Used when --lt-debug. Prints its arguments to stdout +# (redirection is the responsibility of the caller) +func_lt_dump_args () +{ + lt_dump_args_N=1; + for lt_arg + do + \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\" + lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` + done +} + +# Core function for launching the target application +func_exec_program_core () +{ +" + case $host in + # Backslashes separate directories on plain windows + *-*-mingw | *-*-os2* | *-cegcc*) + $ECHO "\ + if test -n \"\$lt_option_debug\"; then + \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2 + func_lt_dump_args \${1+\"\$@\"} 1>&2 + fi + exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} +" + ;; + + *) + $ECHO "\ + if test -n \"\$lt_option_debug\"; then + \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2 + func_lt_dump_args \${1+\"\$@\"} 1>&2 + fi + exec \"\$progdir/\$program\" \${1+\"\$@\"} +" + ;; + esac + $ECHO "\ + \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 + exit 1 +} + +# A function to encapsulate launching the target application +# Strips options in the --lt-* namespace from \$@ and +# launches target application with the remaining arguments. +func_exec_program () +{ + for lt_wr_arg + do + case \$lt_wr_arg in + --lt-*) ;; + *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; + esac + shift + done + func_exec_program_core \${1+\"\$@\"} +} + + # Parse options + func_parse_lt_options \"\$0\" \${1+\"\$@\"} + + # Find the directory that this script lives in. + thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` + test \"x\$thisdir\" = \"x\$file\" && thisdir=. + + # Follow symbolic links until we get to the real thisdir. + file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\` + while test -n \"\$file\"; do + destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` + + # If there was a directory component, then change thisdir. + if test \"x\$destdir\" != \"x\$file\"; then + case \"\$destdir\" in + [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; + *) thisdir=\"\$thisdir/\$destdir\" ;; + esac + fi + + file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` + file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` + done + + # Usually 'no', except on cygwin/mingw when embedded into + # the cwrapper. + WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 + if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then + # special case for '.' + if test \"\$thisdir\" = \".\"; then + thisdir=\`pwd\` + fi + # remove .libs from thisdir + case \"\$thisdir\" in + *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; + $objdir ) thisdir=. ;; + esac + fi + + # Try to get the absolute directory name. + absdir=\`cd \"\$thisdir\" && pwd\` + test -n \"\$absdir\" && thisdir=\"\$absdir\" +" + + if test "$fast_install" = yes; then + $ECHO "\ + program=lt-'$outputname'$exeext + progdir=\"\$thisdir/$objdir\" + + if test ! -f \"\$progdir/\$program\" || + { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ + test \"X\$file\" != \"X\$progdir/\$program\"; }; then + + file=\"\$\$-\$program\" + + if test ! -d \"\$progdir\"; then + $MKDIR \"\$progdir\" + else + $RM \"\$progdir/\$file\" + fi" + + $ECHO "\ + + # relink executable if necessary + if test -n \"\$relink_command\"; then + if relink_command_output=\`eval \$relink_command 2>&1\`; then : + else + $ECHO \"\$relink_command_output\" >&2 + $RM \"\$progdir/\$file\" + exit 1 + fi + fi + + $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || + { $RM \"\$progdir/\$program\"; + $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } + $RM \"\$progdir/\$file\" + fi" + else + $ECHO "\ + program='$outputname' + progdir=\"\$thisdir/$objdir\" +" + fi + + $ECHO "\ + + if test -f \"\$progdir/\$program\"; then" + + # Export our shlibpath_var if we have one. + if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then + $ECHO "\ + # Add our own library path to $shlibpath_var + $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" + + # Some systems cannot cope with colon-terminated $shlibpath_var + # The second colon is a workaround for a bug in BeOS R4 sed + $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` + + export $shlibpath_var +" + fi + + # 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. + func_exec_program \${1+\"\$@\"} + fi + else + # The program doesn't exist. + \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 + \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 + \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 + exit 1 + fi +fi\ +" +} + + +# func_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 + func_to_host_path_result=`( cmd //c echo "$1" ) 2>/dev/null | + $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"` + ;; + *cygwin* ) + func_to_host_path_result=`cygpath -w "$1" | + $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_stripname : : "$1" + func_to_host_pathlist_tmp1=$func_stripname_result + case $build in + *mingw* ) # Actually, msys. + # Awkward: cmd appends spaces to result. + func_to_host_pathlist_result=` + ( cmd //c echo "$func_to_host_pathlist_tmp1" ) 2>/dev/null | + $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"` + ;; + *cygwin* ) + func_to_host_pathlist_result=`cygpath -w -p "$func_to_host_pathlist_tmp1" | + $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_append func_to_host_pathlist_result ";$func_to_host_path_result" + fi + fi + fi + 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_append 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 < +#include +#ifdef _MSC_VER +# include +# include +# include +#else +# include +# include +# ifdef __CYGWIN__ +# include +# endif +#endif +#include +#include +#include +#include +#include +#include +#include +#include + +/* declarations of non-ANSI functions */ +#if defined(__MINGW32__) +# ifdef __STRICT_ANSI__ +int _putenv (const char *); +# endif +#elif defined(__CYGWIN__) +# ifdef __STRICT_ANSI__ +char *realpath (const char *, char *); +int putenv (char *); +int setenv (const char *, const char *, int); +# endif +/* #elif defined (other platforms) ... */ +#endif + +/* portability defines, excluding path handling macros */ +#if defined(_MSC_VER) +# define setmode _setmode +# define stat _stat +# define chmod _chmod +# define getcwd _getcwd +# define putenv _putenv +# define S_IXUSR _S_IEXEC +# ifndef _INTPTR_T_DEFINED +# define _INTPTR_T_DEFINED +# define intptr_t int +# endif +#elif defined(__MINGW32__) +# define setmode _setmode +# define stat _stat +# define chmod _chmod +# define getcwd _getcwd +# define putenv _putenv +#elif defined(__CYGWIN__) +# define HAVE_SETENV +# define FOPEN_WB "wb" +/* #elif defined (other platforms) ... */ +#endif + +#if defined(PATH_MAX) +# define LT_PATHMAX PATH_MAX +#elif defined(MAXPATHLEN) +# define LT_PATHMAX MAXPATHLEN +#else +# define LT_PATHMAX 1024 +#endif + +#ifndef S_IXOTH +# define S_IXOTH 0 +#endif +#ifndef S_IXGRP +# define S_IXGRP 0 +#endif + +/* path handling portability macros */ +#ifndef DIR_SEPARATOR +# define DIR_SEPARATOR '/' +# define PATH_SEPARATOR ':' +#endif + +#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ + defined (__OS2__) +# define HAVE_DOS_BASED_FILE_SYSTEM +# define FOPEN_WB "wb" +# ifndef DIR_SEPARATOR_2 +# define DIR_SEPARATOR_2 '\\' +# endif +# ifndef PATH_SEPARATOR_2 +# define PATH_SEPARATOR_2 ';' +# endif +#endif + +#ifndef DIR_SEPARATOR_2 +# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) +#else /* DIR_SEPARATOR_2 */ +# define IS_DIR_SEPARATOR(ch) \ + (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) +#endif /* DIR_SEPARATOR_2 */ + +#ifndef PATH_SEPARATOR_2 +# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) +#else /* PATH_SEPARATOR_2 */ +# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) +#endif /* PATH_SEPARATOR_2 */ + +#ifndef FOPEN_WB +# define FOPEN_WB "w" +#endif +#ifndef _O_BINARY +# define _O_BINARY 0 +#endif + +#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) +#define XFREE(stale) do { \ + if (stale) { free ((void *) stale); stale = 0; } \ +} while (0) + +#if defined(LT_DEBUGWRAPPER) +static int lt_debug = 1; +#else +static int lt_debug = 0; +#endif + +const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ + +void *xmalloc (size_t num); +char *xstrdup (const char *string); +const char *base_name (const char *name); +char *find_executable (const char *wrapper); +char *chase_symlinks (const char *pathspec); +int make_executable (const char *path); +int check_executable (const char *path); +char *strendzap (char *str, const char *pat); +void lt_debugprintf (const char *file, int line, const char *fmt, ...); +void lt_fatal (const char *file, int line, const char *message, ...); +static const char *nonnull (const char *s); +static const char *nonempty (const char *s); +void lt_setenv (const char *name, const char *value); +char *lt_extend_str (const char *orig_value, const char *add, int to_end); +void lt_update_exe_path (const char *name, const char *value); +void lt_update_lib_path (const char *name, const char *value); +char **prepare_spawn (char **argv); +void lt_dump_script (FILE *f); +EOF + + cat <= 0) + && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) + return 1; + else + return 0; +} + +int +make_executable (const char *path) +{ + int rval = 0; + struct stat st; + + lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", + nonempty (path)); + if ((!path) || (!*path)) + return 0; + + if (stat (path, &st) >= 0) + { + rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); + } + return rval; +} + +/* Searches for the full path of the wrapper. Returns + newly allocated full path name if found, NULL otherwise + Does not chase symlinks, even on platforms that support them. +*/ +char * +find_executable (const char *wrapper) +{ + int has_slash = 0; + const char *p; + const char *p_next; + /* static buffer for getcwd */ + char tmp[LT_PATHMAX + 1]; + int tmp_len; + char *concat_name; + + lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", + nonempty (wrapper)); + + if ((wrapper == NULL) || (*wrapper == '\0')) + return NULL; + + /* Absolute path? */ +#if defined (HAVE_DOS_BASED_FILE_SYSTEM) + if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') + { + concat_name = xstrdup (wrapper); + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + } + else + { +#endif + if (IS_DIR_SEPARATOR (wrapper[0])) + { + concat_name = xstrdup (wrapper); + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + } +#if defined (HAVE_DOS_BASED_FILE_SYSTEM) + } +#endif + + for (p = wrapper; *p; p++) + if (*p == '/') + { + has_slash = 1; + break; + } + if (!has_slash) + { + /* no slashes; search PATH */ + const char *path = getenv ("PATH"); + if (path != NULL) + { + for (p = path; *p; p = p_next) + { + const char *q; + size_t p_len; + for (q = p; *q; q++) + if (IS_PATH_SEPARATOR (*q)) + break; + p_len = q - p; + p_next = (*q == '\0' ? q : q + 1); + if (p_len == 0) + { + /* empty path: current directory */ + if (getcwd (tmp, LT_PATHMAX) == NULL) + lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", + nonnull (strerror (errno))); + tmp_len = strlen (tmp); + concat_name = + XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); + memcpy (concat_name, tmp, tmp_len); + concat_name[tmp_len] = '/'; + strcpy (concat_name + tmp_len + 1, wrapper); + } + else + { + concat_name = + XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); + memcpy (concat_name, p, p_len); + concat_name[p_len] = '/'; + strcpy (concat_name + p_len + 1, wrapper); + } + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + } + } + /* not found in PATH; assume curdir */ + } + /* Relative path | not found in path: prepend cwd */ + if (getcwd (tmp, LT_PATHMAX) == NULL) + lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", + nonnull (strerror (errno))); + tmp_len = strlen (tmp); + concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); + memcpy (concat_name, tmp, tmp_len); + concat_name[tmp_len] = '/'; + strcpy (concat_name + tmp_len + 1, wrapper); + + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + return NULL; +} + +char * +chase_symlinks (const char *pathspec) +{ +#ifndef S_ISLNK + return xstrdup (pathspec); +#else + char buf[LT_PATHMAX]; + struct stat s; + char *tmp_pathspec = xstrdup (pathspec); + char *p; + int has_symlinks = 0; + while (strlen (tmp_pathspec) && !has_symlinks) + { + lt_debugprintf (__FILE__, __LINE__, + "checking path component for symlinks: %s\n", + tmp_pathspec); + if (lstat (tmp_pathspec, &s) == 0) + { + if (S_ISLNK (s.st_mode) != 0) + { + has_symlinks = 1; + break; + } + + /* search backwards for last DIR_SEPARATOR */ + p = tmp_pathspec + strlen (tmp_pathspec) - 1; + while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) + p--; + if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) + { + /* no more DIR_SEPARATORS left */ + break; + } + *p = '\0'; + } + else + { + lt_fatal (__FILE__, __LINE__, + "error accessing file \"%s\": %s", + tmp_pathspec, nonnull (strerror (errno))); + } + } + XFREE (tmp_pathspec); + + if (!has_symlinks) + { + return xstrdup (pathspec); + } + + tmp_pathspec = realpath (pathspec, buf); + if (tmp_pathspec == 0) + { + lt_fatal (__FILE__, __LINE__, + "could not follow symlinks for %s", pathspec); + } + return xstrdup (tmp_pathspec); +#endif +} + +char * +strendzap (char *str, const char *pat) +{ + size_t len, patlen; + + assert (str != NULL); + assert (pat != NULL); + + len = strlen (str); + patlen = strlen (pat); + + if (patlen <= len) + { + str += len - patlen; + if (strcmp (str, pat) == 0) + *str = '\0'; + } + return str; +} + +void +lt_debugprintf (const char *file, int line, const char *fmt, ...) +{ + va_list args; + if (lt_debug) + { + (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); + va_start (args, fmt); + (void) vfprintf (stderr, fmt, args); + va_end (args); + } +} + +static void +lt_error_core (int exit_status, const char *file, + int line, const char *mode, + const char *message, va_list ap) +{ + fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); + vfprintf (stderr, message, ap); + fprintf (stderr, ".\n"); + + if (exit_status >= 0) + exit (exit_status); +} + +void +lt_fatal (const char *file, int line, const char *message, ...) +{ + va_list ap; + va_start (ap, message); + lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); + va_end (ap); +} + +static const char * +nonnull (const char *s) +{ + return s ? s : "(null)"; +} + +static const char * +nonempty (const char *s) +{ + return (s && !*s) ? "(empty)" : nonnull (s); +} + +void +lt_setenv (const char *name, const char *value) +{ + lt_debugprintf (__FILE__, __LINE__, + "(lt_setenv) setting '%s' to '%s'\n", + nonnull (name), nonnull (value)); + { +#ifdef HAVE_SETENV + /* always make a copy, for consistency with !HAVE_SETENV */ + char *str = xstrdup (value); + setenv (name, str, 1); +#else + int len = strlen (name) + 1 + strlen (value) + 1; + char *str = XMALLOC (char, len); + sprintf (str, "%s=%s", name, value); + if (putenv (str) != EXIT_SUCCESS) + { + XFREE (str); + } +#endif + } +} + +char * +lt_extend_str (const char *orig_value, const char *add, int to_end) +{ + char *new_value; + if (orig_value && *orig_value) + { + int orig_value_len = strlen (orig_value); + int add_len = strlen (add); + new_value = XMALLOC (char, add_len + orig_value_len + 1); + if (to_end) + { + strcpy (new_value, orig_value); + strcpy (new_value + orig_value_len, add); + } + else + { + strcpy (new_value, add); + strcpy (new_value + add_len, orig_value); + } + } + else + { + new_value = xstrdup (add); + } + return new_value; +} + +void +lt_update_exe_path (const char *name, const char *value) +{ + lt_debugprintf (__FILE__, __LINE__, + "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", + nonnull (name), nonnull (value)); + + if (name && *name && value && *value) + { + char *new_value = lt_extend_str (getenv (name), value, 0); + /* some systems can't cope with a ':'-terminated path #' */ + int len = strlen (new_value); + while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1])) + { + new_value[len-1] = '\0'; + } + lt_setenv (name, new_value); + XFREE (new_value); + } +} + +void +lt_update_lib_path (const char *name, const char *value) +{ + lt_debugprintf (__FILE__, __LINE__, + "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", + nonnull (name), nonnull (value)); + + if (name && *name && value && *value) + { + char *new_value = lt_extend_str (getenv (name), value, 0); + lt_setenv (name, new_value); + XFREE (new_value); + } +} + +EOF + case $host_os in + mingw*) + cat <<"EOF" + +/* Prepares an argument vector before calling spawn(). + Note that spawn() does not by itself call the command interpreter + (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : + ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); + GetVersionEx(&v); + v.dwPlatformId == VER_PLATFORM_WIN32_NT; + }) ? "cmd.exe" : "command.com"). + Instead it simply concatenates the arguments, separated by ' ', and calls + CreateProcess(). We must quote the arguments since Win32 CreateProcess() + interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a + special way: + - Space and tab are interpreted as delimiters. They are not treated as + delimiters if they are surrounded by double quotes: "...". + - Unescaped double quotes are removed from the input. Their only effect is + that within double quotes, space and tab are treated like normal + characters. + - Backslashes not followed by double quotes are not special. + - But 2*n+1 backslashes followed by a double quote become + n backslashes followed by a double quote (n >= 0): + \" -> " + \\\" -> \" + \\\\\" -> \\" + */ +#define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" +#define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" +char ** +prepare_spawn (char **argv) +{ + size_t argc; + char **new_argv; + size_t i; + + /* Count number of arguments. */ + for (argc = 0; argv[argc] != NULL; argc++) + ; + + /* Allocate new argument vector. */ + new_argv = XMALLOC (char *, argc + 1); + + /* Put quoted arguments into the new argument vector. */ + for (i = 0; i < argc; i++) + { + const char *string = argv[i]; + + if (string[0] == '\0') + new_argv[i] = xstrdup ("\"\""); + else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) + { + int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); + size_t length; + unsigned int backslashes; + const char *s; + char *quoted_string; + char *p; + + length = 0; + backslashes = 0; + if (quote_around) + length++; + for (s = string; *s != '\0'; s++) + { + char c = *s; + if (c == '"') + length += backslashes + 1; + length++; + if (c == '\\') + backslashes++; + else + backslashes = 0; + } + if (quote_around) + length += backslashes + 1; + + quoted_string = XMALLOC (char, length + 1); + + p = quoted_string; + backslashes = 0; + if (quote_around) + *p++ = '"'; + for (s = string; *s != '\0'; s++) + { + char c = *s; + if (c == '"') + { + unsigned int j; + for (j = backslashes + 1; j > 0; j--) + *p++ = '\\'; + } + *p++ = c; + if (c == '\\') + backslashes++; + else + backslashes = 0; + } + if (quote_around) + { + unsigned int j; + for (j = backslashes; j > 0; j--) + *p++ = '\\'; + *p++ = '"'; + } + *p = '\0'; + + new_argv[i] = quoted_string; + } + else + new_argv[i] = (char *) string; + } + new_argv[argc] = NULL; + + return new_argv; +} +EOF + ;; + esac + + cat <<"EOF" +void lt_dump_script (FILE* f) +{ +EOF + func_emit_wrapper yes | + $SED -e 's/\([\\"]\)/\\\1/g' \ + -e 's/^/ fputs ("/' -e 's/$/\\n", f);/' + + cat <<"EOF" +} +EOF +} +# end: func_emit_cwrapperexe_src + +# func_win32_import_lib_p ARG +# True if ARG is an import lib, as indicated by $file_magic_cmd +func_win32_import_lib_p () +{ + $opt_debug + case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in + *import*) : ;; + *) false ;; + esac +} + +# func_mode_link arg... +func_mode_link () +{ + $opt_debug + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + # It is impossible to link a dll without this setting, and + # we shouldn't force the makefile maintainer to figure out + # which system we are compiling for in order to pass an extra + # flag for every libtool invocation. + # allow_undefined=no + + # FIXME: Unfortunately, there are problems with the above when trying + # to make a dll which has undefined symbols, in which case not + # even a static library is built. For now, we need to specify + # -no-undefined on the libtool link line when we can be certain + # that all symbols are satisfied, otherwise we get a static library. + allow_undefined=yes + ;; + *) + allow_undefined=yes + ;; + esac + libtool_args=$nonopt + base_compile="$nonopt $@" + compile_command=$nonopt + finalize_command=$nonopt + + compile_rpath= + finalize_rpath= + compile_shlibpath= + finalize_shlibpath= + convenience= + old_convenience= + deplibs= + old_deplibs= + compiler_flags= + linker_flags= + dllsearchpath= + lib_search_path=`pwd` + inst_prefix_dir= + new_inherited_linker_flags= + + avoid_version=no + bindir= + dlfiles= + dlprefiles= + dlself=no + export_dynamic=no + export_symbols= + export_symbols_regex= + generated= + libobjs= + ltlibs= + module=no + no_install=no + objs= + non_pic_objects= + precious_files_regex= + prefer_static_libs=no + preload=no + prev= + prevarg= + release= + rpath= + xrpath= + perm_rpath= + temp_rpath= + thread_safe=no + vinfo= + vinfo_number=no + weak_libs= + single_module="${wl}-single_module" + func_infer_tag $base_compile + + # We need to know -static, to get the right output filenames. + for arg + do + case $arg in + -shared) + test "$build_libtool_libs" != yes && \ + func_fatal_configuration "can not build a shared library" + build_old_libs=no + break + ;; + -all-static | -static | -static-libtool-libs) + case $arg in + -all-static) + if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then + func_warning "complete static linking is impossible in this configuration" + fi + if test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=yes + ;; + -static) + if test -z "$pic_flag" && test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=built + ;; + -static-libtool-libs) + if test -z "$pic_flag" && test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + prefer_static_libs=yes + ;; + esac + build_libtool_libs=no + build_old_libs=yes + break + ;; + esac + done + + # See if our shared archives depend on static archives. + test -n "$old_archive_from_new_cmds" && build_old_libs=yes + + # Go through the arguments, transforming them on the way. + while test "$#" -gt 0; do + arg="$1" + shift + func_quote_for_eval "$arg" + qarg=$func_quote_for_eval_unquoted_result + func_append libtool_args " $func_quote_for_eval_result" + + # If the previous option needs an argument, assign it. + if test -n "$prev"; then + case $prev in + output) + func_append compile_command " @OUTPUT@" + func_append finalize_command " @OUTPUT@" + ;; + esac + + case $prev in + bindir) + bindir="$arg" + prev= + continue + ;; + dlfiles|dlprefiles) + if test "$preload" = no; then + # Add the symbol object into the linking commands. + func_append compile_command " @SYMFILE@" + func_append finalize_command " @SYMFILE@" + preload=yes + fi + case $arg in + *.la | *.lo) ;; # We handle these cases below. + force) + if test "$dlself" = no; then + dlself=needless + export_dynamic=yes + fi + prev= + continue + ;; + self) + if test "$prev" = dlprefiles; then + dlself=yes + elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then + dlself=yes + else + dlself=needless + export_dynamic=yes + fi + prev= + continue + ;; + *) + if test "$prev" = dlfiles; then + 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 + ;; + + -bindir) + prev=bindir + continue + ;; + + -dlopen) + prev=dlfiles + continue + ;; + + -dlpreopen) + prev=dlprefiles + continue + ;; + + -export-dynamic) + export_dynamic=yes + continue + ;; + + -export-symbols | -export-symbols-regex) + if test -n "$export_symbols" || test -n "$export_symbols_regex"; then + func_fatal_error "more than one -exported-symbols argument is not allowed" + fi + if test "X$arg" = "X-export-symbols"; then + prev=expsyms + else + prev=expsyms_regex + fi + continue + ;; + + -framework) + prev=framework + continue + ;; + + -inst-prefix-dir) + prev=inst_prefix + continue + ;; + + # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* + # so, if we see these flags be careful not to treat them like -L + -L[A-Z][A-Z]*:*) + case $with_gcc/$host in + no/*-*-irix* | /*-*-irix*) + func_append compile_command " $arg" + func_append finalize_command " $arg" + ;; + esac + continue + ;; + + -L*) + func_stripname '-L' '' "$arg" + 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 "$dir" | $SED '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* | *-*-haiku*) + # These systems don't actually have a C or math library (as such) + continue + ;; + *-*-os2*) + # These systems don't actually have a C library (as such) + test "X$arg" = "X-lc" && continue + ;; + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + # Do not include libc due to us having libc/libc_r. + test "X$arg" = "X-lc" && continue + ;; + *-*-rhapsody* | *-*-darwin1.[012]) + # Rhapsody C and math libraries are in the System framework + 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 $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" + ;; + + # Flags to be passed through unchanged, with rationale: + # -64, -mips[0-9] enable 64-bit mode for the SGI compiler + # -r[0-9][0-9]* specify processor for the SGI compiler + # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler + # +DA*, +DD* enable 64-bit mode for the HP compiler + # -q* compiler args for the IBM compiler + # -m*, -t[45]*, -txscale* architecture-specific flags for GCC + # -F/path path to uninstalled frameworks, gcc on darwin + # -p, -pg, --coverage, -fprofile-* profiling flags for GCC + # @file GCC response files + # -tp=* Portland pgcc target processor selection + -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ + -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*) + 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 \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\` + else + shlib_search_path= + fi + eval sys_lib_search_path=\"$sys_lib_search_path_spec\" + eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" + + func_dirname "$output" "/" "" + output_objdir="$func_dirname_result$objdir" + # 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 + func_basename "$deplib" + deplib_base=$func_basename_result + 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 \"$deplib\"" 2>/dev/null | $SED 10q \ + | $EGREP "$match_pattern_regex" > /dev/null; then + valid_a_lib=yes + fi + ;; + pass_all) + valid_a_lib=yes + ;; + esac + if test "$valid_a_lib" != yes; then + echo + $ECHO "*** Warning: Trying to link with static lib archive $deplib." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have" + echo "*** because the file extensions .$libext of this argument makes me believe" + echo "*** that it is just a static archive that I should not use here." + else + echo + $ECHO "*** Warning: Linking the shared library $output against the" + $ECHO "*** static library $deplib is not portable!" + deplibs="$deplib $deplibs" + fi + ;; + esac + continue + ;; + prog) + if test "$pass" != link; then + deplibs="$deplib $deplibs" + else + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + fi + continue + ;; + esac # linkmode + ;; # *.$libext + *.lo | *.$objext) + if test "$pass" = conv; then + deplibs="$deplib $deplibs" + elif test "$linkmode" = prog; then + if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then + # If there is no dlopen support or we're linking statically, + # we need to preload. + 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 "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'` + for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do + case " $new_inherited_linker_flags " in + *" $tmp_inherited_linker_flag "*) ;; + *) new_inherited_linker_flags="$new_inherited_linker_flags $tmp_inherited_linker_flag";; + esac + done + fi + dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + if test "$linkmode,$pass" = "lib,link" || + test "$linkmode,$pass" = "prog,scan" || + { test "$linkmode" != prog && test "$linkmode" != lib; }; then + test -n "$dlopen" && 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 + path= + 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 " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + fi + fi + dependency_libs="$newdependency_libs" + if test "$pass" = dlpreopen; then + # Link the dlpreopened libraries before other libraries + for deplib in $save_deplibs; do + deplibs="$deplib $deplibs" + done + fi + if test "$pass" != dlopen; then + if test "$pass" != conv; then + # Make sure lib_search_path contains only unique directories. + lib_search_path= + for dir in $newlib_search_path; do + case "$lib_search_path " in + *" $dir "*) ;; + *) 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|qnx|sunos) + current="$number_major" + revision="$number_minor" + age="0" + ;; + irix|nonstopux) + func_arith $number_major + $number_minor + current=$func_arith_result + age="$number_minor" + revision="$number_minor" + lt_irix_increment=no + ;; + esac + ;; + no) + current="$1" + revision="$2" + age="$3" + ;; + esac + + # Check that each of the things are valid numbers. + case $current in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + func_error "CURRENT \`$current' must be a nonnegative integer" + func_fatal_error "\`$vinfo' is not valid version information" + ;; + esac + + case $revision in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + func_error "REVISION \`$revision' must be a nonnegative integer" + func_fatal_error "\`$vinfo' is not valid version information" + ;; + esac + + case $age in + 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; + *) + func_error "AGE \`$age' must be a nonnegative integer" + func_fatal_error "\`$vinfo' is not valid version information" + ;; + esac + + if test "$age" -gt "$current"; then + func_error "AGE \`$age' is greater than the current interface number \`$current'" + func_fatal_error "\`$vinfo' is not valid version information" + fi + + # Calculate the version variables. + major= + versuffix= + verstring= + case $version_type in + none) ;; + + darwin) + # Like Linux, but with the current version available in + # verstring for coding it into the library header + func_arith $current - $age + major=.$func_arith_result + versuffix="$major.$age.$revision" + # Darwin ld doesn't like 0 for these options... + func_arith $current + 1 + minor_current=$func_arith_result + xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" + verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" + ;; + + freebsd-aout) + major=".$current" + versuffix=".$current.$revision"; + ;; + + freebsd-elf) + major=".$current" + versuffix=".$current" + ;; + + irix | nonstopux) + if test "X$lt_irix_increment" = "Xno"; then + func_arith $current - $age + else + func_arith $current - $age + 1 + fi + major=$func_arith_result + + case $version_type in + nonstopux) verstring_prefix=nonstopux ;; + *) verstring_prefix=sgi ;; + esac + verstring="$verstring_prefix$major.$revision" + + # Add in all the interfaces that we are compatible with. + loop=$revision + while test "$loop" -ne 0; do + func_arith $revision - $loop + iface=$func_arith_result + func_arith $loop - 1 + loop=$func_arith_result + verstring="$verstring_prefix$major.$iface:$verstring" + done + + # Before this point, $major must not contain `.'. + major=.$major + versuffix="$major.$revision" + ;; + + linux) + 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 "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP` + fi + + # Eliminate all temporary directories. + #for path in $notinst_path; do + # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` + # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` + # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"` + #done + + if test -n "$xrpath"; then + # If the user specified any rpath flags, then add them. + temp_xrpath= + for libdir in $xrpath; do + 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* | *-*-haiku*) + # 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 </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 "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";; + esac + done + if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | + $SED -e 10q | + $EGREP "$file_magic_regex" > /dev/null; then + 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 \"$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 + ;; + *) + # Add a -L argument. + newdeplibs="$newdeplibs $a_deplib" + ;; + esac + done # Gone through all deplibs. + ;; + none | unknown | *) + newdeplibs="" + tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + for i in $predeps $postdeps ; do + # can't use Xsed below, because $i might contain '/' + tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"` + done + fi + case $tmp_deplibs in + *[!\ \ ]*) + echo + if test "X$deplibs_check_method" = "Xnone"; then + echo "*** Warning: inter-library dependencies are not supported in this platform." + else + echo "*** Warning: inter-library dependencies are not known to be supported." + fi + echo "*** All declared inter-library dependencies are being dropped." + droppeddeps=yes + ;; + esac + ;; + esac + versuffix=$versuffix_save + major=$major_save + release=$release_save + libname=$libname_save + name=$name_save + + case $host in + *-*-rhapsody* | *-*-darwin1.[012]) + # On Rhapsody replace the C library with the System framework + newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` + ;; + esac + + if test "$droppeddeps" = yes; then + if test "$module" = yes; then + echo + echo "*** Warning: libtool could not satisfy all declared inter-library" + $ECHO "*** dependencies of module $libname. Therefore, libtool will create" + echo "*** a static module, that should work as long as the dlopening" + echo "*** application is linked with the -dlopen flag." + if test -z "$global_symbol_pipe"; then + echo + echo "*** However, this would only work if libtool was able to extract symbol" + echo "*** lists from a program, using \`nm' or equivalent, but libtool could" + echo "*** not find such a program. So, this module is probably useless." + echo "*** \`nm' from GNU binutils and a full rebuild may help." + fi + if test "$build_old_libs" = no; then + oldlibs="$output_objdir/$libname.$libext" + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + else + echo "*** The inter-library dependencies that have been dropped here will be" + echo "*** automatically added whenever a program is linked with this library" + echo "*** or is declared to -dlopen it." + + if test "$allow_undefined" = no; then + echo + echo "*** Since this library must not contain undefined symbols," + echo "*** because either the platform does not support them or" + echo "*** it was explicitly requested with -no-undefined," + echo "*** libtool will only create a static version of it." + if test "$build_old_libs" = no; then + oldlibs="$output_objdir/$libname.$libext" + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + fi + fi + fi + # Done checking deplibs! + deplibs=$newdeplibs + fi + # Time to change all our "foo.ltframework" stuff back to "-framework foo" + case $host in + *-*-darwin*) + newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + ;; + esac + + # move library search paths that coincide with paths to not yet + # installed libraries to the beginning of the library search list + new_libs= + for path in $notinst_path; do + case " $new_libs " in + *" -L$path/$objdir "*) ;; + *) + case " $deplibs " in + *" -L$path/$objdir "*) + 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 "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP` + test "X$libobjs" = "X " && libobjs= + + delfiles= + if test -n "$export_symbols" && test -n "$include_expsyms"; then + $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" + export_symbols="$output_objdir/$libname.uexp" + 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 "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' + fi + + if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then + # The given exports_symbols file has to be filtered, so filter it. + func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" + # FIXME: $output_objdir/$libname.filter potentially contains lots of + # 's' commands which not all seds can handle. GNU sed should be fine + # though. Also, the filter scales superlinearly with the number of + # global variables. join(1) would be nice here, but unfortunately + # isn't a blessed tool. + $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter + 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 + func_basename "$output" + output_la=$func_basename_result + + # Clear the reloadable object creation command queue and + # initialize k to one. + test_cmds= + concat_cmds= + objlist= + last_robj= + k=1 + + if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then + output=${output_objdir}/${output_la}.lnkscript + func_verbose "creating GNU ld script: $output" + echo 'INPUT (' > $output + for obj in $save_libobjs + do + $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. + reload_objs=$objlist + eval concat_cmds=\"$reload_cmds\" + else + # All subsequent reloadable object files will link in + # the last one created. + reload_objs="$objlist $last_robj" + eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" + fi + last_robj=$output_objdir/$output_la-${k}.$objext + func_arith $k + 1 + k=$func_arith_result + output=$output_objdir/$output_la-${k}.$objext + objlist=" $obj" + func_len " $last_robj" + func_arith $len0 + $func_len_result + len=$func_arith_result + fi + done + # Handle the remaining objects by creating one last + # reloadable object file. All subsequent reloadable object + # files will link in the last one created. + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ + reload_objs="$objlist $last_robj" + eval concat_cmds=\"\${concat_cmds}$reload_cmds\" + if test -n "$last_robj"; then + eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\" + fi + 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 "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' + fi + + if test -n "$orig_export_symbols"; then + # The given exports_symbols file has to be filtered, so filter it. + func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" + # FIXME: $output_objdir/$libname.filter potentially contains lots of + # 's' commands which not all seds can handle. GNU sed should be fine + # though. Also, the filter scales superlinearly with the number of + # global variables. join(1) would be nice here, but unfortunately + # isn't a blessed tool. + $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter + 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 "$tmp_whole_archive_flags" | $SED '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 "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test + + output="$obj" + func_execute_cmds "$reload_cmds" 'exit $?' + + # Exit if we aren't doing a library object file. + if test -z "$libobj"; then + if test -n "$gentop"; then + func_show_eval '${RM}r "$gentop"' + fi + + exit $EXIT_SUCCESS + fi + + if test "$build_libtool_libs" != yes; then + if test -n "$gentop"; then + func_show_eval '${RM}r "$gentop"' + fi + + # Create an invalid libtool object if no PIC, so that we don't + # accidentally link it into a program. + # $show "echo timestamp > $libobj" + # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? + exit $EXIT_SUCCESS + fi + + if test -n "$pic_flag" || test "$pic_mode" != default; then + # Only do commands if we really have different PIC objects. + reload_objs="$libobjs $reload_conv_objs" + output="$libobj" + func_execute_cmds "$reload_cmds" 'exit $?' + fi + + if test -n "$gentop"; then + func_show_eval '${RM}r "$gentop"' + fi + + exit $EXIT_SUCCESS + ;; + + prog) + case $host in + *cygwin*) func_stripname '' '.exe' "$output" + output=$func_stripname_result.exe;; + esac + test -n "$vinfo" && \ + func_warning "\`-version-info' is ignored for programs" + + test -n "$release" && \ + func_warning "\`-release' is ignored for programs" + + test "$preload" = yes \ + && test "$dlopen_support" = unknown \ + && test "$dlopen_self" = unknown \ + && test "$dlopen_self_static" = unknown && \ + func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support." + + case $host in + *-*-rhapsody* | *-*-darwin1.[012]) + # On Rhapsody replace the C library is the System framework + compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` + finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` + ;; + esac + + case $host in + *-*-darwin*) + # Don't allow lazy linking, it breaks C++ global constructors + # But is supposedly fixed on 10.4 or later (yay!). + if test "$tagname" = CXX ; then + case ${MACOSX_DEPLOYMENT_TARGET-10.0} in + 10.[0123]) + 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 " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` + ;; + esac + + + # move library search paths that coincide with paths to not yet + # installed libraries to the beginning of the library search list + new_libs= + for path in $notinst_path; do + case " $new_libs " in + *" -L$path/$objdir "*) ;; + *) + case " $compile_deplibs " in + *" -L$path/$objdir "*) + 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 "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` + finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` + fi + + func_generate_dlsyms "$outputname" "@PROGRAM@" "no" + + # template prelinking step + if test -n "$prelink_cmds"; then + func_execute_cmds "$prelink_cmds" 'exit $?' + fi + + wrappers_required=yes + case $host in + *cegcc* | *mingw32ce*) + # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. + wrappers_required=no + ;; + *cygwin* | *mingw* ) + if test "$build_libtool_libs" != yes; then + wrappers_required=no + fi + ;; + *) + if test "$need_relink" = no || test "$build_libtool_libs" != yes; then + wrappers_required=no + fi + ;; + esac + if test "$wrappers_required" = no; then + # Replace the output file specification. + compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` + link_command="$compile_command$compile_rpath" + + # We have no uninstalled library dependencies, so finalize right now. + exit_status=0 + func_show_eval "$link_command" 'exit_status=$?' + + # 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 "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` + # Delete the old output file. + $opt_dry_run || $RM $output + # Link the executable and exit + func_show_eval "$link_command" 'exit $?' + exit $EXIT_SUCCESS + fi + + if test "$hardcode_action" = relink; then + # Fast installation is not supported + link_command="$compile_var$compile_command$compile_rpath" + relink_command="$finalize_var$finalize_command$finalize_rpath" + + func_warning "this platform does not like uninstalled shared libraries" + func_warning "\`$output' will be relinked during installation" + else + if test "$fast_install" != no; then + link_command="$finalize_var$compile_command$finalize_rpath" + if test "$fast_install" = yes; then + relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` + else + # fast_install is set to needless + relink_command= + fi + else + link_command="$compile_var$compile_command$compile_rpath" + relink_command="$finalize_var$finalize_command$finalize_rpath" + fi + fi + + # Replace the output file specification. + link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` + + # Delete the old output files. + $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname + + func_show_eval "$link_command" 'exit $?' + + # Now create the wrapper script. + func_verbose "creating $output" + + # Quote the relink command for shipping. + if test -n "$relink_command"; then + # Preserve any variables that may affect compiler behavior + for var in $variables_saved_for_relink; do + if eval test -z \"\${$var+set}\"; then + relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" + elif eval var_value=\$$var; test -z "$var_value"; then + relink_command="$var=; export $var; $relink_command" + else + func_quote_for_eval "$var_value" + relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" + fi + done + relink_command="(cd `pwd`; $relink_command)" + relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` + fi + + # Only actually do things if not in dry run mode. + $opt_dry_run || { + # win32 will think the script is a binary if it has + # a .exe suffix, so we strip it off here. + case $output in + *.exe) func_stripname '' '.exe' "$output" + output=$func_stripname_result ;; + esac + # test for cygwin because mv fails w/o .exe extensions + case $host in + *cygwin*) + exeext=.exe + func_stripname '' '.exe' "$outputname" + outputname=$func_stripname_result ;; + *) exeext= ;; + esac + case $host in + *cygwin* | *mingw* ) + func_dirname_and_basename "$output" "" "." + output_name=$func_basename_result + output_path=$func_dirname_result + cwrappersource="$output_path/$objdir/lt-$output_name.c" + cwrapper="$output_path/$output_name.exe" + $RM $cwrappersource $cwrapper + trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 + + func_emit_cwrapperexe_src > $cwrappersource + + # The wrapper executable is built using the $host compiler, + # because it contains $host paths and files. If cross- + # compiling, it, like the target executable, must be + # executed on the $host or under an emulation environment. + $opt_dry_run || { + $LTCC $LTCFLAGS -o $cwrapper $cwrappersource + $STRIP $cwrapper + } + + # Now, create the wrapper script for func_source use: + func_ltwrapper_scriptname $cwrapper + $RM $func_ltwrapper_scriptname_result + trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 + $opt_dry_run || { + # note: this script will not be executed, so do not chmod. + if test "x$build" = "x$host" ; then + $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result + else + func_emit_wrapper no > $func_ltwrapper_scriptname_result + fi + } + ;; + * ) + $RM $output + trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 + + func_emit_wrapper no > $output + chmod +x $output + ;; + esac + } + exit $EXIT_SUCCESS + ;; + esac + + # See if we need to build an old-fashioned archive. + for oldlib in $oldlibs; do + + if test "$build_libtool_libs" = convenience; then + oldobjs="$libobjs_save $symfileobj" + addlibs="$convenience" + build_libtool_libs=no + else + if test "$build_libtool_libs" = module; then + oldobjs="$libobjs_save" + build_libtool_libs=no + else + oldobjs="$old_deplibs $non_pic_objects" + if test "$preload" = yes && test -f "$symfileobj"; then + 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 "$relink_command" | $SED "$sed_quote_subst"` + if test "$hardcode_automatic" = yes ; then + relink_command= + fi + + # Only create the output if not a dry run. + $opt_dry_run || { + for installed in no yes; do + if test "$installed" = yes; then + if test -z "$install_libdir"; then + break + fi + output="$output_objdir/$outputname"i + # Replace all uninstalled libtool libraries with the installed ones + newdependency_libs= + for deplib in $dependency_libs; do + case $deplib in + *.la) + func_basename "$deplib" + name="$func_basename_result" + 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 + # In fact, it would be nice if we could use this code for all target + # systems that can't hard-code library paths into their executables + # and that have no shared library path variable independent of PATH, + # but it turns out we can't easily determine that from inspecting + # libtool variables, so we have to hard-code the OSs to which it + # applies here; at the moment, that means platforms that use the PE + # object format with DLL files. See the long comment at the top of + # tests/bindir.at for full details. + tdlname=$dlname + case $host,$output,$installed,$module,$dlname in + *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) + # If a -bindir argument was supplied, place the dll there. + if test "x$bindir" != x ; + then + func_relative_path "$install_libdir" "$bindir" + tdlname=$func_relative_path_result$dlname + else + # Otherwise fall back on heuristic. + tdlname=../bin/$dlname + fi + ;; + esac + $ECHO > $output "\ +# $outputname - a libtool library file +# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION +# +# Please DO NOT delete this file! +# It is necessary for linking the library. + +# The name that we can dlopen(3). +dlname='$tdlname' + +# Names of this library. +library_names='$library_names' + +# The name of the static archive. +old_library='$old_library' + +# Linker flags that can not go in dependency_libs. +inherited_linker_flags='$new_inherited_linker_flags' + +# Libraries that this one depends upon. +dependency_libs='$dependency_libs' + +# Names of additional weak libraries provided by this library +weak_library_names='$weak_libs' + +# Version information for $libname. +current=$current +age=$age +revision=$revision + +# Is this an already installed library? +installed=$installed + +# Should we warn about portability when linking against -modules? +shouldnotlink=$module + +# Files to dlopen/dlpreopen +dlopen='$dlfiles' +dlpreopen='$dlprefiles' + +# Directory that this library needs to be installed in: +libdir='$install_libdir'" + if test "$installed" = no && test "$need_relink" = yes; then + $ECHO >> $output "\ +relink_command=\"$relink_command\"" + fi + done + } + + # Do a symbolic link so that the libtool archive can be found in + # LD_LIBRARY_PATH before the program is installed. + func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' + ;; + esac + exit $EXIT_SUCCESS +} + +{ test "$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/antlr/libantlr3c-3.4/m4/libtool.m4 b/antlr/libantlr3c-3.4/m4/libtool.m4 new file mode 100644 index 0000000..8c99a62 --- /dev/null +++ b/antlr/libantlr3c-3.4/m4/libtool.m4 @@ -0,0 +1,7441 @@ +# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +# 2006, 2007, 2008, 2009, 2010 Free Software Foundation, +# Inc. +# Written by Gordon Matzigkeit, 1996 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +m4_define([_LT_COPYING], [dnl +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +# 2006, 2007, 2008, 2009, 2010 Free Software Foundation, +# Inc. +# Written by Gordon Matzigkeit, 1996 +# +# This file is part of GNU Libtool. +# +# GNU Libtool is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version. +# +# As a special exception to the GNU General Public License, +# if you distribute this file as part of a program or library that +# is built using GNU Libtool, you may include this file under the +# same distribution terms that you use for the rest of that program. +# +# GNU Libtool is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNU Libtool; see the file COPYING. If not, a copy +# can be downloaded from http://www.gnu.org/licenses/gpl.html, or +# obtained by writing to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +]) + +# serial 57 LT_INIT + + +# LT_PREREQ(VERSION) +# ------------------ +# Complain and exit if this libtool version is less that VERSION. +m4_defun([LT_PREREQ], +[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, + [m4_default([$3], + [m4_fatal([Libtool version $1 or higher is required], + 63)])], + [$2])]) + + +# _LT_CHECK_BUILDDIR +# ------------------ +# Complain if the absolute build directory name contains unusual characters +m4_defun([_LT_CHECK_BUILDDIR], +[case `pwd` in + *\ * | *\ *) + AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; +esac +]) + + +# LT_INIT([OPTIONS]) +# ------------------ +AC_DEFUN([LT_INIT], +[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT +AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl +AC_BEFORE([$0], [LT_LANG])dnl +AC_BEFORE([$0], [LT_OUTPUT])dnl +AC_BEFORE([$0], [LTDL_INIT])dnl +m4_require([_LT_CHECK_BUILDDIR])dnl + +dnl Autoconf doesn't catch unexpanded LT_ macros by default: +m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl +m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl +dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 +dnl unless we require an AC_DEFUNed macro: +AC_REQUIRE([LTOPTIONS_VERSION])dnl +AC_REQUIRE([LTSUGAR_VERSION])dnl +AC_REQUIRE([LTVERSION_VERSION])dnl +AC_REQUIRE([LTOBSOLETE_VERSION])dnl +m4_require([_LT_PROG_LTMAIN])dnl + +_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) + +dnl Parse OPTIONS +_LT_SET_OPTIONS([$0], [$1]) + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ltmain" + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' +AC_SUBST(LIBTOOL)dnl + +_LT_SETUP + +# Only expand once: +m4_define([LT_INIT]) +])# LT_INIT + +# Old names: +AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) +AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_PROG_LIBTOOL], []) +dnl AC_DEFUN([AM_PROG_LIBTOOL], []) + + +# _LT_CC_BASENAME(CC) +# ------------------- +# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +m4_defun([_LT_CC_BASENAME], +[for cc_temp in $1""; do + case $cc_temp in + compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; + distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` +]) + + +# _LT_FILEUTILS_DEFAULTS +# ---------------------- +# It is okay to use these file commands and assume they have been set +# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'. +m4_defun([_LT_FILEUTILS_DEFAULTS], +[: ${CP="cp -f"} +: ${MV="mv -f"} +: ${RM="rm -f"} +])# _LT_FILEUTILS_DEFAULTS + + +# _LT_SETUP +# --------- +m4_defun([_LT_SETUP], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl +AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl + +_LT_DECL([], [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 + +case $host_os in +aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES + fi + ;; +esac + +# Global variables: +ofile=libtool +can_build_shared=yes + +# All known linkers require a `.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a + +with_gnu_ld="$lt_cv_prog_gnu_ld" + +old_CC="$CC" +old_CFLAGS="$CFLAGS" + +# Set sane defaults for various variables +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS +test -z "$LD" && LD=ld +test -z "$ac_objext" && ac_objext=o + +_LT_CC_BASENAME([$compiler]) + +# Only perform the check for file, if the check method requires it +test -z "$MAGIC_CMD" && MAGIC_CMD=file +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + _LT_PATH_MAGIC + fi + ;; +esac + +# Use C for the default configuration in the libtool script +LT_SUPPORTED_TAG([CC]) +_LT_LANG_C_CONFIG +_LT_LANG_DEFAULT_CONFIG +_LT_CONFIG_COMMANDS +])# _LT_SETUP + + +# _LT_PREPARE_SED_QUOTE_VARS +# -------------------------- +# Define a few sed substitution that help us do robust quoting. +m4_defun([_LT_PREPARE_SED_QUOTE_VARS], +[# Backslashify metacharacters that are still active within +# double-quoted strings. +sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\([["`\\]]\)/\\\1/g' + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# Sed substitution to delay expansion of an escaped single quote. +delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' + +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' +]) + +# _LT_PROG_LTMAIN +# --------------- +# Note that this code is called both from `configure', and `config.status' +# now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, +# `config.status' has no value for ac_aux_dir unless we are using Automake, +# so we pass a copy along to make sure it has a sensible value anyway. +m4_defun([_LT_PROG_LTMAIN], +[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl +_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) +ltmain="$ac_aux_dir/ltmain.sh" +])# _LT_PROG_LTMAIN + + +## ------------------------------------- ## +## Accumulate code for creating libtool. ## +## ------------------------------------- ## + +# So that we can recreate a full libtool script including additional +# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS +# in macros and then make a single call at the end using the `libtool' +# label. + + +# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) +# ---------------------------------------- +# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. +m4_define([_LT_CONFIG_LIBTOOL_INIT], +[m4_ifval([$1], + [m4_append([_LT_OUTPUT_LIBTOOL_INIT], + [$1 +])])]) + +# Initialize. +m4_define([_LT_OUTPUT_LIBTOOL_INIT]) + + +# _LT_CONFIG_LIBTOOL([COMMANDS]) +# ------------------------------ +# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. +m4_define([_LT_CONFIG_LIBTOOL], +[m4_ifval([$1], + [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], + [$1 +])])]) + +# Initialize. +m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) + + +# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) +# ----------------------------------------------------- +m4_defun([_LT_CONFIG_SAVE_COMMANDS], +[_LT_CONFIG_LIBTOOL([$1]) +_LT_CONFIG_LIBTOOL_INIT([$2]) +]) + + +# _LT_FORMAT_COMMENT([COMMENT]) +# ----------------------------- +# Add leading comment marks to the start of each line, and a trailing +# full-stop to the whole comment if one is not present already. +m4_define([_LT_FORMAT_COMMENT], +[m4_ifval([$1], [ +m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], + [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) +)]) + + + +## ------------------------ ## +## FIXME: Eliminate VARNAME ## +## ------------------------ ## + + +# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) +# ------------------------------------------------------------------- +# CONFIGNAME is the name given to the value in the libtool script. +# VARNAME is the (base) name used in the configure script. +# VALUE may be 0, 1 or 2 for a computed quote escaped value based on +# VARNAME. Any other value will be used directly. +m4_define([_LT_DECL], +[lt_if_append_uniq([lt_decl_varnames], [$2], [, ], + [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], + [m4_ifval([$1], [$1], [$2])]) + lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) + m4_ifval([$4], + [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) + lt_dict_add_subkey([lt_decl_dict], [$2], + [tagged?], [m4_ifval([$5], [yes], [no])])]) +]) + + +# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) +# -------------------------------------------------------- +m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) + + +# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) +# ------------------------------------------------ +m4_define([lt_decl_tag_varnames], +[_lt_decl_filter([tagged?], [yes], $@)]) + + +# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) +# --------------------------------------------------------- +m4_define([_lt_decl_filter], +[m4_case([$#], + [0], [m4_fatal([$0: too few arguments: $#])], + [1], [m4_fatal([$0: too few arguments: $#: $1])], + [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], + [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], + [lt_dict_filter([lt_decl_dict], $@)])[]dnl +]) + + +# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) +# -------------------------------------------------- +m4_define([lt_decl_quote_varnames], +[_lt_decl_filter([value], [1], $@)]) + + +# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) +# --------------------------------------------------- +m4_define([lt_decl_dquote_varnames], +[_lt_decl_filter([value], [2], $@)]) + + +# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) +# --------------------------------------------------- +m4_define([lt_decl_varnames_tagged], +[m4_assert([$# <= 2])dnl +_$0(m4_quote(m4_default([$1], [[, ]])), + m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), + m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) +m4_define([_lt_decl_varnames_tagged], +[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) + + +# lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) +# ------------------------------------------------ +m4_define([lt_decl_all_varnames], +[_$0(m4_quote(m4_default([$1], [[, ]])), + m4_if([$2], [], + m4_quote(lt_decl_varnames), + m4_quote(m4_shift($@))))[]dnl +]) +m4_define([_lt_decl_all_varnames], +[lt_join($@, lt_decl_varnames_tagged([$1], + lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl +]) + + +# _LT_CONFIG_STATUS_DECLARE([VARNAME]) +# ------------------------------------ +# Quote a variable value, and forward it to `config.status' so that its +# declaration there will have the same value as in `configure'. VARNAME +# must have a single quote delimited value for this to work. +m4_define([_LT_CONFIG_STATUS_DECLARE], +[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) + + +# _LT_CONFIG_STATUS_DECLARATIONS +# ------------------------------ +# We delimit libtool config variables with single quotes, so when +# we write them to config.status, we have to be sure to quote all +# embedded single quotes properly. In configure, this macro expands +# each variable declared with _LT_DECL (and _LT_TAGDECL) into: +# +# ='`$ECHO "$" | $SED "$delay_single_quote_subst"`' +m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], +[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), + [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) + + +# _LT_LIBTOOL_TAGS +# ---------------- +# Output comment and list of tags supported by the script +m4_defun([_LT_LIBTOOL_TAGS], +[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl +available_tags="_LT_TAGS"dnl +]) + + +# _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) +# ----------------------------------- +# Extract the dictionary values for VARNAME (optionally with TAG) and +# expand to a commented shell variable setting: +# +# # Some comment about what VAR is for. +# visible_name=$lt_internal_name +m4_define([_LT_LIBTOOL_DECLARE], +[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], + [description])))[]dnl +m4_pushdef([_libtool_name], + m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl +m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), + [0], [_libtool_name=[$]$1], + [1], [_libtool_name=$lt_[]$1], + [2], [_libtool_name=$lt_[]$1], + [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl +m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl +]) + + +# _LT_LIBTOOL_CONFIG_VARS +# ----------------------- +# Produce commented declarations of non-tagged libtool config variables +# suitable for insertion in the LIBTOOL CONFIG section of the `libtool' +# script. Tagged libtool config variables (even for the LIBTOOL CONFIG +# section) are produced by _LT_LIBTOOL_TAG_VARS. +m4_defun([_LT_LIBTOOL_CONFIG_VARS], +[m4_foreach([_lt_var], + m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), + [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) + + +# _LT_LIBTOOL_TAG_VARS(TAG) +# ------------------------- +m4_define([_LT_LIBTOOL_TAG_VARS], +[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), + [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) + + +# _LT_TAGVAR(VARNAME, [TAGNAME]) +# ------------------------------ +m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) + + +# _LT_CONFIG_COMMANDS +# ------------------- +# Send accumulated output to $CONFIG_STATUS. Thanks to the lists of +# variables for single and double quote escaping we saved from calls +# to _LT_DECL, we can put quote escaped variables declarations +# into `config.status', and then the shell code to quote escape them in +# for loops in `config.status'. Finally, any additional code accumulated +# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. +m4_defun([_LT_CONFIG_COMMANDS], +[AC_PROVIDE_IFELSE([LT_OUTPUT], + dnl If the libtool generation code has been placed in $CONFIG_LT, + dnl instead of duplicating it all over again into config.status, + dnl then we will have config.status run $CONFIG_LT later, so it + dnl needs to know what name is stored there: + [AC_CONFIG_COMMANDS([libtool], + [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], + dnl If the libtool generation code is destined for config.status, + dnl expand the accumulated commands and init code now: + [AC_CONFIG_COMMANDS([libtool], + [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) +])#_LT_CONFIG_COMMANDS + + +# Initialize. +m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], +[ + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +sed_quote_subst='$sed_quote_subst' +double_quote_subst='$double_quote_subst' +delay_variable_subst='$delay_variable_subst' +_LT_CONFIG_STATUS_DECLARATIONS +LTCC='$LTCC' +LTCFLAGS='$LTCFLAGS' +compiler='$compiler_DEFAULT' + +# A function that is used when there is no print builtin or printf. +func_fallback_echo () +{ + eval 'cat <<_LTECHO_EOF +\$[]1 +_LTECHO_EOF' +} + +# Quote evaled strings. +for var in lt_decl_all_varnames([[ \ +]], lt_decl_quote_varnames); do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[[\\\\\\\`\\"\\\$]]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +# Double-quote double-evaled strings. +for var in lt_decl_all_varnames([[ \ +]], lt_decl_dquote_varnames); do + case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in + *[[\\\\\\\`\\"\\\$]]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +_LT_OUTPUT_LIBTOOL_INIT +]) + +# _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) +# ------------------------------------ +# Generate a child script FILE with all initialization necessary to +# reuse the environment learned by the parent script, and make the +# file executable. If COMMENT is supplied, it is inserted after the +# `#!' sequence but before initialization text begins. After this +# macro, additional text can be appended to FILE to form the body of +# the child script. The macro ends with non-zero status if the +# file could not be fully written (such as if the disk is full). +m4_ifdef([AS_INIT_GENERATED], +[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], +[m4_defun([_LT_GENERATED_FILE_INIT], +[m4_require([AS_PREPARE])]dnl +[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl +[lt_write_fail=0 +cat >$1 <<_ASEOF || lt_write_fail=1 +#! $SHELL +# Generated by $as_me. +$2 +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$1 <<\_ASEOF || lt_write_fail=1 +AS_SHELL_SANITIZE +_AS_PREPARE +exec AS_MESSAGE_FD>&1 +_ASEOF +test $lt_write_fail = 0 && chmod +x $1[]dnl +m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT + +# LT_OUTPUT +# --------- +# This macro allows early generation of the libtool script (before +# AC_OUTPUT is called), incase it is used in configure for compilation +# tests. +AC_DEFUN([LT_OUTPUT], +[: ${CONFIG_LT=./config.lt} +AC_MSG_NOTICE([creating $CONFIG_LT]) +_LT_GENERATED_FILE_INIT(["$CONFIG_LT"], +[# Run this file to recreate a libtool stub with the current configuration.]) + +cat >>"$CONFIG_LT" <<\_LTEOF +lt_cl_silent=false +exec AS_MESSAGE_LOG_FD>>config.log +{ + echo + AS_BOX([Running $as_me.]) +} >&AS_MESSAGE_LOG_FD + +lt_cl_help="\ +\`$as_me' creates a local libtool stub from the current configuration, +for use in further configure time tests before the real libtool is +generated. + +Usage: $[0] [[OPTIONS]] + + -h, --help print this help, then exit + -V, --version print version number, then exit + -q, --quiet do not print progress messages + -d, --debug don't remove temporary files + +Report bugs to ." + +lt_cl_version="\ +m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl +m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) +configured by $[0], generated by m4_PACKAGE_STRING. + +Copyright (C) 2010 Free Software Foundation, Inc. +This config.lt script is free software; the Free Software Foundation +gives unlimited permision to copy, distribute and modify it." + +while test $[#] != 0 +do + case $[1] in + --version | --v* | -V ) + echo "$lt_cl_version"; exit 0 ;; + --help | --h* | -h ) + echo "$lt_cl_help"; exit 0 ;; + --debug | --d* | -d ) + debug=: ;; + --quiet | --q* | --silent | --s* | -q ) + lt_cl_silent=: ;; + + -*) AC_MSG_ERROR([unrecognized option: $[1] +Try \`$[0] --help' for more information.]) ;; + + *) AC_MSG_ERROR([unrecognized argument: $[1] +Try \`$[0] --help' for more information.]) ;; + esac + shift +done + +if $lt_cl_silent; then + exec AS_MESSAGE_FD>/dev/null +fi +_LTEOF + +cat >>"$CONFIG_LT" <<_LTEOF +_LT_OUTPUT_LIBTOOL_COMMANDS_INIT +_LTEOF + +cat >>"$CONFIG_LT" <<\_LTEOF +AC_MSG_NOTICE([creating $ofile]) +_LT_OUTPUT_LIBTOOL_COMMANDS +AS_EXIT(0) +_LTEOF +chmod +x "$CONFIG_LT" + +# configure is writing to config.log, but config.lt does its own redirection, +# appending to config.log, which fails on DOS, as config.log is still kept +# open by configure. Here we exec the FD to /dev/null, effectively closing +# config.log, so it can be properly (re)opened and appended to by config.lt. +lt_cl_success=: +test "$silent" = yes && + lt_config_lt_args="$lt_config_lt_args --quiet" +exec AS_MESSAGE_LOG_FD>/dev/null +$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false +exec AS_MESSAGE_LOG_FD>>config.log +$lt_cl_success || AS_EXIT(1) +])# LT_OUTPUT + + +# _LT_CONFIG(TAG) +# --------------- +# If TAG is the built-in tag, create an initial libtool script with a +# default configuration from the untagged config vars. Otherwise add code +# to config.status for appending the configuration named by TAG from the +# matching tagged config vars. +m4_defun([_LT_CONFIG], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +_LT_CONFIG_SAVE_COMMANDS([ + m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl + m4_if(_LT_TAG, [C], [ + # See if we are running on zsh, and set the options which allow our + # commands through without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + + cfgfile="${ofile}T" + trap "$RM \"$cfgfile\"; exit 1" 1 2 15 + $RM "$cfgfile" + + cat <<_LT_EOF >> "$cfgfile" +#! $SHELL + +# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: +# NOTE: Changes made to this file will be lost: look at ltmain.sh. +# +_LT_COPYING +_LT_LIBTOOL_TAGS + +# ### BEGIN LIBTOOL CONFIG +_LT_LIBTOOL_CONFIG_VARS +_LT_LIBTOOL_TAG_VARS +# ### END LIBTOOL CONFIG + +_LT_EOF + + case $host_os in + aix3*) + cat <<\_LT_EOF >> "$cfgfile" +# AIX sometimes has problems with the GCC collect2 program. For some +# reason, if we set the COLLECT_NAMES environment variable, the problems +# vanish in a puff of smoke. +if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES +fi +_LT_EOF + ;; + esac + + _LT_PROG_LTMAIN + + # We use sed instead of cat because bash on DJGPP gets confused if + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? + sed '/^# 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)]) +AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_CXX], []) +dnl AC_DEFUN([AC_LIBTOOL_F77], []) +dnl AC_DEFUN([AC_LIBTOOL_FC], []) +dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) +dnl AC_DEFUN([AC_LIBTOOL_RC], []) + + +# _LT_TAG_COMPILER +# ---------------- +m4_defun([_LT_TAG_COMPILER], +[AC_REQUIRE([AC_PROG_CC])dnl + +_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl +_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl +_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl +_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC +])# _LT_TAG_COMPILER + + +# _LT_COMPILER_BOILERPLATE +# ------------------------ +# Check for compiler boilerplate output or warnings with +# the simple compiler test code. +m4_defun([_LT_COMPILER_BOILERPLATE], +[m4_require([_LT_DECL_SED])dnl +ac_outfile=conftest.$ac_objext +echo "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$RM conftest* +])# _LT_COMPILER_BOILERPLATE + + +# _LT_LINKER_BOILERPLATE +# ---------------------- +# Check for linker boilerplate output or warnings with +# the simple link test code. +m4_defun([_LT_LINKER_BOILERPLATE], +[m4_require([_LT_DECL_SED])dnl +ac_outfile=conftest.$ac_objext +echo "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$RM -r conftest* +])# _LT_LINKER_BOILERPLATE + +# _LT_REQUIRED_DARWIN_CHECKS +# ------------------------- +m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ + case $host_os in + rhapsody* | darwin*) + AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) + AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) + AC_CHECK_TOOL([LIPO], [lipo], [:]) + AC_CHECK_TOOL([OTOOL], [otool], [:]) + AC_CHECK_TOOL([OTOOL64], [otool64], [:]) + _LT_DECL([], [DSYMUTIL], [1], + [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) + _LT_DECL([], [NMEDIT], [1], + [Tool to change global to local symbols on Mac OS X]) + _LT_DECL([], [LIPO], [1], + [Tool to manipulate fat objects and archives on Mac OS X]) + _LT_DECL([], [OTOOL], [1], + [ldd/readelf like tool for Mach-O binaries on Mac OS X]) + _LT_DECL([], [OTOOL64], [1], + [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) + + AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], + [lt_cv_apple_cc_single_mod=no + if test -z "${LT_MULTI_MODULE}"; then + # By default we will add the -single_module flag. You can override + # by either setting the environment variable LT_MULTI_MODULE + # non-empty at configure time, or by adding -multi_module to the + # link flags. + rm -rf libconftest.dylib* + echo "int foo(void){return 1;}" > conftest.c + echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ +-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD + $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ + -dynamiclib -Wl,-single_module conftest.c 2>conftest.err + _lt_result=$? + if 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" + ]) + AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], + [lt_cv_ld_force_load=no + cat > conftest.c << _LT_EOF +int forced_loaded() { return 2;} +_LT_EOF + echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD + $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD + echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD + $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD + echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD + $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD + cat > conftest.c << _LT_EOF +int main() { return 0;} +_LT_EOF + echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD + $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err + _lt_result=$? + if test -f conftest && test ! -s conftest.err && test $_lt_result = 0 && $GREP forced_load conftest 2>&1 >/dev/null; then + lt_cv_ld_force_load=yes + else + cat conftest.err >&AS_MESSAGE_LOG_FD + fi + rm -f conftest.err libconftest.a conftest conftest.c + rm -rf conftest.dSYM + ]) + case $host_os in + rhapsody* | darwin1.[[012]]) + _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; + darwin1.*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + darwin*) # darwin 5.x on + # if running on 10.5 or later, the deployment target defaults + # to the OS version, if on x86, and 10.4, the deployment + # target defaults to 10.4. Don't you love it? + case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in + 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + 10.[[012]]*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + 10.*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + esac + ;; + esac + if test "$lt_cv_apple_cc_single_mod" = "yes"; then + _lt_dar_single_mod='$single_module' + fi + if test "$lt_cv_ld_exported_symbols_list" = "yes"; then + _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' + else + _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then + _lt_dsymutil='~$DSYMUTIL $lib || :' + else + _lt_dsymutil= + fi + ;; + esac +]) + + +# _LT_DARWIN_LINKER_FEATURES +# -------------------------- +# Checks for linker and compiler features on darwin +m4_defun([_LT_DARWIN_LINKER_FEATURES], +[ + m4_require([_LT_REQUIRED_DARWIN_CHECKS]) + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_automatic, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + if test "$lt_cv_ld_force_load" = "yes"; then + _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' + else + _LT_TAGVAR(whole_archive_flag_spec, $1)='' + fi + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" + case $cc_basename in + ifort*) _lt_dar_can_shared=yes ;; + *) _lt_dar_can_shared=$GCC ;; + esac + if test "$_lt_dar_can_shared" = "yes"; then + output_verbose_link_cmd=func_echo_all + _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" + _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" + _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" + _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" + m4_if([$1], [CXX], +[ if test "$lt_cv_apple_cc_single_mod" != "yes"; then + _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" + _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" + fi +],[]) + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi +]) + +# _LT_SYS_MODULE_PATH_AIX +# ----------------------- +# 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], +[m4_divert_text([M4SH-INIT], [$1 +])])# _LT_SHELL_INIT + + + +# _LT_PROG_ECHO_BACKSLASH +# ----------------------- +# Find how we can fake an echo command that does not interpret backslash. +# In particular, with Autoconf 2.60 or later we add some code to the start +# of the generated configure script which will find a shell with a builtin +# printf (which we can use as an echo command). +m4_defun([_LT_PROG_ECHO_BACKSLASH], +[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO +ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + +AC_MSG_CHECKING([how to print strings]) +# Test print first, because it will be a builtin if present. +if test "X`print -r -- -n 2>/dev/null`" = X-n && \ + test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='print -r --' +elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then + ECHO='printf %s\n' +else + # Use this function as a fallback that always works. + func_fallback_echo () + { + eval 'cat <<_LTECHO_EOF +$[]1 +_LTECHO_EOF' + } + ECHO='func_fallback_echo' +fi + +# func_echo_all arg... +# Invoke $ECHO with all args, space-separated. +func_echo_all () +{ + $ECHO "$*" +} + +case "$ECHO" in + printf*) AC_MSG_RESULT([printf]) ;; + print*) AC_MSG_RESULT([print -r]) ;; + *) AC_MSG_RESULT([cat]) ;; +esac + +m4_ifdef([_AS_DETECT_SUGGESTED], +[_AS_DETECT_SUGGESTED([ + test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( + ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' + ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO + ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO + PATH=/empty FPATH=/empty; export PATH FPATH + test "X`printf %s $ECHO`" = "X$ECHO" \ + || test "X`print -r -- $ECHO`" = "X$ECHO" )])]) + +_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) +_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) +])# _LT_PROG_ECHO_BACKSLASH + + +# _LT_ENABLE_LOCK +# --------------- +m4_defun([_LT_ENABLE_LOCK], +[AC_ARG_ENABLE([libtool-lock], + [AS_HELP_STRING([--disable-libtool-lock], + [avoid locking (might break parallel builds)])]) +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case $host in +ia64-*-hpux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.$ac_objext` in + *ELF-32*) + HPUX_IA64_MODE="32" + ;; + *ELF-64*) + HPUX_IA64_MODE="64" + ;; + esac + fi + rm -rf conftest* + ;; +*-*-irix6*) + # Find out which ABI we are using. + echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + if test "$lt_cv_prog_gnu_ld" = yes; then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" + ;; + *N32*) + LD="${LD-ld} -melf32bmipn32" + ;; + *64-bit*) + LD="${LD-ld} -melf64bmip" + ;; + esac + else + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + fi + rm -rf conftest* + ;; + +x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ +s390*-*linux*|s390*-*tpf*|sparc*-*linux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.o` in + *32-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_i386_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_i386" + ;; + ppc64-*linux*|powerpc64-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) + LD="${LD-ld} -m elf_s390" + ;; + sparc64-*linux*) + LD="${LD-ld} -m elf32_sparc" + ;; + esac + ;; + *64-bit*) + case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_x86_64_fbsd" + ;; + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + ppc*-*linux*|powerpc*-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*|s390*-*tpf*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + +*-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -belf" + AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, + [AC_LANG_PUSH(C) + AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) + AC_LANG_POP]) + if test x"$lt_cv_cc_needs_belf" != x"yes"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS="$SAVE_CFLAGS" + fi + ;; +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 + +case $host_os in + darwin*) + lock_old_archive_extraction=yes ;; + *) + lock_old_archive_extraction=no ;; +esac +_LT_DECL([], [old_postinstall_cmds], [2]) +_LT_DECL([], [old_postuninstall_cmds], [2]) +_LT_TAGDECL([], [old_archive_cmds], [2], + [Commands used to build an old-style archive]) +_LT_DECL([], [lock_old_archive_extraction], [0], + [Whether to use a lock for old archive extraction]) +])# _LT_CMD_OLD_ARCHIVE + + +# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) +# ---------------------------------------------------------------- +# Check whether the given compiler option works +AC_DEFUN([_LT_COMPILER_OPTION], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_SED])dnl +AC_CACHE_CHECK([$1], [$2], + [$2=no + m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$3" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&AS_MESSAGE_LOG_FD + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + $2=yes + fi + fi + $RM conftest* +]) + +if test x"[$]$2" = xyes; then + m4_if([$5], , :, [$5]) +else + m4_if([$6], , :, [$6]) +fi +])# _LT_COMPILER_OPTION + +# Old name: +AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) + + +# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +# [ACTION-SUCCESS], [ACTION-FAILURE]) +# ---------------------------------------------------- +# Check whether the given linker option works +AC_DEFUN([_LT_LINKER_OPTION], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_SED])dnl +AC_CACHE_CHECK([$1], [$2], + [$2=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $3" + echo "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&AS_MESSAGE_LOG_FD + $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + $2=yes + fi + else + $2=yes + fi + fi + $RM -r conftest* + LDFLAGS="$save_LDFLAGS" +]) + +if test x"[$]$2" = xyes; then + m4_if([$4], , :, [$4]) +else + m4_if([$5], , :, [$5]) +fi +])# _LT_LINKER_OPTION + +# Old name: +AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) + + +# LT_CMD_MAX_LEN +#--------------- +AC_DEFUN([LT_CMD_MAX_LEN], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +# find the maximum length of command line arguments +AC_MSG_CHECKING([the maximum length of command line arguments]) +AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl + i=0 + teststring="ABCD" + + case $build_os in + msdosdjgpp*) + # On DJGPP, this test can blow up pretty badly due to problems in libc + # (any single argument exceeding 2000 bytes causes a buffer overrun + # during glob expansion). Even if it were fixed, the result of this + # check would be larger than it should be. + lt_cv_sys_max_cmd_len=12288; # 12K is about right + ;; + + gnu*) + # Under GNU Hurd, this test is not required because there is + # no limit to the length of command line arguments. + # Libtool will interpret -1 as no limit whatsoever + lt_cv_sys_max_cmd_len=-1; + ;; + + cygwin* | mingw* | cegcc*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, + # you end up with a "frozen" computer, even though with patience + # the test eventually succeeds (with a max line length of 256k). + # Instead, let's just punt: use the minimum linelength reported by + # all of the supported platforms: 8192 (on NT/2K/XP). + lt_cv_sys_max_cmd_len=8192; + ;; + + mint*) + # On MiNT this can take a long time and run out of memory. + lt_cv_sys_max_cmd_len=8192; + ;; + + amigaos*) + # On AmigaOS with pdksh, this test takes hours, literally. + # So we just punt and use a minimum line length of 8192. + lt_cv_sys_max_cmd_len=8192; + ;; + + netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) + # This has been around since 386BSD, at least. Likely further. + if test -x /sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` + elif test -x /usr/sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` + else + lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs + fi + # And add a safety zone + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + ;; + + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + 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"`func_fallback_echo "$teststring$teststring" 2>/dev/null` \ + = "X$teststring$teststring"; } >/dev/null 2>&1 && + test $i != 17 # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + # Only check the string length outside the loop. + lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` + teststring= + # Add a significant safety factor because C++ compilers can tack on + # massive amounts of additional arguments before passing them to the + # linker. It appears as though 1/2 is a usable value. + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` + fi + ;; + esac +]) +if test -n $lt_cv_sys_max_cmd_len ; then + AC_MSG_RESULT($lt_cv_sys_max_cmd_len) +else + AC_MSG_RESULT(none) +fi +max_cmd_len=$lt_cv_sys_max_cmd_len +_LT_DECL([], [max_cmd_len], [0], + [What is the maximum length of a command?]) +])# LT_CMD_MAX_LEN + +# Old name: +AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) + + +# _LT_HEADER_DLFCN +# ---------------- +m4_defun([_LT_HEADER_DLFCN], +[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl +])# _LT_HEADER_DLFCN + + +# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, +# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) +# ---------------------------------------------------------------- +m4_defun([_LT_TRY_DLOPEN_SELF], +[m4_require([_LT_HEADER_DLFCN])dnl +if test "$cross_compiling" = yes; then : + [$4] +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +[#line $LINENO "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include +#endif + +#include + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +/* When -fvisbility=hidden is used, assume the code has been annotated + correspondingly for the symbols needed. */ +#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) +void fnord () __attribute__((visibility("default"))); +#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; + else puts (dlerror ()); + } + /* dlclose (self); */ + } + else + puts (dlerror ()); + + return status; +}] +_LT_EOF + if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) $1 ;; + x$lt_dlneed_uscore) $2 ;; + x$lt_dlunknown|x*) $3 ;; + esac + else : + # compilation failed + $3 + fi +fi +rm -fr conftest* +])# _LT_TRY_DLOPEN_SELF + + +# LT_SYS_DLOPEN_SELF +# ------------------ +AC_DEFUN([LT_SYS_DLOPEN_SELF], +[m4_require([_LT_HEADER_DLFCN])dnl +if test "x$enable_dlopen" != xyes; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else + lt_cv_dlopen=no + lt_cv_dlopen_libs= + + case $host_os in + beos*) + lt_cv_dlopen="load_add_on" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + + mingw* | pw32* | cegcc*) + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= + ;; + + cygwin*) + lt_cv_dlopen="dlopen" + lt_cv_dlopen_libs= + ;; + + darwin*) + # if libdl is installed we need to link against it + AC_CHECK_LIB([dl], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ + lt_cv_dlopen="dyld" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ]) + ;; + + *) + AC_CHECK_FUNC([shl_load], + [lt_cv_dlopen="shl_load"], + [AC_CHECK_LIB([dld], [shl_load], + [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"], + [AC_CHECK_FUNC([dlopen], + [lt_cv_dlopen="dlopen"], + [AC_CHECK_LIB([dl], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], + [AC_CHECK_LIB([svld], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], + [AC_CHECK_LIB([dld], [dld_link], + [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"]) + ]) + ]) + ]) + ]) + ]) + ;; + esac + + if test "x$lt_cv_dlopen" != xno; then + enable_dlopen=yes + else + enable_dlopen=no + fi + + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS="$CPPFLAGS" + test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + + save_LDFLAGS="$LDFLAGS" + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + + save_LIBS="$LIBS" + LIBS="$lt_cv_dlopen_libs $LIBS" + + AC_CACHE_CHECK([whether a program can dlopen itself], + lt_cv_dlopen_self, [dnl + _LT_TRY_DLOPEN_SELF( + lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, + lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) + ]) + + if test "x$lt_cv_dlopen_self" = xyes; then + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + AC_CACHE_CHECK([whether a statically linked program can dlopen itself], + lt_cv_dlopen_self_static, [dnl + _LT_TRY_DLOPEN_SELF( + lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, + lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) + ]) + fi + + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + LIBS="$save_LIBS" + ;; + esac + + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac + + case $lt_cv_dlopen_self_static in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac +fi +_LT_DECL([dlopen_support], [enable_dlopen], [0], + [Whether dlopen is supported]) +_LT_DECL([dlopen_self], [enable_dlopen_self], [0], + [Whether dlopen of programs is supported]) +_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], + [Whether dlopen of statically linked programs is supported]) +])# LT_SYS_DLOPEN_SELF + +# Old name: +AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) + + +# _LT_COMPILER_C_O([TAGNAME]) +# --------------------------- +# Check to see if options -c and -o are simultaneously supported by compiler. +# This macro does not hard code the compiler like AC_PROG_CC_C_O. +m4_defun([_LT_COMPILER_C_O], +[m4_require([_LT_DECL_SED])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_TAG_COMPILER])dnl +AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], + [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], + [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no + $RM -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&AS_MESSAGE_LOG_FD + echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes + fi + fi + chmod u+w . 2>&AS_MESSAGE_LOG_FD + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* +]) +_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], + [Does compiler simultaneously support -c and -o options?]) +])# _LT_COMPILER_C_O + + +# _LT_COMPILER_FILE_LOCKS([TAGNAME]) +# ---------------------------------- +# Check to see if we can do hard links to lock some files if needed +m4_defun([_LT_COMPILER_FILE_LOCKS], +[m4_require([_LT_ENABLE_LOCK])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +_LT_COMPILER_C_O([$1]) + +hard_links="nottested" +if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + AC_MSG_CHECKING([if we can lock with hard links]) + hard_links=yes + $RM conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + AC_MSG_RESULT([$hard_links]) + if test "$hard_links" = no; then + AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) + need_locks=warn + fi +else + need_locks=no +fi +_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) +])# _LT_COMPILER_FILE_LOCKS + + +# _LT_CHECK_OBJDIR +# ---------------- +m4_defun([_LT_CHECK_OBJDIR], +[AC_CACHE_CHECK([for objdir], [lt_cv_objdir], +[rm -f .libs 2>/dev/null +mkdir .libs 2>/dev/null +if test -d .libs; then + lt_cv_objdir=.libs +else + # MS-DOS does not allow filenames that begin with a dot. + lt_cv_objdir=_libs +fi +rmdir .libs 2>/dev/null]) +objdir=$lt_cv_objdir +_LT_DECL([], [objdir], [0], + [The name of the directory that contains temporary libtool files])dnl +m4_pattern_allow([LT_OBJDIR])dnl +AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/", + [Define to the sub-directory in which libtool stores uninstalled libraries.]) +])# _LT_CHECK_OBJDIR + + +# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) +# -------------------------------------- +# Check hardcoding attributes. +m4_defun([_LT_LINKER_HARDCODE_LIBPATH], +[AC_MSG_CHECKING([how to hardcode library paths into programs]) +_LT_TAGVAR(hardcode_action, $1)= +if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || + test -n "$_LT_TAGVAR(runpath_var, $1)" || + test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then + + # We can hardcode non-existent directories. + if test "$_LT_TAGVAR(hardcode_direct, $1)" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no && + test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then + # Linking always hardcodes the temporary library directory. + _LT_TAGVAR(hardcode_action, $1)=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + _LT_TAGVAR(hardcode_action, $1)=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + _LT_TAGVAR(hardcode_action, $1)=unsupported +fi +AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) + +if test "$_LT_TAGVAR(hardcode_action, $1)" = relink || + test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi +_LT_TAGDECL([], [hardcode_action], [0], + [How to hardcode a shared library path into an executable]) +])# _LT_LINKER_HARDCODE_LIBPATH + + +# _LT_CMD_STRIPLIB +# ---------------- +m4_defun([_LT_CMD_STRIPLIB], +[m4_require([_LT_DECL_EGREP]) +striplib= +old_striplib= +AC_MSG_CHECKING([whether stripping libraries is possible]) +if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + AC_MSG_RESULT([yes]) +else +# FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP" ; then + striplib="$STRIP -x" + old_striplib="$STRIP -S" + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + fi + ;; + *) + AC_MSG_RESULT([no]) + ;; + esac +fi +_LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) +_LT_DECL([], [striplib], [1]) +])# _LT_CMD_STRIPLIB + + +# _LT_SYS_DYNAMIC_LINKER([TAG]) +# ----------------------------- +# PORTME Fill in your ld.so characteristics +m4_defun([_LT_SYS_DYNAMIC_LINKER], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_OBJDUMP])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_CHECK_SHELL_FEATURES])dnl +AC_MSG_CHECKING([dynamic linker characteristics]) +m4_if([$1], + [], [ +if test "$GCC" = yes; then + case $host_os in + darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; + *) lt_awk_arg="/^libraries:/" ;; + esac + case $host_os in + mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;; + *) lt_sed_strip_eq="s,=/,/,g" ;; + esac + lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` + case $lt_search_path_spec in + *\;*) + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` + ;; + *) + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` + ;; + esac + # Ok, now we have the path, separated by spaces, we can step through it + # and add multilib dir if necessary. + lt_tmp_lt_search_path_spec= + lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` + for lt_sys_path in $lt_search_path_spec; do + if test -d "$lt_sys_path/$lt_multi_os_dir"; then + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" + else + test -d "$lt_sys_path" && \ + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" + fi + done + lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' +BEGIN {RS=" "; FS="/|\n";} { + lt_foo=""; + lt_count=0; + for (lt_i = NF; lt_i > 0; lt_i--) { + if ($lt_i != "" && $lt_i != ".") { + if ($lt_i == "..") { + lt_count++; + } else { + if (lt_count == 0) { + lt_foo="/" $lt_i lt_foo; + } else { + lt_count--; + } + } + } + } + if (lt_foo != "") { lt_freq[[lt_foo]]++; } + if (lt_freq[[lt_foo]] == 1) { print lt_foo; } +}'` + # AWK program above erroneously prepends '/' to C:/dos/paths + # for these hosts. + case $host_os in + mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ + $SED 's,/\([[A-Za-z]]:\),\1,g'` ;; + esac + sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi]) +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux + 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.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + case $host_cpu in + powerpc) + # Since July 2007 AmigaOS4 officially supports .so libraries. + # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + ;; + m68k) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + esac + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[[45]]*) + version_type=linux + 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}' +m4_if([$1], [],[ + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) + ;; + mingw* | cegcc*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + ;; + esac + ;; + + *) + 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 + ;; + +haiku*) + version_type=linux + need_lib_prefix=no + need_version=no + dynamic_linker="$host_os runtime_loader" + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LIBRARY_PATH + shlibpath_overrides_runpath=yes + sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555, ... + postinstall_cmds='chmod 555 $lib' + # or fails outright, so override atomically: + install_override_mode=555 + ;; + +interix[[3-9]]*) + version_type=linux + 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 | kopensolaris*-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 + AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath], + [lt_cv_shlibpath_overrides_runpath=no + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ + LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" + AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], + [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], + [lt_cv_shlibpath_overrides_runpath=yes])]) + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + ]) + shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath + + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # Add ABI-specific directories to the system library path. + sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib" + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" + + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux + 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([], [install_override_mode], [1], + [Permission mode override for installation of shared libraries]) +_LT_DECL([], [postinstall_cmds], [2], + [Command to use after installation of a shared archive]) +_LT_DECL([], [postuninstall_cmds], [2], + [Command to use after uninstallation of a shared archive]) +_LT_DECL([], [finish_cmds], [2], + [Commands used to finish a libtool library installation in a directory]) +_LT_DECL([], [finish_eval], [1], + [[As "finish_cmds", except a single script fragment to be evaled but + not shown]]) +_LT_DECL([], [hardcode_into_libs], [0], + [Whether we should hardcode library paths into libraries]) +_LT_DECL([], [sys_lib_search_path_spec], [2], + [Compile-time system search path for libraries]) +_LT_DECL([], [sys_lib_dlsearch_path_spec], [2], + [Run-time system search path for libraries]) +])# _LT_SYS_DYNAMIC_LINKER + + +# _LT_PATH_TOOL_PREFIX(TOOL) +# -------------------------- +# find a file program which can recognize shared library +AC_DEFUN([_LT_PATH_TOOL_PREFIX], +[m4_require([_LT_DECL_EGREP])dnl +AC_MSG_CHECKING([for $1]) +AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, +[case $MAGIC_CMD in +[[\\/*] | ?:[\\/]*]) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR +dnl $ac_dummy forces splitting on constant user-supplied paths. +dnl POSIX.2 word splitting is done only on the output of word expansions, +dnl not every word. This closes a longstanding sh security hole. + ac_dummy="m4_if([$2], , $PATH, [$2])" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$1; then + lt_cv_path_MAGIC_CMD="$ac_dir/$1" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <<_LT_EOF 1>&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +_LT_EOF + fi ;; + esac + fi + break + fi + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac]) +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + AC_MSG_RESULT($MAGIC_CMD) +else + AC_MSG_RESULT(no) +fi +_LT_DECL([], [MAGIC_CMD], [0], + [Used to examine libraries when file_magic_cmd begins with "file"])dnl +])# _LT_PATH_TOOL_PREFIX + +# Old name: +AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) + + +# _LT_PATH_MAGIC +# -------------- +# find a file program which can recognize a shared library +m4_defun([_LT_PATH_MAGIC], +[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) + else + MAGIC_CMD=: + fi +fi +])# _LT_PATH_MAGIC + + +# LT_PATH_LD +# ---------- +# find the pathname to the GNU or non-GNU linker +AC_DEFUN([LT_PATH_LD], +[AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_PROG_ECHO_BACKSLASH])dnl + +AC_ARG_WITH([gnu-ld], + [AS_HELP_STRING([--with-gnu-ld], + [assume the C compiler uses GNU ld @<:@default=no@:>@])], + [test "$withval" = no || with_gnu_ld=yes], + [with_gnu_ld=no])dnl + +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + AC_MSG_CHECKING([for ld used by $CC]) + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [[\\/]]* | ?:[[\\/]]*) + re_direlt='/[[^/]][[^/]]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` + while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do + ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + AC_MSG_CHECKING([for GNU ld]) +else + AC_MSG_CHECKING([for non-GNU ld]) +fi +AC_CACHE_VAL(lt_cv_path_LD, +[if test -z "$LD"; then + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null 2>&1; then + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + else + # Keep this pattern in sync with the one in func_win32_libid. + lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' + lt_cv_file_magic_cmd='$OBJDUMP -f' + fi + ;; + +cegcc*) + # use the weaker test based on 'objdump'. See mingw*. + lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + ;; + +darwin* | rhapsody*) + lt_cv_deplibs_check_method=pass_all + ;; + +freebsd* | dragonfly*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + case $host_cpu in + i*86 ) + # Not sure whether the presence of OpenBSD here was a mistake. + # Let's accept both of them until this is cleared up. + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; + +gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + +haiku*) + lt_cv_deplibs_check_method=pass_all + ;; + +hpux10.20* | hpux11*) + lt_cv_file_magic_cmd=/usr/bin/file + case $host_cpu in + ia64*) + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' + lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so + ;; + hppa*64*) + [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'] + lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl + ;; + *) + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library' + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + esac + ;; + +interix[[3-9]]*) + # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' + ;; + +irix5* | irix6* | nonstopux*) + case $LD in + *-32|*"-32 ") libmagic=32-bit;; + *-n32|*"-n32 ") libmagic=N32;; + *-64|*"-64 ") libmagic=64-bit;; + *) libmagic=never-match;; + esac + lt_cv_deplibs_check_method=pass_all + ;; + +# This must be Linux ELF. +linux* | k*bsd*-gnu | kopensolaris*-gnu) + lt_cv_deplibs_check_method=pass_all + ;; + +netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' + fi + ;; + +newos6*) + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libnls.so + ;; + +*nto* | *qnx*) + lt_cv_deplibs_check_method=pass_all + ;; + +openbsd*) + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' + fi + ;; + +osf3* | osf4* | osf5*) + lt_cv_deplibs_check_method=pass_all + ;; + +rdos*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv4 | sysv4.3*) + case $host_vendor in + motorola) + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + ncr) + lt_cv_deplibs_check_method=pass_all + ;; + sequent) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' + ;; + sni) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" + lt_cv_file_magic_test_file=/lib/libc.so + ;; + siemens) + lt_cv_deplibs_check_method=pass_all + ;; + pc) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +tpf*) + lt_cv_deplibs_check_method=pass_all + ;; +esac +]) +file_magic_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. + if test -n "$DUMPBIN"; then : + # Let the user override the test. + else + AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) + case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in + *COFF*) + DUMPBIN="$DUMPBIN -symbols" + ;; + *) + DUMPBIN=: + ;; + esac + fi + AC_SUBST([DUMPBIN]) + if test "$DUMPBIN" != ":"; then + NM="$DUMPBIN" + fi +fi +test -z "$NM" && NM=nm +AC_SUBST([NM]) +_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl + +AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], + [lt_cv_nm_interface="BSD nm" + echo "int some_variable = 0;" > conftest.$ac_ext + (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$ac_compile" 2>conftest.err) + cat conftest.err >&AS_MESSAGE_LOG_FD + (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) + (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) + cat conftest.err >&AS_MESSAGE_LOG_FD + (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) + cat conftest.out >&AS_MESSAGE_LOG_FD + if $GREP 'External.*some_variable' conftest.out > /dev/null; then + lt_cv_nm_interface="MS dumpbin" + fi + rm -f conftest*]) +])# LT_PATH_NM + +# Old names: +AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) +AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AM_PROG_NM], []) +dnl AC_DEFUN([AC_PROG_NM], []) + + +# LT_LIB_M +# -------- +# check for math library +AC_DEFUN([LT_LIB_M], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +LIBM= +case $host in +*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) + # These system don't have libm, or don't need it + ;; +*-ncr-sysv4.3*) + AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") + AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") + ;; +*) + AC_CHECK_LIB(m, cos, LIBM="-lm") + ;; +esac +AC_SUBST([LIBM]) +])# LT_LIB_M + +# Old name: +AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_CHECK_LIBM], []) + + +# _LT_COMPILER_NO_RTTI([TAGNAME]) +# ------------------------------- +m4_defun([_LT_COMPILER_NO_RTTI], +[m4_require([_LT_TAG_COMPILER])dnl + +_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= + +if test "$GCC" = yes; then + case $cc_basename in + nvcc*) + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; + *) + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;; + esac + + _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], + lt_cv_prog_compiler_rtti_exceptions, + [-fno-rtti -fno-exceptions], [], + [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) +fi +_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], + [Compiler flag to turn off builtin functions]) +])# _LT_COMPILER_NO_RTTI + + +# _LT_CMD_GLOBAL_SYMBOLS +# ---------------------- +m4_defun([_LT_CMD_GLOBAL_SYMBOLS], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([LT_PATH_NM])dnl +AC_REQUIRE([LT_PATH_LD])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_TAG_COMPILER])dnl + +# Check for command to grab the raw symbol name followed by C symbol from nm. +AC_MSG_CHECKING([command to parse $NM output from $compiler object]) +AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], +[ +# These are sane defaults that work on at least a few old systems. +# [They come from Ultrix. What could be older than Ultrix?!! ;)] + +# Character class describing NM global symbol codes. +symcode='[[BCDEGRST]]' + +# Regexp to match symbols that can be accessed directly from C. +sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' + +# Define system-specific variables. +case $host_os in +aix*) + symcode='[[BCDT]]' + ;; +cygwin* | mingw* | pw32* | cegcc*) + symcode='[[ABCDGISTW]]' + ;; +hpux*) + if test "$host_cpu" = ia64; then + symcode='[[ABCDEGRST]]' + fi + ;; +irix* | nonstopux*) + symcode='[[BCDEGRST]]' + ;; +osf*) + symcode='[[BCDEGQRST]]' + ;; +solaris*) + symcode='[[BDRT]]' + ;; +sco3.2v5*) + symcode='[[DT]]' + ;; +sysv4.2uw2*) + symcode='[[DT]]' + ;; +sysv5* | sco5v6* | unixware* | OpenUNIX*) + symcode='[[ABDT]]' + ;; +sysv4) + symcode='[[DFNSTU]]' + ;; +esac + +# If we're using GNU nm, then use its standard symbol codes. +case `$NM -V 2>&1` in +*GNU* | *'with BFD'*) + symcode='[[ABCDGIRSTW]]' ;; +esac + +# Transform an extracted symbol line into a proper C declaration. +# Some systems (esp. on ia64) link data and code symbols differently, +# so use this general approach. +lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + +# Transform an extracted symbol line into symbol name and symbol address +lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'" +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'" + +# Handle CRLF in mingw tool chain +opt_cr= +case $build_os in +mingw*) + opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp + ;; +esac + +# Try without a prefix underscore, then with it. +for ac_symprfx in "" "_"; do + + # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. + symxfrm="\\1 $ac_symprfx\\2 \\2" + + # Write the raw and C identifiers. + if test "$lt_cv_nm_interface" = "MS dumpbin"; then + # Fake it for dumpbin and say T for any non-static function + # and D for any global variable. + # Also find C++ and __fastcall symbols from MSVC++, + # which start with @ or ?. + lt_cv_sys_global_symbol_pipe="$AWK ['"\ +" {last_section=section; section=\$ 3};"\ +" /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)= + ;; + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + _LT_TAGVAR(lt_prog_compiler_static, $1)= + ;; + interix[[3-9]]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + sysv4*MP*) + if test -d /usr/nec; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic + fi + ;; + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + ;; + *qnx* | *nto*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + else + case $host_os in + aix[[4-9]]*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + else + _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' + fi + ;; + chorus*) + case $cc_basename in + cxch68*) + # Green Hills C++ Compiler + # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" + ;; + esac + ;; + dgux*) + case $cc_basename in + ec++*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + ;; + ghcx*) + # Green Hills C++ Compiler + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + *) + ;; + esac + ;; + freebsd* | dragonfly*) + # FreeBSD uses GNU C++ + ;; + hpux9* | hpux10* | hpux11*) + case $cc_basename in + CC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + if test "$host_cpu" != ia64; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + fi + ;; + aCC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + ;; + esac + ;; + *) + ;; + esac + ;; + interix*) + # This is c89, which is MS Visual C++ (no shared libs) + # Anyone wants to do a port? + ;; + irix5* | irix6* | nonstopux*) + case $cc_basename in + CC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + # CC pic flag -KPIC is the default. + ;; + *) + ;; + esac + ;; + linux* | k*bsd*-gnu | kopensolaris*-gnu) + case $cc_basename in + KCC*) + # KAI C++ Compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + ecpc* ) + # old Intel C++ for x86_64 which still supported -KPIC. + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + icpc* ) + # Intel C++, used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + pgCC* | pgcpp*) + # Portland Group C++ compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + cxx*) + # Compaq C++ + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*) + # IBM XL 8.0, 9.0 on PPC and BlueGene + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; + esac + ;; + esac + ;; + lynxos*) + ;; + m88k*) + ;; + mvs*) + case $cc_basename in + cxx*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' + ;; + *) + ;; + esac + ;; + netbsd*) + ;; + *qnx* | *nto*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' + ;; + RCC*) + # Rational C++ 2.4.1 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + cxx*) + # Digital/Compaq C++ + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + *) + ;; + esac + ;; + psos*) + ;; + solaris*) + case $cc_basename in + CC* | sunCC*) + # Sun C++ 4.2, 5.x and Centerline C++ + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; + gcx*) + # Green Hills C++ Compiler + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + ;; + *) + ;; + esac + ;; + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + lcc*) + # Lucid + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + *) + ;; + esac + ;; + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + case $cc_basename in + CC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + esac + ;; + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + ;; + *) + ;; + esac + ;; + vxworks*) + ;; + *) + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + esac + fi +], +[ + if test "$GCC" = yes; then + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + m68k) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' + ;; + esac + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | cygwin* | pw32* | os2* | cegcc*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + ;; + + haiku*) + # PIC is the default for Haiku. + # The "-static" flag exists, but is broken. + _LT_TAGVAR(lt_prog_compiler_static, $1)= + ;; + + hpux*) + # PIC is the default for 64-bit PA HP-UX, but not for 32-bit + # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag + # sets the default TLS model and affects inlining. + case $host_cpu in + hppa*64*) + # +Z the default + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + ;; + + interix[[3-9]]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + enable_shared=no + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic + fi + ;; + + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + + case $cc_basename in + nvcc*) # Cuda Compiler Driver 2.2 + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Xcompiler -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 | kopensolaris*-gnu) + case $cc_basename in + # old Intel for x86_64 which still supported -KPIC. + ecc*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + # icc used to be incompatible with GCC. + # ICC 10 doesn't accept -KPIC any more. + icc* | ifort*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + # Lahey Fortran 8.1. + lf95*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' + _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' + ;; + pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + ccc*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # All Alpha code is PIC. + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + xl* | bgxl* | bgf* | mpixl*) + # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ F* | *Sun*Fortran*) + # Sun Fortran 8.3 passes all unrecognized flags to the linker + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='' + ;; + *Sun\ 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,' + ;; + esac + ;; + esac + ;; + + newsos6) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + + osf3* | osf4* | osf5*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # All OSF/1 code is PIC. + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + rdos*) + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + solaris*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + case $cc_basename in + f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; + *) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; + esac + ;; + + sunos4*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec ;then + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + unicos*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + + uts4*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + *) + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + esac + fi +]) +case $host_os in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" + ;; +esac +AC_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 + # Also, AIX nm treats weak defined symbols like other global defined + # symbols, whereas GNU nm marks them as "W". + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + else + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + fi + ;; + pw32*) + _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" + ;; + cygwin* | mingw* | cegcc*) + _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 + + # On some targets, GNU ld is compatible enough with the native linker + # that we're better off using the native interface for both. + lt_use_gnu_ld_interface=no + if test "$with_gnu_ld" = yes; then + case $host_os in + aix*) + # The AIX port of GNU ld has always aspired to compatibility + # with the native linker. However, as the warning in the GNU ld + # block says, versions before 2.19.5* couldn't really create working + # shared libraries, regardless of the interface used. + case `$LD -v 2>&1` in + *\ \(GNU\ Binutils\)\ 2.19.5*) ;; + *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;; + *\ \(GNU\ Binutils\)\ [[3-9]]*) ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + ;; + *) + lt_use_gnu_ld_interface=yes + ;; + esac + fi + + if test "$lt_use_gnu_ld_interface" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then + _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + _LT_TAGVAR(whole_archive_flag_spec, $1)= + fi + supports_anon_versioning=no + case `$LD -v 2>&1` in + *GNU\ gold*) supports_anon_versioning=yes ;; + *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + + # See if GNU ld supports shared libraries. + case $host_os in + aix[[3-9]]*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + _LT_TAGVAR(ld_shlibs, $1)=no + cat <<_LT_EOF 1>&2 + +*** Warning: the GNU linker, at least up to release 2.19, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to install binutils +*** 2.20 or above, or modify your PATH so that a non-GNU linker is found. +*** You will then need to restart the configuration process. + +_LT_EOF + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='' + ;; + m68k) + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + ;; + + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=no + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/'\'' | $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 + ;; + + haiku*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + + interix[[3-9]]*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + + gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) + tmp_diet=no + if test "$host_os" = linux-dietlibc; then + case $cc_basename in + diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) + esac + fi + if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ + && test "$tmp_diet" = no + then + tmp_addflag= + tmp_sharedflag='-shared' + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95* | pgfortran*) + # Portland Group f77 and f90 compilers + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + lf95*) # Lahey Fortran 8.1 + _LT_TAGVAR(whole_archive_flag_spec, $1)= + tmp_sharedflag='--shared' ;; + xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) + tmp_sharedflag='-qmkshrobj' + tmp_addflag= ;; + nvcc*) # Cuda Compiler Driver 2.2 + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(compiler_needs_object, $1)=yes + ;; + esac + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) # Sun C 5.9 + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(compiler_needs_object, $1)=yes + tmp_sharedflag='-G' ;; + *Sun\ F*) # Sun Fortran 8.3 + tmp_sharedflag='-G' ;; + esac + _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + + if test "x$supports_anon_versioning" = xyes; then + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + + case $cc_basename in + xlf* | bgf* | bgxlf* | mpixlf*) + # IBM XL Fortran 10.1 on PPC cannot create shared libs itself + _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' + _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' + if test "x$supports_anon_versioning" = xyes; then + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + fi + ;; + esac + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $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 + # Also, AIX nm treats weak defined symbols like other global + # defined symbols, whereas GNU nm marks them as "W". + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + else + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + _LT_TAGVAR(archive_cmds, $1)='' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' + + if test "$GCC" = yes; then + case $host_os in aix4.[[012]]|aix4.[[012]].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + _LT_TAGVAR(hardcode_direct, $1)=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)= + fi + ;; + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + 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 func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' + _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + _LT_SYS_MODULE_PATH_AIX + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' + if test "$with_gnu_ld" = yes; then + # We only use this code for GNU lds that support --whole-archive. + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)=yes + # This is similar to how AIX traditionally builds its shared libraries. + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + case $host_cpu in + powerpc) + # see comment about AmigaOS4 .so support + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='' + ;; + m68k) + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + ;; + + bsdi[[45]]*) + _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' + # FIXME: Should let the user specify the lib program. + _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' + _LT_TAGVAR(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 && test "$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 && test "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -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' + ;; + *) + m4_if($1, [], [ + # Older versions of the 11.00 compiler do not understand -b yet + # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) + _LT_LINKER_OPTION([if $CC understands -b], + _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], + [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], + [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], + [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) + ;; + esac + fi + if test "$with_gnu_ld" = no; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + case $host_cpu in + hppa*64*|ia64*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + *) + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + # Try to use the -exported_symbol ld option, if it does not + # work, assume that -exports_file does not work either and + # implicitly export all symbols. + 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" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${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" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)='no' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(inherit_rpath, $1)=yes + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + newsos6) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *nto* | *qnx*) + ;; + + openbsd*) + if test -f /usr/libexec/ld.so; then + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + else + case $host_os in + openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + ;; + esac + fi + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + os2*) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + + osf3*) + if test "$GCC" = yes; then + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)='no' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + else + _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ + $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' + + # Both c and cxx compiler support -rpath directly + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)='no' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + + solaris*) + _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' + if test "$GCC" = yes; then + wlarc='${wl}' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${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_CACHE_CHECK([whether -lc should be explicitly linked in], + [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1), + [$RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + if AC_TRY_EVAL(ac_compile) 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) + pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) + _LT_TAGVAR(allow_undefined_flag, $1)= + if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) + then + lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no + else + lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes + fi + _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + ]) + _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1) + ;; + esac + fi + ;; +esac + +_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], + [Whether or not to add -lc for building shared libraries]) +_LT_TAGDECL([allow_libtool_libs_with_static_runtimes], + [enable_shared_with_static_runtimes], [0], + [Whether or not to disallow shared libs when runtime libs are static]) +_LT_TAGDECL([], [export_dynamic_flag_spec], [1], + [Compiler flag to allow reflexive dlopens]) +_LT_TAGDECL([], [whole_archive_flag_spec], [1], + [Compiler flag to generate shared objects directly from archives]) +_LT_TAGDECL([], [compiler_needs_object], [1], + [Whether the compiler copes with passing no objects directly]) +_LT_TAGDECL([], [old_archive_from_new_cmds], [2], + [Create an old-style archive from a shared archive]) +_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], + [Create a temporary old-style archive to link instead of a shared archive]) +_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) +_LT_TAGDECL([], [archive_expsym_cmds], [2]) +_LT_TAGDECL([], [module_cmds], [2], + [Commands used to build a loadable module if different from building + a shared archive.]) +_LT_TAGDECL([], [module_expsym_cmds], [2]) +_LT_TAGDECL([], [with_gnu_ld], [1], + [Whether we are building with GNU ld or not]) +_LT_TAGDECL([], [allow_undefined_flag], [1], + [Flag that allows shared libraries with undefined symbols to be built]) +_LT_TAGDECL([], [no_undefined_flag], [1], + [Flag that enforces no undefined symbols]) +_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], + [Flag to hardcode $libdir into a binary during linking. + This must work even if $libdir does not exist]) +_LT_TAGDECL([], [hardcode_libdir_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_LANG_CXX_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for a C++ compiler are suitably +# defined. These variables are subsequently used by _LT_CONFIG to write +# the compiler configuration to `libtool'. +m4_defun([_LT_LANG_CXX_CONFIG], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_EGREP])dnl +if test -n "$CXX" && ( test "X$CXX" != "Xno" && + ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || + (test "X$CXX" != "Xg++"))) ; then + AC_PROG_CXXCPP +else + _lt_caught_CXX_error=yes +fi + +AC_LANG_PUSH(C++) +_LT_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_TAGVAR(allow_undefined_flag, $1)= +_LT_TAGVAR(always_export_symbols, $1)=no +_LT_TAGVAR(archive_expsym_cmds, $1)= +_LT_TAGVAR(compiler_needs_object, $1)=no +_LT_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_TAGVAR(hardcode_direct, $1)=no +_LT_TAGVAR(hardcode_direct_absolute, $1)=no +_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_TAGVAR(hardcode_libdir_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(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds +_LT_TAGVAR(no_undefined_flag, $1)= +_LT_TAGVAR(whole_archive_flag_spec, $1)= +_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Source file extension for C++ test sources. +ac_ext=cpp + +# Object file extension for compiled C++ test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# No sense in running all these tests if we already determined that +# the CXX compiler isn't working. Some variables (like enable_shared) +# are currently assumed to apply to all compilers on this platform, +# and will be corrupted by setting them based on a non-working compiler. +if test "$_lt_caught_CXX_error" != yes; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="int some_variable = 0;" + + # Code to be used in simple link tests + lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' + + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + _LT_TAG_COMPILER + + # save warnings/boilerplate of simple test code + _LT_COMPILER_BOILERPLATE + _LT_LINKER_BOILERPLATE + + # Allow CC to be a program name with arguments. + lt_save_CC=$CC + lt_save_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 -v "^Configured with:" | $GREP "\-L"' + + else + GXX=no + with_gnu_ld=no + wlarc= + fi + + # PORTME: fill in a description of your system's C++ link characteristics + AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) + _LT_TAGVAR(ld_shlibs, $1)=yes + case $host_os in + aix3*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + aix[[4-9]]*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) + for ld_flag in $LDFLAGS; do + case $ld_flag in + *-brtl*) + aix_use_runtimelinking=yes + break + ;; + esac + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + _LT_TAGVAR(archive_cmds, $1)='' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' + + if test "$GXX" = yes; then + case $host_os in aix4.[[012]]|aix4.[[012]].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && + strings "$collect2name" | $GREP resolve_lib_name >/dev/null + then + # We have reworked collect2 + : + else + # We have old collect2 + _LT_TAGVAR(hardcode_direct, $1)=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)= + fi + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + 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 func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' + _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + _LT_SYS_MODULE_PATH_AIX + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' + if test "$with_gnu_ld" = yes; then + # We only use this code for GNU lds that support --whole-archive. + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + else + # Exported symbols can be pulled into shared objects from archives + _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)=yes + # This is similar to how AIX traditionally builds its shared + # libraries. + _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + chorus*) + case $cc_basename in + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + cygwin* | mingw* | pw32* | cegcc*) + # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=no + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + 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*) + ;; + + haiku*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + + hpux9*) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, + # but as the default + # location of the library. + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + aCC*) + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + ;; + *) + if test "$GXX" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib -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; func_echo_all "$list"' + ;; + *) + if test "$GXX" = yes; then + if test $with_gnu_ld = no; then + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -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" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + + # Archives containing C++ object files must be created using + # "CC -ar", where "CC" is the IRIX C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' + ;; + *) + if test "$GXX" = yes; then + if test "$with_gnu_ld" = no; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' + fi + fi + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + esac + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(inherit_rpath, $1)=yes + ;; + + linux* | k*bsd*-gnu | kopensolaris*-gnu) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' + ;; + icpc* | ecpc* ) + # Intel C++ + with_gnu_ld=yes + # version 8.0 and above of icpc choke on multiply defined symbols + # if we add $predep_objects and $postdep_objects, however 7.1 and + # earlier do not add the objects themselves. + case `$CC -V 2>&1` in + *"Version 7."*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + ;; + *) # Version 8.0 or newer + tmp_idyn= + case $host_cpu in + ia64*) tmp_idyn=' -i_dynamic';; + esac + _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + ;; + esac + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + ;; + pgCC* | pgcpp*) + # Portland Group C++ compiler + case `$CC -V` in + *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) + _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ + compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' + _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ + $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ + $RANLIB $oldlib' + _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ + $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + ;; + *) # Version 6 and above use weak symbols + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + ;; + esac + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + ;; + cxx*) + # Compaq C++ + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' + + runpath_var=LD_RUN_PATH + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' + ;; + xl* | mpixl* | bgxl*) + # IBM XL 8.0 on PPC, with GNU ld + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + if test "x$supports_anon_versioning" = xyes; then + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' + _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(compiler_needs_object, $1)=yes + + # Not sure whether something based on + # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 + # would be better. + output_verbose_link_cmd='func_echo_all' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' + ;; + esac + ;; + esac + ;; + + lynxos*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + m88k*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + mvs*) + case $cc_basename in + cxx*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' + wlarc= + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + fi + # Workaround some broken pre-1.5 toolchains + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' + ;; + + *nto* | *qnx*) + _LT_TAGVAR(ld_shlibs, $1)=yes + ;; + + openbsd2*) + # C++ shared libraries are fairly broken + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + openbsd*) + if test -f /usr/libexec/ld.so; then + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + fi + output_verbose_link_cmd=func_echo_all + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Archives containing C++ object files must be created using + # the KAI C++ compiler. + case $host in + osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; + *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; + esac + ;; + RCC*) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + cxx*) + case $host in + osf3*) + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + ;; + *) + _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ + echo "-hidden">> $lib.exp~ + $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~ + $RM $lib.exp' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + ;; + esac + + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' + ;; + *) + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + case $host in + osf3*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + ;; + esac + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + + else + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + psos*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + lcc*) + # Lucid + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + solaris*) + case $cc_basename in + CC* | sunCC*) + # Sun C++ 4.2, 5.x and Centerline C++ + _LT_TAGVAR(archive_cmds_need_lc,$1)=yes + _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' + _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + # The compiler driver will combine and reorder linker options, + # but understands `-z linker_flag'. + # Supported since Solaris 2.6 (maybe 2.5.1?) + _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' + ;; + esac + _LT_TAGVAR(link_all_deplibs, $1)=yes + + output_verbose_link_cmd='func_echo_all' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' + ;; + gcx*) + # Green Hills C++ Compiler + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + + # The C++ compiler must be used to create the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' + ;; + *) + # GNU C++ compiler with Solaris linker + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' + if $CC --version | $GREP -v '^2\.7' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -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 -v "^Configured with:" | $GREP "\-L"' + else + # g++ 2.7 appears to require `-G' NOT `-shared' on this + # platform. + _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' + fi + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + ;; + esac + fi + ;; + esac + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) + _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ + '"$_LT_TAGVAR(old_archive_cmds, $1)" + _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ + '"$_LT_TAGVAR(reload_cmds, $1)" + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + vxworks*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + + AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) + test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no + + _LT_TAGVAR(GCC, $1)="$GXX" + _LT_TAGVAR(LD, $1)="$LD" + + ## CAVEAT EMPTOR: + ## There is no encapsulation within the following macros, do not change + ## the running order or otherwise move them around unless you know exactly + ## what you are doing... + _LT_SYS_HIDDEN_LIBDEPS($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) + fi # test -n "$compiler" + + CC=$lt_save_CC + 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* | sunCC*) + # The more standards-conforming stlport4 library is + # incompatible with the Cstd library. Avoid specifying + # it if it's in CXXFLAGS. Ignore libCrun as + # -library=stlport4 depends on it. + case " $CXX $CXXFLAGS " in + *" -library=stlport4 "*) + solaris_use_stlport4=yes + ;; + esac + + # Adding this requires a known-good setup of shared libraries for + # Sun compiler versions before 5.6, else PIC objects from an old + # archive will be linked into the output, leading to subtle bugs. + if test "$solaris_use_stlport4" != yes; then + _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' + fi + ;; + esac + ;; +esac +]) + +case " $_LT_TAGVAR(postdeps, $1) " in +*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; +esac + _LT_TAGVAR(compiler_lib_search_dirs, $1)= +if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then + _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` +fi +_LT_TAGDECL([], [compiler_lib_search_dirs], [1], + [The directories searched by this compiler when creating a shared library]) +_LT_TAGDECL([], [predep_objects], [1], + [Dependencies to place before and after the objects being linked to + create a shared library]) +_LT_TAGDECL([], [postdep_objects], [1]) +_LT_TAGDECL([], [predeps], [1]) +_LT_TAGDECL([], [postdeps], [1]) +_LT_TAGDECL([], [compiler_lib_search_path], [1], + [The library search path used internally by the compiler when linking + a shared library]) +])# _LT_SYS_HIDDEN_LIBDEPS + + +# _LT_LANG_F77_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for a Fortran 77 compiler are +# suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_F77_CONFIG], +[AC_LANG_PUSH(Fortran 77) +if test -z "$F77" || test "X$F77" = "Xno"; then + _lt_disable_F77=yes +fi + +_LT_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_TAGVAR(allow_undefined_flag, $1)= +_LT_TAGVAR(always_export_symbols, $1)=no +_LT_TAGVAR(archive_expsym_cmds, $1)= +_LT_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_TAGVAR(hardcode_direct, $1)=no +_LT_TAGVAR(hardcode_direct_absolute, $1)=no +_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_TAGVAR(hardcode_libdir_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(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds +_LT_TAGVAR(no_undefined_flag, $1)= +_LT_TAGVAR(whole_archive_flag_spec, $1)= +_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Source file extension for f77 test sources. +ac_ext=f + +# Object file extension for compiled f77 test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# No sense in running all these tests if we already determined that +# the F77 compiler isn't working. Some variables (like enable_shared) +# are currently assumed to apply to all compilers on this platform, +# and will be corrupted by setting them based on a non-working compiler. +if test "$_lt_disable_F77" != yes; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="\ + subroutine t + return + end +" + + # Code to be used in simple link tests + lt_simple_link_test_code="\ + program t + end +" + + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + _LT_TAG_COMPILER + + # save warnings/boilerplate of simple test code + _LT_COMPILER_BOILERPLATE + _LT_LINKER_BOILERPLATE + + # Allow CC to be a program name with arguments. + lt_save_CC="$CC" + lt_save_GCC=$GCC + 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_LANG_FC_CONFIG([TAG]) +# ------------------------- +# Ensure that the configuration variables for a Fortran compiler are +# suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_FC_CONFIG], +[AC_LANG_PUSH(Fortran) + +if test -z "$FC" || test "X$FC" = "Xno"; then + _lt_disable_FC=yes +fi + +_LT_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_TAGVAR(allow_undefined_flag, $1)= +_LT_TAGVAR(always_export_symbols, $1)=no +_LT_TAGVAR(archive_expsym_cmds, $1)= +_LT_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_TAGVAR(hardcode_direct, $1)=no +_LT_TAGVAR(hardcode_direct_absolute, $1)=no +_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_TAGVAR(hardcode_libdir_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(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds +_LT_TAGVAR(no_undefined_flag, $1)= +_LT_TAGVAR(whole_archive_flag_spec, $1)= +_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Source file extension for fc test sources. +ac_ext=${ac_fc_srcext-f} + +# Object file extension for compiled fc test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# No sense in running all these tests if we already determined that +# the FC compiler isn't working. Some variables (like enable_shared) +# are currently assumed to apply to all compilers on this platform, +# and will be corrupted by setting them based on a non-working compiler. +if test "$_lt_disable_FC" != yes; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="\ + subroutine t + return + end +" + + # Code to be used in simple link tests + lt_simple_link_test_code="\ + program t + end +" + + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + _LT_TAG_COMPILER + + # save warnings/boilerplate of simple test code + _LT_COMPILER_BOILERPLATE + _LT_LINKER_BOILERPLATE + + # Allow CC to be a program name with arguments. + lt_save_CC="$CC" + lt_save_GCC=$GCC + 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 +_LT_TAGVAR(reload_flag, $1)=$reload_flag +_LT_TAGVAR(reload_cmds, $1)=$reload_cmds + +## CAVEAT EMPTOR: +## There is no encapsulation within the following macros, do not change +## the running order or otherwise move them around unless you know exactly +## what you are doing... +if test -n "$compiler"; then + _LT_COMPILER_NO_RTTI($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) +fi + +AC_LANG_RESTORE + +GCC=$lt_save_GCC +CC="$lt_save_CC" +])# _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 "${1}" | $SED "$dirname"` + if test "X$func_dirname_result" = "X${1}"; then + func_dirname_result="${3}" + else + func_dirname_result="$func_dirname_result${2}" + fi +} + +# func_basename file +func_basename () +{ + func_basename_result=`$ECHO "${1}" | $SED "$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 "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; + *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; 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 "${1}" | $SED "$my_sed_long_opt"` + func_opt_split_arg=`$ECHO "${1}" | $SED "$my_sed_long_arg"` +} + +# func_lo2o object +func_lo2o () +{ + func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` +} + +# func_xform libobj-or-source +func_xform () +{ + func_xform_result=`$ECHO "${1}" | $SED '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/antlr/libantlr3c-3.4/m4/ltoptions.m4 b/antlr/libantlr3c-3.4/m4/ltoptions.m4 new file mode 100644 index 0000000..17cfd51 --- /dev/null +++ b/antlr/libantlr3c-3.4/m4/ltoptions.m4 @@ -0,0 +1,369 @@ +# Helper functions for option handling. -*- Autoconf -*- +# +# Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# Written by Gary V. Vaughan, 2004 +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +# serial 7 ltoptions.m4 + +# This is to help aclocal find these macros, as it can't see m4_define. +AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) + + +# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) +# ------------------------------------------ +m4_define([_LT_MANGLE_OPTION], +[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) + + +# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) +# --------------------------------------- +# Set option OPTION-NAME for macro MACRO-NAME, and if there is a +# matching handler defined, dispatch to it. Other OPTION-NAMEs are +# saved as a flag. +m4_define([_LT_SET_OPTION], +[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl +m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), + _LT_MANGLE_DEFUN([$1], [$2]), + [m4_warning([Unknown $1 option `$2'])])[]dnl +]) + + +# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) +# ------------------------------------------------------------ +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +m4_define([_LT_IF_OPTION], +[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) + + +# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) +# ------------------------------------------------------- +# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME +# are set. +m4_define([_LT_UNLESS_OPTIONS], +[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), + [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), + [m4_define([$0_found])])])[]dnl +m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 +])[]dnl +]) + + +# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) +# ---------------------------------------- +# OPTION-LIST is a space-separated list of Libtool options associated +# with MACRO-NAME. If any OPTION has a matching handler declared with +# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about +# the unknown option and exit. +m4_defun([_LT_SET_OPTIONS], +[# Set options +m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), + [_LT_SET_OPTION([$1], _LT_Option)]) + +m4_if([$1],[LT_INIT],[ + dnl + dnl Simply set some default values (i.e off) if boolean options were not + dnl specified: + _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no + ]) + _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no + ]) + dnl + dnl If no reference was made to various pairs of opposing options, then + dnl we run the default mode handler for the pair. For example, if neither + dnl `shared' nor `disable-shared' was passed, we enable building of shared + dnl archives by default: + _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) + _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) + _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) + _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], + [_LT_ENABLE_FAST_INSTALL]) + ]) +])# _LT_SET_OPTIONS + + +## --------------------------------- ## +## Macros to handle LT_INIT options. ## +## --------------------------------- ## + +# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) +# ----------------------------------------- +m4_define([_LT_MANGLE_DEFUN], +[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) + + +# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) +# ----------------------------------------------- +m4_define([LT_OPTION_DEFINE], +[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl +])# LT_OPTION_DEFINE + + +# dlopen +# ------ +LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes +]) + +AU_DEFUN([AC_LIBTOOL_DLOPEN], +[_LT_SET_OPTION([LT_INIT], [dlopen]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you +put the `dlopen' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) + + +# win32-dll +# --------- +# Declare package support for building win32 dll's. +LT_OPTION_DEFINE([LT_INIT], [win32-dll], +[enable_win32_dll=yes + +case $host in +*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) + AC_CHECK_TOOL(AS, as, false) + AC_CHECK_TOOL(DLLTOOL, dlltool, false) + AC_CHECK_TOOL(OBJDUMP, objdump, false) + ;; +esac + +test -z "$AS" && AS=as +_LT_DECL([], [AS], [1], [Assembler program])dnl + +test -z "$DLLTOOL" && DLLTOOL=dlltool +_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl + +test -z "$OBJDUMP" && OBJDUMP=objdump +_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl +])# win32-dll + +AU_DEFUN([AC_LIBTOOL_WIN32_DLL], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +_LT_SET_OPTION([LT_INIT], [win32-dll]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you +put the `win32-dll' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) + + +# _LT_ENABLE_SHARED([DEFAULT]) +# ---------------------------- +# implement the --enable-shared flag, and supports the `shared' and +# `disable-shared' LT_INIT options. +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +m4_define([_LT_ENABLE_SHARED], +[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl +AC_ARG_ENABLE([shared], + [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], + [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_shared=yes ;; + no) enable_shared=no ;; + *) + enable_shared=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) + + _LT_DECL([build_libtool_libs], [enable_shared], [0], + [Whether or not to build shared libraries]) +])# _LT_ENABLE_SHARED + +LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) +LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) + +# Old names: +AC_DEFUN([AC_ENABLE_SHARED], +[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) +]) + +AC_DEFUN([AC_DISABLE_SHARED], +[_LT_SET_OPTION([LT_INIT], [disable-shared]) +]) + +AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) +AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AM_ENABLE_SHARED], []) +dnl AC_DEFUN([AM_DISABLE_SHARED], []) + + + +# _LT_ENABLE_STATIC([DEFAULT]) +# ---------------------------- +# implement the --enable-static flag, and support the `static' and +# `disable-static' LT_INIT options. +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +m4_define([_LT_ENABLE_STATIC], +[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl +AC_ARG_ENABLE([static], + [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], + [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_static=yes ;; + no) enable_static=no ;; + *) + enable_static=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_static=]_LT_ENABLE_STATIC_DEFAULT) + + _LT_DECL([build_old_libs], [enable_static], [0], + [Whether or not to build static libraries]) +])# _LT_ENABLE_STATIC + +LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) +LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) + +# Old names: +AC_DEFUN([AC_ENABLE_STATIC], +[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) +]) + +AC_DEFUN([AC_DISABLE_STATIC], +[_LT_SET_OPTION([LT_INIT], [disable-static]) +]) + +AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) +AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AM_ENABLE_STATIC], []) +dnl AC_DEFUN([AM_DISABLE_STATIC], []) + + + +# _LT_ENABLE_FAST_INSTALL([DEFAULT]) +# ---------------------------------- +# implement the --enable-fast-install flag, and support the `fast-install' +# and `disable-fast-install' LT_INIT options. +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +m4_define([_LT_ENABLE_FAST_INSTALL], +[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl +AC_ARG_ENABLE([fast-install], + [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], + [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_fast_install=yes ;; + no) enable_fast_install=no ;; + *) + enable_fast_install=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) + +_LT_DECL([fast_install], [enable_fast_install], [0], + [Whether or not to optimize for fast installation])dnl +])# _LT_ENABLE_FAST_INSTALL + +LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) +LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) + +# Old names: +AU_DEFUN([AC_ENABLE_FAST_INSTALL], +[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you put +the `fast-install' option into LT_INIT's first parameter.]) +]) + +AU_DEFUN([AC_DISABLE_FAST_INSTALL], +[_LT_SET_OPTION([LT_INIT], [disable-fast-install]) +AC_DIAGNOSE([obsolete], +[$0: Remove this warning and the call to _LT_SET_OPTION when you put +the `disable-fast-install' option into LT_INIT's first parameter.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) +dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) + + +# _LT_WITH_PIC([MODE]) +# -------------------- +# implement the --with-pic flag, and support the `pic-only' and `no-pic' +# LT_INIT options. +# MODE is either `yes' or `no'. If omitted, it defaults to `both'. +m4_define([_LT_WITH_PIC], +[AC_ARG_WITH([pic], + [AS_HELP_STRING([--with-pic], + [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/antlr/libantlr3c-3.4/m4/ltsugar.m4 b/antlr/libantlr3c-3.4/m4/ltsugar.m4 new file mode 100644 index 0000000..9000a05 --- /dev/null +++ b/antlr/libantlr3c-3.4/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/antlr/libantlr3c-3.4/m4/ltversion.m4 b/antlr/libantlr3c-3.4/m4/ltversion.m4 new file mode 100644 index 0000000..93fc771 --- /dev/null +++ b/antlr/libantlr3c-3.4/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 3175 ltversion.m4 +# This file is part of GNU Libtool + +m4_define([LT_PACKAGE_VERSION], [2.2.10]) +m4_define([LT_PACKAGE_REVISION], [1.3175]) + +AC_DEFUN([LTVERSION_VERSION], +[macro_version='2.2.10' +macro_revision='1.3175' +_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) +_LT_DECL(, macro_revision, 0) +]) diff --git a/antlr/libantlr3c-3.4/m4/lt~obsolete.m4 b/antlr/libantlr3c-3.4/m4/lt~obsolete.m4 new file mode 100644 index 0000000..c573da9 --- /dev/null +++ b/antlr/libantlr3c-3.4/m4/lt~obsolete.m4 @@ -0,0 +1,98 @@ +# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- +# +# Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc. +# Written by Scott James Remnant, 2004. +# +# This file is free software; the Free Software Foundation gives +# unlimited permission to copy and/or distribute it, with or without +# modifications, as long as this notice is preserved. + +# serial 5 lt~obsolete.m4 + +# These exist entirely to fool aclocal when bootstrapping libtool. +# +# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN) +# which have later been changed to m4_define as they aren't part of the +# exported API, or moved to Autoconf or Automake where they belong. +# +# The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN +# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us +# using a macro with the same name in our local m4/libtool.m4 it'll +# pull the old libtool.m4 in (it doesn't see our shiny new m4_define +# and doesn't know about Autoconf macros at all.) +# +# So we provide this file, which has a silly filename so it's always +# included after everything else. This provides aclocal with the +# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything +# because those macros already exist, or will be overwritten later. +# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. +# +# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. +# Yes, that means every name once taken will need to remain here until +# we give up compatibility with versions before 1.7, at which point +# we need to keep only those names which we still refer to. + +# This is to help aclocal find these macros, as it can't see m4_define. +AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) + +m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) +m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) +m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) +m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) +m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) +m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) +m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) +m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) +m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) +m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) +m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) +m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) +m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) +m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) +m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) +m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) +m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) +m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) +m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) +m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) +m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) +m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) +m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) +m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) +m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) +m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) +m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) +m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) +m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) +m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) +m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) +m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) +m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) +m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) +m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) +m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) +m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) +m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) +m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) +m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) +m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) +m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) +m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) +m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) +m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) +m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) +m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) +m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) +m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) +m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) +m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) +m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) +m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) +m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) +m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) +m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) +m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) diff --git a/antlr/libantlr3c-3.4/missing b/antlr/libantlr3c-3.4/missing new file mode 100755 index 0000000..28055d2 --- /dev/null +++ b/antlr/libantlr3c-3.4/missing @@ -0,0 +1,376 @@ +#! /bin/sh +# Common stub for a few missing GNU programs while installing. + +scriptversion=2009-04-28.21; # UTC + +# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006, +# 2008, 2009 Free Software Foundation, Inc. +# Originally by Fran,cois Pinard , 1996. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +if test $# -eq 0; then + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 +fi + +run=: +sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' +sed_minuso='s/.* -o \([^ ]*\).*/\1/p' + +# In the cases where this matters, `missing' is being run in the +# srcdir already. +if test -f configure.ac; then + configure_ac=configure.ac +else + configure_ac=configure.in +fi + +msg="missing on your system" + +case $1 in +--run) + # Try to run requested program, and just exit if it succeeds. + run= + shift + "$@" && exit 0 + # Exit code 63 means version mismatch. This often happens + # when the user try to use an ancient version of a tool on + # a file that requires a minimum version. In this case we + # we should proceed has if the program had been absent, or + # if --run hadn't been passed. + if test $? = 63; then + run=: + msg="probably too old" + fi + ;; + + -h|--h|--he|--hel|--help) + echo "\ +$0 [OPTION]... PROGRAM [ARGUMENT]... + +Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an +error status if there is no known handling for PROGRAM. + +Options: + -h, --help display this help and exit + -v, --version output version information and exit + --run try to run the given command, and emulate it if it fails + +Supported PROGRAM values: + aclocal touch file \`aclocal.m4' + autoconf touch file \`configure' + autoheader touch file \`config.h.in' + autom4te touch the output file, or create a stub one + automake touch all \`Makefile.in' files + bison create \`y.tab.[ch]', if possible, from existing .[ch] + flex create \`lex.yy.c', if possible, from existing .c + help2man touch the output file + lex create \`lex.yy.c', if possible, from existing .c + makeinfo touch the output file + 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 ." + 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-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/antlr/libantlr3c-3.4/src/antlr3baserecognizer.c b/antlr/libantlr3c-3.4/src/antlr3baserecognizer.c new file mode 100644 index 0000000..e2eccc6 --- /dev/null +++ b/antlr/libantlr3c-3.4/src/antlr3baserecognizer.c @@ -0,0 +1,2235 @@ +/** \file + * Contains the base functions that all recognizers require. + * Any function can be overridden by a lexer/parser/tree parser or by the + * ANTLR3 programmer. + * + * \addtogroup pANTLR3_BASE_RECOGNIZER + * @{ + */ +#include + +// [The "BSD licence"] +// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC +// http://www.temporal-wave.com +// http://www.linkedin.com/in/jimidle +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. The name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#ifdef ANTLR3_WINDOWS +#pragma warning( disable : 4100 ) +#endif + +/* Interface functions -standard implementations cover parser and treeparser + * almost completely but are overridden by the parser or tree parser as needed. Lexer overrides + * most of these functions. + */ +static void beginResync (pANTLR3_BASE_RECOGNIZER recognizer); +static pANTLR3_BITSET computeErrorRecoverySet (pANTLR3_BASE_RECOGNIZER recognizer); +static void endResync (pANTLR3_BASE_RECOGNIZER recognizer); +static void beginBacktrack (pANTLR3_BASE_RECOGNIZER recognizer, ANTLR3_UINT32 level); +static void endBacktrack (pANTLR3_BASE_RECOGNIZER recognizer, ANTLR3_UINT32 level, ANTLR3_BOOLEAN successful); + +static void * match (pANTLR3_BASE_RECOGNIZER recognizer, ANTLR3_UINT32 ttype, pANTLR3_BITSET_LIST follow); +static void matchAny (pANTLR3_BASE_RECOGNIZER recognizer); +static void mismatch (pANTLR3_BASE_RECOGNIZER recognizer, ANTLR3_UINT32 ttype, pANTLR3_BITSET_LIST follow); +static ANTLR3_BOOLEAN mismatchIsUnwantedToken (pANTLR3_BASE_RECOGNIZER recognizer, pANTLR3_INT_STREAM is, ANTLR3_UINT32 ttype); +static ANTLR3_BOOLEAN mismatchIsMissingToken (pANTLR3_BASE_RECOGNIZER recognizer, pANTLR3_INT_STREAM is, pANTLR3_BITSET_LIST follow); +static void reportError (pANTLR3_BASE_RECOGNIZER recognizer); +static pANTLR3_BITSET computeCSRuleFollow (pANTLR3_BASE_RECOGNIZER recognizer); +static pANTLR3_BITSET combineFollows (pANTLR3_BASE_RECOGNIZER recognizer, ANTLR3_BOOLEAN exact); +static void displayRecognitionError (pANTLR3_BASE_RECOGNIZER recognizer, pANTLR3_UINT8 * tokenNames); +static void recover (pANTLR3_BASE_RECOGNIZER recognizer); +static void * recoverFromMismatchedToken (pANTLR3_BASE_RECOGNIZER recognizer, ANTLR3_UINT32 ttype, pANTLR3_BITSET_LIST follow); +static void * recoverFromMismatchedSet (pANTLR3_BASE_RECOGNIZER recognizer, pANTLR3_BITSET_LIST follow); +static ANTLR3_BOOLEAN recoverFromMismatchedElement(pANTLR3_BASE_RECOGNIZER recognizer, pANTLR3_BITSET_LIST follow); +static void consumeUntil (pANTLR3_BASE_RECOGNIZER recognizer, ANTLR3_UINT32 tokenType); +static void consumeUntilSet (pANTLR3_BASE_RECOGNIZER recognizer, pANTLR3_BITSET set); +static pANTLR3_STACK getRuleInvocationStack (pANTLR3_BASE_RECOGNIZER recognizer); +static pANTLR3_STACK getRuleInvocationStackNamed (pANTLR3_BASE_RECOGNIZER recognizer, pANTLR3_UINT8 name); +static pANTLR3_HASH_TABLE toStrings (pANTLR3_BASE_RECOGNIZER recognizer, pANTLR3_HASH_TABLE); +static ANTLR3_MARKER getRuleMemoization (pANTLR3_BASE_RECOGNIZER recognizer, ANTLR3_INTKEY ruleIndex, ANTLR3_MARKER ruleParseStart); +static ANTLR3_BOOLEAN alreadyParsedRule (pANTLR3_BASE_RECOGNIZER recognizer, ANTLR3_MARKER ruleIndex); +static void memoize (pANTLR3_BASE_RECOGNIZER recognizer, ANTLR3_MARKER ruleIndex, ANTLR3_MARKER ruleParseStart); +static ANTLR3_BOOLEAN synpred (pANTLR3_BASE_RECOGNIZER recognizer, void * ctx, void (*predicate)(void * ctx)); +static void reset (pANTLR3_BASE_RECOGNIZER recognizer); +static void freeBR (pANTLR3_BASE_RECOGNIZER recognizer); +static void * getCurrentInputSymbol (pANTLR3_BASE_RECOGNIZER recognizer, pANTLR3_INT_STREAM istream); +static void * getMissingSymbol (pANTLR3_BASE_RECOGNIZER recognizer, pANTLR3_INT_STREAM istream, pANTLR3_EXCEPTION e, + ANTLR3_UINT32 expectedTokenType, pANTLR3_BITSET_LIST follow); +static ANTLR3_UINT32 getNumberOfSyntaxErrors (pANTLR3_BASE_RECOGNIZER recognizer); + +ANTLR3_API pANTLR3_BASE_RECOGNIZER +antlr3BaseRecognizerNew(ANTLR3_UINT32 type, ANTLR3_UINT32 sizeHint, pANTLR3_RECOGNIZER_SHARED_STATE state) +{ + pANTLR3_BASE_RECOGNIZER recognizer; + + // Allocate memory for the structure + // + recognizer = (pANTLR3_BASE_RECOGNIZER) ANTLR3_MALLOC((size_t)sizeof(ANTLR3_BASE_RECOGNIZER)); + + if (recognizer == NULL) + { + // Allocation failed + // + return NULL; + } + + + // If we have been supplied with a pre-existing recognizer state + // then we just install it, otherwise we must create one from scratch + // + if (state == NULL) + { + recognizer->state = (pANTLR3_RECOGNIZER_SHARED_STATE) ANTLR3_CALLOC(1, (size_t)sizeof(ANTLR3_RECOGNIZER_SHARED_STATE)); + + if (recognizer->state == NULL) + { + ANTLR3_FREE(recognizer); + return NULL; + } + + // Initialize any new recognizer state + // + recognizer->state->errorRecovery = ANTLR3_FALSE; + recognizer->state->lastErrorIndex = -1; + recognizer->state->failed = ANTLR3_FALSE; + recognizer->state->errorCount = 0; + recognizer->state->backtracking = 0; + recognizer->state->following = NULL; + recognizer->state->ruleMemo = NULL; + recognizer->state->tokenNames = NULL; + recognizer->state->sizeHint = sizeHint; + recognizer->state->tokSource = NULL; + recognizer->state->tokFactory = NULL; + + // Rather than check to see if we must initialize + // the stack every time we are asked for an new rewrite stream + // we just always create an empty stack and then just + // free it when the base recognizer is freed. + // + recognizer->state->rStreams = antlr3VectorNew(0); // We don't know the size. + + if (recognizer->state->rStreams == NULL) + { + // Out of memory + // + ANTLR3_FREE(recognizer->state); + ANTLR3_FREE(recognizer); + return NULL; + } + } + else + { + // Install the one we were given, and do not reset it here + // as it will either already have been initialized or will + // be in a state that needs to be preserved. + // + recognizer->state = state; + } + + // Install the BR API + // + recognizer->alreadyParsedRule = alreadyParsedRule; + recognizer->beginResync = beginResync; + recognizer->combineFollows = combineFollows; + recognizer->beginBacktrack = beginBacktrack; + recognizer->endBacktrack = endBacktrack; + recognizer->computeCSRuleFollow = computeCSRuleFollow; + recognizer->computeErrorRecoverySet = computeErrorRecoverySet; + recognizer->consumeUntil = consumeUntil; + recognizer->consumeUntilSet = consumeUntilSet; + recognizer->displayRecognitionError = displayRecognitionError; + recognizer->endResync = endResync; + recognizer->exConstruct = antlr3MTExceptionNew; + recognizer->getRuleInvocationStack = getRuleInvocationStack; + recognizer->getRuleInvocationStackNamed = getRuleInvocationStackNamed; + recognizer->getRuleMemoization = getRuleMemoization; + recognizer->match = match; + recognizer->matchAny = matchAny; + recognizer->memoize = memoize; + recognizer->mismatch = mismatch; + recognizer->mismatchIsUnwantedToken = mismatchIsUnwantedToken; + recognizer->mismatchIsMissingToken = mismatchIsMissingToken; + recognizer->recover = recover; + recognizer->recoverFromMismatchedElement= recoverFromMismatchedElement; + recognizer->recoverFromMismatchedSet = recoverFromMismatchedSet; + recognizer->recoverFromMismatchedToken = recoverFromMismatchedToken; + recognizer->getNumberOfSyntaxErrors = getNumberOfSyntaxErrors; + recognizer->reportError = reportError; + recognizer->reset = reset; + recognizer->synpred = synpred; + recognizer->toStrings = toStrings; + recognizer->getCurrentInputSymbol = getCurrentInputSymbol; + recognizer->getMissingSymbol = getMissingSymbol; + recognizer->debugger = NULL; + + recognizer->free = freeBR; + + /* Initialize variables + */ + recognizer->type = type; + + + return recognizer; +} +static void +freeBR (pANTLR3_BASE_RECOGNIZER recognizer) +{ + pANTLR3_EXCEPTION thisE; + + // Did we have a state allocated? + // + if (recognizer->state != NULL) + { + // Free any rule memoization we set up + // + if (recognizer->state->ruleMemo != NULL) + { + recognizer->state->ruleMemo->free(recognizer->state->ruleMemo); + recognizer->state->ruleMemo = NULL; + } + + // Free any exception space we have left around + // + thisE = recognizer->state->exception; + if (thisE != NULL) + { + thisE->freeEx(thisE); + } + + // Free any rewrite streams we have allocated + // + if (recognizer->state->rStreams != NULL) + { + recognizer->state->rStreams->free(recognizer->state->rStreams); + } + + // Free up any token factory we created (error recovery for instance) + // + if (recognizer->state->tokFactory != NULL) + { + recognizer->state->tokFactory->close(recognizer->state->tokFactory); + } + // Free the shared state memory + // + ANTLR3_FREE(recognizer->state); + } + + // Free the actual recognizer space + // + ANTLR3_FREE(recognizer); +} + +/** + * Creates a new Mismatched Token Exception and inserts in the recognizer + * exception stack. + * + * \param recognizer + * Context pointer for this recognizer + * + */ +ANTLR3_API void +antlr3MTExceptionNew(pANTLR3_BASE_RECOGNIZER recognizer) +{ + /* Create a basic recognition exception structure + */ + antlr3RecognitionExceptionNew(recognizer); + + /* Now update it to indicate this is a Mismatched token exception + */ + recognizer->state->exception->name = ANTLR3_MISMATCHED_EX_NAME; + recognizer->state->exception->type = ANTLR3_MISMATCHED_TOKEN_EXCEPTION; + + return; +} + +ANTLR3_API void +antlr3RecognitionExceptionNew(pANTLR3_BASE_RECOGNIZER recognizer) +{ + pANTLR3_EXCEPTION ex; + pANTLR3_LEXER lexer; + pANTLR3_PARSER parser; + pANTLR3_TREE_PARSER tparser; + + pANTLR3_INPUT_STREAM ins; + pANTLR3_INT_STREAM is; + pANTLR3_COMMON_TOKEN_STREAM cts; + pANTLR3_TREE_NODE_STREAM tns; + + ins = NULL; + cts = NULL; + tns = NULL; + is = NULL; + lexer = NULL; + parser = NULL; + tparser = NULL; + + switch (recognizer->type) + { + case ANTLR3_TYPE_LEXER: + + lexer = (pANTLR3_LEXER) (recognizer->super); + ins = lexer->input; + is = ins->istream; + + break; + + case ANTLR3_TYPE_PARSER: + + parser = (pANTLR3_PARSER) (recognizer->super); + cts = (pANTLR3_COMMON_TOKEN_STREAM)(parser->tstream->super); + is = parser->tstream->istream; + + break; + + case ANTLR3_TYPE_TREE_PARSER: + + tparser = (pANTLR3_TREE_PARSER) (recognizer->super); + tns = tparser->ctnstream->tnstream; + is = tns->istream; + + break; + + default: + + ANTLR3_FPRINTF(stderr, "Base recognizer function antlr3RecognitionExceptionNew called by unknown parser type - provide override for this function\n"); + return; + + break; + } + + /* Create a basic exception structure + */ + ex = antlr3ExceptionNew(ANTLR3_RECOGNITION_EXCEPTION, + (void *)ANTLR3_RECOGNITION_EX_NAME, + NULL, + ANTLR3_FALSE); + + /* Rest of information depends on the base type of the + * input stream. + */ + switch (is->type & ANTLR3_INPUT_MASK) + { + case ANTLR3_CHARSTREAM: + + ex->c = is->_LA (is, 1); /* Current input character */ + ex->line = ins->getLine (ins); /* Line number comes from stream */ + ex->charPositionInLine = ins->getCharPositionInLine (ins); /* Line offset also comes from the stream */ + ex->index = is->index (is); + ex->streamName = ins->fileName; + ex->message = "Unexpected character"; + break; + + case ANTLR3_TOKENSTREAM: + + ex->token = cts->tstream->_LT (cts->tstream, 1); /* Current input token */ + ex->line = ((pANTLR3_COMMON_TOKEN)(ex->token))->getLine (ex->token); + ex->charPositionInLine = ((pANTLR3_COMMON_TOKEN)(ex->token))->getCharPositionInLine (ex->token); + ex->index = cts->tstream->istream->index (cts->tstream->istream); + if (((pANTLR3_COMMON_TOKEN)(ex->token))->type == ANTLR3_TOKEN_EOF) + { + ex->streamName = NULL; + } + else + { + ex->streamName = ((pANTLR3_COMMON_TOKEN)(ex->token))->input->fileName; + } + ex->message = "Unexpected token"; + break; + + case ANTLR3_COMMONTREENODE: + + ex->token = tns->_LT (tns, 1); /* Current input tree node */ + ex->line = ((pANTLR3_BASE_TREE)(ex->token))->getLine (ex->token); + ex->charPositionInLine = ((pANTLR3_BASE_TREE)(ex->token))->getCharPositionInLine (ex->token); + ex->index = tns->istream->index (tns->istream); + + // Are you ready for this? Deep breath now... + // + { + pANTLR3_COMMON_TREE tnode; + + tnode = ((pANTLR3_COMMON_TREE)(((pANTLR3_BASE_TREE)(ex->token))->super)); + + if (tnode->token == NULL) + { + ex->streamName = ((pANTLR3_BASE_TREE)(ex->token))->strFactory->newStr(((pANTLR3_BASE_TREE)(ex->token))->strFactory, (pANTLR3_UINT8)"-unknown source-"); + } + else + { + if (tnode->token->input == NULL) + { + ex->streamName = NULL; + } + else + { + ex->streamName = tnode->token->input->fileName; + } + } + ex->message = "Unexpected node"; + } + break; + } + + ex->input = is; + ex->nextException = recognizer->state->exception; /* So we don't leak the memory */ + recognizer->state->exception = ex; + recognizer->state->error = ANTLR3_TRUE; /* Exception is outstanding */ + + return; +} + + +/// Match current input symbol against ttype. Upon error, do one token +/// insertion or deletion if possible. +/// To turn off single token insertion or deletion error +/// recovery, override mismatchRecover() and have it call +/// plain mismatch(), which does not recover. Then any error +/// in a rule will cause an exception and immediate exit from +/// rule. Rule would recover by resynchronizing to the set of +/// symbols that can follow rule ref. +/// +static void * +match( pANTLR3_BASE_RECOGNIZER recognizer, + ANTLR3_UINT32 ttype, pANTLR3_BITSET_LIST follow) +{ + pANTLR3_PARSER parser; + pANTLR3_TREE_PARSER tparser; + pANTLR3_INT_STREAM is; + void * matchedSymbol; + + switch (recognizer->type) + { + case ANTLR3_TYPE_PARSER: + + parser = (pANTLR3_PARSER) (recognizer->super); + tparser = NULL; + is = parser->tstream->istream; + + break; + + case ANTLR3_TYPE_TREE_PARSER: + + tparser = (pANTLR3_TREE_PARSER) (recognizer->super); + parser = NULL; + is = tparser->ctnstream->tnstream->istream; + + break; + + default: + + ANTLR3_FPRINTF(stderr, "Base recognizer function 'match' called by unknown parser type - provide override for this function\n"); + return ANTLR3_FALSE; + + break; + } + + // Pick up the current input token/node for assignment to labels + // + matchedSymbol = recognizer->getCurrentInputSymbol(recognizer, is); + + if (is->_LA(is, 1) == ttype) + { + // The token was the one we were told to expect + // + is->consume(is); // Consume that token from the stream + recognizer->state->errorRecovery = ANTLR3_FALSE; // Not in error recovery now (if we were) + recognizer->state->failed = ANTLR3_FALSE; // The match was a success + return matchedSymbol; // We are done + } + + // We did not find the expected token type, if we are backtracking then + // we just set the failed flag and return. + // + if (recognizer->state->backtracking > 0) + { + // Backtracking is going on + // + recognizer->state->failed = ANTLR3_TRUE; + return matchedSymbol; + } + + // We did not find the expected token and there is no backtracking + // going on, so we mismatch, which creates an exception in the recognizer exception + // stack. + // + matchedSymbol = recognizer->recoverFromMismatchedToken(recognizer, ttype, follow); + return matchedSymbol; +} + +/// Consumes the next token, whatever it is, and resets the recognizer state +/// so that it is not in error. +/// +/// \param recognizer +/// Recognizer context pointer +/// +static void +matchAny(pANTLR3_BASE_RECOGNIZER recognizer) +{ + pANTLR3_PARSER parser; + pANTLR3_TREE_PARSER tparser; + pANTLR3_INT_STREAM is; + + switch (recognizer->type) + { + case ANTLR3_TYPE_PARSER: + + parser = (pANTLR3_PARSER) (recognizer->super); + tparser = NULL; + is = parser->tstream->istream; + + break; + + case ANTLR3_TYPE_TREE_PARSER: + + tparser = (pANTLR3_TREE_PARSER) (recognizer->super); + parser = NULL; + is = tparser->ctnstream->tnstream->istream; + + break; + + default: + + ANTLR3_FPRINTF(stderr, "Base recognizer function 'matchAny' called by unknown parser type - provide override for this function\n"); + return; + + break; + } + recognizer->state->errorRecovery = ANTLR3_FALSE; + recognizer->state->failed = ANTLR3_FALSE; + is->consume(is); + + return; +} +/// +/// +static ANTLR3_BOOLEAN +mismatchIsUnwantedToken(pANTLR3_BASE_RECOGNIZER recognizer, pANTLR3_INT_STREAM is, ANTLR3_UINT32 ttype) +{ + ANTLR3_UINT32 nextt; + + nextt = is->_LA(is, 2); + + if (nextt == ttype) + { + if (recognizer->state->exception != NULL) + { + recognizer->state->exception->expecting = nextt; + } + return ANTLR3_TRUE; // This token is unknown, but the next one is the one we wanted + } + else + { + return ANTLR3_FALSE; // Neither this token, nor the one following is the one we wanted + } +} + +/// +/// +static ANTLR3_BOOLEAN +mismatchIsMissingToken(pANTLR3_BASE_RECOGNIZER recognizer, pANTLR3_INT_STREAM is, pANTLR3_BITSET_LIST follow) +{ + ANTLR3_BOOLEAN retcode; + pANTLR3_BITSET followClone; + pANTLR3_BITSET viableTokensFollowingThisRule; + + if (follow == NULL) + { + // There is no information about the tokens that can follow the last one + // hence we must say that the current one we found is not a member of the + // follow set and does not indicate a missing token. We will just consume this + // single token and see if the parser works it out from there. + // + return ANTLR3_FALSE; + } + + followClone = NULL; + viableTokensFollowingThisRule = NULL; + + // The C bitset maps are laid down at compile time by the + // C code generation. Hence we cannot remove things from them + // and so on. So, in order to remove EOR (if we need to) then + // we clone the static bitset. + // + followClone = antlr3BitsetLoad(follow); + if (followClone == NULL) + { + return ANTLR3_FALSE; + } + + // Compute what can follow this grammar reference + // + if (followClone->isMember(followClone, ANTLR3_EOR_TOKEN_TYPE)) + { + // EOR can follow, but if we are not the start symbol, we + // need to remove it. + // + if (recognizer->state->following->vector->count >= 0) + { + followClone->remove(followClone, ANTLR3_EOR_TOKEN_TYPE); + } + + // Now compute the visiable tokens that can follow this rule, according to context + // and make them part of the follow set. + // + viableTokensFollowingThisRule = recognizer->computeCSRuleFollow(recognizer); + followClone->borInPlace(followClone, viableTokensFollowingThisRule); + } + + /// if current token is consistent with what could come after set + /// then we know we're missing a token; error recovery is free to + /// "insert" the missing token + /// + /// BitSet cannot handle negative numbers like -1 (EOF) so I leave EOR + /// in follow set to indicate that the fall of the start symbol is + /// in the set (EOF can follow). + /// + if ( followClone->isMember(followClone, is->_LA(is, 1)) + || followClone->isMember(followClone, ANTLR3_EOR_TOKEN_TYPE) + ) + { + retcode = ANTLR3_TRUE; + } + else + { + retcode = ANTLR3_FALSE; + } + + if (viableTokensFollowingThisRule != NULL) + { + viableTokensFollowingThisRule->free(viableTokensFollowingThisRule); + } + if (followClone != NULL) + { + followClone->free(followClone); + } + + return retcode; + +} + +/// Factor out what to do upon token mismatch so tree parsers can behave +/// differently. Override and call mismatchRecover(input, ttype, follow) +/// to get single token insertion and deletion. Use this to turn off +/// single token insertion and deletion. Override mismatchRecover +/// to call this instead. +/// +/// \remark mismatch only works for parsers and must be overridden for anything else. +/// +static void +mismatch(pANTLR3_BASE_RECOGNIZER recognizer, ANTLR3_UINT32 ttype, pANTLR3_BITSET_LIST follow) +{ + pANTLR3_PARSER parser; + pANTLR3_TREE_PARSER tparser; + pANTLR3_INT_STREAM is; + + // Install a mismatched token exception in the exception stack + // + antlr3MTExceptionNew(recognizer); + recognizer->state->exception->expecting = ttype; + + switch (recognizer->type) + { + case ANTLR3_TYPE_PARSER: + + parser = (pANTLR3_PARSER) (recognizer->super); + tparser = NULL; + is = parser->tstream->istream; + + break; + + default: + + ANTLR3_FPRINTF(stderr, "Base recognizer function 'mismatch' called by unknown parser type - provide override for this function\n"); + return; + + break; + } + + if (mismatchIsUnwantedToken(recognizer, is, ttype)) + { + // Create a basic recognition exception structure + // + antlr3RecognitionExceptionNew(recognizer); + + // Now update it to indicate this is an unwanted token exception + // + recognizer->state->exception->name = ANTLR3_UNWANTED_TOKEN_EXCEPTION_NAME; + recognizer->state->exception->type = ANTLR3_UNWANTED_TOKEN_EXCEPTION; + + return; + } + + if (mismatchIsMissingToken(recognizer, is, follow)) + { + // Create a basic recognition exception structure + // + antlr3RecognitionExceptionNew(recognizer); + + // Now update it to indicate this is an unwanted token exception + // + recognizer->state->exception->name = ANTLR3_MISSING_TOKEN_EXCEPTION_NAME; + recognizer->state->exception->type = ANTLR3_MISSING_TOKEN_EXCEPTION; + + return; + } + + // Just a mismatched token is all we can dtermine + // + antlr3MTExceptionNew(recognizer); + + return; +} +/// Report a recognition problem. +/// +/// This method sets errorRecovery to indicate the parser is recovering +/// not parsing. Once in recovery mode, no errors are generated. +/// To get out of recovery mode, the parser must successfully match +/// a token (after a resync). So it will go: +/// +/// 1. error occurs +/// 2. enter recovery mode, report error +/// 3. consume until token found in resynch set +/// 4. try to resume parsing +/// 5. next match() will reset errorRecovery mode +/// +/// If you override, make sure to update errorCount if you care about that. +/// +static void +reportError (pANTLR3_BASE_RECOGNIZER recognizer) +{ + // Invoke the debugger event if there is a debugger listening to us + // + if (recognizer->debugger != NULL) + { + recognizer->debugger->recognitionException(recognizer->debugger, recognizer->state->exception); + } + + if (recognizer->state->errorRecovery == ANTLR3_TRUE) + { + // Already in error recovery so don't display another error while doing so + // + return; + } + + // Signal we are in error recovery now + // + recognizer->state->errorRecovery = ANTLR3_TRUE; + + // Indicate this recognizer had an error while processing. + // + recognizer->state->errorCount++; + + // Call the error display routine + // + recognizer->displayRecognitionError(recognizer, recognizer->state->tokenNames); +} + +static void +beginBacktrack (pANTLR3_BASE_RECOGNIZER recognizer, ANTLR3_UINT32 level) +{ + if (recognizer->debugger != NULL) + { + recognizer->debugger->beginBacktrack(recognizer->debugger, level); + } +} + +static void +endBacktrack (pANTLR3_BASE_RECOGNIZER recognizer, ANTLR3_UINT32 level, ANTLR3_BOOLEAN successful) +{ + if (recognizer->debugger != NULL) + { + recognizer->debugger->endBacktrack(recognizer->debugger, level, successful); + } +} +static void +beginResync (pANTLR3_BASE_RECOGNIZER recognizer) +{ + if (recognizer->debugger != NULL) + { + recognizer->debugger->beginResync(recognizer->debugger); + } +} + +static void +endResync (pANTLR3_BASE_RECOGNIZER recognizer) +{ + if (recognizer->debugger != NULL) + { + recognizer->debugger->endResync(recognizer->debugger); + } +} + +/// Compute the error recovery set for the current rule. +/// Documentation below is from the Java implementation. +/// +/// During rule invocation, the parser pushes the set of tokens that can +/// follow that rule reference on the stack; this amounts to +/// computing FIRST of what follows the rule reference in the +/// enclosing rule. This local follow set only includes tokens +/// from within the rule; i.e., the FIRST computation done by +/// ANTLR stops at the end of a rule. +// +/// EXAMPLE +// +/// When you find a "no viable alt exception", the input is not +/// consistent with any of the alternatives for rule r. The best +/// thing to do is to consume tokens until you see something that +/// can legally follow a call to r *or* any rule that called r. +/// You don't want the exact set of viable next tokens because the +/// input might just be missing a token--you might consume the +/// rest of the input looking for one of the missing tokens. +/// +/// Consider grammar: +/// +/// a : '[' b ']' +/// | '(' b ')' +/// ; +/// b : c '^' INT ; +/// c : ID +/// | INT +/// ; +/// +/// At each rule invocation, the set of tokens that could follow +/// that rule is pushed on a stack. Here are the various "local" +/// follow sets: +/// +/// FOLLOW(b1_in_a) = FIRST(']') = ']' +/// FOLLOW(b2_in_a) = FIRST(')') = ')' +/// FOLLOW(c_in_b) = FIRST('^') = '^' +/// +/// Upon erroneous input "[]", the call chain is +/// +/// a -> b -> c +/// +/// and, hence, the follow context stack is: +/// +/// depth local follow set after call to rule +/// 0 a (from main()) +/// 1 ']' b +/// 3 '^' c +/// +/// Notice that ')' is not included, because b would have to have +/// been called from a different context in rule a for ')' to be +/// included. +/// +/// For error recovery, we cannot consider FOLLOW(c) +/// (context-sensitive or otherwise). We need the combined set of +/// all context-sensitive FOLLOW sets--the set of all tokens that +/// could follow any reference in the call chain. We need to +/// resync to one of those tokens. Note that FOLLOW(c)='^' and if +/// we resync'd to that token, we'd consume until EOF. We need to +/// sync to context-sensitive FOLLOWs for a, b, and c: {']','^'}. +/// In this case, for input "[]", LA(1) is in this set so we would +/// not consume anything and after printing an error rule c would +/// return normally. It would not find the required '^' though. +/// At this point, it gets a mismatched token error and throws an +/// exception (since LA(1) is not in the viable following token +/// set). The rule exception handler tries to recover, but finds +/// the same recovery set and doesn't consume anything. Rule b +/// exits normally returning to rule a. Now it finds the ']' (and +/// with the successful match exits errorRecovery mode). +/// +/// So, you can see that the parser walks up call chain looking +/// for the token that was a member of the recovery set. +/// +/// Errors are not generated in errorRecovery mode. +/// +/// ANTLR's error recovery mechanism is based upon original ideas: +/// +/// "Algorithms + Data Structures = Programs" by Niklaus Wirth +/// +/// and +/// +/// "A note on error recovery in recursive descent parsers": +/// http://portal.acm.org/citation.cfm?id=947902.947905 +/// +/// Later, Josef Grosch had some good ideas: +/// +/// "Efficient and Comfortable Error Recovery in Recursive Descent +/// Parsers": +/// ftp://www.cocolab.com/products/cocktail/doca4.ps/ell.ps.zip +/// +/// Like Grosch I implemented local FOLLOW sets that are combined +/// at run-time upon error to avoid overhead during parsing. +/// +static pANTLR3_BITSET +computeErrorRecoverySet (pANTLR3_BASE_RECOGNIZER recognizer) +{ + return recognizer->combineFollows(recognizer, ANTLR3_FALSE); +} + +/// Compute the context-sensitive FOLLOW set for current rule. +/// Documentation below is from the Java runtime. +/// +/// This is the set of token types that can follow a specific rule +/// reference given a specific call chain. You get the set of +/// viable tokens that can possibly come next (look ahead depth 1) +/// given the current call chain. Contrast this with the +/// definition of plain FOLLOW for rule r: +/// +/// FOLLOW(r)={x | S=>*alpha r beta in G and x in FIRST(beta)} +/// +/// where x in T* and alpha, beta in V*; T is set of terminals and +/// V is the set of terminals and non terminals. In other words, +/// FOLLOW(r) is the set of all tokens that can possibly follow +/// references to r in///any* sentential form (context). At +/// runtime, however, we know precisely which context applies as +/// we have the call chain. We may compute the exact (rather +/// than covering superset) set of following tokens. +/// +/// For example, consider grammar: +/// +/// stat : ID '=' expr ';' // FOLLOW(stat)=={EOF} +/// | "return" expr '.' +/// ; +/// expr : atom ('+' atom)* ; // FOLLOW(expr)=={';','.',')'} +/// atom : INT // FOLLOW(atom)=={'+',')',';','.'} +/// | '(' expr ')' +/// ; +/// +/// The FOLLOW sets are all inclusive whereas context-sensitive +/// FOLLOW sets are precisely what could follow a rule reference. +/// For input input "i=(3);", here is the derivation: +/// +/// stat => ID '=' expr ';' +/// => ID '=' atom ('+' atom)* ';' +/// => ID '=' '(' expr ')' ('+' atom)* ';' +/// => ID '=' '(' atom ')' ('+' atom)* ';' +/// => ID '=' '(' INT ')' ('+' atom)* ';' +/// => ID '=' '(' INT ')' ';' +/// +/// At the "3" token, you'd have a call chain of +/// +/// stat -> expr -> atom -> expr -> atom +/// +/// What can follow that specific nested ref to atom? Exactly ')' +/// as you can see by looking at the derivation of this specific +/// input. Contrast this with the FOLLOW(atom)={'+',')',';','.'}. +/// +/// You want the exact viable token set when recovering from a +/// token mismatch. Upon token mismatch, if LA(1) is member of +/// the viable next token set, then you know there is most likely +/// a missing token in the input stream. "Insert" one by just not +/// throwing an exception. +/// +static pANTLR3_BITSET +computeCSRuleFollow (pANTLR3_BASE_RECOGNIZER recognizer) +{ + return recognizer->combineFollows(recognizer, ANTLR3_FALSE); +} + +/// Compute the current followset for the input stream. +/// +static pANTLR3_BITSET +combineFollows (pANTLR3_BASE_RECOGNIZER recognizer, ANTLR3_BOOLEAN exact) +{ + pANTLR3_BITSET followSet; + pANTLR3_BITSET localFollowSet; + ANTLR3_UINT32 top; + ANTLR3_UINT32 i; + + top = recognizer->state->following->size(recognizer->state->following); + + followSet = antlr3BitsetNew(0); + localFollowSet = NULL; + + for (i = top; i>0; i--) + { + localFollowSet = antlr3BitsetLoad((pANTLR3_BITSET_LIST) recognizer->state->following->get(recognizer->state->following, i-1)); + + if (localFollowSet != NULL) + { + followSet->borInPlace(followSet, localFollowSet); + + if (exact == ANTLR3_TRUE) + { + if (localFollowSet->isMember(localFollowSet, ANTLR3_EOR_TOKEN_TYPE) == ANTLR3_FALSE) + { + // Only leave EOR in the set if at top (start rule); this lets us know + // if we have to include the follow(start rule); I.E., EOF + // + if (i>1) + { + followSet->remove(followSet, ANTLR3_EOR_TOKEN_TYPE); + } + } + else + { + break; // Cannot see End Of Rule from here, just drop out + } + } + localFollowSet->free(localFollowSet); + localFollowSet = NULL; + } + } + + if (localFollowSet != NULL) + { + localFollowSet->free(localFollowSet); + } + return followSet; +} + +/// Standard/Example error display method. +/// No generic error message display funciton coudl possibly do everything correctly +/// for all possible parsers. Hence you are provided with this example routine, which +/// you should override in your parser/tree parser to do as you will. +/// +/// Here we depart somewhat from the Java runtime as that has now split up a lot +/// of the error display routines into spearate units. However, ther is little advantage +/// to this in the C version as you will probably implement all such routines as a +/// separate translation unit, rather than install them all as pointers to functions +/// in the base recognizer. +/// +static void +displayRecognitionError (pANTLR3_BASE_RECOGNIZER recognizer, pANTLR3_UINT8 * tokenNames) +{ + pANTLR3_PARSER parser; + pANTLR3_TREE_PARSER tparser; + pANTLR3_INT_STREAM is; + pANTLR3_STRING ttext; + pANTLR3_STRING ftext; + pANTLR3_EXCEPTION ex; + pANTLR3_COMMON_TOKEN theToken; + pANTLR3_BASE_TREE theBaseTree; + pANTLR3_COMMON_TREE theCommonTree; + + // Retrieve some info for easy reading. + // + ex = recognizer->state->exception; + ttext = NULL; + + // See if there is a 'filename' we can use + // + if (ex->streamName == NULL) + { + if (((pANTLR3_COMMON_TOKEN)(ex->token))->type == ANTLR3_TOKEN_EOF) + { + ANTLR3_FPRINTF(stderr, "-end of input-("); + } + else + { + ANTLR3_FPRINTF(stderr, "-unknown source-("); + } + } + else + { + ftext = ex->streamName->to8(ex->streamName); + ANTLR3_FPRINTF(stderr, "%s(", ftext->chars); + } + + // Next comes the line number + // + + ANTLR3_FPRINTF(stderr, "%d) ", recognizer->state->exception->line); + ANTLR3_FPRINTF(stderr, " : error %d : %s", + recognizer->state->exception->type, + (pANTLR3_UINT8) (recognizer->state->exception->message)); + + + // How we determine the next piece is dependent on which thing raised the + // error. + // + switch (recognizer->type) + { + case ANTLR3_TYPE_PARSER: + + // Prepare the knowledge we know we have + // + parser = (pANTLR3_PARSER) (recognizer->super); + tparser = NULL; + is = parser->tstream->istream; + theToken = (pANTLR3_COMMON_TOKEN)(recognizer->state->exception->token); + ttext = theToken->toString(theToken); + + ANTLR3_FPRINTF(stderr, ", at offset %d", recognizer->state->exception->charPositionInLine); + if (theToken != NULL) + { + if (theToken->type == ANTLR3_TOKEN_EOF) + { + ANTLR3_FPRINTF(stderr, ", at "); + } + else + { + // Guard against null text in a token + // + ANTLR3_FPRINTF(stderr, "\n near %s\n ", ttext == NULL ? (pANTLR3_UINT8)"" : ttext->chars); + } + } + break; + + case ANTLR3_TYPE_TREE_PARSER: + + tparser = (pANTLR3_TREE_PARSER) (recognizer->super); + parser = NULL; + is = tparser->ctnstream->tnstream->istream; + theBaseTree = (pANTLR3_BASE_TREE)(recognizer->state->exception->token); + ttext = theBaseTree->toStringTree(theBaseTree); + + if (theBaseTree != NULL) + { + theCommonTree = (pANTLR3_COMMON_TREE) theBaseTree->super; + + if (theCommonTree != NULL) + { + theToken = (pANTLR3_COMMON_TOKEN) theBaseTree->getToken(theBaseTree); + } + ANTLR3_FPRINTF(stderr, ", at offset %d", theBaseTree->getCharPositionInLine(theBaseTree)); + ANTLR3_FPRINTF(stderr, ", near %s", ttext->chars); + } + break; + + default: + + ANTLR3_FPRINTF(stderr, "Base recognizer function displayRecognitionError called by unknown parser type - provide override for this function\n"); + return; + break; + } + + // Although this function should generally be provided by the implementation, this one + // should be as helpful as possible for grammar developers and serve as an example + // of what you can do with each exception type. In general, when you make up your + // 'real' handler, you should debug the routine with all possible errors you expect + // which will then let you be as specific as possible about all circumstances. + // + // Note that in the general case, errors thrown by tree parsers indicate a problem + // with the output of the parser or with the tree grammar itself. The job of the parser + // is to produce a perfect (in traversal terms) syntactically correct tree, so errors + // at that stage should really be semantic errors that your own code determines and handles + // in whatever way is appropriate. + // + switch (ex->type) + { + case ANTLR3_UNWANTED_TOKEN_EXCEPTION: + + // Indicates that the recognizer was fed a token which seesm to be + // spurious input. We can detect this when the token that follows + // this unwanted token would normally be part of the syntactically + // correct stream. Then we can see that the token we are looking at + // is just something that should not be there and throw this exception. + // + if (tokenNames == NULL) + { + ANTLR3_FPRINTF(stderr, " : Extraneous input..."); + } + else + { + if (ex->expecting == ANTLR3_TOKEN_EOF) + { + ANTLR3_FPRINTF(stderr, " : Extraneous input - expected \n"); + } + else + { + ANTLR3_FPRINTF(stderr, " : Extraneous input - expected %s ...\n", tokenNames[ex->expecting]); + } + } + break; + + case ANTLR3_MISSING_TOKEN_EXCEPTION: + + // Indicates that the recognizer detected that the token we just + // hit would be valid syntactically if preceeded by a particular + // token. Perhaps a missing ';' at line end or a missing ',' in an + // expression list, and such like. + // + if (tokenNames == NULL) + { + ANTLR3_FPRINTF(stderr, " : Missing token (%d)...\n", ex->expecting); + } + else + { + if (ex->expecting == ANTLR3_TOKEN_EOF) + { + ANTLR3_FPRINTF(stderr, " : Missing \n"); + } + else + { + ANTLR3_FPRINTF(stderr, " : Missing %s \n", tokenNames[ex->expecting]); + } + } + break; + + case ANTLR3_RECOGNITION_EXCEPTION: + + // Indicates that the recognizer received a token + // in the input that was not predicted. This is the basic exception type + // from which all others are derived. So we assume it was a syntax error. + // You may get this if there are not more tokens and more are needed + // to complete a parse for instance. + // + ANTLR3_FPRINTF(stderr, " : syntax error...\n"); + break; + + case ANTLR3_MISMATCHED_TOKEN_EXCEPTION: + + // We were expecting to see one thing and got another. This is the + // most common error if we coudl not detect a missing or unwanted token. + // Here you can spend your efforts to + // derive more useful error messages based on the expected + // token set and the last token and so on. The error following + // bitmaps do a good job of reducing the set that we were looking + // for down to something small. Knowing what you are parsing may be + // able to allow you to be even more specific about an error. + // + if (tokenNames == NULL) + { + ANTLR3_FPRINTF(stderr, " : syntax error...\n"); + } + else + { + if (ex->expecting == ANTLR3_TOKEN_EOF) + { + ANTLR3_FPRINTF(stderr, " : expected \n"); + } + else + { + ANTLR3_FPRINTF(stderr, " : expected %s ...\n", tokenNames[ex->expecting]); + } + } + break; + + case ANTLR3_NO_VIABLE_ALT_EXCEPTION: + + // We could not pick any alt decision from the input given + // so god knows what happened - however when you examine your grammar, + // you should. It means that at the point where the current token occurred + // that the DFA indicates nowhere to go from here. + // + ANTLR3_FPRINTF(stderr, " : cannot match to any predicted input...\n"); + + break; + + case ANTLR3_MISMATCHED_SET_EXCEPTION: + + { + ANTLR3_UINT32 count; + ANTLR3_UINT32 bit; + ANTLR3_UINT32 size; + ANTLR3_UINT32 numbits; + pANTLR3_BITSET errBits; + + // This means we were able to deal with one of a set of + // possible tokens at this point, but we did not see any + // member of that set. + // + ANTLR3_FPRINTF(stderr, " : unexpected input...\n expected one of : "); + + // What tokens could we have accepted at this point in the + // parse? + // + count = 0; + errBits = antlr3BitsetLoad (ex->expectingSet); + numbits = errBits->numBits (errBits); + size = errBits->size (errBits); + + if (size > 0) + { + // However many tokens we could have dealt with here, it is usually + // not useful to print ALL of the set here. I arbitrarily chose 8 + // here, but you should do whatever makes sense for you of course. + // No token number 0, so look for bit 1 and on. + // + for (bit = 1; bit < numbits && count < 8 && count < size; bit++) + { + // TODO: This doesn;t look right - should be asking if the bit is set!! + // + if (tokenNames[bit]) + { + ANTLR3_FPRINTF(stderr, "%s%s", count > 0 ? ", " : "", tokenNames[bit]); + count++; + } + } + ANTLR3_FPRINTF(stderr, "\n"); + } + else + { + ANTLR3_FPRINTF(stderr, "Actually dude, we didn't seem to be expecting anything here, or at least\n"); + ANTLR3_FPRINTF(stderr, "I could not work out what I was expecting, like so many of us these days!\n"); + } + } + break; + + case ANTLR3_EARLY_EXIT_EXCEPTION: + + // We entered a loop requiring a number of token sequences + // but found a token that ended that sequence earlier than + // we should have done. + // + ANTLR3_FPRINTF(stderr, " : missing elements...\n"); + break; + + default: + + // We don't handle any other exceptions here, but you can + // if you wish. If we get an exception that hits this point + // then we are just going to report what we know about the + // token. + // + ANTLR3_FPRINTF(stderr, " : syntax not recognized...\n"); + break; + } + + // Here you have the token that was in error which if this is + // the standard implementation will tell you the line and offset + // and also record the address of the start of the line in the + // input stream. You could therefore print the source line and so on. + // Generally though, I would expect that your lexer/parser will keep + // its own map of lines and source pointers or whatever as there + // are a lot of specific things you need to know about the input + // to do something like that. + // Here is where you do it though :-). + // +} + +/// Return how many syntax errors were detected by this recognizer +/// +static ANTLR3_UINT32 +getNumberOfSyntaxErrors(pANTLR3_BASE_RECOGNIZER recognizer) +{ + return recognizer->state->errorCount; +} + +/// Recover from an error found on the input stream. Mostly this is +/// NoViableAlt exceptions, but could be a mismatched token that +/// the match() routine could not recover from. +/// +static void +recover (pANTLR3_BASE_RECOGNIZER recognizer) +{ + // Used to compute the follow set of tokens + // + pANTLR3_BITSET followSet; + pANTLR3_PARSER parser; + pANTLR3_TREE_PARSER tparser; + pANTLR3_INT_STREAM is; + + switch (recognizer->type) + { + case ANTLR3_TYPE_PARSER: + + parser = (pANTLR3_PARSER) (recognizer->super); + tparser = NULL; + is = parser->tstream->istream; + + break; + + case ANTLR3_TYPE_TREE_PARSER: + + tparser = (pANTLR3_TREE_PARSER) (recognizer->super); + parser = NULL; + is = tparser->ctnstream->tnstream->istream; + + break; + + default: + + ANTLR3_FPRINTF(stderr, "Base recognizer function recover called by unknown parser type - provide override for this function\n"); + return; + + break; + } + + // Are we about to repeat the same error? + // + if (recognizer->state->lastErrorIndex == is->index(is)) + { + // The last error was at the same token index point. This must be a case + // where LT(1) is in the recovery token set so nothing is + // consumed. Consume a single token so at least to prevent + // an infinite loop; this is a failsafe. + // + is->consume(is); + } + + // Record error index position + // + recognizer->state->lastErrorIndex = is->index(is); + + // Work out the follows set for error recovery + // + followSet = recognizer->computeErrorRecoverySet(recognizer); + + // Call resync hook (for debuggers and so on) + // + recognizer->beginResync(recognizer); + + // Consume tokens until we have resynced to something in the follows set + // + recognizer->consumeUntilSet(recognizer, followSet); + + // End resync hook + // + recognizer->endResync(recognizer); + + // Destroy the temporary bitset we produced. + // + followSet->free(followSet); + + // Reset the inError flag so we don't re-report the exception + // + recognizer->state->error = ANTLR3_FALSE; + recognizer->state->failed = ANTLR3_FALSE; +} + + +/// Attempt to recover from a single missing or extra token. +/// +/// EXTRA TOKEN +/// +/// LA(1) is not what we are looking for. If LA(2) has the right token, +/// however, then assume LA(1) is some extra spurious token. Delete it +/// and LA(2) as if we were doing a normal match(), which advances the +/// input. +/// +/// MISSING TOKEN +/// +/// If current token is consistent with what could come after +/// ttype then it is ok to "insert" the missing token, else throw +/// exception For example, Input "i=(3;" is clearly missing the +/// ')'. When the parser returns from the nested call to expr, it +/// will have call chain: +/// +/// stat -> expr -> atom +/// +/// and it will be trying to match the ')' at this point in the +/// derivation: +/// +/// => ID '=' '(' INT ')' ('+' atom)* ';' +/// ^ +/// match() will see that ';' doesn't match ')' and report a +/// mismatched token error. To recover, it sees that LA(1)==';' +/// is in the set of tokens that can follow the ')' token +/// reference in rule atom. It can assume that you forgot the ')'. +/// +/// The exception that was passed in, in the java implementation is +/// sorted in the recognizer exception stack in the C version. To 'throw' it we set the +/// error flag and rules cascade back when this is set. +/// +static void * +recoverFromMismatchedToken (pANTLR3_BASE_RECOGNIZER recognizer, ANTLR3_UINT32 ttype, pANTLR3_BITSET_LIST follow) +{ + pANTLR3_PARSER parser; + pANTLR3_TREE_PARSER tparser; + pANTLR3_INT_STREAM is; + void * matchedSymbol; + + + + switch (recognizer->type) + { + case ANTLR3_TYPE_PARSER: + + parser = (pANTLR3_PARSER) (recognizer->super); + tparser = NULL; + is = parser->tstream->istream; + + break; + + case ANTLR3_TYPE_TREE_PARSER: + + tparser = (pANTLR3_TREE_PARSER) (recognizer->super); + parser = NULL; + is = tparser->ctnstream->tnstream->istream; + + break; + + default: + + ANTLR3_FPRINTF(stderr, "Base recognizer function recoverFromMismatchedToken called by unknown parser type - provide override for this function\n"); + return NULL; + + break; + } + + // Create an exception if we need one + // + if (recognizer->state->exception == NULL) + { + antlr3RecognitionExceptionNew(recognizer); + } + + // If the next token after the one we are looking at in the input stream + // is what we are looking for then we remove the one we have discovered + // from the stream by consuming it, then consume this next one along too as + // if nothing had happened. + // + if ( recognizer->mismatchIsUnwantedToken(recognizer, is, ttype) == ANTLR3_TRUE) + { + recognizer->state->exception->type = ANTLR3_UNWANTED_TOKEN_EXCEPTION; + recognizer->state->exception->message = ANTLR3_UNWANTED_TOKEN_EXCEPTION_NAME; + + // Call resync hook (for debuggers and so on) + // + if (recognizer->debugger != NULL) + { + recognizer->debugger->beginResync(recognizer->debugger); + } + + // "delete" the extra token + // + recognizer->beginResync(recognizer); + is->consume(is); + recognizer->endResync(recognizer); + // End resync hook + // + if (recognizer->debugger != NULL) + { + recognizer->debugger->endResync(recognizer->debugger); + } + + // Print out the error after we consume so that ANTLRWorks sees the + // token in the exception. + // + recognizer->reportError(recognizer); + + // Return the token we are actually matching + // + matchedSymbol = recognizer->getCurrentInputSymbol(recognizer, is); + + // Consume the token that the rule actually expected to get as if everything + // was hunky dory. + // + is->consume(is); + + recognizer->state->error = ANTLR3_FALSE; // Exception is not outstanding any more + + return matchedSymbol; + } + + // Single token deletion (Unwanted above) did not work + // so we see if we can insert a token instead by calculating which + // token would be missing + // + if (mismatchIsMissingToken(recognizer, is, follow)) + { + // We can fake the missing token and proceed + // + matchedSymbol = recognizer->getMissingSymbol(recognizer, is, recognizer->state->exception, ttype, follow); + recognizer->state->exception->type = ANTLR3_MISSING_TOKEN_EXCEPTION; + recognizer->state->exception->message = ANTLR3_MISSING_TOKEN_EXCEPTION_NAME; + recognizer->state->exception->token = matchedSymbol; + recognizer->state->exception->expecting = ttype; + + // Print out the error after we insert so that ANTLRWorks sees the + // token in the exception. + // + recognizer->reportError(recognizer); + + recognizer->state->error = ANTLR3_FALSE; // Exception is not outstanding any more + + return matchedSymbol; + } + + + // Neither deleting nor inserting tokens allows recovery + // must just report the exception. + // + recognizer->state->error = ANTLR3_TRUE; + return NULL; +} + +static void * +recoverFromMismatchedSet (pANTLR3_BASE_RECOGNIZER recognizer, pANTLR3_BITSET_LIST follow) +{ + pANTLR3_PARSER parser; + pANTLR3_TREE_PARSER tparser; + pANTLR3_INT_STREAM is; + pANTLR3_COMMON_TOKEN matchedSymbol; + + switch (recognizer->type) + { + case ANTLR3_TYPE_PARSER: + + parser = (pANTLR3_PARSER) (recognizer->super); + tparser = NULL; + is = parser->tstream->istream; + + break; + + case ANTLR3_TYPE_TREE_PARSER: + + tparser = (pANTLR3_TREE_PARSER) (recognizer->super); + parser = NULL; + is = tparser->ctnstream->tnstream->istream; + + break; + + default: + + ANTLR3_FPRINTF(stderr, "Base recognizer function recoverFromMismatchedSet called by unknown parser type - provide override for this function\n"); + return NULL; + + break; + } + + if (recognizer->mismatchIsMissingToken(recognizer, is, follow) == ANTLR3_TRUE) + { + // We can fake the missing token and proceed + // + matchedSymbol = recognizer->getMissingSymbol(recognizer, is, recognizer->state->exception, ANTLR3_TOKEN_INVALID, follow); + recognizer->state->exception->type = ANTLR3_MISSING_TOKEN_EXCEPTION; + recognizer->state->exception->token = matchedSymbol; + + // Print out the error after we insert so that ANTLRWorks sees the + // token in the exception. + // + recognizer->reportError(recognizer); + + recognizer->state->error = ANTLR3_FALSE; // Exception is not outstanding any more + + return matchedSymbol; + } + + // TODO - Single token deletion like in recoverFromMismatchedToken() + // + recognizer->state->error = ANTLR3_TRUE; + recognizer->state->failed = ANTLR3_TRUE; + return NULL; +} + +/// This code is factored out from mismatched token and mismatched set +/// recovery. It handles "single token insertion" error recovery for +/// both. No tokens are consumed to recover from insertions. Return +/// true if recovery was possible else return false. +/// +static ANTLR3_BOOLEAN +recoverFromMismatchedElement (pANTLR3_BASE_RECOGNIZER recognizer, pANTLR3_BITSET_LIST followBits) +{ + pANTLR3_BITSET viableToksFollowingRule; + pANTLR3_BITSET follow; + pANTLR3_PARSER parser; + pANTLR3_TREE_PARSER tparser; + pANTLR3_INT_STREAM is; + + switch (recognizer->type) + { + case ANTLR3_TYPE_PARSER: + + parser = (pANTLR3_PARSER) (recognizer->super); + tparser = NULL; + is = parser->tstream->istream; + + break; + + case ANTLR3_TYPE_TREE_PARSER: + + tparser = (pANTLR3_TREE_PARSER) (recognizer->super); + parser = NULL; + is = tparser->ctnstream->tnstream->istream; + + break; + + default: + + ANTLR3_FPRINTF(stderr, "Base recognizer function recover called by unknown parser type - provide override for this function\n"); + return ANTLR3_FALSE; + + break; + } + + follow = antlr3BitsetLoad(followBits); + + if (follow == NULL) + { + /* The follow set is NULL, which means we don't know what can come + * next, so we "hit and hope" by just signifying that we cannot + * recover, which will just cause the next token to be consumed, + * which might dig us out. + */ + return ANTLR3_FALSE; + } + + /* We have a bitmap for the follow set, hence we can compute + * what can follow this grammar element reference. + */ + if (follow->isMember(follow, ANTLR3_EOR_TOKEN_TYPE) == ANTLR3_TRUE) + { + /* First we need to know which of the available tokens are viable + * to follow this reference. + */ + viableToksFollowingRule = recognizer->computeCSRuleFollow(recognizer); + + /* Remove the EOR token, which we do not wish to compute with + */ + follow->remove(follow, ANTLR3_EOR_TOKEN_TYPE); + viableToksFollowingRule->free(viableToksFollowingRule); + /* We now have the computed set of what can follow the current token + */ + } + + /* We can now see if the current token works with the set of tokens + * that could follow the current grammar reference. If it looks like it + * is consistent, then we can "insert" that token by not throwing + * an exception and assuming that we saw it. + */ + if ( follow->isMember(follow, is->_LA(is, 1)) == ANTLR3_TRUE) + { + /* report the error, but don't cause any rules to abort and stuff + */ + recognizer->reportError(recognizer); + if (follow != NULL) + { + follow->free(follow); + } + recognizer->state->error = ANTLR3_FALSE; + recognizer->state->failed = ANTLR3_FALSE; + return ANTLR3_TRUE; /* Success in recovery */ + } + + if (follow != NULL) + { + follow->free(follow); + } + + /* We could not find anything viable to do, so this is going to + * cause an exception. + */ + return ANTLR3_FALSE; +} + +/// Eat tokens from the input stream until we get one of JUST the right type +/// +static void +consumeUntil (pANTLR3_BASE_RECOGNIZER recognizer, ANTLR3_UINT32 tokenType) +{ + ANTLR3_UINT32 ttype; + pANTLR3_PARSER parser; + pANTLR3_TREE_PARSER tparser; + pANTLR3_INT_STREAM is; + + switch (recognizer->type) + { + case ANTLR3_TYPE_PARSER: + + parser = (pANTLR3_PARSER) (recognizer->super); + tparser = NULL; + is = parser->tstream->istream; + + break; + + case ANTLR3_TYPE_TREE_PARSER: + + tparser = (pANTLR3_TREE_PARSER) (recognizer->super); + parser = NULL; + is = tparser->ctnstream->tnstream->istream; + + break; + + default: + + ANTLR3_FPRINTF(stderr, "Base recognizer function 'consumeUntil' called by unknown parser type - provide override for this function\n"); + return; + + break; + } + + // What do have at the moment? + // + ttype = is->_LA(is, 1); + + // Start eating tokens until we get to the one we want. + // + while (ttype != ANTLR3_TOKEN_EOF && ttype != tokenType) + { + is->consume(is); + ttype = is->_LA(is, 1); + } +} + +/// Eat tokens from the input stream until we find one that +/// belongs to the supplied set. +/// +static void +consumeUntilSet (pANTLR3_BASE_RECOGNIZER recognizer, pANTLR3_BITSET set) +{ + ANTLR3_UINT32 ttype; + pANTLR3_PARSER parser; + pANTLR3_TREE_PARSER tparser; + pANTLR3_INT_STREAM is; + + switch (recognizer->type) + { + case ANTLR3_TYPE_PARSER: + + parser = (pANTLR3_PARSER) (recognizer->super); + tparser = NULL; + is = parser->tstream->istream; + + break; + + case ANTLR3_TYPE_TREE_PARSER: + + tparser = (pANTLR3_TREE_PARSER) (recognizer->super); + parser = NULL; + is = tparser->ctnstream->tnstream->istream; + + break; + + default: + + ANTLR3_FPRINTF(stderr, "Base recognizer function 'consumeUntilSet' called by unknown parser type - provide override for this function\n"); + return; + + break; + } + + // What do have at the moment? + // + ttype = is->_LA(is, 1); + + // Start eating tokens until we get to one we want. + // + while (ttype != ANTLR3_TOKEN_EOF && set->isMember(set, ttype) == ANTLR3_FALSE) + { + is->consume(is); + ttype = is->_LA(is, 1); + } +} + +/** Return the rule invocation stack (how we got here in the parse. + * In the java version Ter just asks the JVM for all the information + * but in C we don't get this information, so I am going to do nothing + * right now. + */ +static pANTLR3_STACK +getRuleInvocationStack (pANTLR3_BASE_RECOGNIZER recognizer) +{ + return NULL; +} + +static pANTLR3_STACK +getRuleInvocationStackNamed (pANTLR3_BASE_RECOGNIZER recognizer, pANTLR3_UINT8 name) +{ + return NULL; +} + +/** Convenience method for template rewrites - NYI. + */ +static pANTLR3_HASH_TABLE +toStrings (pANTLR3_BASE_RECOGNIZER recognizer, pANTLR3_HASH_TABLE tokens) +{ + return NULL; +} + +static void ANTLR3_CDECL +freeIntTrie (void * trie) +{ + ((pANTLR3_INT_TRIE)trie)->free((pANTLR3_INT_TRIE)trie); +} + + +/** Pointer to a function to return whether the rule has parsed input starting at the supplied + * start index before. If the rule has not parsed input starting from the supplied start index, + * then it will return ANTLR3_MEMO_RULE_UNKNOWN. If it has parsed from the suppled start point + * then it will return the point where it last stopped parsing after that start point. + * + * \remark + * The rule memos are an ANTLR3_LIST of ANTLR3_LISTS, however if this becomes any kind of performance + * issue (it probably won't, the hash tables are pretty quick) then we could make a special int only + * version of the table. + */ +static ANTLR3_MARKER +getRuleMemoization (pANTLR3_BASE_RECOGNIZER recognizer, ANTLR3_INTKEY ruleIndex, ANTLR3_MARKER ruleParseStart) +{ + /* The rule memos are an ANTLR3_LIST of ANTLR3_LIST. + */ + pANTLR3_INT_TRIE ruleList; + ANTLR3_MARKER stopIndex; + pANTLR3_TRIE_ENTRY entry; + + /* See if we have a list in the ruleMemos for this rule, and if not, then create one + * as we will need it eventually if we are being asked for the memo here. + */ + entry = recognizer->state->ruleMemo->get(recognizer->state->ruleMemo, (ANTLR3_INTKEY)ruleIndex); + + if (entry == NULL) + { + /* Did not find it, so create a new one for it, with a bit depth based on the + * size of the input stream. We need the bit depth to incorporate the number if + * bits required to represent the largest possible stop index in the input, which is the + * last character. An int stream is free to return the largest 64 bit offset if it has + * no idea of the size, but you should remember that this will cause the leftmost + * bit match algorithm to run to 63 bits, which will be the whole time spent in the trie ;-) + */ + ruleList = antlr3IntTrieNew(63); /* Depth is theoretically 64 bits, but probably not ;-) */ + + if (ruleList != NULL) + { + recognizer->state->ruleMemo->add(recognizer->state->ruleMemo, (ANTLR3_INTKEY)ruleIndex, ANTLR3_HASH_TYPE_STR, 0, ANTLR3_FUNC_PTR(ruleList), freeIntTrie); + } + + /* We cannot have a stopIndex in a trie we have just created of course + */ + return MEMO_RULE_UNKNOWN; + } + + ruleList = (pANTLR3_INT_TRIE) (entry->data.ptr); + + /* See if there is a stop index associated with the supplied start index. + */ + stopIndex = 0; + + entry = ruleList->get(ruleList, ruleParseStart); + if (entry != NULL) + { + stopIndex = (ANTLR3_MARKER)(entry->data.intVal); + } + + if (stopIndex == 0) + { + return MEMO_RULE_UNKNOWN; + } + + return stopIndex; +} + +/** Has this rule already parsed input at the current index in the + * input stream? Return ANTLR3_TRUE if we have and ANTLR3_FALSE + * if we have not. + * + * This method has a side-effect: if we have seen this input for + * this rule and successfully parsed before, then seek ahead to + * 1 past the stop token matched for this rule last time. + */ +static ANTLR3_BOOLEAN +alreadyParsedRule (pANTLR3_BASE_RECOGNIZER recognizer, ANTLR3_MARKER ruleIndex) +{ + ANTLR3_MARKER stopIndex; + pANTLR3_LEXER lexer; + pANTLR3_PARSER parser; + pANTLR3_TREE_PARSER tparser; + pANTLR3_INT_STREAM is; + + switch (recognizer->type) + { + case ANTLR3_TYPE_PARSER: + + parser = (pANTLR3_PARSER) (recognizer->super); + tparser = NULL; + lexer = NULL; + is = parser->tstream->istream; + + break; + + case ANTLR3_TYPE_TREE_PARSER: + + tparser = (pANTLR3_TREE_PARSER) (recognizer->super); + parser = NULL; + lexer = NULL; + is = tparser->ctnstream->tnstream->istream; + + break; + + case ANTLR3_TYPE_LEXER: + + lexer = (pANTLR3_LEXER) (recognizer->super); + parser = NULL; + tparser = NULL; + is = lexer->input->istream; + break; + + default: + + ANTLR3_FPRINTF(stderr, "Base recognizer function 'alreadyParsedRule' called by unknown parser type - provide override for this function\n"); + return ANTLR3_FALSE; + + break; + } + + /* See if we have a memo marker for this. + */ + stopIndex = recognizer->getRuleMemoization(recognizer, ruleIndex, is->index(is)); + + if (stopIndex == MEMO_RULE_UNKNOWN) + { + return ANTLR3_FALSE; + } + + if (stopIndex == MEMO_RULE_FAILED) + { + recognizer->state->failed = ANTLR3_TRUE; + } + else + { + is->seek(is, stopIndex+1); + } + + /* If here then the rule was executed for this input already + */ + return ANTLR3_TRUE; +} + +/** Record whether or not this rule parsed the input at this position + * successfully. + */ +static void +memoize (pANTLR3_BASE_RECOGNIZER recognizer, ANTLR3_MARKER ruleIndex, ANTLR3_MARKER ruleParseStart) +{ + /* The rule memos are an ANTLR3_LIST of ANTLR3_LIST. + */ + pANTLR3_INT_TRIE ruleList; + pANTLR3_TRIE_ENTRY entry; + ANTLR3_MARKER stopIndex; + pANTLR3_LEXER lexer; + pANTLR3_PARSER parser; + pANTLR3_TREE_PARSER tparser; + pANTLR3_INT_STREAM is; + + switch (recognizer->type) + { + case ANTLR3_TYPE_PARSER: + + parser = (pANTLR3_PARSER) (recognizer->super); + tparser = NULL; + is = parser->tstream->istream; + + break; + + case ANTLR3_TYPE_TREE_PARSER: + + tparser = (pANTLR3_TREE_PARSER) (recognizer->super); + parser = NULL; + is = tparser->ctnstream->tnstream->istream; + + break; + + case ANTLR3_TYPE_LEXER: + + lexer = (pANTLR3_LEXER) (recognizer->super); + parser = NULL; + tparser = NULL; + is = lexer->input->istream; + break; + + default: + + ANTLR3_FPRINTF(stderr, "Base recognizer function consumeUntilSet called by unknown parser type - provide override for this function\n"); + return; + + break; + } + + stopIndex = recognizer->state->failed == ANTLR3_TRUE ? MEMO_RULE_FAILED : is->index(is) - 1; + + entry = recognizer->state->ruleMemo->get(recognizer->state->ruleMemo, (ANTLR3_INTKEY)ruleIndex); + + if (entry != NULL) + { + ruleList = (pANTLR3_INT_TRIE)(entry->data.ptr); + + /* If we don't already have this entry, append it. The memoize trie does not + * accept duplicates so it won't add it if already there and we just ignore the + * return code as we don't care if it is there already. + */ + ruleList->add(ruleList, ruleParseStart, ANTLR3_HASH_TYPE_INT, stopIndex, NULL, NULL); + } +} +/** A syntactic predicate. Returns true/false depending on whether + * the specified grammar fragment matches the current input stream. + * This resets the failed instance var afterwards. + */ +static ANTLR3_BOOLEAN +synpred (pANTLR3_BASE_RECOGNIZER recognizer, void * ctx, void (*predicate)(void * ctx)) +{ + ANTLR3_MARKER start; + pANTLR3_PARSER parser; + pANTLR3_TREE_PARSER tparser; + pANTLR3_INT_STREAM is; + + switch (recognizer->type) + { + case ANTLR3_TYPE_PARSER: + + parser = (pANTLR3_PARSER) (recognizer->super); + tparser = NULL; + is = parser->tstream->istream; + + break; + + case ANTLR3_TYPE_TREE_PARSER: + + tparser = (pANTLR3_TREE_PARSER) (recognizer->super); + parser = NULL; + is = tparser->ctnstream->tnstream->istream; + + break; + + default: + + ANTLR3_FPRINTF(stderr, "Base recognizer function 'synPred' called by unknown parser type - provide override for this function\n"); + return ANTLR3_FALSE; + + break; + } + + /* Begin backtracking so we can get back to where we started after trying out + * the syntactic predicate. + */ + start = is->mark(is); + recognizer->state->backtracking++; + + /* Try the syntactical predicate + */ + predicate(ctx); + + /* Reset + */ + is->rewind(is, start); + recognizer->state->backtracking--; + + if (recognizer->state->failed == ANTLR3_TRUE) + { + /* Predicate failed + */ + recognizer->state->failed = ANTLR3_FALSE; + return ANTLR3_FALSE; + } + else + { + /* Predicate was successful + */ + recognizer->state->failed = ANTLR3_FALSE; + return ANTLR3_TRUE; + } +} + +static void +reset(pANTLR3_BASE_RECOGNIZER recognizer) +{ + if (recognizer->state->following != NULL) + { + recognizer->state->following->free(recognizer->state->following); + } + + // Reset the state flags + // + recognizer->state->errorRecovery = ANTLR3_FALSE; + recognizer->state->lastErrorIndex = -1; + recognizer->state->failed = ANTLR3_FALSE; + recognizer->state->errorCount = 0; + recognizer->state->backtracking = 0; + recognizer->state->following = NULL; + + if (recognizer->state != NULL) + { + if (recognizer->state->ruleMemo != NULL) + { + recognizer->state->ruleMemo->free(recognizer->state->ruleMemo); + recognizer->state->ruleMemo = antlr3IntTrieNew(15); /* 16 bit depth is enough for 32768 rules! */ + } + } + + + // Install a new following set + // + recognizer->state->following = antlr3StackNew(8); + +} + +// Default implementation is for parser and assumes a token stream as supplied by the runtime. +// You MAY need override this function if the standard TOKEN_STREAM is not what you are using. +// +static void * +getCurrentInputSymbol (pANTLR3_BASE_RECOGNIZER recognizer, pANTLR3_INT_STREAM istream) +{ + return ((pANTLR3_TOKEN_STREAM)istream->super)->_LT((pANTLR3_TOKEN_STREAM)istream->super, 1); +} + +// Default implementation is for parser and assumes a token stream as supplied by the runtime. +// You MAY need override this function if the standard COMMON_TOKEN_STREAM is not what you are using. +// +static void * +getMissingSymbol (pANTLR3_BASE_RECOGNIZER recognizer, pANTLR3_INT_STREAM istream, pANTLR3_EXCEPTION e, + ANTLR3_UINT32 expectedTokenType, pANTLR3_BITSET_LIST follow) +{ + pANTLR3_TOKEN_STREAM ts; + pANTLR3_COMMON_TOKEN_STREAM cts; + pANTLR3_COMMON_TOKEN token; + pANTLR3_COMMON_TOKEN current; + pANTLR3_STRING text; + + // Dereference the standard pointers + // + ts = (pANTLR3_TOKEN_STREAM)istream->super; + cts = (pANTLR3_COMMON_TOKEN_STREAM)ts->super; + + // Work out what to use as the current symbol to make a line and offset etc + // If we are at EOF, we use the token before EOF + // + current = ts->_LT(ts, 1); + if (current->getType(current) == ANTLR3_TOKEN_EOF) + { + current = ts->_LT(ts, -1); + } + + // Create a new empty token + // + if (recognizer->state->tokFactory == NULL) + { + // We don't yet have a token factory for making tokens + // we just need a fake one using the input stream of the current + // token. + // + recognizer->state->tokFactory = antlr3TokenFactoryNew(current->input); + } + token = recognizer->state->tokFactory->newToken(recognizer->state->tokFactory); + + // Set some of the token properties based on the current token + // + token->setLine (token, current->getLine(current)); + token->setCharPositionInLine (token, current->getCharPositionInLine(current)); + token->setChannel (token, ANTLR3_TOKEN_DEFAULT_CHANNEL); + token->setType (token, expectedTokenType); + token->user1 = current->user1; + token->user2 = current->user2; + token->user3 = current->user3; + token->custom = current->custom; + token->lineStart = current->lineStart; + + // Create the token text that shows it has been inserted + // + token->setText8(token, (pANTLR3_UINT8)"getText(token); + + if (text != NULL) + { + text->append8(text, (const char *)recognizer->state->tokenNames[expectedTokenType]); + text->append8(text, (const char *)">"); + } + + // Finally return the pointer to our new token + // + return token; +} + + +#ifdef ANTLR3_WINDOWS +#pragma warning( default : 4100 ) +#endif + +/// @} +/// + diff --git a/antlr/libantlr3c-3.4/src/antlr3basetree.c b/antlr/libantlr3c-3.4/src/antlr3basetree.c new file mode 100644 index 0000000..bbc81e7 --- /dev/null +++ b/antlr/libantlr3c-3.4/src/antlr3basetree.c @@ -0,0 +1,489 @@ +#include + +#ifdef ANTLR3_WINDOWS +#pragma warning( disable : 4100 ) +#endif + +// [The "BSD licence"] +// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC +// http://www.temporal-wave.com +// http://www.linkedin.com/in/jimidle +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. The name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +static void * getChild (pANTLR3_BASE_TREE tree, ANTLR3_UINT32 i); +static ANTLR3_UINT32 getChildCount (pANTLR3_BASE_TREE tree); +static ANTLR3_UINT32 getCharPositionInLine +(pANTLR3_BASE_TREE tree); +static ANTLR3_UINT32 getLine (pANTLR3_BASE_TREE tree); +static pANTLR3_BASE_TREE +getFirstChildWithType +(pANTLR3_BASE_TREE tree, ANTLR3_UINT32 type); +static void addChild (pANTLR3_BASE_TREE tree, pANTLR3_BASE_TREE child); +static void addChildren (pANTLR3_BASE_TREE tree, pANTLR3_LIST kids); +static void replaceChildren (pANTLR3_BASE_TREE parent, ANTLR3_INT32 startChildIndex, ANTLR3_INT32 stopChildIndex, pANTLR3_BASE_TREE t); + +static void freshenPACIndexesAll(pANTLR3_BASE_TREE tree); +static void freshenPACIndexes (pANTLR3_BASE_TREE tree, ANTLR3_UINT32 offset); + +static void setChild (pANTLR3_BASE_TREE tree, ANTLR3_UINT32 i, void * child); +static void * deleteChild (pANTLR3_BASE_TREE tree, ANTLR3_UINT32 i); +static void * dupTree (pANTLR3_BASE_TREE tree); +static pANTLR3_STRING toStringTree (pANTLR3_BASE_TREE tree); + + +ANTLR3_API pANTLR3_BASE_TREE +antlr3BaseTreeNew(pANTLR3_BASE_TREE tree) +{ + /* api */ + tree->getChild = getChild; + tree->getChildCount = getChildCount; + tree->addChild = (void (*)(pANTLR3_BASE_TREE, void *))(addChild); + tree->addChildren = addChildren; + tree->setChild = setChild; + tree->deleteChild = deleteChild; + tree->dupTree = dupTree; + tree->toStringTree = toStringTree; + tree->getCharPositionInLine = getCharPositionInLine; + tree->getLine = getLine; + tree->replaceChildren = replaceChildren; + tree->freshenPACIndexesAll = freshenPACIndexesAll; + tree->freshenPACIndexes = freshenPACIndexes; + tree->getFirstChildWithType = (void *(*)(pANTLR3_BASE_TREE, ANTLR3_UINT32))(getFirstChildWithType); + tree->children = NULL; + tree->strFactory = NULL; + + /* Rest must be filled in by caller. + */ + return tree; +} + +static ANTLR3_UINT32 +getCharPositionInLine (pANTLR3_BASE_TREE tree) +{ + return 0; +} + +static ANTLR3_UINT32 +getLine (pANTLR3_BASE_TREE tree) +{ + return 0; +} +static pANTLR3_BASE_TREE +getFirstChildWithType (pANTLR3_BASE_TREE tree, ANTLR3_UINT32 type) +{ + ANTLR3_UINT32 i; + ANTLR3_UINT32 cs; + + pANTLR3_BASE_TREE t; + if (tree->children != NULL) + { + cs = tree->children->size(tree->children); + for (i = 0; i < cs; i++) + { + t = (pANTLR3_BASE_TREE) (tree->children->get(tree->children, i)); + if (tree->getType(t) == type) + { + return (pANTLR3_BASE_TREE)t; + } + } + } + return NULL; +} + + + +static void * +getChild (pANTLR3_BASE_TREE tree, ANTLR3_UINT32 i) +{ + if ( tree->children == NULL + || i >= tree->children->size(tree->children)) + { + return NULL; + } + return tree->children->get(tree->children, i); +} + + +static ANTLR3_UINT32 +getChildCount (pANTLR3_BASE_TREE tree) +{ + if (tree->children == NULL) + { + return 0; + } + else + { + return tree->children->size(tree->children); + } +} + +void +addChild (pANTLR3_BASE_TREE tree, pANTLR3_BASE_TREE child) +{ + ANTLR3_UINT32 n; + ANTLR3_UINT32 i; + + if (child == NULL) + { + return; + } + + if (child->isNilNode(child) == ANTLR3_TRUE) + { + if (child->children != NULL && child->children == tree->children) + { + // TODO: Change to exception rather than ANTLR3_FPRINTF? + // + ANTLR3_FPRINTF(stderr, "ANTLR3: An attempt was made to add a child list to itself!\n"); + return; + } + + // Add all of the children's children to this list + // + if (child->children != NULL) + { + if (tree->children == NULL) + { + // We are build ing the tree structure here, so we need not + // worry about duplication of pointers as the tree node + // factory will only clean up each node once. So we just + // copy in the child's children pointer as the child is + // a nil node (has not root itself). + // + tree->children = child->children; + child->children = NULL; + freshenPACIndexesAll(tree); + + } + else + { + // Need to copy the children + // + n = child->children->size(child->children); + + for (i = 0; i < n; i++) + { + pANTLR3_BASE_TREE entry; + entry = child->children->get(child->children, i); + + // ANTLR3 lists can be sparse, unlike Array Lists + // + if (entry != NULL) + { + tree->children->add(tree->children, entry, (void (ANTLR3_CDECL *) (void *))child->free); + } + } + } + } + } + else + { + // Tree we are adding is not a Nil and might have children to copy + // + if (tree->children == NULL) + { + // No children in the tree we are adding to, so create a new list on + // the fly to hold them. + // + tree->createChildrenList(tree); + } + + tree->children->add(tree->children, child, (void (ANTLR3_CDECL *)(void *))child->free); + + } +} + +/// Add all elements of the supplied list as children of this node +/// +static void +addChildren (pANTLR3_BASE_TREE tree, pANTLR3_LIST kids) +{ + ANTLR3_UINT32 i; + ANTLR3_UINT32 s; + + s = kids->size(kids); + for (i = 0; iaddChild(tree, (pANTLR3_BASE_TREE)(kids->get(kids, i+1))); + } +} + + +static void +setChild (pANTLR3_BASE_TREE tree, ANTLR3_UINT32 i, void * child) +{ + if (tree->children == NULL) + { + tree->createChildrenList(tree); + } + tree->children->set(tree->children, i, child, NULL, ANTLR3_FALSE); +} + +static void * +deleteChild (pANTLR3_BASE_TREE tree, ANTLR3_UINT32 i) +{ + if ( tree->children == NULL) + { + return NULL; + } + + return tree->children->remove(tree->children, i); +} + +static void * +dupTree (pANTLR3_BASE_TREE tree) +{ + pANTLR3_BASE_TREE newTree; + ANTLR3_UINT32 i; + ANTLR3_UINT32 s; + + newTree = tree->dupNode (tree); + + if (tree->children != NULL) + { + s = tree->children->size (tree->children); + + for (i = 0; i < s; i++) + { + pANTLR3_BASE_TREE t; + pANTLR3_BASE_TREE newNode; + + t = (pANTLR3_BASE_TREE) tree->children->get(tree->children, i); + + if (t!= NULL) + { + newNode = t->dupTree(t); + newTree->addChild(newTree, newNode); + } + } + } + + return newTree; +} + +static pANTLR3_STRING +toStringTree (pANTLR3_BASE_TREE tree) +{ + pANTLR3_STRING string; + ANTLR3_UINT32 i; + ANTLR3_UINT32 n; + pANTLR3_BASE_TREE t; + + if (tree->children == NULL || tree->children->size(tree->children) == 0) + { + return tree->toString(tree); + } + + /* Need a new string with nothing at all in it. + */ + string = tree->strFactory->newRaw(tree->strFactory); + + if (tree->isNilNode(tree) == ANTLR3_FALSE) + { + string->append8 (string, "("); + string->appendS (string, tree->toString(tree)); + string->append8 (string, " "); + } + if (tree->children != NULL) + { + n = tree->children->size(tree->children); + + for (i = 0; i < n; i++) + { + t = (pANTLR3_BASE_TREE) tree->children->get(tree->children, i); + + if (i > 0) + { + string->append8(string, " "); + } + string->appendS(string, t->toStringTree(t)); + } + } + if (tree->isNilNode(tree) == ANTLR3_FALSE) + { + string->append8(string,")"); + } + + return string; +} + +/// Delete children from start to stop and replace with t even if t is +/// a list (nil-root tree). Num of children can increase or decrease. +/// For huge child lists, inserting children can force walking rest of +/// children to set their child index; could be slow. +/// +static void +replaceChildren (pANTLR3_BASE_TREE parent, ANTLR3_INT32 startChildIndex, ANTLR3_INT32 stopChildIndex, pANTLR3_BASE_TREE newTree) +{ + ANTLR3_INT32 replacingHowMany; // How many nodes will go away + ANTLR3_INT32 replacingWithHowMany; // How many nodes will replace them + ANTLR3_INT32 numNewChildren; // Tracking variable + ANTLR3_INT32 delta; // Difference in new vs existing count + + ANTLR3_INT32 i; + ANTLR3_INT32 j; + + pANTLR3_VECTOR newChildren; // Iterator for whatever we are going to add in + ANTLR3_BOOLEAN freeNewChildren; // Whether we created the iterator locally or reused it + + if (parent->children == NULL) + { + ANTLR3_FPRINTF(stderr, "replaceChildren call: Indexes are invalid; no children in list for %s", parent->getText(parent)->chars); + return; + } + + // Either use the existing list of children in the supplied nil node, or build a vector of the + // tree we were given if it is not a nil node, then we treat both situations exactly the same + // + if (newTree->isNilNode(newTree)) + { + newChildren = newTree->children; + freeNewChildren = ANTLR3_FALSE; // We must NO free this memory + } + else + { + newChildren = antlr3VectorNew(1); + if (newChildren == NULL) + { + ANTLR3_FPRINTF(stderr, "replaceChildren: out of memory!!"); + exit(1); + } + newChildren->add(newChildren, (void *)newTree, NULL); + + freeNewChildren = ANTLR3_TRUE; // We must free this memory + } + + // Initialize + // + replacingHowMany = stopChildIndex - startChildIndex + 1; + replacingWithHowMany = newChildren->size(newChildren); + delta = replacingHowMany - replacingWithHowMany; + numNewChildren = newChildren->size(newChildren); + + // If it is the same number of nodes, then do a direct replacement + // + if (delta == 0) + { + pANTLR3_BASE_TREE child; + + // Same number of nodes + // + j = 0; + for (i = startChildIndex; i <= stopChildIndex; i++) + { + child = (pANTLR3_BASE_TREE) newChildren->get(newChildren, j); + parent->children->set(parent->children, i, child, NULL, ANTLR3_FALSE); + child->setParent(child, parent); + child->setChildIndex(child, i); + } + } + else if (delta > 0) + { + ANTLR3_UINT32 indexToDelete; + + // Less nodes than there were before + // reuse what we have then delete the rest + // + for (j = 0; j < numNewChildren; j++) + { + parent->children->set(parent->children, startChildIndex + j, newChildren->get(newChildren, j), NULL, ANTLR3_FALSE); + } + + // We just delete the same index position until done + // + indexToDelete = startChildIndex + numNewChildren; + + for (j = indexToDelete; j <= (ANTLR3_INT32)stopChildIndex; j++) + { + parent->children->remove(parent->children, indexToDelete); + } + + parent->freshenPACIndexes(parent, startChildIndex); + } + else + { + ANTLR3_UINT32 numToInsert; + + // More nodes than there were before + // Use what we can, then start adding + // + for (j = 0; j < replacingHowMany; j++) + { + parent->children->set(parent->children, startChildIndex + j, newChildren->get(newChildren, j), NULL, ANTLR3_FALSE); + } + + numToInsert = replacingWithHowMany - replacingHowMany; + + for (j = replacingHowMany; j < replacingWithHowMany; j++) + { + parent->children->add(parent->children, newChildren->get(newChildren, j), NULL); + } + + parent->freshenPACIndexes(parent, startChildIndex); + } + + if (freeNewChildren == ANTLR3_TRUE) + { + ANTLR3_FREE(newChildren->elements); + newChildren->elements = NULL; + newChildren->size = 0; + ANTLR3_FREE(newChildren); // Will not free the nodes + } +} + +/// Set the parent and child indexes for all children of the +/// supplied tree. +/// +static void +freshenPACIndexesAll(pANTLR3_BASE_TREE tree) +{ + tree->freshenPACIndexes(tree, 0); +} + +/// Set the parent and child indexes for some of the children of the +/// supplied tree, starting with the child at the supplied index. +/// +static void +freshenPACIndexes (pANTLR3_BASE_TREE tree, ANTLR3_UINT32 offset) +{ + ANTLR3_UINT32 count; + ANTLR3_UINT32 c; + + count = tree->getChildCount(tree); // How many children do we have + + // Loop from the supplied index and set the indexes and parent + // + for (c = offset; c < count; c++) + { + pANTLR3_BASE_TREE child; + + child = tree->getChild(tree, c); + + child->setChildIndex(child, c); + child->setParent(child, tree); + } +} + diff --git a/antlr/libantlr3c-3.4/src/antlr3basetreeadaptor.c b/antlr/libantlr3c-3.4/src/antlr3basetreeadaptor.c new file mode 100644 index 0000000..e35878f --- /dev/null +++ b/antlr/libantlr3c-3.4/src/antlr3basetreeadaptor.c @@ -0,0 +1,909 @@ +/** \file + * Contains the base functions that all tree adaptors start with. + * this implementation can then be overridden by any higher implementation. + * + */ + +// [The "BSD licence"] +// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC +// http://www.temporal-wave.com +// http://www.linkedin.com/in/jimidle +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. The name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include + +#ifdef ANTLR3_WINDOWS +#pragma warning( disable : 4100 ) +#endif + +/* Interface functions + */ +static pANTLR3_BASE_TREE nilNode (pANTLR3_BASE_TREE_ADAPTOR adaptor); +static pANTLR3_BASE_TREE dbgNil (pANTLR3_BASE_TREE_ADAPTOR adaptor); +static pANTLR3_BASE_TREE dupTree (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE t); +static pANTLR3_BASE_TREE dbgDupTree (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE t); +static pANTLR3_BASE_TREE dupTreeTT (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE t, pANTLR3_BASE_TREE parent); +static void addChild (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE t, pANTLR3_BASE_TREE child); +static void dbgAddChild (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE t, pANTLR3_BASE_TREE child); +static pANTLR3_BASE_TREE becomeRoot (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE newRoot, pANTLR3_BASE_TREE oldRoot); +static pANTLR3_BASE_TREE dbgBecomeRoot (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE newRoot, pANTLR3_BASE_TREE oldRoot); +static pANTLR3_BASE_TREE rulePostProcessing (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE root); +static void addChildToken (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE t, pANTLR3_COMMON_TOKEN child); +static void dbgAddChildToken (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE t, pANTLR3_COMMON_TOKEN child); +static pANTLR3_BASE_TREE becomeRootToken (pANTLR3_BASE_TREE_ADAPTOR adaptor, void * newRoot, pANTLR3_BASE_TREE oldRoot); +static pANTLR3_BASE_TREE dbgBecomeRootToken (pANTLR3_BASE_TREE_ADAPTOR adaptor, void * newRoot, pANTLR3_BASE_TREE oldRoot); +static pANTLR3_BASE_TREE createTypeToken (pANTLR3_BASE_TREE_ADAPTOR adaptor, ANTLR3_UINT32 tokenType, pANTLR3_COMMON_TOKEN fromToken); +static pANTLR3_BASE_TREE dbgCreateTypeToken (pANTLR3_BASE_TREE_ADAPTOR adaptor, ANTLR3_UINT32 tokenType, pANTLR3_COMMON_TOKEN fromToken); +static pANTLR3_BASE_TREE createTypeTokenText (pANTLR3_BASE_TREE_ADAPTOR adaptor, ANTLR3_UINT32 tokenType, pANTLR3_COMMON_TOKEN fromToken, pANTLR3_UINT8 text); +static pANTLR3_BASE_TREE dbgCreateTypeTokenText (pANTLR3_BASE_TREE_ADAPTOR adaptor, ANTLR3_UINT32 tokenType, pANTLR3_COMMON_TOKEN fromToken, pANTLR3_UINT8 text); +static pANTLR3_BASE_TREE createTypeText (pANTLR3_BASE_TREE_ADAPTOR adaptor, ANTLR3_UINT32 tokenType, pANTLR3_UINT8 text); +static pANTLR3_BASE_TREE dbgCreateTypeText (pANTLR3_BASE_TREE_ADAPTOR adaptor, ANTLR3_UINT32 tokenType, pANTLR3_UINT8 text); +static ANTLR3_UINT32 getType (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE t); +static void setType (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE t, ANTLR3_UINT32 type); +static pANTLR3_STRING getText (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE t); +static void setText (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_STRING t); +static void setText8 (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_UINT8 t); +static pANTLR3_BASE_TREE getChild (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE t, ANTLR3_UINT32 i); +static ANTLR3_UINT32 getChildCount (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE t); +static ANTLR3_UINT32 getUniqueID (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE t); +static ANTLR3_BOOLEAN isNilNode (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE t); +static pANTLR3_STRING makeDot (pANTLR3_BASE_TREE_ADAPTOR adaptor, void * theTree); + +/** Given a pointer to a base tree adaptor structure (which is usually embedded in the + * super class the implements the tree adaptor used in the parse), initialize its + * function pointers and so on. + */ +ANTLR3_API void +antlr3BaseTreeAdaptorInit(pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_DEBUG_EVENT_LISTENER debugger) +{ + // Initialize the interface + // + if (debugger == NULL) + { + adaptor->nilNode = (void * (*)(pANTLR3_BASE_TREE_ADAPTOR)) + nilNode; + adaptor->addChild = (void (*)(pANTLR3_BASE_TREE_ADAPTOR, void *, void *)) + addChild; + adaptor->becomeRoot = (void * (*)(pANTLR3_BASE_TREE_ADAPTOR, void *, void *)) + becomeRoot; + adaptor->addChildToken = (void (*)(pANTLR3_BASE_TREE_ADAPTOR, void *, pANTLR3_COMMON_TOKEN)) + addChildToken; + adaptor->becomeRootToken = (void * (*)(pANTLR3_BASE_TREE_ADAPTOR, void *, void *)) + becomeRootToken; + adaptor->createTypeToken = (void * (*)(pANTLR3_BASE_TREE_ADAPTOR, ANTLR3_UINT32, pANTLR3_COMMON_TOKEN)) + createTypeToken; + adaptor->createTypeTokenText = (void * (*)(pANTLR3_BASE_TREE_ADAPTOR, ANTLR3_UINT32, pANTLR3_COMMON_TOKEN, pANTLR3_UINT8)) + createTypeTokenText; + adaptor->createTypeText = (void * (*)(pANTLR3_BASE_TREE_ADAPTOR, ANTLR3_UINT32, pANTLR3_UINT8)) + createTypeText; + adaptor->dupTree = (void * (*)(pANTLR3_BASE_TREE_ADAPTOR, void *)) + dupTree; + } + else + { + adaptor->nilNode = (void * (*)(pANTLR3_BASE_TREE_ADAPTOR)) + dbgNil; + adaptor->addChild = (void (*)(pANTLR3_BASE_TREE_ADAPTOR, void *, void *)) + dbgAddChild; + adaptor->becomeRoot = (void * (*)(pANTLR3_BASE_TREE_ADAPTOR, void *, void *)) + dbgBecomeRoot; + adaptor->addChildToken = (void (*)(pANTLR3_BASE_TREE_ADAPTOR, void *, pANTLR3_COMMON_TOKEN)) + dbgAddChildToken; + adaptor->becomeRootToken = (void * (*)(pANTLR3_BASE_TREE_ADAPTOR, void *, void *)) + dbgBecomeRootToken; + adaptor->createTypeToken = (void * (*)(pANTLR3_BASE_TREE_ADAPTOR, ANTLR3_UINT32, pANTLR3_COMMON_TOKEN)) + dbgCreateTypeToken; + adaptor->createTypeTokenText = (void * (*)(pANTLR3_BASE_TREE_ADAPTOR, ANTLR3_UINT32, pANTLR3_COMMON_TOKEN, pANTLR3_UINT8)) + dbgCreateTypeTokenText; + adaptor->createTypeText = (void * (*)(pANTLR3_BASE_TREE_ADAPTOR, ANTLR3_UINT32, pANTLR3_UINT8)) + dbgCreateTypeText; + adaptor->dupTree = (void * (*)(pANTLR3_BASE_TREE_ADAPTOR, void *)) + dbgDupTree; + debugger->adaptor = adaptor; + } + + adaptor->dupTreeTT = (void * (*)(pANTLR3_BASE_TREE_ADAPTOR, void *, void *)) + dupTreeTT; + adaptor->rulePostProcessing = (void * (*)(pANTLR3_BASE_TREE_ADAPTOR, void *)) + rulePostProcessing; + adaptor->getType = (ANTLR3_UINT32 (*)(pANTLR3_BASE_TREE_ADAPTOR, void *)) + getType; + adaptor->setType = (void (*)(pANTLR3_BASE_TREE_ADAPTOR, void *, ANTLR3_UINT32)) + setType; + adaptor->getText = (pANTLR3_STRING (*) (pANTLR3_BASE_TREE_ADAPTOR, void *)) + getText; + adaptor->setText8 = (void (*)(pANTLR3_BASE_TREE_ADAPTOR, pANTLR3_UINT8)) + setText8; + adaptor->setText = (void (*)(pANTLR3_BASE_TREE_ADAPTOR, pANTLR3_STRING)) + setText; + adaptor->getChild = (void * (*)(pANTLR3_BASE_TREE_ADAPTOR, void *, ANTLR3_UINT32)) + getChild; + adaptor->getChildCount = (ANTLR3_UINT32 (*)(pANTLR3_BASE_TREE_ADAPTOR, void *)) + getChildCount; + adaptor->getUniqueID = (ANTLR3_UINT32 (*)(pANTLR3_BASE_TREE_ADAPTOR, void *)) + getUniqueID; + adaptor->isNilNode = (ANTLR3_BOOLEAN (*)(pANTLR3_BASE_TREE_ADAPTOR, void *)) + isNilNode; + + adaptor->makeDot = (pANTLR3_STRING (*)(pANTLR3_BASE_TREE_ADAPTOR, void *)) + makeDot; + + /* Remaining functions filled in by the caller. + */ + return; +} + +static void +defineDotNodes(pANTLR3_BASE_TREE_ADAPTOR adaptor, void * t, pANTLR3_STRING dotSpec ) +{ + // How many nodes are we talking about? + // + int nCount; + int i; + pANTLR3_BASE_TREE child; + char buff[64]; + pANTLR3_STRING text; + int j; + + + + + + // Count the nodes + // + nCount = adaptor->getChildCount(adaptor, t); + + if (nCount == 0) + { + // This will already have been included as a child of another node + // so there is nothing to add. + // + return; + } + + // For each child of the current tree, define a node using the + // memory address of the node to name it + // + for (i = 0; igetChild(adaptor, t, i); + + // Name the node + // + sprintf(buff, "\tn%p[label=\"", child); + dotSpec->append8(dotSpec, buff); + text = adaptor->getText(adaptor, child); + for (j = 0; j < (ANTLR3_INT32)(text->len); j++) + { + switch(text->charAt(text, j)) + { + case '"': + + dotSpec->append8(dotSpec, "\\\""); + break; + + case '\n': + + dotSpec->append8(dotSpec, "\\n"); + break; + + case '\r': + + dotSpec->append8(dotSpec, "\\r"); + break; + + default: + + dotSpec->addc(dotSpec, text->charAt(text, j)); + break; + } + } + dotSpec->append8(dotSpec, "\"]\n"); + + // And now define the children of this child (if any) + // + defineDotNodes(adaptor, child, dotSpec); + } + + // Done + // + return; +} + +static void +defineDotEdges(pANTLR3_BASE_TREE_ADAPTOR adaptor, void * t, pANTLR3_STRING dotSpec) +{ + // How many nodes are we talking about? + // + int nCount; + int i; + + if (t == NULL) + { + // No tree, so do nothing + // + return; + } + + // Count the nodes + // + nCount = adaptor->getChildCount(adaptor, t); + + if (nCount == 0) + { + // This will already have been included as a child of another node + // so there is nothing to add. + // + return; + } + + // For each child, define an edge from this parent, then process + // and children of this child in the same way + // + for (i=0; igetChild(adaptor, t, i); + + // Create the edge relation + // + sprintf(buff, "\t\tn%p -> n%p\t\t// ", t, child); + + dotSpec->append8(dotSpec, buff); + + // Document the relationship + // + text = adaptor->getText(adaptor, t); + for (j = 0; j < (ANTLR3_INT32)(text->len); j++) + { + switch(text->charAt(text, j)) + { + case '"': + + dotSpec->append8(dotSpec, "\\\""); + break; + + case '\n': + + dotSpec->append8(dotSpec, "\\n"); + break; + + case '\r': + + dotSpec->append8(dotSpec, "\\r"); + break; + + default: + + dotSpec->addc(dotSpec, text->charAt(text, j)); + break; + } + } + + dotSpec->append8(dotSpec, " -> "); + + text = adaptor->getText(adaptor, child); + for (j = 0; j < (ANTLR3_INT32)(text->len); j++) + { + switch(text->charAt(text, j)) + { + case '"': + + dotSpec->append8(dotSpec, "\\\""); + break; + + case '\n': + + dotSpec->append8(dotSpec, "\\n"); + break; + + case '\r': + + dotSpec->append8(dotSpec, "\\r"); + break; + + default: + + dotSpec->addc(dotSpec, text->charAt(text, j)); + break; + } + } + dotSpec->append8(dotSpec, "\n"); + + + // Define edges for this child + // + defineDotEdges(adaptor, child, dotSpec); + } + + // Done + // + return; +} + +/// Produce a DOT specification for graphviz +// +static pANTLR3_STRING +makeDot (pANTLR3_BASE_TREE_ADAPTOR adaptor, void * theTree) +{ + // The string we are building up + // + pANTLR3_STRING dotSpec; + char buff[64]; + pANTLR3_STRING text; + int j; + + dotSpec = adaptor->strFactory->newStr8 + + ( + adaptor->strFactory, + + // Default look and feel + // + (pANTLR3_UINT8) + "digraph {\n\n" + "\tordering=out;\n" + "\tranksep=.4;\n" + "\tbgcolor=\"lightgrey\"; node [shape=box, fixedsize=false, fontsize=12, fontname=\"Helvetica-bold\", fontcolor=\"blue\"\n" + "\twidth=.25, height=.25, color=\"black\", fillcolor=\"white\", style=\"filled, solid, bold\"];\n\n" + "\tedge [arrowsize=.5, color=\"black\", style=\"bold\"]\n\n" + ); + + if (theTree == NULL) + { + // No tree, so create a blank spec + // + dotSpec->append8(dotSpec, "n0[label=\"EMPTY TREE\"]\n"); + return dotSpec; + } + + sprintf(buff, "\tn%p[label=\"", theTree); + dotSpec->append8(dotSpec, buff); + text = adaptor->getText(adaptor, theTree); + for (j = 0; j < (ANTLR3_INT32)(text->len); j++) + { + switch(text->charAt(text, j)) + { + case '"': + + dotSpec->append8(dotSpec, "\\\""); + break; + + case '\n': + + dotSpec->append8(dotSpec, "\\n"); + break; + + case '\r': + + dotSpec->append8(dotSpec, "\\r"); + break; + + default: + + dotSpec->addc(dotSpec, text->charAt(text, j)); + break; + } + } + dotSpec->append8(dotSpec, "\"]\n"); + + // First produce the node defintions + // + defineDotNodes(adaptor, theTree, dotSpec); + dotSpec->append8(dotSpec, "\n"); + defineDotEdges(adaptor, theTree, dotSpec); + + // Terminate the spec + // + dotSpec->append8(dotSpec, "\n}"); + + // Result + // + return dotSpec; +} + + +/** Create and return a nil tree node (no token payload) + */ +static pANTLR3_BASE_TREE +nilNode (pANTLR3_BASE_TREE_ADAPTOR adaptor) +{ + return adaptor->create(adaptor, NULL); +} + +static pANTLR3_BASE_TREE +dbgNil (pANTLR3_BASE_TREE_ADAPTOR adaptor) +{ + pANTLR3_BASE_TREE t; + + t = adaptor->create (adaptor, NULL); + adaptor->debugger->createNode (adaptor->debugger, t); + + return t; +} + +/** Return a duplicate of the entire tree (implementation provided by the + * BASE_TREE interface.) + */ +static pANTLR3_BASE_TREE +dupTree (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE t) +{ + return adaptor->dupTreeTT(adaptor, t, NULL); +} + +pANTLR3_BASE_TREE +dupTreeTT (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE t, pANTLR3_BASE_TREE parent) +{ + pANTLR3_BASE_TREE newTree; + pANTLR3_BASE_TREE child; + pANTLR3_BASE_TREE newSubTree; + ANTLR3_UINT32 n; + ANTLR3_UINT32 i; + + if (t == NULL) + { + return NULL; + } + newTree = t->dupNode(t); + + // Ensure new subtree root has parent/child index set + // + adaptor->setChildIndex (adaptor, newTree, t->getChildIndex(t)); + adaptor->setParent (adaptor, newTree, parent); + n = adaptor->getChildCount (adaptor, t); + + for (i=0; i < n; i++) + { + child = adaptor->getChild (adaptor, t, i); + newSubTree = adaptor->dupTreeTT (adaptor, child, t); + adaptor->addChild (adaptor, newTree, newSubTree); + } + return newTree; +} + +/// Sends the required debugging events for duplicating a tree +/// to the debugger. +/// +static void +simulateTreeConstruction(pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE tree) +{ + ANTLR3_UINT32 n; + ANTLR3_UINT32 i; + pANTLR3_BASE_TREE child; + + // Send the create node event + // + adaptor->debugger->createNode(adaptor->debugger, tree); + + n = adaptor->getChildCount(adaptor, tree); + for (i = 0; i < n; i++) + { + child = adaptor->getChild(adaptor, tree, i); + simulateTreeConstruction(adaptor, child); + adaptor->debugger->addChild(adaptor->debugger, tree, child); + } +} + +pANTLR3_BASE_TREE +dbgDupTree (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE tree) +{ + pANTLR3_BASE_TREE t; + + // Call the normal dup tree mechanism first + // + t = adaptor->dupTreeTT(adaptor, tree, NULL); + + // In order to tell the debugger what we have just done, we now + // simulate the tree building mechanism. THis will fire + // lots of debugging events to the client and look like we + // duped the tree.. + // + simulateTreeConstruction(adaptor, t); + + return t; +} + +/** Add a child to the tree t. If child is a flat tree (a list), make all + * in list children of t. Warning: if t has no children, but child does + * and child isNilNode then it is ok to move children to t via + * t.children = child.children; i.e., without copying the array. This + * is for construction and I'm not sure it's completely general for + * a tree's addChild method to work this way. Make sure you differentiate + * between your tree's addChild and this parser tree construction addChild + * if it's not ok to move children to t with a simple assignment. + */ +static void +addChild (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE t, pANTLR3_BASE_TREE child) +{ + if (t != NULL && child != NULL) + { + t->addChild(t, child); + } +} +static void +dbgAddChild (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE t, pANTLR3_BASE_TREE child) +{ + if (t != NULL && child != NULL) + { + t->addChild(t, child); + adaptor->debugger->addChild(adaptor->debugger, t, child); + } +} +/** Use the adaptor implementation to add a child node with the supplied token + */ +static void +addChildToken (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE t, pANTLR3_COMMON_TOKEN child) +{ + if (t != NULL && child != NULL) + { + adaptor->addChild(adaptor, t, adaptor->create(adaptor, child)); + } +} +static void +dbgAddChildToken (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE t, pANTLR3_COMMON_TOKEN child) +{ + pANTLR3_BASE_TREE tc; + + if (t != NULL && child != NULL) + { + tc = adaptor->create(adaptor, child); + adaptor->addChild(adaptor, t, tc); + adaptor->debugger->addChild(adaptor->debugger, t, tc); + } +} + +/** If oldRoot is a nil root, just copy or move the children to newRoot. + * If not a nil root, make oldRoot a child of newRoot. + * + * \code + * old=^(nil a b c), new=r yields ^(r a b c) + * old=^(a b c), new=r yields ^(r ^(a b c)) + * \endcode + * + * If newRoot is a nil-rooted single child tree, use the single + * child as the new root node. + * + * \code + * old=^(nil a b c), new=^(nil r) yields ^(r a b c) + * old=^(a b c), new=^(nil r) yields ^(r ^(a b c)) + * \endcode + * + * If oldRoot was null, it's ok, just return newRoot (even if isNilNode). + * + * \code + * old=null, new=r yields r + * old=null, new=^(nil r) yields ^(nil r) + * \endcode + * + * Return newRoot. Throw an exception if newRoot is not a + * simple node or nil root with a single child node--it must be a root + * node. If newRoot is ^(nil x) return x as newRoot. + * + * Be advised that it's ok for newRoot to point at oldRoot's + * children; i.e., you don't have to copy the list. We are + * constructing these nodes so we should have this control for + * efficiency. + */ +static pANTLR3_BASE_TREE +becomeRoot (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE newRootTree, pANTLR3_BASE_TREE oldRootTree) +{ + pANTLR3_BASE_TREE saveRoot; + + /* Protect against tree rewrites if we are in some sort of error + * state, but have tried to recover. In C we can end up with a null pointer + * for a tree that was not produced. + */ + if (newRootTree == NULL) + { + return oldRootTree; + } + + /* root is just the new tree as is if there is no + * current root tree. + */ + if (oldRootTree == NULL) + { + return newRootTree; + } + + /* Produce ^(nil real-node) + */ + if (newRootTree->isNilNode(newRootTree)) + { + if (newRootTree->getChildCount(newRootTree) > 1) + { + /* TODO: Handle tree exceptions + */ + ANTLR3_FPRINTF(stderr, "More than one node as root! TODO: Create tree exception handling\n"); + return newRootTree; + } + + /* The new root is the first child, keep track of the original newRoot + * because if it was a Nil Node, then we can reuse it now. + */ + saveRoot = newRootTree; + newRootTree = newRootTree->getChild(newRootTree, 0); + + // Reclaim the old nilNode() + // + saveRoot->reuse(saveRoot); + } + + /* Add old root into new root. addChild takes care of the case where oldRoot + * is a flat list (nill rooted tree). All children of oldroot are added to + * new root. + */ + newRootTree->addChild(newRootTree, oldRootTree); + + // If the oldroot tree was a nil node, then we know at this point + // it has become orphaned by the rewrite logic, so we tell it to do + // whatever it needs to do to be reused. + // + if (oldRootTree->isNilNode(oldRootTree)) + { + // We have taken an old Root Tree and appended all its children to the new + // root. In addition though it was a nil node, which means the generated code + // will not reuse it again, so we will reclaim it here. First we want to zero out + // any pointers it was carrying around. We are just the baseTree handler so we + // don't know necessarilly know how to do this for the real node, we just ask the tree itself + // to do it. + // + oldRootTree->reuse(oldRootTree); + } + /* Always returns new root structure + */ + return newRootTree; + +} +static pANTLR3_BASE_TREE +dbgBecomeRoot (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE newRootTree, pANTLR3_BASE_TREE oldRootTree) +{ + pANTLR3_BASE_TREE t; + + t = becomeRoot(adaptor, newRootTree, oldRootTree); + + adaptor->debugger->becomeRoot(adaptor->debugger, newRootTree, oldRootTree); + + return t; +} +/** Transform ^(nil x) to x + */ +static pANTLR3_BASE_TREE + rulePostProcessing (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE root) +{ + pANTLR3_BASE_TREE saveRoot; + + // Keep track of the root we are given. If it is a nilNode, then we + // can reuse it rather than orphaning it! + // + saveRoot = root; + + if (root != NULL && root->isNilNode(root)) + { + if (root->getChildCount(root) == 0) + { + root = NULL; + } + else if (root->getChildCount(root) == 1) + { + root = root->getChild(root, 0); + root->setParent(root, NULL); + root->setChildIndex(root, -1); + + // The root we were given was a nil node, wiht one child, which means it has + // been abandoned and would be lost in the node factory. However + // nodes can be flagged as resuable to prevent this terrible waste + // + saveRoot->reuse(saveRoot); + } + } + + return root; +} + +/** Use the adaptor interface to set a new tree node with the supplied token + * to the root of the tree. + */ +static pANTLR3_BASE_TREE + becomeRootToken (pANTLR3_BASE_TREE_ADAPTOR adaptor, void * newRoot, pANTLR3_BASE_TREE oldRoot) +{ + return adaptor->becomeRoot(adaptor, adaptor->create(adaptor, newRoot), oldRoot); +} +static pANTLR3_BASE_TREE +dbgBecomeRootToken (pANTLR3_BASE_TREE_ADAPTOR adaptor, void * newRoot, pANTLR3_BASE_TREE oldRoot) +{ + pANTLR3_BASE_TREE t; + + t = adaptor->becomeRoot(adaptor, adaptor->create(adaptor, newRoot), oldRoot); + + adaptor->debugger->becomeRoot(adaptor->debugger,t, oldRoot); + + return t; +} + +/** Use the super class supplied create() method to create a new node + * from the supplied token. + */ +static pANTLR3_BASE_TREE +createTypeToken (pANTLR3_BASE_TREE_ADAPTOR adaptor, ANTLR3_UINT32 tokenType, pANTLR3_COMMON_TOKEN fromToken) +{ + /* Create the new token + */ + fromToken = adaptor->createTokenFromToken(adaptor, fromToken); + + /* Set the type of the new token to that supplied + */ + fromToken->setType(fromToken, tokenType); + + /* Return a new node based upon this token + */ + return adaptor->create(adaptor, fromToken); +} +static pANTLR3_BASE_TREE +dbgCreateTypeToken (pANTLR3_BASE_TREE_ADAPTOR adaptor, ANTLR3_UINT32 tokenType, pANTLR3_COMMON_TOKEN fromToken) +{ + pANTLR3_BASE_TREE t; + + t = createTypeToken(adaptor, tokenType, fromToken); + + adaptor->debugger->createNode(adaptor->debugger, t); + + return t; +} + +static pANTLR3_BASE_TREE +createTypeTokenText (pANTLR3_BASE_TREE_ADAPTOR adaptor, ANTLR3_UINT32 tokenType, pANTLR3_COMMON_TOKEN fromToken, pANTLR3_UINT8 text) +{ + /* Create the new token + */ + fromToken = adaptor->createTokenFromToken(adaptor, fromToken); + + /* Set the type of the new token to that supplied + */ + fromToken->setType(fromToken, tokenType); + + /* Set the text of the token accordingly + */ + fromToken->setText8(fromToken, text); + + /* Return a new node based upon this token + */ + return adaptor->create(adaptor, fromToken); +} +static pANTLR3_BASE_TREE +dbgCreateTypeTokenText (pANTLR3_BASE_TREE_ADAPTOR adaptor, ANTLR3_UINT32 tokenType, pANTLR3_COMMON_TOKEN fromToken, pANTLR3_UINT8 text) +{ + pANTLR3_BASE_TREE t; + + t = createTypeTokenText(adaptor, tokenType, fromToken, text); + + adaptor->debugger->createNode(adaptor->debugger, t); + + return t; +} + +static pANTLR3_BASE_TREE + createTypeText (pANTLR3_BASE_TREE_ADAPTOR adaptor, ANTLR3_UINT32 tokenType, pANTLR3_UINT8 text) +{ + pANTLR3_COMMON_TOKEN fromToken; + + /* Create the new token + */ + fromToken = adaptor->createToken(adaptor, tokenType, text); + + /* Return a new node based upon this token + */ + return adaptor->create(adaptor, fromToken); +} +static pANTLR3_BASE_TREE + dbgCreateTypeText (pANTLR3_BASE_TREE_ADAPTOR adaptor, ANTLR3_UINT32 tokenType, pANTLR3_UINT8 text) +{ + pANTLR3_BASE_TREE t; + + t = createTypeText(adaptor, tokenType, text); + + adaptor->debugger->createNode(adaptor->debugger, t); + + return t; + +} +/** Dummy implementation - will be supplied by super class + */ +static ANTLR3_UINT32 + getType (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE t) +{ + return 0; +} + +/** Dummy implementation - will be supplied by super class + */ +static void + setType (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE t, ANTLR3_UINT32 type) +{ + ANTLR3_FPRINTF(stderr, "Internal error - implementor of superclass containing ANTLR3_TREE_ADAPTOR did not implement setType()\n"); +} + +/** Dummy implementation - will be supplied by super class + */ +static pANTLR3_STRING + getText (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE t) +{ + ANTLR3_FPRINTF(stderr, "Internal error - implementor of superclass containing ANTLR3_TREE_ADAPTOR did not implement getText()\n"); + return NULL; +} + +/** Dummy implementation - will be supplied by super class + */ +static void + setText (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_STRING t) +{ + ANTLR3_FPRINTF(stderr, "Internal error - implementor of superclass containing ANTLR3_TREE_ADAPTOR did not implement setText()\n"); +} +/** Dummy implementation - will be supplied by super class + */ +static void +setText8 (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_UINT8 t) +{ + ANTLR3_FPRINTF(stderr, "Internal error - implementor of superclass containing ANTLR3_TREE_ADAPTOR did not implement setText()\n"); +} + +static pANTLR3_BASE_TREE + getChild (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE tree, ANTLR3_UINT32 i) +{ + ANTLR3_FPRINTF(stderr, "Internal error - implementor of superclass containing ANTLR3_TREE_ADAPTOR did not implement getChild()\n"); + return NULL; +} + +static ANTLR3_UINT32 + getChildCount (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE tree) +{ + ANTLR3_FPRINTF(stderr, "Internal error - implementor of superclass containing ANTLR3_TREE_ADAPTOR did not implement getChildCount()\n"); + return 0; +} + +/** Returns a uniqueID for the node. Because this is the C implementation + * we can just use its address suitably converted/cast to an integer. + */ +static ANTLR3_UINT32 + getUniqueID (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE node) +{ + return ANTLR3_UINT32_CAST(node); +} + +static ANTLR3_BOOLEAN +isNilNode (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE t) +{ + return t->isNilNode(t); +} diff --git a/antlr/libantlr3c-3.4/src/antlr3bitset.c b/antlr/libantlr3c-3.4/src/antlr3bitset.c new file mode 100644 index 0000000..4e63c79 --- /dev/null +++ b/antlr/libantlr3c-3.4/src/antlr3bitset.c @@ -0,0 +1,681 @@ +/// +/// \file +/// Contains the C implementation of ANTLR3 bitsets as adapted from Terence Parr's +/// Java implementation. +/// + +// [The "BSD licence"] +// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC +// http://www.temporal-wave.com +// http://www.linkedin.com/in/jimidle +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. The name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include + +// External interface +// + +static pANTLR3_BITSET antlr3BitsetClone (pANTLR3_BITSET inSet); +static pANTLR3_BITSET antlr3BitsetOR (pANTLR3_BITSET bitset1, pANTLR3_BITSET bitset2); +static void antlr3BitsetORInPlace (pANTLR3_BITSET bitset, pANTLR3_BITSET bitset2); +static ANTLR3_UINT32 antlr3BitsetSize (pANTLR3_BITSET bitset); +static void antlr3BitsetAdd (pANTLR3_BITSET bitset, ANTLR3_INT32 bit); +static ANTLR3_BOOLEAN antlr3BitsetEquals (pANTLR3_BITSET bitset1, pANTLR3_BITSET bitset2); +static ANTLR3_BOOLEAN antlr3BitsetMember (pANTLR3_BITSET bitset, ANTLR3_UINT32 bit); +static ANTLR3_UINT32 antlr3BitsetNumBits (pANTLR3_BITSET bitset); +static void antlr3BitsetRemove (pANTLR3_BITSET bitset, ANTLR3_UINT32 bit); +static ANTLR3_BOOLEAN antlr3BitsetIsNil (pANTLR3_BITSET bitset); +static pANTLR3_INT32 antlr3BitsetToIntList (pANTLR3_BITSET bitset); + +// Local functions +// +static void growToInclude (pANTLR3_BITSET bitset, ANTLR3_INT32 bit); +static void grow (pANTLR3_BITSET bitset, ANTLR3_INT32 newSize); +static ANTLR3_UINT64 bitMask (ANTLR3_UINT32 bitNumber); +static ANTLR3_UINT32 numWordsToHold (ANTLR3_UINT32 bit); +static ANTLR3_UINT32 wordNumber (ANTLR3_UINT32 bit); +static void antlr3BitsetFree (pANTLR3_BITSET bitset); + +static void +antlr3BitsetFree(pANTLR3_BITSET bitset) +{ + if (bitset->blist.bits != NULL) + { + ANTLR3_FREE(bitset->blist.bits); + bitset->blist.bits = NULL; + } + ANTLR3_FREE(bitset); + + return; +} + +ANTLR3_API pANTLR3_BITSET +antlr3BitsetNew(ANTLR3_UINT32 numBits) +{ + pANTLR3_BITSET bitset; + + ANTLR3_UINT32 numelements; + + // Allocate memory for the bitset structure itself + // + bitset = (pANTLR3_BITSET) ANTLR3_MALLOC((size_t)sizeof(ANTLR3_BITSET)); + + if (bitset == NULL) + { + return NULL; + } + + // Avoid memory thrashing at the up front expense of a few bytes + // + if (numBits < (8 * ANTLR3_BITSET_BITS)) + { + numBits = 8 * ANTLR3_BITSET_BITS; + } + + // No we need to allocate the memory for the number of bits asked for + // in multiples of ANTLR3_UINT64. + // + numelements = ((numBits -1) >> ANTLR3_BITSET_LOG_BITS) + 1; + + bitset->blist.bits = (pANTLR3_BITWORD) ANTLR3_MALLOC((size_t)(numelements * sizeof(ANTLR3_BITWORD))); + memset(bitset->blist.bits, 0, (size_t)(numelements * sizeof(ANTLR3_BITWORD))); + bitset->blist.length = numelements; + + if (bitset->blist.bits == NULL) + { + ANTLR3_FREE(bitset); + return NULL; + } + + antlr3BitsetSetAPI(bitset); + + + // All seems good + // + return bitset; +} + +ANTLR3_API void +antlr3BitsetSetAPI(pANTLR3_BITSET bitset) +{ + bitset->clone = antlr3BitsetClone; + bitset->bor = antlr3BitsetOR; + bitset->borInPlace = antlr3BitsetORInPlace; + bitset->size = antlr3BitsetSize; + bitset->add = antlr3BitsetAdd; + bitset->grow = grow; + bitset->equals = antlr3BitsetEquals; + bitset->isMember = antlr3BitsetMember; + bitset->numBits = antlr3BitsetNumBits; + bitset->remove = antlr3BitsetRemove; + bitset->isNilNode = antlr3BitsetIsNil; + bitset->toIntList = antlr3BitsetToIntList; + + bitset->free = antlr3BitsetFree; +} + +ANTLR3_API pANTLR3_BITSET +antlr3BitsetCopy(pANTLR3_BITSET_LIST blist) +{ + pANTLR3_BITSET bitset; + int numElements; + + // Allocate memory for the bitset structure itself + // + bitset = (pANTLR3_BITSET) ANTLR3_MALLOC((size_t)sizeof(ANTLR3_BITSET)); + + if (bitset == NULL) + { + return NULL; + } + + numElements = blist->length; + + // Avoid memory thrashing at the expense of a few more bytes + // + if (numElements < 8) + { + numElements = 8; + } + + // Install the length in ANTLR3_UINT64 units + // + bitset->blist.length = numElements; + + bitset->blist.bits = (pANTLR3_BITWORD)ANTLR3_MALLOC((size_t)(numElements * sizeof(ANTLR3_BITWORD))); + + if (bitset->blist.bits == NULL) + { + ANTLR3_FREE(bitset); + return NULL; + } + + ANTLR3_MEMCPY(bitset->blist.bits, blist->bits, (ANTLR3_UINT64)(numElements * sizeof(ANTLR3_BITWORD))); + + // All seems good + // + return bitset; +} + +static pANTLR3_BITSET +antlr3BitsetClone(pANTLR3_BITSET inSet) +{ + pANTLR3_BITSET bitset; + + // Allocate memory for the bitset structure itself + // + bitset = antlr3BitsetNew(ANTLR3_BITSET_BITS * inSet->blist.length); + + if (bitset == NULL) + { + return NULL; + } + + // Install the actual bits in the source set + // + ANTLR3_MEMCPY(bitset->blist.bits, inSet->blist.bits, (ANTLR3_UINT64)(inSet->blist.length * sizeof(ANTLR3_BITWORD))); + + // All seems good + // + return bitset; +} + + +ANTLR3_API pANTLR3_BITSET +antlr3BitsetList(pANTLR3_HASH_TABLE list) +{ + pANTLR3_BITSET bitSet; + pANTLR3_HASH_ENUM en; + pANTLR3_HASH_KEY key; + ANTLR3_UINT64 bit; + + // We have no idea what exactly is in the list + // so create a default bitset and then just add stuff + // as we enumerate. + // + bitSet = antlr3BitsetNew(0); + + en = antlr3EnumNew(list); + + while (en->next(en, &key, (void **)(&bit)) == ANTLR3_SUCCESS) + { + bitSet->add(bitSet, (ANTLR3_UINT32)bit); + } + en->free(en); + + return NULL; +} + +/// +/// \brief +/// Creates a new bitset with at least one 64 bit bset of bits, but as +/// many 64 bit sets as are required. +/// +/// \param[in] bset +/// A variable number of bits to add to the set, ending in -1 (impossible bit). +/// +/// \returns +/// A new bit set with all of the specified bitmaps in it and the API +/// initialized. +/// +/// Call as: +/// - pANTLR3_BITSET = antlrBitsetLoad(bset, bset11, ..., -1); +/// - pANTLR3_BITSET = antlrBitsetOf(-1); Create empty bitset +/// +/// \remarks +/// Stdargs function - must supply -1 as last paremeter, which is NOT +/// added to the set. +/// +/// +ANTLR3_API pANTLR3_BITSET +antlr3BitsetLoad(pANTLR3_BITSET_LIST inBits) +{ + pANTLR3_BITSET bitset; + ANTLR3_UINT32 count; + + // Allocate memory for the bitset structure itself + // the input parameter is the bit number (0 based) + // to include in the bitset, so we need at at least + // bit + 1 bits. If any arguments indicate a + // a bit higher than the default number of bits (0 means default size) + // then Add() will take care + // of it. + // + bitset = antlr3BitsetNew(0); + + if (bitset == NULL) + { + return NULL; + } + + if (inBits != NULL) + { + // Now we can add the element bits into the set + // + count=0; + while (count < inBits->length) + { + if (bitset->blist.length <= count) + { + bitset->grow(bitset, count+1); + } + + bitset->blist.bits[count] = *((inBits->bits)+count); + count++; + } + } + + // return the new bitset + // + return bitset; +} + +/// +/// \brief +/// Creates a new bitset with at least one element, but as +/// many elements are required. +/// +/// \param[in] bit +/// A variable number of bits to add to the set, ending in -1 (impossible bit). +/// +/// \returns +/// A new bit set with all of the specified elements added into it. +/// +/// Call as: +/// - pANTLR3_BITSET = antlrBitsetOf(n, n1, n2, -1); +/// - pANTLR3_BITSET = antlrBitsetOf(-1); Create empty bitset +/// +/// \remarks +/// Stdargs function - must supply -1 as last paremeter, which is NOT +/// added to the set. +/// +/// +ANTLR3_API pANTLR3_BITSET +antlr3BitsetOf(ANTLR3_INT32 bit, ...) +{ + pANTLR3_BITSET bitset; + + va_list ap; + + // Allocate memory for the bitset structure itself + // the input parameter is the bit number (0 based) + // to include in the bitset, so we need at at least + // bit + 1 bits. If any arguments indicate a + // a bit higher than the default number of bits (0 menas default size) + // then Add() will take care + // of it. + // + bitset = antlr3BitsetNew(0); + + if (bitset == NULL) + { + return NULL; + } + + // Now we can add the element bits into the set + // + va_start(ap, bit); + while (bit != -1) + { + antlr3BitsetAdd(bitset, bit); + bit = va_arg(ap, ANTLR3_UINT32); + } + va_end(ap); + + // return the new bitset + // + return bitset; +} + +static pANTLR3_BITSET +antlr3BitsetOR(pANTLR3_BITSET bitset1, pANTLR3_BITSET bitset2) +{ + pANTLR3_BITSET bitset; + + if (bitset1 == NULL) + { + return antlr3BitsetClone(bitset2); + } + + if (bitset2 == NULL) + { + return antlr3BitsetClone(bitset1); + } + + // Allocate memory for the newly ordered bitset structure itself. + // + bitset = antlr3BitsetClone(bitset1); + + antlr3BitsetORInPlace(bitset, bitset2); + + return bitset; + +} + +static void +antlr3BitsetAdd(pANTLR3_BITSET bitset, ANTLR3_INT32 bit) +{ + ANTLR3_UINT32 word; + + word = wordNumber(bit); + + if (word >= bitset->blist.length) + { + growToInclude(bitset, bit); + } + + bitset->blist.bits[word] |= bitMask(bit); + +} + +static void +grow(pANTLR3_BITSET bitset, ANTLR3_INT32 newSize) +{ + pANTLR3_BITWORD newBits; + + // Space for newly sized bitset - TODO: come back to this and use realloc?, it may + // be more efficient... + // + newBits = (pANTLR3_BITWORD) ANTLR3_CALLOC(1, (size_t)(newSize * sizeof(ANTLR3_BITWORD))); + if (bitset->blist.bits != NULL) + { + // Copy existing bits + // + ANTLR3_MEMCPY((void *)newBits, (const void *)bitset->blist.bits, (size_t)(bitset->blist.length * sizeof(ANTLR3_BITWORD))); + + // Out with the old bits... de de de derrr + // + ANTLR3_FREE(bitset->blist.bits); + } + + // In with the new bits... keerrrang. + // + bitset->blist.bits = newBits; + bitset->blist.length = newSize; +} + +static void +growToInclude(pANTLR3_BITSET bitset, ANTLR3_INT32 bit) +{ + ANTLR3_UINT32 bl; + ANTLR3_UINT32 nw; + + bl = (bitset->blist.length << 1); + nw = numWordsToHold(bit); + + if (bl > nw) + { + bitset->grow(bitset, bl); + } + else + { + bitset->grow(bitset, nw); + } +} + +static void +antlr3BitsetORInPlace(pANTLR3_BITSET bitset, pANTLR3_BITSET bitset2) +{ + ANTLR3_UINT32 minimum; + ANTLR3_UINT32 i; + + if (bitset2 == NULL) + { + return; + } + + + // First make sure that the target bitset is big enough + // for the new bits to be ored in. + // + if (bitset->blist.length < bitset2->blist.length) + { + growToInclude(bitset, (bitset2->blist.length * sizeof(ANTLR3_BITWORD))); + } + + // Or the miniimum number of bits after any resizing went on + // + if (bitset->blist.length < bitset2->blist.length) + { + minimum = bitset->blist.length; + } + else + { + minimum = bitset2->blist.length; + } + + for (i = minimum; i > 0; i--) + { + bitset->blist.bits[i-1] |= bitset2->blist.bits[i-1]; + } +} + +static ANTLR3_UINT64 +bitMask(ANTLR3_UINT32 bitNumber) +{ + return ((ANTLR3_UINT64)1) << (bitNumber & (ANTLR3_BITSET_MOD_MASK)); +} + +static ANTLR3_UINT32 +antlr3BitsetSize(pANTLR3_BITSET bitset) +{ + ANTLR3_UINT32 degree; + ANTLR3_INT32 i; + ANTLR3_INT8 bit; + + // TODO: Come back to this, it may be faster to & with 0x01 + // then shift right a copy of the 4 bits, than shift left a constant of 1. + // But then again, the optimizer might just work this out + // anyway. + // + degree = 0; + for (i = bitset->blist.length - 1; i>= 0; i--) + { + if (bitset->blist.bits[i] != 0) + { + for (bit = ANTLR3_BITSET_BITS - 1; bit >= 0; bit--) + { + if ((bitset->blist.bits[i] & (((ANTLR3_BITWORD)1) << bit)) != 0) + { + degree++; + } + } + } + } + return degree; +} + +static ANTLR3_BOOLEAN +antlr3BitsetEquals(pANTLR3_BITSET bitset1, pANTLR3_BITSET bitset2) +{ + ANTLR3_INT32 minimum; + ANTLR3_INT32 i; + + if (bitset1 == NULL || bitset2 == NULL) + { + return ANTLR3_FALSE; + } + + // Work out the minimum comparison set + // + if (bitset1->blist.length < bitset2->blist.length) + { + minimum = bitset1->blist.length; + } + else + { + minimum = bitset2->blist.length; + } + + // Make sure explict in common bits are equal + // + for (i = minimum - 1; i >=0 ; i--) + { + if (bitset1->blist.bits[i] != bitset2->blist.bits[i]) + { + return ANTLR3_FALSE; + } + } + + // Now make sure the bits of the larger set are all turned + // off. + // + if (bitset1->blist.length > (ANTLR3_UINT32)minimum) + { + for (i = minimum ; (ANTLR3_UINT32)i < bitset1->blist.length; i++) + { + if (bitset1->blist.bits[i] != 0) + { + return ANTLR3_FALSE; + } + } + } + else if (bitset2->blist.length > (ANTLR3_UINT32)minimum) + { + for (i = minimum; (ANTLR3_UINT32)i < bitset2->blist.length; i++) + { + if (bitset2->blist.bits[i] != 0) + { + return ANTLR3_FALSE; + } + } + } + + return ANTLR3_TRUE; +} + +static ANTLR3_BOOLEAN +antlr3BitsetMember(pANTLR3_BITSET bitset, ANTLR3_UINT32 bit) +{ + ANTLR3_UINT32 wordNo; + + wordNo = wordNumber(bit); + + if (wordNo >= bitset->blist.length) + { + return ANTLR3_FALSE; + } + + if ((bitset->blist.bits[wordNo] & bitMask(bit)) == 0) + { + return ANTLR3_FALSE; + } + else + { + return ANTLR3_TRUE; + } +} + +static void +antlr3BitsetRemove(pANTLR3_BITSET bitset, ANTLR3_UINT32 bit) +{ + ANTLR3_UINT32 wordNo; + + wordNo = wordNumber(bit); + + if (wordNo < bitset->blist.length) + { + bitset->blist.bits[wordNo] &= ~(bitMask(bit)); + } +} +static ANTLR3_BOOLEAN +antlr3BitsetIsNil(pANTLR3_BITSET bitset) +{ + ANTLR3_INT32 i; + + for (i = bitset->blist.length -1; i>= 0; i--) + { + if (bitset->blist.bits[i] != 0) + { + return ANTLR3_FALSE; + } + } + + return ANTLR3_TRUE; +} + +static ANTLR3_UINT32 +numWordsToHold(ANTLR3_UINT32 bit) +{ + return (bit >> ANTLR3_BITSET_LOG_BITS) + 1; +} + +static ANTLR3_UINT32 +wordNumber(ANTLR3_UINT32 bit) +{ + return bit >> ANTLR3_BITSET_LOG_BITS; +} + +static ANTLR3_UINT32 +antlr3BitsetNumBits(pANTLR3_BITSET bitset) +{ + return bitset->blist.length << ANTLR3_BITSET_LOG_BITS; +} + +/** Produce an integer list of all the bits that are turned on + * in this bitset. Used for error processing in the main as the bitset + * reresents a number of integer tokens which we use for follow sets + * and so on. + * + * The first entry is the number of elements following in the list. + */ +static pANTLR3_INT32 +antlr3BitsetToIntList (pANTLR3_BITSET bitset) +{ + ANTLR3_UINT32 numInts; // How many integers we will need + ANTLR3_UINT32 numBits; // How many bits are in the set + ANTLR3_UINT32 i; + ANTLR3_UINT32 index; + + pANTLR3_INT32 intList; + + numInts = bitset->size(bitset) + 1; + numBits = bitset->numBits(bitset); + + intList = (pANTLR3_INT32)ANTLR3_MALLOC(numInts * sizeof(ANTLR3_INT32)); + + if (intList == NULL) + { + return NULL; // Out of memory + } + + intList[0] = numInts; + + // Enumerate the bits that are turned on + // + for (i = 0, index = 1; iisMember(bitset, i) == ANTLR3_TRUE) + { + intList[index++] = i; + } + } + + // Result set + // + return intList; +} + diff --git a/antlr/libantlr3c-3.4/src/antlr3collections.c b/antlr/libantlr3c-3.4/src/antlr3collections.c new file mode 100644 index 0000000..d9e22e9 --- /dev/null +++ b/antlr/libantlr3c-3.4/src/antlr3collections.c @@ -0,0 +1,2741 @@ +/// \file +/// Provides a number of useful functions that are roughly equivalent +/// to java HashTable and List for the purposes of Antlr 3 C runtime. +/// Also useable by the C programmer for things like symbol tables pointers +/// and so on. +/// +/// + +// [The "BSD licence"] +// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC +// http://www.temporal-wave.com +// http://www.linkedin.com/in/jimidle +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. The name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include + +#include "antlr3collections.h" + +// Interface functions for hash table +// + +// String based keys +// +static void antlr3HashDelete (pANTLR3_HASH_TABLE table, void * key); +static void * antlr3HashGet (pANTLR3_HASH_TABLE table, void * key); +static pANTLR3_HASH_ENTRY antlr3HashRemove (pANTLR3_HASH_TABLE table, void * key); +static ANTLR3_INT32 antlr3HashPut (pANTLR3_HASH_TABLE table, void * key, void * element, void (ANTLR3_CDECL *freeptr)(void *)); + +// Integer based keys (Lists and so on) +// +static void antlr3HashDeleteI (pANTLR3_HASH_TABLE table, ANTLR3_INTKEY key); +static void * antlr3HashGetI (pANTLR3_HASH_TABLE table, ANTLR3_INTKEY key); +static pANTLR3_HASH_ENTRY antlr3HashRemoveI (pANTLR3_HASH_TABLE table, ANTLR3_INTKEY key); +static ANTLR3_INT32 antlr3HashPutI (pANTLR3_HASH_TABLE table, ANTLR3_INTKEY key, void * element, void (ANTLR3_CDECL *freeptr)(void *)); + +static void antlr3HashFree (pANTLR3_HASH_TABLE table); +static ANTLR3_UINT32 antlr3HashSize (pANTLR3_HASH_TABLE table); + +// ----------- + +// Interface functions for enumeration +// +static int antlr3EnumNext (pANTLR3_HASH_ENUM en, pANTLR3_HASH_KEY * key, void ** data); +static void antlr3EnumFree (pANTLR3_HASH_ENUM en); + +// Interface functions for List +// +static void antlr3ListFree (pANTLR3_LIST list); +static void antlr3ListDelete(pANTLR3_LIST list, ANTLR3_INTKEY key); +static void * antlr3ListGet (pANTLR3_LIST list, ANTLR3_INTKEY key); +static ANTLR3_INT32 antlr3ListPut (pANTLR3_LIST list, ANTLR3_INTKEY key, void * element, void (ANTLR3_CDECL *freeptr)(void *)); +static ANTLR3_INT32 antlr3ListAdd (pANTLR3_LIST list, void * element, void (ANTLR3_CDECL *freeptr)(void *)); +static void * antlr3ListRemove(pANTLR3_LIST list, ANTLR3_INTKEY key); +static ANTLR3_UINT32 antlr3ListSize (pANTLR3_LIST list); + +// Interface functions for Stack +// +static void antlr3StackFree (pANTLR3_STACK stack); +static void * antlr3StackPop (pANTLR3_STACK stack); +static void * antlr3StackGet (pANTLR3_STACK stack, ANTLR3_INTKEY key); +static ANTLR3_BOOLEAN antlr3StackPush (pANTLR3_STACK stack, void * element, void (ANTLR3_CDECL *freeptr)(void *)); +static ANTLR3_UINT32 antlr3StackSize (pANTLR3_STACK stack); +static void * antlr3StackPeek (pANTLR3_STACK stack); + +// Interface functions for vectors +// +static void ANTLR3_CDECL antlr3VectorFree (pANTLR3_VECTOR vector); +static void antlr3VectorDel (pANTLR3_VECTOR vector, ANTLR3_UINT32 entry); +static void * antlr3VectorGet (pANTLR3_VECTOR vector, ANTLR3_UINT32 entry); +static void * antrl3VectorRemove (pANTLR3_VECTOR vector, ANTLR3_UINT32 entry); +static void antlr3VectorClear (pANTLR3_VECTOR vector); +static ANTLR3_UINT32 antlr3VectorAdd (pANTLR3_VECTOR vector, void * element, void (ANTLR3_CDECL *freeptr)(void *)); +static ANTLR3_UINT32 antlr3VectorSet (pANTLR3_VECTOR vector, ANTLR3_UINT32 entry, void * element, void (ANTLR3_CDECL *freeptr)(void *), ANTLR3_BOOLEAN freeExisting); +static ANTLR3_UINT32 antlr3VectorSize (pANTLR3_VECTOR vector); +static ANTLR3_BOOLEAN antlr3VectorSwap (pANTLR3_VECTOR vector, ANTLR3_UINT32 entry1, ANTLR3_UINT32 entry2); + +static void newPool (pANTLR3_VECTOR_FACTORY factory); +static void closeVectorFactory (pANTLR3_VECTOR_FACTORY factory); +static pANTLR3_VECTOR newVector (pANTLR3_VECTOR_FACTORY factory); +static void returnVector (pANTLR3_VECTOR_FACTORY factory, pANTLR3_VECTOR vector); + + +// Interface functions for int TRIE +// +static pANTLR3_TRIE_ENTRY intTrieGet (pANTLR3_INT_TRIE trie, ANTLR3_INTKEY key); +static ANTLR3_BOOLEAN intTrieDel (pANTLR3_INT_TRIE trie, ANTLR3_INTKEY key); +static ANTLR3_BOOLEAN intTrieAdd (pANTLR3_INT_TRIE trie, ANTLR3_INTKEY key, ANTLR3_UINT32 type, ANTLR3_INTKEY intType, void * data, void (ANTLR3_CDECL *freeptr)(void *)); +static void intTrieFree (pANTLR3_INT_TRIE trie); + + +// Interface functions for topological sorter +// +static void addEdge (pANTLR3_TOPO topo, ANTLR3_UINT32 edge, ANTLR3_UINT32 dependency); +static pANTLR3_UINT32 sortToArray (pANTLR3_TOPO topo); +static void sortVector (pANTLR3_TOPO topo, pANTLR3_VECTOR v); +static void freeTopo (pANTLR3_TOPO topo); + +// Local function to advance enumeration structure pointers +// +static void antlr3EnumNextEntry(pANTLR3_HASH_ENUM en); + +pANTLR3_HASH_TABLE +antlr3HashTableNew(ANTLR3_UINT32 sizeHint) +{ + // All we have to do is create the hashtable tracking structure + // and allocate memory for the requested number of buckets. + // + pANTLR3_HASH_TABLE table; + + ANTLR3_UINT32 bucket; // Used to traverse the buckets + + table = ANTLR3_MALLOC(sizeof(ANTLR3_HASH_TABLE)); + + // Error out if no memory left + if (table == NULL) + { + return NULL; + } + + // Allocate memory for the buckets + // + table->buckets = (pANTLR3_HASH_BUCKET) ANTLR3_MALLOC((size_t) (sizeof(ANTLR3_HASH_BUCKET) * sizeHint)); + + if (table->buckets == NULL) + { + ANTLR3_FREE((void *)table); + return NULL; + } + + // Modulo of the table, (bucket count). + // + table->modulo = sizeHint; + + table->count = 0; /* Nothing in there yet ( I hope) */ + + /* Initialize the buckets to empty + */ + for (bucket = 0; bucket < sizeHint; bucket++) + { + table->buckets[bucket].entries = NULL; + } + + /* Exclude duplicate entries by default + */ + table->allowDups = ANTLR3_FALSE; + + /* Assume that keys should by strduped before they are + * entered in the table. + */ + table->doStrdup = ANTLR3_TRUE; + + /* Install the interface + */ + + table->get = antlr3HashGet; + table->put = antlr3HashPut; + table->del = antlr3HashDelete; + table->remove = antlr3HashRemove; + + table->getI = antlr3HashGetI; + table->putI = antlr3HashPutI; + table->delI = antlr3HashDeleteI; + table->removeI = antlr3HashRemoveI; + + table->size = antlr3HashSize; + table->free = antlr3HashFree; + + return table; +} + +static void +antlr3HashFree(pANTLR3_HASH_TABLE table) +{ + ANTLR3_UINT32 bucket; /* Used to traverse the buckets */ + + pANTLR3_HASH_BUCKET thisBucket; + pANTLR3_HASH_ENTRY entry; + pANTLR3_HASH_ENTRY nextEntry; + + /* Free the table, all buckets and all entries, and all the + * keys and data (if the table exists) + */ + if (table != NULL) + { + for (bucket = 0; bucket < table->modulo; bucket++) + { + thisBucket = &(table->buckets[bucket]); + + /* Allow sparse tables, though we don't create them as such at present + */ + if ( thisBucket != NULL) + { + entry = thisBucket->entries; + + /* Search all entries in the bucket and free them up + */ + while (entry != NULL) + { + /* Save next entry - we do not want to access memory in entry after we + * have freed it. + */ + nextEntry = entry->nextEntry; + + /* Free any data pointer, this only happens if the user supplied + * a pointer to a routine that knwos how to free the structure they + * added to the table. + */ + if (entry->free != NULL) + { + entry->free(entry->data); + } + + /* Free the key memory - we know that we allocated this + */ + if (entry->keybase.type == ANTLR3_HASH_TYPE_STR && entry->keybase.key.sKey != NULL) + { + ANTLR3_FREE(entry->keybase.key.sKey); + } + + /* Free this entry + */ + ANTLR3_FREE(entry); + entry = nextEntry; /* Load next pointer to see if we shoud free it */ + } + /* Invalidate the current pointer + */ + thisBucket->entries = NULL; + } + } + + /* Now we can free the bucket memory + */ + ANTLR3_FREE(table->buckets); + } + + /* Now we free teh memory for the table itself + */ + ANTLR3_FREE(table); +} + +/** return the current size of the hash table + */ +static ANTLR3_UINT32 antlr3HashSize (pANTLR3_HASH_TABLE table) +{ + return table->count; +} + +/** Remove a numeric keyed entry from a hash table if it exists, + * no error if it does not exist. + */ +static pANTLR3_HASH_ENTRY antlr3HashRemoveI (pANTLR3_HASH_TABLE table, ANTLR3_INTKEY key) +{ + ANTLR3_UINT32 hash; + pANTLR3_HASH_BUCKET bucket; + pANTLR3_HASH_ENTRY entry; + pANTLR3_HASH_ENTRY * nextPointer; + + /* First we need to know the hash of the provided key + */ + hash = (ANTLR3_UINT32)(key % (ANTLR3_INTKEY)(table->modulo)); + + /* Knowing the hash, we can find the bucket + */ + bucket = table->buckets + hash; + + /* Now, we traverse the entries in the bucket until + * we find the key or the end of the entries in the bucket. + * We track the element prior to the one we are examining + * as we need to set its next pointer to the next pointer + * of the entry we are deleting (if we find it). + */ + entry = bucket->entries; /* Entry to examine */ + nextPointer = & bucket->entries; /* Where to put the next pointer of the deleted entry */ + + while (entry != NULL) + { + /* See if this is the entry we wish to delete + */ + if (entry->keybase.key.iKey == key) + { + /* It was the correct entry, so we set the next pointer + * of the previous entry to the next pointer of this + * located one, which takes it out of the chain. + */ + (*nextPointer) = entry->nextEntry; + + table->count--; + + return entry; + } + else + { + /* We found an entry but it wasn't the one that was wanted, so + * move to the next one, if any. + */ + nextPointer = & (entry->nextEntry); /* Address of the next pointer in the current entry */ + entry = entry->nextEntry; /* Address of the next element in the bucket (if any) */ + } + } + + return NULL; /* Not found */ +} + +/** Remove the element in the hash table for a particular + * key value, if it exists - no error if it does not. + */ +static pANTLR3_HASH_ENTRY +antlr3HashRemove(pANTLR3_HASH_TABLE table, void * key) +{ + ANTLR3_UINT32 hash; + pANTLR3_HASH_BUCKET bucket; + pANTLR3_HASH_ENTRY entry; + pANTLR3_HASH_ENTRY * nextPointer; + + /* First we need to know the hash of the provided key + */ + hash = antlr3Hash(key, (ANTLR3_UINT32)strlen((const char *)key)); + + /* Knowing the hash, we can find the bucket + */ + bucket = table->buckets + (hash % table->modulo); + + /* Now, we traverse the entries in the bucket until + * we find the key or the end of the entires in the bucket. + * We track the element prior to the one we are exmaining + * as we need to set its next pointer to the next pointer + * of the entry we are deleting (if we find it). + */ + entry = bucket->entries; /* Entry to examine */ + nextPointer = & bucket->entries; /* Where to put the next pointer of the deleted entry */ + + while (entry != NULL) + { + /* See if this is the entry we wish to delete + */ + if (strcmp((const char *)key, (const char *)entry->keybase.key.sKey) == 0) + { + /* It was the correct entry, so we set the next pointer + * of the previous entry to the next pointer of this + * located one, which takes it out of the chain. + */ + (*nextPointer) = entry->nextEntry; + + /* Release the key - if we allocated that + */ + if (table->doStrdup == ANTLR3_TRUE) + { + ANTLR3_FREE(entry->keybase.key.sKey); + } + entry->keybase.key.sKey = NULL; + + table->count--; + + return entry; + } + else + { + /* We found an entry but it wasn't the one that was wanted, so + * move to the next one, if any. + */ + nextPointer = & (entry->nextEntry); /* Address of the next pointer in the current entry */ + entry = entry->nextEntry; /* Address of the next element in the bucket (if any) */ + } + } + + return NULL; /* Not found */ +} + +/** Takes the element with the supplied key out of the list, and deletes the data + * calling the supplied free() routine if any. + */ +static void +antlr3HashDeleteI (pANTLR3_HASH_TABLE table, ANTLR3_INTKEY key) +{ + pANTLR3_HASH_ENTRY entry; + + entry = antlr3HashRemoveI(table, key); + + /* Now we can free the elements and the entry in order + */ + if (entry != NULL && entry->free != NULL) + { + /* Call programmer supplied function to release this entry data + */ + entry->free(entry->data); + entry->data = NULL; + } + /* Finally release the space for this entry block. + */ + ANTLR3_FREE(entry); +} + +/** Takes the element with the supplied key out of the list, and deletes the data + * calling the supplied free() routine if any. + */ +static void +antlr3HashDelete (pANTLR3_HASH_TABLE table, void * key) +{ + pANTLR3_HASH_ENTRY entry; + + entry = antlr3HashRemove(table, key); + + /* Now we can free the elements and the entry in order + */ + if (entry != NULL && entry->free != NULL) + { + /* Call programmer supplied function to release this entry data + */ + entry->free(entry->data); + entry->data = NULL; + } + /* Finally release the space for this entry block. + */ + ANTLR3_FREE(entry); +} + +/** Return the element pointer in the hash table for a particular + * key value, or NULL if it don't exist (or was itself NULL). + */ +static void * +antlr3HashGetI(pANTLR3_HASH_TABLE table, ANTLR3_INTKEY key) +{ + ANTLR3_UINT32 hash; + pANTLR3_HASH_BUCKET bucket; + pANTLR3_HASH_ENTRY entry; + + /* First we need to know the hash of the provided key + */ + hash = (ANTLR3_UINT32)(key % (ANTLR3_INTKEY)(table->modulo)); + + /* Knowing the hash, we can find the bucket + */ + bucket = table->buckets + hash; + + /* Now we can inspect the key at each entry in the bucket + * and see if we have a match. + */ + entry = bucket->entries; + + while (entry != NULL) + { + if (entry->keybase.key.iKey == key) + { + /* Match was found, return the data pointer for this entry + */ + return entry->data; + } + entry = entry->nextEntry; + } + + /* If we got here, then we did not find the key + */ + return NULL; +} + +/** Return the element pointer in the hash table for a particular + * key value, or NULL if it don't exist (or was itself NULL). + */ +static void * +antlr3HashGet(pANTLR3_HASH_TABLE table, void * key) +{ + ANTLR3_UINT32 hash; + pANTLR3_HASH_BUCKET bucket; + pANTLR3_HASH_ENTRY entry; + + + /* First we need to know the hash of the provided key + */ + hash = antlr3Hash(key, (ANTLR3_UINT32)strlen((const char *)key)); + + /* Knowing the hash, we can find the bucket + */ + bucket = table->buckets + (hash % table->modulo); + + /* Now we can inspect the key at each entry in the bucket + * and see if we have a match. + */ + entry = bucket->entries; + + while (entry != NULL) + { + if (strcmp((const char *)key, (const char *)entry->keybase.key.sKey) == 0) + { + /* Match was found, return the data pointer for this entry + */ + return entry->data; + } + entry = entry->nextEntry; + } + + /* If we got here, then we did not find the key + */ + return NULL; +} + +/** Add the element pointer in to the table, based upon the + * hash of the provided key. + */ +static ANTLR3_INT32 +antlr3HashPutI(pANTLR3_HASH_TABLE table, ANTLR3_INTKEY key, void * element, void (ANTLR3_CDECL *freeptr)(void *)) +{ + ANTLR3_UINT32 hash; + pANTLR3_HASH_BUCKET bucket; + pANTLR3_HASH_ENTRY entry; + pANTLR3_HASH_ENTRY * newPointer; + + /* First we need to know the hash of the provided key + */ + hash = (ANTLR3_UINT32)(key % (ANTLR3_INTKEY)(table->modulo)); + + /* Knowing the hash, we can find the bucket + */ + bucket = table->buckets + hash; + + /* Knowing the bucket, we can traverse the entries until we + * we find a NULL pointer or we find that this is already + * in the table and duplicates were not allowed. + */ + newPointer = &bucket->entries; + + while (*newPointer != NULL) + { + /* The value at new pointer is pointing to an existing entry. + * If duplicates are allowed then we don't care what it is, but + * must reject this add if the key is the same as the one we are + * supplied with. + */ + if (table->allowDups == ANTLR3_FALSE) + { + if ((*newPointer)->keybase.key.iKey == key) + { + return ANTLR3_ERR_HASHDUP; + } + } + + /* Point to the next entry pointer of the current entry we + * are traversing, if it is NULL we will create our new + * structure and point this to it. + */ + newPointer = &((*newPointer)->nextEntry); + } + + /* newPointer is now pointing at the pointer where we need to + * add our new entry, so let's crate the entry and add it in. + */ + entry = (pANTLR3_HASH_ENTRY)ANTLR3_MALLOC((size_t)sizeof(ANTLR3_HASH_ENTRY)); + + if (entry == NULL) + { + return ANTLR3_ERR_NOMEM; + } + + entry->data = element; /* Install the data element supplied */ + entry->free = freeptr; /* Function that knows how to release the entry */ + entry->keybase.type = ANTLR3_HASH_TYPE_INT; /* Indicate the key type stored here for when we free */ + entry->keybase.key.iKey = key; /* Record the key value */ + entry->nextEntry = NULL; /* Ensure that the forward pointer ends the chain */ + + *newPointer = entry; /* Install the next entry in this bucket */ + + table->count++; + + return ANTLR3_SUCCESS; +} + + +/** Add the element pointer in to the table, based upon the + * hash of the provided key. + */ +static ANTLR3_INT32 +antlr3HashPut(pANTLR3_HASH_TABLE table, void * key, void * element, void (ANTLR3_CDECL *freeptr)(void *)) +{ + ANTLR3_UINT32 hash; + pANTLR3_HASH_BUCKET bucket; + pANTLR3_HASH_ENTRY entry; + pANTLR3_HASH_ENTRY * newPointer; + + /* First we need to know the hash of the provided key + */ + hash = antlr3Hash(key, (ANTLR3_UINT32)strlen((const char *)key)); + + /* Knowing the hash, we can find the bucket + */ + bucket = table->buckets + (hash % table->modulo); + + /* Knowign the bucket, we can traverse the entries until we + * we find a NULL pointer ofr we find that this is already + * in the table and duplicates were not allowed. + */ + newPointer = &bucket->entries; + + while (*newPointer != NULL) + { + /* The value at new pointer is pointing to an existing entry. + * If duplicates are allowed then we don't care what it is, but + * must reject this add if the key is the same as the one we are + * supplied with. + */ + if (table->allowDups == ANTLR3_FALSE) + { + if (strcmp((const char*) key, (const char *)(*newPointer)->keybase.key.sKey) == 0) + { + return ANTLR3_ERR_HASHDUP; + } + } + + /* Point to the next entry pointer of the current entry we + * are traversing, if it is NULL we will create our new + * structure and point this to it. + */ + newPointer = &((*newPointer)->nextEntry); + } + + /* newPointer is now poiting at the pointer where we need to + * add our new entry, so let's crate the entry and add it in. + */ + entry = (pANTLR3_HASH_ENTRY)ANTLR3_MALLOC((size_t)sizeof(ANTLR3_HASH_ENTRY)); + + if (entry == NULL) + { + return ANTLR3_ERR_NOMEM; + } + + entry->data = element; /* Install the data element supplied */ + entry->free = freeptr; /* Function that knows how to release the entry */ + entry->keybase.type = ANTLR3_HASH_TYPE_STR; /* Indicate the key type stored here for free() */ + if (table->doStrdup == ANTLR3_TRUE) + { + entry->keybase.key.sKey = ANTLR3_STRDUP(key); /* Record the key value */ + } + else + { + entry->keybase.key.sKey = key; /* Record the key value */ + } + entry->nextEntry = NULL; /* Ensure that the forward pointer ends the chain */ + + *newPointer = entry; /* Install the next entry in this bucket */ + + table->count++; + + return ANTLR3_SUCCESS; +} + +/** \brief Creates an enumeration structure to traverse the hash table. + * + * \param table Table to enumerate + * \return Pointer to enumeration structure. + */ +pANTLR3_HASH_ENUM +antlr3EnumNew (pANTLR3_HASH_TABLE table) +{ + pANTLR3_HASH_ENUM en; + + /* Allocate structure memory + */ + en = (pANTLR3_HASH_ENUM) ANTLR3_MALLOC((size_t)sizeof(ANTLR3_HASH_ENUM)); + + /* Check that the allocation was good + */ + if (en == NULL) + { + return (pANTLR3_HASH_ENUM) ANTLR3_FUNC_PTR(ANTLR3_ERR_NOMEM); + } + + /* Initialize the start pointers + */ + en->table = table; + en->bucket = 0; /* First bucket */ + en->entry = en->table->buckets->entries; /* First entry to return */ + + /* Special case in that the first bucket may not have anything in it + * but the antlr3EnumNext() function expects that the en->entry is + * set to the next valid pointer. Hence if it is not a valid element + * pointer, attempt to find the next one that is, (table may be empty + * of course. + */ + if (en->entry == NULL) + { + antlr3EnumNextEntry(en); + } + + /* Install the interface + */ + en->free = antlr3EnumFree; + en->next = antlr3EnumNext; + + /* All is good + */ + return en; +} + +/** \brief Return the next entry in the hashtable being traversed by the supplied + * enumeration. + * + * \param[in] en Pointer to the enumeration tracking structure + * \param key Pointer to void pointer, where the key pointer is returned. + * \param data Pointer to void pointer where the data pointer is returned. + * \return + * - ANTLR3_SUCCESS if there was a next key + * - ANTLR3_FAIL if there were no more keys + * + * \remark + * No checking of input structure is performed! + */ +static int +antlr3EnumNext (pANTLR3_HASH_ENUM en, pANTLR3_HASH_KEY * key, void ** data) +{ + /* If the current entry is valid, then use it + */ + if (en->bucket >= en->table->modulo) + { + /* Already exhausted the table + */ + return ANTLR3_FAIL; + } + + /* Pointers are already set to the current entry to return, or + * we would not be at this point in the logic flow. + */ + *key = &(en->entry->keybase); + *data = en->entry->data; + + /* Return pointers are set up, so now we move the element + * pointer to the next in the table (if any). + */ + antlr3EnumNextEntry(en); + + return ANTLR3_SUCCESS; +} + +/** \brief Local function to advance the entry pointer of an enumeration + * structure to the next valid entry (if there is one). + * + * \param[in] enum Pointer to ANTLR3 enumeration structure returned by antlr3EnumNew() + * + * \remark + * - The function always leaves the pointers pointing at a valid entry if there + * is one, so if the entry pointer is NULL when this function exits, there were + * no more entries in the table. + */ +static void +antlr3EnumNextEntry(pANTLR3_HASH_ENUM en) +{ + pANTLR3_HASH_BUCKET bucket; + + /* See if the current entry pointer is valid first of all + */ + if (en->entry != NULL) + { + /* Current entry was a valid point, see if there is another + * one in the chain. + */ + if (en->entry->nextEntry != NULL) + { + /* Next entry in the enumeration is just the next entry + * in the chain. + */ + en->entry = en->entry->nextEntry; + return; + } + } + + /* There were no more entries in the current bucket, if there are + * more buckets then chase them until we find an entry. + */ + en->bucket++; + + while (en->bucket < en->table->modulo) + { + /* There was one more bucket, see if it has any elements in it + */ + bucket = en->table->buckets + en->bucket; + + if (bucket->entries != NULL) + { + /* There was an entry in this bucket, so we can use it + * for the next entry in the enumeration. + */ + en->entry = bucket->entries; + return; + } + + /* There was nothing in the bucket we just examined, move to the + * next one. + */ + en->bucket++; + } + + /* Here we have exhausted all buckets and the enumeration pointer will + * have its bucket count = table->modulo which signifies that we are done. + */ +} + +/** \brief Frees up the memory structures that represent a hash table + * enumeration. + * \param[in] enum Pointer to ANTLR3 enumeration structure returned by antlr3EnumNew() + */ +static void +antlr3EnumFree (pANTLR3_HASH_ENUM en) +{ + /* Nothing to check, we just free it. + */ + ANTLR3_FREE(en); +} + +/** Given an input key of arbitrary length, return a hash value of + * it. This can then be used (with suitable modulo) to index other + * structures. + */ +ANTLR3_API ANTLR3_UINT32 +antlr3Hash(void * key, ANTLR3_UINT32 keylen) +{ + /* Accumulate the hash value of the key + */ + ANTLR3_UINT32 hash; + pANTLR3_UINT8 keyPtr; + ANTLR3_UINT32 i1; + + hash = 0; + keyPtr = (pANTLR3_UINT8) key; + + /* Iterate the key and accumulate the hash + */ + while(keylen > 0) + { + hash = (hash << 4) + (*(keyPtr++)); + + if ((i1=hash&0xf0000000) != 0) + { + hash = hash ^ (i1 >> 24); + hash = hash ^ i1; + } + keylen--; + } + + return hash; +} + +ANTLR3_API pANTLR3_LIST +antlr3ListNew (ANTLR3_UINT32 sizeHint) +{ + pANTLR3_LIST list; + + /* Allocate memory + */ + list = (pANTLR3_LIST)ANTLR3_MALLOC((size_t)sizeof(ANTLR3_LIST)); + + if (list == NULL) + { + return (pANTLR3_LIST)ANTLR3_FUNC_PTR(ANTLR3_ERR_NOMEM); + } + + /* Now we need to add a new table + */ + list->table = antlr3HashTableNew(sizeHint); + + if (list->table == (pANTLR3_HASH_TABLE)ANTLR3_FUNC_PTR(ANTLR3_ERR_NOMEM)) + { + return (pANTLR3_LIST)ANTLR3_FUNC_PTR(ANTLR3_ERR_NOMEM); + } + + /* Allocation was good, install interface + */ + list->free = antlr3ListFree; + list->del = antlr3ListDelete; + list->get = antlr3ListGet; + list->add = antlr3ListAdd; + list->remove = antlr3ListRemove; + list->put = antlr3ListPut; + list->size = antlr3ListSize; + + return list; +} + +static ANTLR3_UINT32 antlr3ListSize (pANTLR3_LIST list) +{ + return list->table->size(list->table); +} + +static void +antlr3ListFree (pANTLR3_LIST list) +{ + /* Free the hashtable that stores the list + */ + list->table->free(list->table); + + /* Free the allocation for the list itself + */ + ANTLR3_FREE(list); +} + +static void +antlr3ListDelete (pANTLR3_LIST list, ANTLR3_INTKEY key) +{ + list->table->delI(list->table, key); +} + +static void * +antlr3ListGet (pANTLR3_LIST list, ANTLR3_INTKEY key) +{ + return list->table->getI(list->table, key); +} + +/** Add the supplied element to the list, at the next available key + */ +static ANTLR3_INT32 antlr3ListAdd (pANTLR3_LIST list, void * element, void (ANTLR3_CDECL *freeptr)(void *)) +{ + ANTLR3_INTKEY key; + + key = list->table->size(list->table) + 1; + return list->put(list, key, element, freeptr); +} + +/** Remove from the list, but don't free the element, just send it back to the + * caller. + */ +static void * +antlr3ListRemove (pANTLR3_LIST list, ANTLR3_INTKEY key) +{ + pANTLR3_HASH_ENTRY entry; + + entry = list->table->removeI(list->table, key); + + if (entry != NULL) + { + return entry->data; + } + else + { + return NULL; + } +} + +static ANTLR3_INT32 +antlr3ListPut (pANTLR3_LIST list, ANTLR3_INTKEY key, void * element, void (ANTLR3_CDECL *freeptr)(void *)) +{ + return list->table->putI(list->table, key, element, freeptr); +} + +ANTLR3_API pANTLR3_STACK +antlr3StackNew (ANTLR3_UINT32 sizeHint) +{ + pANTLR3_STACK stack; + + /* Allocate memory + */ + stack = (pANTLR3_STACK)ANTLR3_MALLOC((size_t)sizeof(ANTLR3_STACK)); + + if (stack == NULL) + { + return (pANTLR3_STACK)ANTLR3_FUNC_PTR(ANTLR3_ERR_NOMEM); + } + + /* Now we need to add a new table + */ + stack->vector = antlr3VectorNew(sizeHint); + stack->top = NULL; + + if (stack->vector == (pANTLR3_VECTOR)ANTLR3_FUNC_PTR(ANTLR3_ERR_NOMEM)) + { + return (pANTLR3_STACK)ANTLR3_FUNC_PTR(ANTLR3_ERR_NOMEM); + } + + /* Looks good, now add the interface + */ + stack->get = antlr3StackGet; + stack->free = antlr3StackFree; + stack->pop = antlr3StackPop; + stack->push = antlr3StackPush; + stack->size = antlr3StackSize; + stack->peek = antlr3StackPeek; + + return stack; +} + +static ANTLR3_UINT32 antlr3StackSize (pANTLR3_STACK stack) +{ + return stack->vector->count; +} + + +static void +antlr3StackFree (pANTLR3_STACK stack) +{ + /* Free the list that supports the stack + */ + stack->vector->free(stack->vector); + stack->vector = NULL; + stack->top = NULL; + + ANTLR3_FREE(stack); +} + +static void * +antlr3StackPop (pANTLR3_STACK stack) +{ + // Delete the element that is currently at the top of the stack + // + stack->vector->del(stack->vector, stack->vector->count - 1); + + // And get the element that is the now the top of the stack (if anything) + // NOTE! This is not quite like a 'real' stack, which would normally return you + // the current top of the stack, then remove it from the stack. + // TODO: Review this, it is correct for follow sets which is what this was done for + // but is not as obvious when using it as a 'real'stack. + // + stack->top = stack->vector->get(stack->vector, stack->vector->count - 1); + return stack->top; +} + +static void * +antlr3StackGet (pANTLR3_STACK stack, ANTLR3_INTKEY key) +{ + return stack->vector->get(stack->vector, (ANTLR3_UINT32)key); +} + +static void * +antlr3StackPeek (pANTLR3_STACK stack) +{ + return stack->top; +} + +static ANTLR3_BOOLEAN +antlr3StackPush (pANTLR3_STACK stack, void * element, void (ANTLR3_CDECL *freeptr)(void *)) +{ + stack->top = element; + return (ANTLR3_BOOLEAN)(stack->vector->add(stack->vector, element, freeptr)); +} + +ANTLR3_API pANTLR3_VECTOR +antlr3VectorNew (ANTLR3_UINT32 sizeHint) +{ + pANTLR3_VECTOR vector; + + + // Allocate memory for the vector structure itself + // + vector = (pANTLR3_VECTOR) ANTLR3_MALLOC((size_t)(sizeof(ANTLR3_VECTOR))); + + if (vector == NULL) + { + return (pANTLR3_VECTOR)ANTLR3_FUNC_PTR(ANTLR3_ERR_NOMEM); + } + + // Now fill in the defaults + // + antlr3SetVectorApi(vector, sizeHint); + + // And everything is hunky dory + // + return vector; +} + +ANTLR3_API void +antlr3SetVectorApi (pANTLR3_VECTOR vector, ANTLR3_UINT32 sizeHint) +{ + ANTLR3_UINT32 initialSize; + + // Allow vectors to be guessed by ourselves, so input size can be zero + // + if (sizeHint > ANTLR3_VECTOR_INTERNAL_SIZE) + { + initialSize = sizeHint; + } + else + { + initialSize = ANTLR3_VECTOR_INTERNAL_SIZE; + } + + if (sizeHint > ANTLR3_VECTOR_INTERNAL_SIZE) + { + vector->elements = (pANTLR3_VECTOR_ELEMENT)ANTLR3_MALLOC((size_t)(sizeof(ANTLR3_VECTOR_ELEMENT) * initialSize)); + } + else + { + vector->elements = vector->internal; + } + + if (vector->elements == NULL) + { + ANTLR3_FREE(vector); + return; + } + + // Memory allocated successfully + // + vector->count = 0; // No entries yet of course + vector->elementsSize = initialSize; // Available entries + + // Now we can install the API + // + vector->add = antlr3VectorAdd; + vector->del = antlr3VectorDel; + vector->get = antlr3VectorGet; + vector->free = antlr3VectorFree; + vector->set = antlr3VectorSet; + vector->remove = antrl3VectorRemove; + vector->clear = antlr3VectorClear; + vector->size = antlr3VectorSize; + vector->swap = antlr3VectorSwap; + + // Assume that this is not a factory made vector + // + vector->factoryMade = ANTLR3_FALSE; +} + +// Clear the entries in a vector. +// Clearing the vector leaves its capacity the same but +// it walks the entries first to see if any of them +// have a free routine that must be called. +// +static void +antlr3VectorClear (pANTLR3_VECTOR vector) +{ + ANTLR3_UINT32 entry; + + // We must traverse every entry in the vector and if it has + // a pointer to a free function then we call it with the + // the entry pointer + // + for (entry = 0; entry < vector->count; entry++) + { + if (vector->elements[entry].freeptr != NULL) + { + vector->elements[entry].freeptr(vector->elements[entry].element); + } + vector->elements[entry].freeptr = NULL; + vector->elements[entry].element = NULL; + } + + // Having called any free pointers, we just reset the entry count + // back to zero. + // + vector->count = 0; +} + +static +void ANTLR3_CDECL antlr3VectorFree (pANTLR3_VECTOR vector) +{ + ANTLR3_UINT32 entry; + + // We must traverse every entry in the vector and if it has + // a pointer to a free function then we call it with the + // the entry pointer + // + for (entry = 0; entry < vector->count; entry++) + { + if (vector->elements[entry].freeptr != NULL) + { + vector->elements[entry].freeptr(vector->elements[entry].element); + } + vector->elements[entry].freeptr = NULL; + vector->elements[entry].element = NULL; + } + + if (vector->factoryMade == ANTLR3_FALSE) + { + // The entries are freed, so free the element allocation + // + if (vector->elementsSize > ANTLR3_VECTOR_INTERNAL_SIZE) + { + ANTLR3_FREE(vector->elements); + } + vector->elements = NULL; + + // Finally, free the allocation for the vector itself + // + ANTLR3_FREE(vector); + } +} + +static void antlr3VectorDel (pANTLR3_VECTOR vector, ANTLR3_UINT32 entry) +{ + // Check this is a valid request first + // + if (entry >= vector->count) + { + return; + } + + // Valid request, check for free pointer and call it if present + // + if (vector->elements[entry].freeptr != NULL) + { + vector->elements[entry].freeptr(vector->elements[entry].element); + vector->elements[entry].freeptr = NULL; + } + + if (entry == vector->count - 1) + { + // Ensure the pointer is never reused by accident, but otherwise just + // decrement the pointer. + // + vector->elements[entry].element = NULL; + } + else + { + // Need to shuffle trailing pointers back over the deleted entry + // + ANTLR3_MEMMOVE(vector->elements + entry, vector->elements + entry + 1, sizeof(ANTLR3_VECTOR_ELEMENT) * (vector->count - entry - 1)); + } + + // One less entry in the vector now + // + vector->count--; +} + +static void * antlr3VectorGet (pANTLR3_VECTOR vector, ANTLR3_UINT32 entry) +{ + // Ensure this is a valid request + // + if (entry < vector->count) + { + return vector->elements[entry].element; + } + else + { + // I know nothing, Mr. Fawlty! + // + return NULL; + } +} + +/// Remove the entry from the vector, but do not free any entry, even if it has +/// a free pointer. +/// +static void * antrl3VectorRemove (pANTLR3_VECTOR vector, ANTLR3_UINT32 entry) +{ + void * element; + + // Check this is a valid request first + // + if (entry >= vector->count) + { + return NULL; + } + + // Valid request, return the sorted pointer + // + + element = vector->elements[entry].element; + + if (entry == vector->count - 1) + { + // Ensure the pointer is never reused by accident, but otherwise just + // decrement the pointer. + /// + vector->elements[entry].element = NULL; + vector->elements[entry].freeptr = NULL; + } + else + { + // Need to shuffle trailing pointers back over the deleted entry + // + ANTLR3_MEMMOVE(vector->elements + entry, vector->elements + entry + 1, sizeof(ANTLR3_VECTOR_ELEMENT) * (vector->count - entry - 1)); + } + + // One less entry in the vector now + // + vector->count--; + + return element; +} + +static void +antlr3VectorResize (pANTLR3_VECTOR vector, ANTLR3_UINT32 hint) +{ + ANTLR3_UINT32 newSize; + + // Need to resize the element pointers. We double the allocation + // we already have unless asked for a specific increase. + // + if (hint == 0 || hint < vector->elementsSize) + { + newSize = vector->elementsSize * 2; + } + else + { + newSize = hint * 2; + } + + // Now we know how many we need, so we see if we have just expanded + // past the built in vector elements or were already past that + // + if (vector->elementsSize > ANTLR3_VECTOR_INTERNAL_SIZE) + { + // We were already larger than the internal size, so we just + // use realloc so that the pointers are copied for us + // + vector->elements = (pANTLR3_VECTOR_ELEMENT)ANTLR3_REALLOC(vector->elements, (sizeof(ANTLR3_VECTOR_ELEMENT)* newSize)); + } + else + { + // The current size was less than or equal to the internal array size and as we always start + // with a size that is at least the maximum internal size, then we must need to allocate new memory + // for external pointers. We don't want to take the time to calculate if a requested element + // is part of the internal or external entries, so we copy the internal ones to the new space + // + vector->elements = (pANTLR3_VECTOR_ELEMENT)ANTLR3_MALLOC((sizeof(ANTLR3_VECTOR_ELEMENT)* newSize)); + ANTLR3_MEMCPY(vector->elements, vector->internal, ANTLR3_VECTOR_INTERNAL_SIZE * sizeof(ANTLR3_VECTOR_ELEMENT)); + } + + vector->elementsSize = newSize; +} + +/// Add the supplied pointer and freeing function pointer to the list, +/// expanding the vector if needed. +/// +static ANTLR3_UINT32 antlr3VectorAdd (pANTLR3_VECTOR vector, void * element, void (ANTLR3_CDECL *freeptr)(void *)) +{ + // Do we need to resize the vector table? + // + if (vector->count == vector->elementsSize) + { + antlr3VectorResize(vector, 0); // Give no hint, we let it add 1024 or double it + } + + // Insert the new entry + // + vector->elements[vector->count].element = element; + vector->elements[vector->count].freeptr = freeptr; + + vector->count++; // One more element counted + + return (ANTLR3_UINT32)(vector->count); + +} + +/// Replace the element at the specified entry point with the supplied +/// entry. +/// +static ANTLR3_UINT32 +antlr3VectorSet (pANTLR3_VECTOR vector, ANTLR3_UINT32 entry, void * element, void (ANTLR3_CDECL *freeptr)(void *), ANTLR3_BOOLEAN freeExisting) +{ + + // If the vector is currently not big enough, then we expand it + // + if (entry >= vector->elementsSize) + { + antlr3VectorResize(vector, entry); // We will get at least this many + } + + // Valid request, replace the current one, freeing any prior entry if told to + // + if ( entry < vector->count // If actually replacing an element + && freeExisting // And told to free any existing element + && vector->elements[entry].freeptr != NULL // And the existing element has a free pointer + ) + { + vector->elements[entry].freeptr(vector->elements[entry].element); + } + + // Install the new pointers + // + vector->elements[entry].freeptr = freeptr; + vector->elements[entry].element = element; + + if (entry >= vector->count) + { + vector->count = entry + 1; + } + return (ANTLR3_UINT32)(entry); // Indicates the replacement was successful + +} + +/// Replace the element at the specified entry point with the supplied +/// entry. +/// +static ANTLR3_BOOLEAN +antlr3VectorSwap (pANTLR3_VECTOR vector, ANTLR3_UINT32 entry1, ANTLR3_UINT32 entry2) +{ + + void * tempEntry; + void (ANTLR3_CDECL *freeptr)(void *); + + // If the vector is currently not big enough, then we do nothing + // + if (entry1 >= vector->elementsSize || entry2 >= vector->elementsSize) + { + return ANTLR3_FALSE; + } + + // Valid request, swap them + // + tempEntry = vector->elements[entry1].element; + freeptr = vector->elements[entry1].freeptr; + + // Install the new pointers + // + vector->elements[entry1].freeptr = vector->elements[entry2].freeptr; + vector->elements[entry1].element = vector->elements[entry2].element; + + vector->elements[entry2].freeptr = freeptr; + vector->elements[entry2].element = tempEntry; + + return ANTLR3_TRUE; + +} + +static ANTLR3_UINT32 antlr3VectorSize (pANTLR3_VECTOR vector) +{ + return vector->count; +} + +#ifdef ANTLR3_WINDOWS +#pragma warning (push) +#pragma warning (disable : 4100) +#endif +/// Vector factory creation +/// +ANTLR3_API pANTLR3_VECTOR_FACTORY +antlr3VectorFactoryNew (ANTLR3_UINT32 sizeHint) +{ + pANTLR3_VECTOR_FACTORY factory; + + // Allocate memory for the factory + // + factory = (pANTLR3_VECTOR_FACTORY)ANTLR3_MALLOC((size_t)(sizeof(ANTLR3_VECTOR_FACTORY))); + + if (factory == NULL) + { + return NULL; + } + + // Factory memory is good, so create a new vector pool + // + factory->pools = NULL; + factory->thisPool = -1; + + newPool(factory); + + // Initialize the API, ignore the hint as this algorithm does + // a better job really. + // + antlr3SetVectorApi(&(factory->unTruc), ANTLR3_VECTOR_INTERNAL_SIZE); + + factory->unTruc.factoryMade = ANTLR3_TRUE; + + // Install the factory API + // + factory->close = closeVectorFactory; + factory->newVector = newVector; + factory->returnVector = returnVector; + + // Create a stack to accumulate reusable vectors + // + factory->freeStack = antlr3StackNew(16); + return factory; +} +#ifdef ANTLR3_WINDOWS +#pragma warning (pop) +#endif + +static void +returnVector (pANTLR3_VECTOR_FACTORY factory, pANTLR3_VECTOR vector) +{ + // First we need to clear out anything that is still in the vector + // + vector->clear(vector); + + // We have a free stack available so we can add the vector we were + // given into the free chain. The vector has to have come from this + // factory, so we already know how to release its memory when it + // dies by virtue of the factory being closed. + // + factory->freeStack->push(factory->freeStack, vector, NULL); + + // TODO: remove this line once happy printf("Returned vector %08X to the pool, stack size is %d\n", vector, factory->freeStack->size(factory->freeStack)); +} + +static void +newPool(pANTLR3_VECTOR_FACTORY factory) +{ + /* Increment factory count + */ + factory->thisPool++; + + /* Ensure we have enough pointers allocated + */ + factory->pools = (pANTLR3_VECTOR *) + ANTLR3_REALLOC( (void *)factory->pools, /* Current pools pointer (starts at NULL) */ + (ANTLR3_UINT32)((factory->thisPool + 1) * sizeof(pANTLR3_VECTOR *)) /* Memory for new pool pointers */ + ); + + /* Allocate a new pool for the factory + */ + factory->pools[factory->thisPool] = + (pANTLR3_VECTOR) + ANTLR3_MALLOC((size_t)(sizeof(ANTLR3_VECTOR) * ANTLR3_FACTORY_VPOOL_SIZE)); + + + /* Reset the counters + */ + factory->nextVector = 0; + + /* Done + */ + return; +} + +static void +closeVectorFactory (pANTLR3_VECTOR_FACTORY factory) +{ + pANTLR3_VECTOR pool; + ANTLR3_INT32 poolCount; + ANTLR3_UINT32 limit; + ANTLR3_UINT32 vector; + pANTLR3_VECTOR check; + + // First see if we have a free chain stack to release? + // + if (factory->freeStack != NULL) + { + factory->freeStack->free(factory->freeStack); + } + + /* We iterate the vector pools one at a time + */ + for (poolCount = 0; poolCount <= factory->thisPool; poolCount++) + { + /* Pointer to current pool + */ + pool = factory->pools[poolCount]; + + /* Work out how many tokens we need to check in this pool. + */ + limit = (poolCount == factory->thisPool ? factory->nextVector : ANTLR3_FACTORY_VPOOL_SIZE); + + /* Marginal condition, we might be at the start of a brand new pool + * where the nextToken is 0 and nothing has been allocated. + */ + if (limit > 0) + { + /* We have some vectors allocated from this pool + */ + for (vector = 0; vector < limit; vector++) + { + /* Next one in the chain + */ + check = pool + vector; + + // Call the free function on each of the vectors in the pool, + // which in turn will cause any elements it holds that also have a free + // pointer to be freed. However, because any vector may be in any other + // vector, we don't free the element allocations yet. We do that in a + // a specific pass, coming up next. The vector free function knows that + // this is a factory allocated pool vector and so it won't free things it + // should not. + // + check->free(check); + } + } + } + + /* We iterate the vector pools one at a time once again, but this time + * we are going to free up any allocated element pointers. Note that we are doing this + * so that we do not try to release vectors twice. When building ASTs we just copy + * the vectors all over the place and they may be embedded in this vector pool + * numerous times. + */ + for (poolCount = 0; poolCount <= factory->thisPool; poolCount++) + { + /* Pointer to current pool + */ + pool = factory->pools[poolCount]; + + /* Work out how many tokens we need to check in this pool. + */ + limit = (poolCount == factory->thisPool ? factory->nextVector : ANTLR3_FACTORY_VPOOL_SIZE); + + /* Marginal condition, we might be at the start of a brand new pool + * where the nextToken is 0 and nothing has been allocated. + */ + if (limit > 0) + { + /* We have some vectors allocated from this pool + */ + for (vector = 0; vector < limit; vector++) + { + /* Next one in the chain + */ + check = pool + vector; + + // Anything in here should be factory made, but we do this just + // to triple check. We just free up the elements if they were + // allocated beyond the internal size. + // + if (check->factoryMade == ANTLR3_TRUE && check->elementsSize > ANTLR3_VECTOR_INTERNAL_SIZE) + { + ANTLR3_FREE(check->elements); + check->elements = NULL; + } + } + } + + // We can now free this pool allocation as we have called free on every element in every vector + // and freed any memory for pointers the grew beyond the internal size limit. + // + ANTLR3_FREE(factory->pools[poolCount]); + factory->pools[poolCount] = NULL; + } + + /* All the pools are deallocated we can free the pointers to the pools + * now. + */ + ANTLR3_FREE(factory->pools); + + /* Finally, we can free the space for the factory itself + */ + ANTLR3_FREE(factory); + +} + +static pANTLR3_VECTOR +newVector(pANTLR3_VECTOR_FACTORY factory) +{ + pANTLR3_VECTOR vector; + + // If we have anything on the re claim stack, reuse it + // + vector = factory->freeStack->peek(factory->freeStack); + + if (vector != NULL) + { + // Cool we got something we could reuse + // + factory->freeStack->pop(factory->freeStack); + + // TODO: remove this line once happy printf("Reused vector %08X from stack, size is now %d\n", vector, factory->freeStack->size(factory->freeStack)); + return vector; + + } + + // See if we need a new vector pool before allocating a new + // one + // + if (factory->nextVector >= ANTLR3_FACTORY_VPOOL_SIZE) + { + // We ran out of vectors in the current pool, so we need a new pool + // + newPool(factory); + } + + // Assuming everything went well (we are trying for performance here so doing minimal + // error checking. Then we can work out what the pointer is to the next vector. + // + vector = factory->pools[factory->thisPool] + factory->nextVector; + factory->nextVector++; + + // We have our token pointer now, so we can initialize it to the predefined model. + // + antlr3SetVectorApi(vector, ANTLR3_VECTOR_INTERNAL_SIZE); + vector->factoryMade = ANTLR3_TRUE; + + // We know that the pool vectors are created at the default size, which means they + // will start off using their internal entry pointers. We must intialize our pool vector + // to point to its own internal entry table and not the pre-made one. + // + vector->elements = vector->internal; + + // TODO: remove this line once happy printf("Used a new vector at %08X from the pools as nothing on the reusue stack\n", vector); + + // And we are done + // + return vector; +} + +/** Array of left most significant bit positions for an 8 bit + * element provides an efficient way to find the highest bit + * that is set in an n byte value (n>0). Assuming the values will all hit the data cache, + * coding without conditional elements should allow branch + * prediction to work well and of course a parallel instruction cache + * will whip through this. Otherwise we must loop shifting a one + * bit and masking. The values we tend to be placing in out integer + * patricia trie are usually a lot lower than the 64 bits we + * allow for the key allows. Hence there is a lot of redundant looping and + * shifting in a while loop. Whereas, the lookup table is just + * a few ands and indirect lookups, while testing for 0. This + * is likely to be done in parallel on many processors available + * when I wrote this. If this code survives as long as yacc, then + * I may already be dead by the time you read this and maybe there is + * a single machine instruction to perform the operation. What + * else are you going to do with all those transistors? Jim 2007 + * + * The table is probably obvious but it is just the number 0..7 + * of the MSB in each integer value 0..256 + */ +static ANTLR3_UINT8 bitIndex[256] = +{ + 0, // 0 - Just for padding + 0, // 1 + 1, 1, // 2..3 + 2, 2, 2, 2, // 4..7 + 3, 3, 3, 3, 3, 3, 3, 3, // 8+ + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, // 16+ + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, // 32+ + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, // 64+ + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, // 128+ + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7 +}; + +/** Rather than use the bit index of a trie node to shift + * 0x01 left that many times, then & with the result, it is + * faster to use the bit index as an index into this table + * which holds precomputed masks for any of the 64 bits + * we need to mask off singly. The data values will stay in + * cache while ever a trie is in heavy use, such as in + * memoization. It is also pretty enough to be ASCII art. + */ +static ANTLR3_UINT64 bitMask[64] = +{ + 0x0000000000000001ULL, 0x0000000000000002ULL, 0x0000000000000004ULL, 0x0000000000000008ULL, + 0x0000000000000010ULL, 0x0000000000000020ULL, 0x0000000000000040ULL, 0x0000000000000080ULL, + 0x0000000000000100ULL, 0x0000000000000200ULL, 0x0000000000000400ULL, 0x0000000000000800ULL, + 0x0000000000001000ULL, 0x0000000000002000ULL, 0x0000000000004000ULL, 0x0000000000008000ULL, + 0x0000000000010000ULL, 0x0000000000020000ULL, 0x0000000000040000ULL, 0x0000000000080000ULL, + 0x0000000000100000ULL, 0x0000000000200000ULL, 0x0000000000400000ULL, 0x0000000000800000ULL, + 0x0000000001000000ULL, 0x0000000002000000ULL, 0x0000000004000000ULL, 0x0000000008000000ULL, + 0x0000000010000000ULL, 0x0000000020000000ULL, 0x0000000040000000ULL, 0x0000000080000000ULL, + 0x0000000100000000ULL, 0x0000000200000000ULL, 0x0000000400000000ULL, 0x0000000800000000ULL, + 0x0000001000000000ULL, 0x0000002000000000ULL, 0x0000004000000000ULL, 0x0000008000000000ULL, + 0x0000010000000000ULL, 0x0000020000000000ULL, 0x0000040000000000ULL, 0x0000080000000000ULL, + 0x0000100000000000ULL, 0x0000200000000000ULL, 0x0000400000000000ULL, 0x0000800000000000ULL, + 0x0001000000000000ULL, 0x0002000000000000ULL, 0x0004000000000000ULL, 0x0008000000000000ULL, + 0x0010000000000000ULL, 0x0020000000000000ULL, 0x0040000000000000ULL, 0x0080000000000000ULL, + 0x0100000000000000ULL, 0x0200000000000000ULL, 0x0400000000000000ULL, 0x0800000000000000ULL, + 0x1000000000000000ULL, 0x2000000000000000ULL, 0x4000000000000000ULL, 0x8000000000000000ULL +}; + +/* INT TRIE Implementation of depth 64 bits, being the number of bits + * in a 64 bit integer. + */ + +pANTLR3_INT_TRIE +antlr3IntTrieNew(ANTLR3_UINT32 depth) +{ + pANTLR3_INT_TRIE trie; + + trie = (pANTLR3_INT_TRIE) ANTLR3_CALLOC(1, sizeof(ANTLR3_INT_TRIE)); /* Base memory required */ + + if (trie == NULL) + { + return (pANTLR3_INT_TRIE) ANTLR3_FUNC_PTR(ANTLR3_ERR_NOMEM); + } + + /* Now we need to allocate the root node. This makes it easier + * to use the tree as we don't have to do anything special + * for the root node. + */ + trie->root = (pANTLR3_INT_TRIE_NODE) ANTLR3_CALLOC(1, sizeof(ANTLR3_INT_TRIE)); + + if (trie->root == NULL) + { + ANTLR3_FREE(trie); + return (pANTLR3_INT_TRIE) ANTLR3_FUNC_PTR(ANTLR3_ERR_NOMEM); + } + + trie->add = intTrieAdd; + trie->del = intTrieDel; + trie->free = intTrieFree; + trie->get = intTrieGet; + + /* Now we seed the root node with the index being the + * highest left most bit we want to test, which limits the + * keys in the trie. This is the trie 'depth'. The limit for + * this implementation is 63 (bits 0..63). + */ + trie->root->bitNum = depth; + + /* And as we have nothing in here yet, we set both child pointers + * of the root node to point back to itself. + */ + trie->root->leftN = trie->root; + trie->root->rightN = trie->root; + trie->count = 0; + + /* Finally, note that the key for this root node is 0 because + * we use calloc() to initialise it. + */ + + return trie; +} + +/** Search the int Trie and return a pointer to the first bucket indexed + * by the key if it is contained in the trie, otherwise NULL. + */ +static pANTLR3_TRIE_ENTRY +intTrieGet (pANTLR3_INT_TRIE trie, ANTLR3_INTKEY key) +{ + pANTLR3_INT_TRIE_NODE thisNode; + pANTLR3_INT_TRIE_NODE nextNode; + + if (trie->count == 0) + { + return NULL; /* Nothing in this trie yet */ + } + /* Starting at the root node in the trie, compare the bit index + * of the current node with its next child node (starts left from root). + * When the bit index of the child node is greater than the bit index of the current node + * then by definition (as the bit index decreases as we descent the trie) + * we have reached a 'backward' pointer. A backward pointer means we + * have reached the only node that can be reached by the bits given us so far + * and it must either be the key we are looking for, or if not then it + * means the entry was not in the trie, and we return NULL. A backward pointer + * points back in to the tree structure rather than down (deeper) within the + * tree branches. + */ + thisNode = trie->root; /* Start at the root node */ + nextNode = thisNode->leftN; /* Examine the left node from the root */ + + /* While we are descending the tree nodes... + */ + while (thisNode->bitNum > nextNode->bitNum) + { + /* Next node now becomes the new 'current' node + */ + thisNode = nextNode; + + /* We now test the bit indicated by the bitmap in the next node + * in the key we are searching for. The new next node is the + * right node if that bit is set and the left node it is not. + */ + if (key & bitMask[nextNode->bitNum]) + { + nextNode = nextNode->rightN; /* 1 is right */ + } + else + { + nextNode = nextNode->leftN; /* 0 is left */ + } + } + + /* Here we have reached a node where the bitMap index is lower than + * its parent. This means it is pointing backward in the tree and + * must therefore be a terminal node, being the only point than can + * be reached with the bits seen so far. It is either the actual key + * we wanted, or if that key is not in the trie it is another key + * that is currently the only one that can be reached by those bits. + * That situation would obviously change if the key was to be added + * to the trie. + * + * Hence it only remains to test whether this is actually the key or not. + */ + if (nextNode->key == key) + { + /* This was the key, so return the entry pointer + */ + return nextNode->buckets; + } + else + { + return NULL; /* That key is not in the trie (note that we set the pointer to -1 if no payload) */ + } +} + + +static ANTLR3_BOOLEAN +intTrieDel (pANTLR3_INT_TRIE trie, ANTLR3_INTKEY key) +{ + pANTLR3_INT_TRIE_NODE p; + + p=trie->root; + key = key; + + return ANTLR3_FALSE; +} + +/** Add an entry into the INT trie. + * Basically we descend the trie as we do when searching it, which will + * locate the only node in the trie that can be reached by the bit pattern of the + * key. If the key is actually at that node, then if the trie accepts duplicates + * we add the supplied data in a new chained bucket to that data node. If it does + * not accept duplicates then we merely return FALSE in case the caller wants to know + * whether the key was already in the trie. + * If the node we locate is not the key we are looking to add, then we insert a new node + * into the trie with a bit index of the leftmost differing bit and the left or right + * node pointing to itself or the data node we are inserting 'before'. + */ +static ANTLR3_BOOLEAN +intTrieAdd (pANTLR3_INT_TRIE trie, ANTLR3_INTKEY key, ANTLR3_UINT32 type, ANTLR3_INTKEY intVal, void * data, void (ANTLR3_CDECL *freeptr)(void *)) +{ + pANTLR3_INT_TRIE_NODE thisNode; + pANTLR3_INT_TRIE_NODE nextNode; + pANTLR3_INT_TRIE_NODE entNode; + ANTLR3_UINT32 depth; + pANTLR3_TRIE_ENTRY newEnt; + pANTLR3_TRIE_ENTRY nextEnt; + ANTLR3_INTKEY xorKey; + + /* Cache the bit depth of this trie, which is always the highest index, + * which is in the root node + */ + depth = trie->root->bitNum; + + thisNode = trie->root; /* Start with the root node */ + nextNode = trie->root->leftN; /* And assume we start to the left */ + + /* Now find the only node that can be currently reached by the bits in the + * key we are being asked to insert. + */ + while (thisNode->bitNum > nextNode->bitNum) + { + /* Still descending the structure, next node becomes current. + */ + thisNode = nextNode; + + if (key & bitMask[nextNode->bitNum]) + { + /* Bit at the required index was 1, so travers the right node from here + */ + nextNode = nextNode->rightN; + } + else + { + /* Bit at the required index was 0, so we traverse to the left + */ + nextNode = nextNode->leftN; + } + } + /* Here we have located the only node that can be reached by the + * bits in the requested key. It could in fact be that key or the node + * we need to use to insert the new key. + */ + if (nextNode->key == key) + { + /* We have located an exact match, but we will only append to the bucket chain + * if this trie accepts duplicate keys. + */ + if (trie->allowDups ==ANTLR3_TRUE) + { + /* Yes, we are accepting duplicates + */ + newEnt = (pANTLR3_TRIE_ENTRY)ANTLR3_CALLOC(1, sizeof(ANTLR3_TRIE_ENTRY)); + + if (newEnt == NULL) + { + /* Out of memory, all we can do is return the fact that the insert failed. + */ + return ANTLR3_FALSE; + } + + /* Otherwise insert this in the chain + */ + newEnt->type = type; + newEnt->freeptr = freeptr; + if (type == ANTLR3_HASH_TYPE_STR) + { + newEnt->data.ptr = data; + } + else + { + newEnt->data.intVal = intVal; + } + + /* We want to be able to traverse the stored elements in the order that they were + * added as duplicate keys. We might need to revise this opinion if we end up having many duplicate keys + * as perhaps reverse order is just as good, so long as it is ordered. + */ + nextEnt = nextNode->buckets; + while (nextEnt->next != NULL) + { + nextEnt = nextEnt->next; + } + nextEnt->next = newEnt; + + trie->count++; + return ANTLR3_TRUE; + } + else + { + /* We found the key is already there and we are not allowed duplicates in this + * trie. + */ + return ANTLR3_FALSE; + } + } + + /* Here we have discovered the only node that can be reached by the bits in the key + * but we have found that this node is not the key we need to insert. We must find the + * the leftmost bit by which the current key for that node and the new key we are going + * to insert, differ. While this nested series of ifs may look a bit strange, experimentation + * showed that it allows a machine code path that works well with predicated execution + */ + xorKey = (key ^ nextNode->key); /* Gives 1 bits only where they differ then we find the left most 1 bit*/ + + /* Most common case is a 32 bit key really + */ +#ifdef ANTLR3_USE_64BIT + if (xorKey & 0xFFFFFFFF00000000) + { + if (xorKey & 0xFFFF000000000000) + { + if (xorKey & 0xFF00000000000000) + { + depth = 56 + bitIndex[((xorKey & 0xFF00000000000000)>>56)]; + } + else + { + depth = 48 + bitIndex[((xorKey & 0x00FF000000000000)>>48)]; + } + } + else + { + if (xorKey & 0x0000FF0000000000) + { + depth = 40 + bitIndex[((xorKey & 0x0000FF0000000000)>>40)]; + } + else + { + depth = 32 + bitIndex[((xorKey & 0x000000FF00000000)>>32)]; + } + } + } + else +#endif + { + if (xorKey & 0x00000000FFFF0000) + { + if (xorKey & 0x00000000FF000000) + { + depth = 24 + bitIndex[((xorKey & 0x00000000FF000000)>>24)]; + } + else + { + depth = 16 + bitIndex[((xorKey & 0x0000000000FF0000)>>16)]; + } + } + else + { + if (xorKey & 0x000000000000FF00) + { + depth = 8 + bitIndex[((xorKey & 0x0000000000000FF00)>>8)]; + } + else + { + depth = bitIndex[xorKey & 0x00000000000000FF]; + } + } + } + + /* We have located the leftmost differing bit, indicated by the depth variable. So, we know what + * bit index we are to insert the new entry at. There are two cases, being where the two keys + * differ at a bit position that is not currently part of the bit testing, where they differ on a bit + * that is currently being skipped in the indexed comparisons, and where they differ on a bit + * that is merely lower down in the current bit search. If the bit index went bit 4, bit 2 and they differ + * at bit 3, then we have the "skipped" bit case. But if that chain was Bit 4, Bit 2 and they differ at bit 1 + * then we have the easy bit . + * + * So, set up to descend the tree again, but this time looking for the insert point + * according to whether we skip the bit that differs or not. + */ + thisNode = trie->root; + entNode = trie->root->leftN; + + /* Note the slight difference in the checks here to cover both cases + */ + while (thisNode->bitNum > entNode->bitNum && entNode->bitNum > depth) + { + /* Still descending the structure, next node becomes current. + */ + thisNode = entNode; + + if (key & bitMask[entNode->bitNum]) + { + /* Bit at the required index was 1, so traverse the right node from here + */ + entNode = entNode->rightN; + } + else + { + /* Bit at the required index was 0, so we traverse to the left + */ + entNode = entNode->leftN; + } + } + + /* We have located the correct insert point for this new key, so we need + * to allocate our entry and insert it etc. + */ + nextNode = (pANTLR3_INT_TRIE_NODE)ANTLR3_CALLOC(1, sizeof(ANTLR3_INT_TRIE_NODE)); + if (nextNode == NULL) + { + /* All that work and no memory - bummer. + */ + return ANTLR3_FALSE; + } + + /* Build a new entry block for the new node + */ + newEnt = (pANTLR3_TRIE_ENTRY)ANTLR3_CALLOC(1, sizeof(ANTLR3_TRIE_ENTRY)); + + if (newEnt == NULL) + { + /* Out of memory, all we can do is return the fact that the insert failed. + */ + return ANTLR3_FALSE; + } + + /* Otherwise enter this in our new node + */ + newEnt->type = type; + newEnt->freeptr = freeptr; + if (type == ANTLR3_HASH_TYPE_STR) + { + newEnt->data.ptr = data; + } + else + { + newEnt->data.intVal = intVal; + } + /* Install it + */ + nextNode->buckets = newEnt; + nextNode->key = key; + nextNode->bitNum = depth; + + /* Work out the right and left pointers for this new node, which involve + * terminating with the current found node either right or left according + * to whether the current index bit is 1 or 0 + */ + if (key & bitMask[depth]) + { + nextNode->leftN = entNode; /* Terminates at previous position */ + nextNode->rightN = nextNode; /* Terminates with itself */ + } + else + { + nextNode->rightN = entNode; /* Terminates at previous position */ + nextNode->leftN = nextNode; /* Terminates with itself */ + } + + /* Finally, we need to change the pointers at the node we located + * for inserting. If the key bit at its index is set then the right + * pointer for that node becomes the newly created node, otherwise the left + * pointer does. + */ + if (key & bitMask[thisNode->bitNum] ) + { + thisNode->rightN = nextNode; + } + else + { + thisNode->leftN = nextNode; + } + + /* Et voila + */ + trie->count++; + return ANTLR3_TRUE; + +} +/** Release memory allocated to this tree. + * Basic algorithm is that we do a depth first left descent and free + * up any nodes that are not backward pointers. + */ +static void +freeIntNode(pANTLR3_INT_TRIE_NODE node) +{ + pANTLR3_TRIE_ENTRY thisEntry; + pANTLR3_TRIE_ENTRY nextEntry; + + /* If this node has a left pointer that is not a back pointer + * then recursively call to free this + */ + if (node->bitNum > node->leftN->bitNum) + { + /* We have a left node that needs descending, so do it. + */ + freeIntNode(node->leftN); + } + + /* The left nodes from here should now be dealt with, so + * we need to descend any right nodes that are not back pointers + */ + if (node->bitNum > node->rightN->bitNum) + { + /* There are some right nodes to descend and deal with. + */ + freeIntNode(node->rightN); + } + + /* Now all the children are dealt with, we can destroy + * this node too + */ + thisEntry = node->buckets; + + while (thisEntry != NULL) + { + nextEntry = thisEntry->next; + + /* Do we need to call a custom free pointer for this string entry? + */ + if (thisEntry->type == ANTLR3_HASH_TYPE_STR && thisEntry->freeptr != NULL) + { + thisEntry->freeptr(thisEntry->data.ptr); + } + + /* Now free the data for this bucket entry + */ + ANTLR3_FREE(thisEntry); + thisEntry = nextEntry; /* See if there are any more to free */ + } + + /* The bucket entry is now gone, so we can free the memory for + * the entry itself. + */ + ANTLR3_FREE(node); + + /* And that should be it for everything under this node and itself + */ +} + +/** Called to free all nodes and the structure itself. + */ +static void +intTrieFree (pANTLR3_INT_TRIE trie) +{ + /* Descend from the root and free all the nodes + */ + freeIntNode(trie->root); + + /* the nodes are all gone now, so we need only free the memory + * for the structure itself + */ + ANTLR3_FREE(trie); +} + + +/** + * Allocate and initialize a new ANTLR3 topological sorter, which can be + * used to define edges that identify numerical node indexes that depend on other + * numerical node indexes, which can then be sorted topologically such that + * any node is sorted after all its dependent nodes. + * + * Use: + * + * /verbatim + + pANTLR3_TOPO topo; + topo = antlr3NewTopo(); + + if (topo == NULL) { out of memory } + + topo->addEdge(topo, 3, 0); // Node 3 depends on node 0 + topo->addEdge(topo, 0, 1); // Node - depends on node 1 + topo->sortVector(topo, myVector); // Sort the vector in place (node numbers are the vector entry numbers) + + * /verbatim + */ +ANTLR3_API pANTLR3_TOPO +antlr3TopoNew() +{ + pANTLR3_TOPO topo = (pANTLR3_TOPO)ANTLR3_MALLOC(sizeof(ANTLR3_TOPO)); + + if (topo == NULL) + { + return NULL; + } + + // Initialize variables + // + + topo->visited = NULL; // Don't know how big it is yet + topo->limit = 1; // No edges added yet + topo->edges = NULL; // No edges added yet + topo->sorted = NULL; // Nothing sorted at the start + topo->cycle = NULL; // No cycles at the start + topo->cycleMark = 0; // No cycles at the start + topo->hasCycle = ANTLR3_FALSE; // No cycle at the start + + // API + // + topo->addEdge = addEdge; + topo->sortToArray = sortToArray; + topo->sortVector = sortVector; + topo->free = freeTopo; + + return topo; +} +// Topological sorter +// +static void +addEdge (pANTLR3_TOPO topo, ANTLR3_UINT32 edge, ANTLR3_UINT32 dependency) +{ + ANTLR3_UINT32 i; + ANTLR3_UINT32 maxEdge; + pANTLR3_BITSET edgeDeps; + + if (edge>dependency) + { + maxEdge = edge; + } + else + { + maxEdge = dependency; + } + // We need to add an edge to says that the node indexed by 'edge' is + // dependent on the node indexed by 'dependency' + // + + // First see if we have enough room in the edges array to add the edge? + // + if (topo->edges == NULL) + { + // We don't have any edges yet, so create an array to hold them + // + topo->edges = ANTLR3_CALLOC(sizeof(pANTLR3_BITSET) * (maxEdge + 1), 1); + if (topo->edges == NULL) + { + return; + } + + // Set the limit to what we have now + // + topo->limit = maxEdge + 1; + } + else if (topo->limit <= maxEdge) + { + // WE have some edges but not enough + // + topo->edges = ANTLR3_REALLOC(topo->edges, sizeof(pANTLR3_BITSET) * (maxEdge + 1)); + if (topo->edges == NULL) + { + return; + } + + // Initialize the new bitmaps to ;indicate we have no edges defined yet + // + for (i = topo->limit; i <= maxEdge; i++) + { + *((topo->edges) + i) = NULL; + } + + // Set the limit to what we have now + // + topo->limit = maxEdge + 1; + } + + // If the edge was flagged as depending on itself, then we just + // do nothing as it means this routine was just called to add it + // in to the list of nodes. + // + if (edge == dependency) + { + return; + } + + // Pick up the bit map for the requested edge + // + edgeDeps = *((topo->edges) + edge); + + if (edgeDeps == NULL) + { + // No edges are defined yet for this node + // + edgeDeps = antlr3BitsetNew(0); + *((topo->edges) + edge) = edgeDeps; + if (edgeDeps == NULL ) + { + return; // Out of memory + } + } + + // Set the bit in the bitmap that corresponds to the requested + // dependency. + // + edgeDeps->add(edgeDeps, dependency); + + // And we are all set + // + return; +} + + +/** + * Given a starting node, descend its dependent nodes (ones that it has edges + * to) until we find one without edges. Having found a node without edges, we have + * discovered the bottom of a depth first search, which we can then ascend, adding + * the nodes in order from the bottom, which gives us the dependency order. + */ +static void +DFS(pANTLR3_TOPO topo, ANTLR3_UINT32 node) +{ + pANTLR3_BITSET edges; + + // Guard against a revisit and check for cycles + // + if (topo->hasCycle == ANTLR3_TRUE) + { + return; // We don't do anything else if we found a cycle + } + + if (topo->visited->isMember(topo->visited, node)) + { + // Check to see if we found a cycle. To do this we search the + // current cycle stack and see if we find this node already in the stack. + // + ANTLR3_UINT32 i; + + for (i=0; icycleMark; i++) + { + if (topo->cycle[i] == node) + { + // Stop! We found a cycle in the input, so rejig the cycle + // stack so that it only contains the cycle and set the cycle flag + // which will tell the caller what happened + // + ANTLR3_UINT32 l; + + for (l = i; l < topo->cycleMark; l++) + { + topo->cycle[l - i] = topo->cycle[l]; // Move to zero base in the cycle list + } + + // Recalculate the limit + // + topo->cycleMark -= i; + + // Signal disaster + // + topo->hasCycle = ANTLR3_TRUE; + } + } + return; + } + + // So far, no cycles have been found and we have not visited this node yet, + // so this node needs to go into the cycle stack before we continue + // then we will take it out of the stack once we have descended all its + // dependencies. + // + topo->cycle[topo->cycleMark++] = node; + + // First flag that we have visited this node + // + topo->visited->add(topo->visited, node); + + // Now, if this node has edges, then we want to ensure we visit + // them all before we drop through and add this node into the sorted + // list. + // + edges = *((topo->edges) + node); + if (edges != NULL) + { + // We have some edges, so visit each of the edge nodes + // that have not already been visited. + // + ANTLR3_UINT32 numBits; // How many bits are in the set + ANTLR3_UINT32 i; + ANTLR3_UINT32 range; + + numBits = edges->numBits(edges); + range = edges->size(edges); // Number of set bits + + // Stop if we exahust the bit list or have checked the + // number of edges that this node refers to (so we don't + // check bits at the end that cannot possibly be set). + // + for (i=0; i<= numBits && range > 0; i++) + { + if (edges->isMember(edges, i)) + { + range--; // About to check another one + + // Found an edge, make sure we visit and descend it + // + DFS(topo, i); + } + } + } + + // At this point we will have visited all the dependencies + // of this node and they will be ordered (even if there are cycles) + // So we just add the node into the sorted list at the + // current index position. + // + topo->sorted[topo->limit++] = node; + + // Remove this node from the cycle list if we have not detected a cycle + // + if (topo->hasCycle == ANTLR3_FALSE) + { + topo->cycleMark--; + } + + return; +} + +static pANTLR3_UINT32 +sortToArray (pANTLR3_TOPO topo) +{ + ANTLR3_UINT32 v; + ANTLR3_UINT32 oldLimit; + + // Guard against being called with no edges defined + // + if (topo->edges == NULL) + { + return 0; + } + // First we need a vector to populate with enough + // entries to accomodate the sorted list and another to accomodate + // the maximum cycle we could detect which is all nodes such as 0->1->2->3->0 + // + topo->sorted = ANTLR3_MALLOC(topo->limit * sizeof(ANTLR3_UINT32)); + topo->cycle = ANTLR3_MALLOC(topo->limit * sizeof(ANTLR3_UINT32)); + + // Next we need an empty bitset to show whether we have visited a node + // or not. This is the bit that gives us linear time of course as we are essentially + // dropping through the nodes in depth first order and when we get to a node that + // has no edges, we pop back up the stack adding the nodes we traversed in reverse + // order. + // + topo->visited = antlr3BitsetNew(0); + + // Now traverse the nodes as if we were just going left to right, but + // then descend each node unless it has already been visited. + // + oldLimit = topo->limit; // Number of nodes to traverse linearly + topo->limit = 0; // Next entry in the sorted table + + for (v = 0; v < oldLimit; v++) + { + // If we did not already visit this node, then descend it until we + // get a node without edges or arrive at a node we have already visited. + // + if (topo->visited->isMember(topo->visited, v) == ANTLR3_FALSE) + { + // We have not visited this one so descend it + // + DFS(topo, v); + } + + // Break the loop if we detect a cycle as we have no need to go any + // further + // + if (topo->hasCycle == ANTLR3_TRUE) + { + break; + } + } + + // Reset the limit to the number we recorded as if we hit a + // cycle, then limit will have stopped at the node where we + // discovered the cycle, but in order to free the edge bitmaps + // we need to know how many we may have allocated and traverse them all. + // + topo->limit = oldLimit; + + // Having traversed all the nodes we were given, we + // are guaranteed to have ordered all the nodes or detected a + // cycle. + // + return topo->sorted; +} + +static void +sortVector (pANTLR3_TOPO topo, pANTLR3_VECTOR v) +{ + // To sort a vector, we first perform the + // sort to an array, then use the results to reorder the vector + // we are given. This is just a convenience routine that allows you to + // sort the children of a tree node into topological order before or + // during an AST walk. This can be useful for optimizations that require + // dag reorders and also when the input stream defines thigns that are + // interdependent and you want to walk the list of the generated trees + // for those things in topological order so you can ignore the interdependencies + // at that point. + // + ANTLR3_UINT32 i; + + // Used as a lookup index to find the current location in the vector of + // the vector entry that was originally at position [0], [1], [2] etc + // + pANTLR3_UINT32 vIndex; + + // Sort into an array, then we can use the array that is + // stored in the topo + // + if (topo->sortToArray(topo) == 0) + { + return; // There were no edges + } + + if (topo->hasCycle == ANTLR3_TRUE) + { + return; // Do nothing if we detected a cycle + } + + // Ensure that the vector we are sorting is at least as big as the + // the input sequence we were adsked to sort. It does not matter if it is + // bigger as thaat probably just means that nodes numbered higher than the + // limit had no dependencies and so can be left alone. + // + if (topo->limit > v->count) + { + // We can only sort the entries that we have dude! The caller is + // responsible for ensuring the vector is the correct one and is the + // correct size etc. + // + topo->limit = v->count; + } + // We need to know the locations of each of the entries + // in the vector as we don't want to duplicate them in a new vector. We + // just use an indirection table to get the vector entry for a particular sequence + // acording to where we moved it last. Then we can just swap vector entries until + // we are done :-) + // + vIndex = ANTLR3_MALLOC(topo->limit * sizeof(ANTLR3_UINT32)); + + // Start index, each vector entry is located where you think it is + // + for (i = 0; i < topo->limit; i++) + { + vIndex[i] = i; + } + + // Now we traverse the sorted array and moved the entries of + // the vector around according to the sort order and the indirection + // table we just created. The index telsl us where in the vector the + // original element entry n is now located via vIndex[n]. + // + for (i=0; i < topo->limit; i++) + { + ANTLR3_UINT32 ind; + + // If the vector entry at i is already the one that it + // should be, then we skip moving it of course. + // + if (vIndex[topo->sorted[i]] == i) + { + continue; + } + + // The vector entry at i, should be replaced with the + // vector entry indicated by topo->sorted[i]. The vector entry + // at topo->sorted[i] may have already been swapped out though, so we + // find where it is now and move it from there to i. + // + ind = vIndex[topo->sorted[i]]; + v->swap(v, i, ind); + + // Update our index. The element at i is now the one we wanted + // to be sorted here and the element we swapped out is now the + // element that was at i just before we swapped it. If you are lost now + // don't worry about it, we are just reindexing on the fly is all. + // + vIndex[topo->sorted[i]] = i; + vIndex[i] = ind; + } + + // Having traversed all the entries, we have sorted the vector in place. + // + ANTLR3_FREE(vIndex); + return; +} + +static void +freeTopo (pANTLR3_TOPO topo) +{ + ANTLR3_UINT32 i; + + // Free the result vector + // + if (topo->sorted != NULL) + { + ANTLR3_FREE(topo->sorted); + topo->sorted = NULL; + } + + // Free the visited map + // + if (topo->visited != NULL) + { + + topo->visited->free(topo->visited); + topo->visited = NULL; + } + + // Free any edgemaps + // + if (topo->edges != NULL) + { + pANTLR3_BITSET edgeList; + + + for (i=0; ilimit; i++) + { + edgeList = *((topo->edges) + i); + if (edgeList != NULL) + { + edgeList->free(edgeList); + } + } + + ANTLR3_FREE(topo->edges); + } + topo->edges = NULL; + + // Free any cycle map + // + if (topo->cycle != NULL) + { + ANTLR3_FREE(topo->cycle); + } + + ANTLR3_FREE(topo); +} diff --git a/antlr/libantlr3c-3.4/src/antlr3commontoken.c b/antlr/libantlr3c-3.4/src/antlr3commontoken.c new file mode 100644 index 0000000..2627431 --- /dev/null +++ b/antlr/libantlr3c-3.4/src/antlr3commontoken.c @@ -0,0 +1,586 @@ +/** + * Contains the default implementation of the common token used within + * java. Custom tokens should create this structure and then append to it using the + * custom pointer to install their own structure and API. + */ + +// [The "BSD licence"] +// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC +// http://www.temporal-wave.com +// http://www.linkedin.com/in/jimidle +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. The name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include + +/* Token API + */ +static pANTLR3_STRING getText (pANTLR3_COMMON_TOKEN token); +static void setText (pANTLR3_COMMON_TOKEN token, pANTLR3_STRING text); +static void setText8 (pANTLR3_COMMON_TOKEN token, pANTLR3_UINT8 text); +static ANTLR3_UINT32 getType (pANTLR3_COMMON_TOKEN token); +static void setType (pANTLR3_COMMON_TOKEN token, ANTLR3_UINT32 type); +static ANTLR3_UINT32 getLine (pANTLR3_COMMON_TOKEN token); +static void setLine (pANTLR3_COMMON_TOKEN token, ANTLR3_UINT32 line); +static ANTLR3_INT32 getCharPositionInLine (pANTLR3_COMMON_TOKEN token); +static void setCharPositionInLine (pANTLR3_COMMON_TOKEN token, ANTLR3_INT32 pos); +static ANTLR3_UINT32 getChannel (pANTLR3_COMMON_TOKEN token); +static void setChannel (pANTLR3_COMMON_TOKEN token, ANTLR3_UINT32 channel); +static ANTLR3_MARKER getTokenIndex (pANTLR3_COMMON_TOKEN token); +static void setTokenIndex (pANTLR3_COMMON_TOKEN token, ANTLR3_MARKER); +static ANTLR3_MARKER getStartIndex (pANTLR3_COMMON_TOKEN token); +static void setStartIndex (pANTLR3_COMMON_TOKEN token, ANTLR3_MARKER index); +static ANTLR3_MARKER getStopIndex (pANTLR3_COMMON_TOKEN token); +static void setStopIndex (pANTLR3_COMMON_TOKEN token, ANTLR3_MARKER index); +static pANTLR3_STRING toString (pANTLR3_COMMON_TOKEN token); + +/* Factory API + */ +static void factoryClose (pANTLR3_TOKEN_FACTORY factory); +static pANTLR3_COMMON_TOKEN newToken (void); +static void setInputStream (pANTLR3_TOKEN_FACTORY factory, pANTLR3_INPUT_STREAM input); +static void factoryReset (pANTLR3_TOKEN_FACTORY factory); + +/* Internal management functions + */ +static void newPool (pANTLR3_TOKEN_FACTORY factory); +static pANTLR3_COMMON_TOKEN newPoolToken (pANTLR3_TOKEN_FACTORY factory); + + +ANTLR3_API pANTLR3_COMMON_TOKEN +antlr3CommonTokenNew(ANTLR3_UINT32 ttype) +{ + pANTLR3_COMMON_TOKEN token; + + // Create a raw token with the interface installed + // + token = newToken(); + + if (token != NULL) + { + token->setType(token, ttype); + } + + // All good + // + return token; +} + +ANTLR3_API pANTLR3_TOKEN_FACTORY +antlr3TokenFactoryNew(pANTLR3_INPUT_STREAM input) +{ + pANTLR3_TOKEN_FACTORY factory; + + /* allocate memory + */ + factory = (pANTLR3_TOKEN_FACTORY) ANTLR3_MALLOC((size_t)sizeof(ANTLR3_TOKEN_FACTORY)); + + if (factory == NULL) + { + return NULL; + } + + /* Install factory API + */ + factory->newToken = newPoolToken; + factory->close = factoryClose; + factory->setInputStream = setInputStream; + factory->reset = factoryReset; + + /* Allocate the initial pool + */ + factory->thisPool = -1; + factory->pools = NULL; + factory->maxPool = -1; + newPool(factory); + + /* Factory space is good, we now want to initialize our cheating token + * which one it is initialized is the model for all tokens we manufacture + */ + antlr3SetTokenAPI(&factory->unTruc); + + /* Set some initial variables for future copying + */ + factory->unTruc.factoryMade = ANTLR3_TRUE; + + // Input stream + // + setInputStream(factory, input); + + return factory; + +} + +static void +setInputStream (pANTLR3_TOKEN_FACTORY factory, pANTLR3_INPUT_STREAM input) +{ + factory->input = input; + factory->unTruc.input = input; + if (input != NULL) + { + factory->unTruc.strFactory = input->strFactory; + } + else + { + factory->unTruc.strFactory = NULL; + } +} + +static void +newPool(pANTLR3_TOKEN_FACTORY factory) +{ + /* Increment factory count + */ + factory->thisPool++; + + // If we were reusing this token factory then we may already have a pool + // allocated. If we exceeded the max avaible then we must allocate a new + // one. + if (factory->thisPool > factory->maxPool) + { + /* Ensure we have enough pointers allocated + */ + factory->pools = (pANTLR3_COMMON_TOKEN *) + ANTLR3_REALLOC( (void *)factory->pools, /* Current pools pointer (starts at NULL) */ + (ANTLR3_UINT32)((factory->thisPool + 1) * sizeof(pANTLR3_COMMON_TOKEN *)) /* Memory for new pool pointers */ + ); + + /* Allocate a new pool for the factory + */ + factory->pools[factory->thisPool] = + (pANTLR3_COMMON_TOKEN) + ANTLR3_CALLOC(1, (size_t)(sizeof(ANTLR3_COMMON_TOKEN) * ANTLR3_FACTORY_POOL_SIZE)); + + // We now have a new pool and can track it as the maximum we have created so far + // + factory->maxPool = factory->thisPool; + } + + /* Reset the counters + */ + factory->nextToken = 0; + + /* Done + */ + return; +} + +static pANTLR3_COMMON_TOKEN +newPoolToken(pANTLR3_TOKEN_FACTORY factory) +{ + pANTLR3_COMMON_TOKEN token; + + /* See if we need a new token pool before allocating a new + * one + */ + if (factory->nextToken >= ANTLR3_FACTORY_POOL_SIZE) + { + /* We ran out of tokens in the current pool, so we need a new pool + */ + newPool(factory); + } + + /* Assuming everything went well (we are trying for performance here so doing minimal + * error checking. Then we can work out what the pointer is to the next token. + */ + token = factory->pools[factory->thisPool] + factory->nextToken; + factory->nextToken++; + + /* We have our token pointer now, so we can initialize it to the predefined model. + * We only need do this though if the token is not already initialized, we just check + * an api function pointer for this as they are allocated via calloc. + */ + if (token->setStartIndex == NULL) + { + antlr3SetTokenAPI(token); + + // It is factory made, and we need to copy the string factory pointer + // + token->factoryMade = ANTLR3_TRUE; + token->strFactory = factory->input == NULL ? NULL : factory->input->strFactory; + token->input = factory->input; + } + + /* And we are done + */ + return token; +} + +static void +factoryReset (pANTLR3_TOKEN_FACTORY factory) +{ + // Just start again with pool #0 when we are + // called. + // + factory->thisPool = -1; + newPool(factory); +} + +static void +factoryClose (pANTLR3_TOKEN_FACTORY factory) +{ + pANTLR3_COMMON_TOKEN pool; + ANTLR3_INT32 poolCount; + ANTLR3_UINT32 limit; + ANTLR3_UINT32 token; + pANTLR3_COMMON_TOKEN check; + + /* We iterate the token pools one at a time + */ + for (poolCount = 0; poolCount <= factory->thisPool; poolCount++) + { + /* Pointer to current pool + */ + pool = factory->pools[poolCount]; + + /* Work out how many tokens we need to check in this pool. + */ + limit = (poolCount == factory->thisPool ? factory->nextToken : ANTLR3_FACTORY_POOL_SIZE); + + /* Marginal condition, we might be at the start of a brand new pool + * where the nextToken is 0 and nothing has been allocated. + */ + if (limit > 0) + { + /* We have some tokens allocated from this pool + */ + for (token = 0; token < limit; token++) + { + /* Next one in the chain + */ + check = pool + token; + + /* If the programmer made this a custom token, then + * see if we need to call their free routine. + */ + if (check->custom != NULL && check->freeCustom != NULL) + { + check->freeCustom(check->custom); + check->custom = NULL; + } + } + } + + /* We can now free this pool allocation + */ + ANTLR3_FREE(factory->pools[poolCount]); + factory->pools[poolCount] = NULL; + } + + /* All the pools are deallocated we can free the pointers to the pools + * now. + */ + ANTLR3_FREE(factory->pools); + + /* Finally, we can free the space for the factory itself + */ + ANTLR3_FREE(factory); +} + + +static pANTLR3_COMMON_TOKEN +newToken(void) +{ + pANTLR3_COMMON_TOKEN token; + + /* Allocate memory for this + */ + token = (pANTLR3_COMMON_TOKEN) ANTLR3_CALLOC(1, (size_t)(sizeof(ANTLR3_COMMON_TOKEN))); + + if (token == NULL) + { + return NULL; + } + + // Install the API + // + antlr3SetTokenAPI(token); + token->factoryMade = ANTLR3_FALSE; + + return token; +} + +ANTLR3_API void +antlr3SetTokenAPI(pANTLR3_COMMON_TOKEN token) +{ + token->getText = getText; + token->setText = setText; + token->setText8 = setText8; + token->getType = getType; + token->setType = setType; + token->getLine = getLine; + token->setLine = setLine; + token->setLine = setLine; + token->getCharPositionInLine = getCharPositionInLine; + token->setCharPositionInLine = setCharPositionInLine; + token->getChannel = getChannel; + token->setChannel = setChannel; + token->getTokenIndex = getTokenIndex; + token->setTokenIndex = setTokenIndex; + token->getStartIndex = getStartIndex; + token->setStartIndex = setStartIndex; + token->getStopIndex = getStopIndex; + token->setStopIndex = setStopIndex; + token->toString = toString; + + return; +} + +static pANTLR3_STRING getText (pANTLR3_COMMON_TOKEN token) +{ + switch (token->textState) + { + case ANTLR3_TEXT_STRING: + + // Someone already created a string for this token, so we just + // use it. + // + return token->tokText.text; + break; + + case ANTLR3_TEXT_CHARP: + + // We had a straight text pointer installed, now we + // must convert it to a string. Note we have to do this here + // or otherwise setText8() will just install the same char* + // + if (token->strFactory != NULL) + { + token->tokText.text = token->strFactory->newStr8(token->strFactory, (pANTLR3_UINT8)token->tokText.chars); + token->textState = ANTLR3_TEXT_STRING; + return token->tokText.text; + } + else + { + // We cannot do anything here + // + return NULL; + } + break; + + default: + + // EOF is a special case + // + if (token->type == ANTLR3_TOKEN_EOF) + { + token->tokText.text = token->strFactory->newStr8(token->strFactory, (pANTLR3_UINT8)""); + token->textState = ANTLR3_TEXT_STRING; + token->tokText.text->factory = token->strFactory; + return token->tokText.text; + } + + + // We had nothing installed in the token, create a new string + // from the input stream + // + + if (token->input != NULL) + { + + return token->input->substr( token->input, + token->getStartIndex(token), + token->getStopIndex(token) + ); + } + + // Nothing to return, there is no input stream + // + return NULL; + break; + } +} +static void setText8 (pANTLR3_COMMON_TOKEN token, pANTLR3_UINT8 text) +{ + // No text to set, so ignore + // + if (text == NULL) return; + + switch (token->textState) + { + case ANTLR3_TEXT_NONE: + case ANTLR3_TEXT_CHARP: // Caller must free before setting again, if it needs to be freed + + // Nothing in there yet, or just a char *, so just set the + // text as a pointer + // + token->textState = ANTLR3_TEXT_CHARP; + token->tokText.chars = (pANTLR3_UCHAR)text; + break; + + default: + + // It was already a pANTLR3_STRING, so just override it + // + token->tokText.text->set8(token->tokText.text, (const char *)text); + break; + } + + // We are done + // + return; +} + +/** \brief Install the supplied text string as teh text for the token. + * The method assumes that the existing text (if any) was created by a factory + * and so does not attempt to release any memory it is using.Text not created + * by a string fctory (not advised) should be released prior to this call. + */ +static void setText (pANTLR3_COMMON_TOKEN token, pANTLR3_STRING text) +{ + // Merely replaces and existing pre-defined text with the supplied + // string + // + token->textState = ANTLR3_TEXT_STRING; + token->tokText.text = text; + + /* We are done + */ + return; +} + +static ANTLR3_UINT32 getType (pANTLR3_COMMON_TOKEN token) +{ + return token->type; +} + +static void setType (pANTLR3_COMMON_TOKEN token, ANTLR3_UINT32 type) +{ + token->type = type; +} + +static ANTLR3_UINT32 getLine (pANTLR3_COMMON_TOKEN token) +{ + return token->line; +} + +static void setLine (pANTLR3_COMMON_TOKEN token, ANTLR3_UINT32 line) +{ + token->line = line; +} + +static ANTLR3_INT32 getCharPositionInLine (pANTLR3_COMMON_TOKEN token) +{ + return token->charPosition; +} + +static void setCharPositionInLine (pANTLR3_COMMON_TOKEN token, ANTLR3_INT32 pos) +{ + token->charPosition = pos; +} + +static ANTLR3_UINT32 getChannel (pANTLR3_COMMON_TOKEN token) +{ + return token->channel; +} + +static void setChannel (pANTLR3_COMMON_TOKEN token, ANTLR3_UINT32 channel) +{ + token->channel = channel; +} + +static ANTLR3_MARKER getTokenIndex (pANTLR3_COMMON_TOKEN token) +{ + return token->index; +} + +static void setTokenIndex (pANTLR3_COMMON_TOKEN token, ANTLR3_MARKER index) +{ + token->index = index; +} + +static ANTLR3_MARKER getStartIndex (pANTLR3_COMMON_TOKEN token) +{ + return token->start == -1 ? (ANTLR3_MARKER)(token->input->data) : token->start; +} + +static void setStartIndex (pANTLR3_COMMON_TOKEN token, ANTLR3_MARKER start) +{ + token->start = start; +} + +static ANTLR3_MARKER getStopIndex (pANTLR3_COMMON_TOKEN token) +{ + return token->stop; +} + +static void setStopIndex (pANTLR3_COMMON_TOKEN token, ANTLR3_MARKER stop) +{ + token->stop = stop; +} + +static pANTLR3_STRING toString (pANTLR3_COMMON_TOKEN token) +{ + pANTLR3_STRING text; + pANTLR3_STRING outtext; + + text = token->getText(token); + + if (text == NULL) + { + return NULL; + } + + if (text->factory == NULL) + { + return text; // This usally means it is the EOF token + } + + /* A new empty string to assemble all the stuff in + */ + outtext = text->factory->newRaw(text->factory); + + /* Now we use our handy dandy string utility to assemble the + * the reporting string + * return "[@"+getTokenIndex()+","+start+":"+stop+"='"+txt+"',<"+type+">"+channelStr+","+line+":"+getCharPositionInLine()+"]"; + */ + outtext->append8(outtext, "[Index: "); + outtext->addi (outtext, (ANTLR3_INT32)token->getTokenIndex(token)); + outtext->append8(outtext, " (Start: "); + outtext->addi (outtext, (ANTLR3_INT32)token->getStartIndex(token)); + outtext->append8(outtext, "-Stop: "); + outtext->addi (outtext, (ANTLR3_INT32)token->getStopIndex(token)); + outtext->append8(outtext, ") ='"); + outtext->appendS(outtext, text); + outtext->append8(outtext, "', type<"); + outtext->addi (outtext, token->type); + outtext->append8(outtext, "> "); + + if (token->getChannel(token) > ANTLR3_TOKEN_DEFAULT_CHANNEL) + { + outtext->append8(outtext, "(channel = "); + outtext->addi (outtext, (ANTLR3_INT32)token->getChannel(token)); + outtext->append8(outtext, ") "); + } + + outtext->append8(outtext, "Line: "); + outtext->addi (outtext, (ANTLR3_INT32)token->getLine(token)); + outtext->append8(outtext, " LinePos:"); + outtext->addi (outtext, token->getCharPositionInLine(token)); + outtext->addc (outtext, ']'); + + return outtext; +} + diff --git a/antlr/libantlr3c-3.4/src/antlr3commontree.c b/antlr/libantlr3c-3.4/src/antlr3commontree.c new file mode 100644 index 0000000..65de38f --- /dev/null +++ b/antlr/libantlr3c-3.4/src/antlr3commontree.c @@ -0,0 +1,547 @@ +// \file +// +// Implementation of ANTLR3 CommonTree, which you can use as a +// starting point for your own tree. Though it is often easier just to tag things on +// to the user pointer in the tree unless you are building a different type +// of structure. +// + +// [The "BSD licence"] +// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC +// http://www.temporal-wave.com +// http://www.linkedin.com/in/jimidle +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. The name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include + + +static pANTLR3_COMMON_TOKEN getToken (pANTLR3_BASE_TREE tree); +static pANTLR3_BASE_TREE dupNode (pANTLR3_BASE_TREE tree); +static ANTLR3_BOOLEAN isNilNode (pANTLR3_BASE_TREE tree); +static ANTLR3_UINT32 getType (pANTLR3_BASE_TREE tree); +static pANTLR3_STRING getText (pANTLR3_BASE_TREE tree); +static ANTLR3_UINT32 getLine (pANTLR3_BASE_TREE tree); +static ANTLR3_UINT32 getCharPositionInLine (pANTLR3_BASE_TREE tree); +static pANTLR3_STRING toString (pANTLR3_BASE_TREE tree); +static pANTLR3_BASE_TREE getParent (pANTLR3_BASE_TREE tree); +static void setParent (pANTLR3_BASE_TREE tree, pANTLR3_BASE_TREE parent); +static void setChildIndex (pANTLR3_BASE_TREE tree, ANTLR3_INT32 i); +static ANTLR3_INT32 getChildIndex (pANTLR3_BASE_TREE tree); +static void createChildrenList (pANTLR3_BASE_TREE tree); +static void reuse (pANTLR3_BASE_TREE tree); + +// Factory functions for the Arboretum +// +static void newPool (pANTLR3_ARBORETUM factory); +static pANTLR3_BASE_TREE newPoolTree (pANTLR3_ARBORETUM factory); +static pANTLR3_BASE_TREE newFromTree (pANTLR3_ARBORETUM factory, pANTLR3_COMMON_TREE tree); +static pANTLR3_BASE_TREE newFromToken (pANTLR3_ARBORETUM factory, pANTLR3_COMMON_TOKEN token); +static void factoryClose (pANTLR3_ARBORETUM factory); + +ANTLR3_API pANTLR3_ARBORETUM +antlr3ArboretumNew(pANTLR3_STRING_FACTORY strFactory) +{ + pANTLR3_ARBORETUM factory; + + // Allocate memory + // + factory = (pANTLR3_ARBORETUM) ANTLR3_MALLOC((size_t)sizeof(ANTLR3_ARBORETUM)); + if (factory == NULL) + { + return NULL; + } + + // Install a vector factory to create, track and free() any child + // node lists. + // + factory->vFactory = antlr3VectorFactoryNew(0); + if (factory->vFactory == NULL) + { + free(factory); + return NULL; + } + + // We also keep a reclaim stack, so that any Nil nodes that are + // orphaned are not just left in the pool but are reused, other wise + // we create 6 times as many nilNodes as ordinary nodes and use loads of + // memory. Perhaps at some point, the analysis phase will generate better + // code and we won't need to do this here. + // + factory->nilStack = antlr3StackNew(0); + + // Install factory API + // + factory->newTree = newPoolTree; + factory->newFromTree = newFromTree; + factory->newFromToken = newFromToken; + factory->close = factoryClose; + + // Allocate the initial pool + // + factory->thisPool = -1; + factory->pools = NULL; + newPool(factory); + + // Factory space is good, we now want to initialize our cheating token + // which one it is initialized is the model for all tokens we manufacture + // + antlr3SetCTAPI(&factory->unTruc); + + // Set some initial variables for future copying, including a string factory + // that we can use later for converting trees to strings. + // + factory->unTruc.factory = factory; + factory->unTruc.baseTree.strFactory = strFactory; + + return factory; + +} + +static void +newPool(pANTLR3_ARBORETUM factory) +{ + // Increment factory count + // + factory->thisPool++; + + // Ensure we have enough pointers allocated + // + factory->pools = (pANTLR3_COMMON_TREE *) + ANTLR3_REALLOC( (void *)factory->pools, // Current pools pointer (starts at NULL) + (ANTLR3_UINT32)((factory->thisPool + 1) * sizeof(pANTLR3_COMMON_TREE *)) // Memory for new pool pointers + ); + + // Allocate a new pool for the factory + // + factory->pools[factory->thisPool] = + (pANTLR3_COMMON_TREE) + ANTLR3_MALLOC((size_t)(sizeof(ANTLR3_COMMON_TREE) * ANTLR3_FACTORY_POOL_SIZE)); + + + // Reset the counters + // + factory->nextTree = 0; + + // Done + // + return; +} + +static pANTLR3_BASE_TREE +newPoolTree (pANTLR3_ARBORETUM factory) +{ + pANTLR3_COMMON_TREE tree; + + // If we have anything on the re claim stack, reuse that sucker first + // + tree = factory->nilStack->peek(factory->nilStack); + + if (tree != NULL) + { + // Cool we got something we could reuse, it will have been cleaned up by + // whatever put it back on the stack (for instance if it had a child vector, + // that will have been cleared to hold zero entries and that vector will get reused too. + // It is the basetree pointer that is placed on the stack of course + // + factory->nilStack->pop(factory->nilStack); + return (pANTLR3_BASE_TREE)tree; + + } + // See if we need a new tree pool before allocating a new tree + // + if (factory->nextTree >= ANTLR3_FACTORY_POOL_SIZE) + { + // We ran out of tokens in the current pool, so we need a new pool + // + newPool(factory); + } + + // Assuming everything went well - we are trying for performance here so doing minimal + // error checking - then we can work out what the pointer is to the next commontree. + // + tree = factory->pools[factory->thisPool] + factory->nextTree; + factory->nextTree++; + + // We have our token pointer now, so we can initialize it to the predefined model. + // + antlr3SetCTAPI(tree); + + // Set some initial variables for future copying, including a string factory + // that we can use later for converting trees to strings. + // + tree->factory = factory; + tree->baseTree.strFactory = factory->unTruc.baseTree.strFactory; + + // The super points to the common tree so we must override the one used by + // by the pre-built tree as otherwise we will always poitn to the same initial + // common tree and we might spend 3 hours trying to debug why - this would never + // happen to me of course! :-( + // + tree->baseTree.super = tree; + + + // And we are done + // + return &(tree->baseTree); +} + + +static pANTLR3_BASE_TREE +newFromTree(pANTLR3_ARBORETUM factory, pANTLR3_COMMON_TREE tree) +{ + pANTLR3_BASE_TREE newTree; + + newTree = factory->newTree(factory); + + if (newTree == NULL) + { + return NULL; + } + + // Pick up the payload we had in the supplied tree + // + ((pANTLR3_COMMON_TREE)(newTree->super))->token = tree->token; + newTree->u = tree->baseTree.u; // Copy any user pointer + + return newTree; +} + +static pANTLR3_BASE_TREE +newFromToken(pANTLR3_ARBORETUM factory, pANTLR3_COMMON_TOKEN token) +{ + pANTLR3_BASE_TREE newTree; + + newTree = factory->newTree(factory); + + if (newTree == NULL) + { + return NULL; + } + + // Pick up the payload we had in the supplied tree + // + ((pANTLR3_COMMON_TREE)(newTree->super))->token = token; + + return newTree; +} + +static void +factoryClose (pANTLR3_ARBORETUM factory) +{ + ANTLR3_INT32 poolCount; + + // First close the vector factory that supplied all the child pointer + // vectors. + // + factory->vFactory->close(factory->vFactory); + + if (factory->nilStack != NULL) + { + factory->nilStack->free(factory->nilStack); + } + + // We now JUST free the pools because the C runtime CommonToken based tree + // cannot contain anything that was not made by this factory. + // + for (poolCount = 0; poolCount <= factory->thisPool; poolCount++) + { + // We can now free this pool allocation + // + ANTLR3_FREE(factory->pools[poolCount]); + factory->pools[poolCount] = NULL; + } + + // All the pools are deallocated we can free the pointers to the pools + // now. + // + ANTLR3_FREE(factory->pools); + + // Finally, we can free the space for the factory itself + // + ANTLR3_FREE(factory); +} + + +ANTLR3_API void +antlr3SetCTAPI(pANTLR3_COMMON_TREE tree) +{ + // Init base tree + // + antlr3BaseTreeNew(&(tree->baseTree)); + + // We need a pointer to ourselves for + // the payload and few functions that we + // provide. + // + tree->baseTree.super = tree; + + // Common tree overrides + + tree->baseTree.isNilNode = isNilNode; + tree->baseTree.toString = toString; + tree->baseTree.dupNode = (void *(*)(pANTLR3_BASE_TREE))(dupNode); + tree->baseTree.getLine = getLine; + tree->baseTree.getCharPositionInLine = getCharPositionInLine; + tree->baseTree.toString = toString; + tree->baseTree.getType = getType; + tree->baseTree.getText = getText; + tree->baseTree.getToken = getToken; + tree->baseTree.getParent = getParent; + tree->baseTree.setParent = setParent; + tree->baseTree.setChildIndex = setChildIndex; + tree->baseTree.getChildIndex = getChildIndex; + tree->baseTree.createChildrenList = createChildrenList; + tree->baseTree.reuse = reuse; + tree->baseTree.free = NULL; // Factory trees have no free function + tree->baseTree.u = NULL; // Initialize user pointer + + tree->baseTree.children = NULL; + + tree->token = NULL; // No token as yet + tree->startIndex = 0; + tree->stopIndex = 0; + tree->parent = NULL; // No parent yet + tree->childIndex = -1; + + return; +} + +// -------------------------------------- +// Non factory node constructors. +// + +ANTLR3_API pANTLR3_COMMON_TREE +antlr3CommonTreeNew() +{ + pANTLR3_COMMON_TREE tree; + tree = ANTLR3_CALLOC(1, sizeof(ANTLR3_COMMON_TREE)); + + if (tree == NULL) + { + return NULL; + } + + antlr3SetCTAPI(tree); + + return tree; +} + +ANTLR3_API pANTLR3_COMMON_TREE +antlr3CommonTreeNewFromToken(pANTLR3_COMMON_TOKEN token) +{ + pANTLR3_COMMON_TREE newTree; + + newTree = antlr3CommonTreeNew(); + + if (newTree == NULL) + { + return NULL; + } + + //Pick up the payload we had in the supplied tree + // + newTree->token = token; + return newTree; +} + +/// Create a new vector for holding child nodes using the inbuilt +/// vector factory. +/// +static void +createChildrenList (pANTLR3_BASE_TREE tree) +{ + tree->children = ((pANTLR3_COMMON_TREE)(tree->super))->factory->vFactory->newVector(((pANTLR3_COMMON_TREE)(tree->super))->factory->vFactory); +} + + +static pANTLR3_COMMON_TOKEN +getToken (pANTLR3_BASE_TREE tree) +{ + // The token is the payload of the common tree or other implementor + // so it is stored within ourselves, which is the super pointer.Note + // that whatever the actual token is, it is passed around by its pointer + // to the common token implementation, which it may of course surround + // with its own super structure. + // + return ((pANTLR3_COMMON_TREE)(tree->super))->token; +} + +static pANTLR3_BASE_TREE +dupNode (pANTLR3_BASE_TREE tree) +{ + // The node we are duplicating is in fact the common tree (that's why we are here) + // so we use the super pointer to duplicate. + // + pANTLR3_COMMON_TREE theOld; + + theOld = (pANTLR3_COMMON_TREE)(tree->super); + + // The pointer we return is the base implementation of course + // + return theOld->factory->newFromTree(theOld->factory, theOld); +} + +static ANTLR3_BOOLEAN +isNilNode (pANTLR3_BASE_TREE tree) +{ + // This is a Nil tree if it has no payload (Token in our case) + // + if (((pANTLR3_COMMON_TREE)(tree->super))->token == NULL) + { + return ANTLR3_TRUE; + } + else + { + return ANTLR3_FALSE; + } +} + +static ANTLR3_UINT32 +getType (pANTLR3_BASE_TREE tree) +{ + pANTLR3_COMMON_TREE theTree; + + theTree = (pANTLR3_COMMON_TREE)(tree->super); + + if (theTree->token == NULL) + { + return 0; + } + else + { + return theTree->token->getType(theTree->token); + } +} + +static pANTLR3_STRING +getText (pANTLR3_BASE_TREE tree) +{ + return tree->toString(tree); +} + +static ANTLR3_UINT32 getLine (pANTLR3_BASE_TREE tree) +{ + pANTLR3_COMMON_TREE cTree; + pANTLR3_COMMON_TOKEN token; + + cTree = (pANTLR3_COMMON_TREE)(tree->super); + + token = cTree->token; + + if (token == NULL || token->getLine(token) == 0) + { + if (tree->getChildCount(tree) > 0) + { + pANTLR3_BASE_TREE child; + + child = (pANTLR3_BASE_TREE)tree->getChild(tree, 0); + return child->getLine(child); + } + return 0; + } + return token->getLine(token); +} + +static ANTLR3_UINT32 getCharPositionInLine (pANTLR3_BASE_TREE tree) +{ + pANTLR3_COMMON_TOKEN token; + + token = ((pANTLR3_COMMON_TREE)(tree->super))->token; + + if (token == NULL || token->getCharPositionInLine(token) == -1) + { + if (tree->getChildCount(tree) > 0) + { + pANTLR3_BASE_TREE child; + + child = (pANTLR3_BASE_TREE)tree->getChild(tree, 0); + + return child->getCharPositionInLine(child); + } + return 0; + } + return token->getCharPositionInLine(token); +} + +static pANTLR3_STRING toString (pANTLR3_BASE_TREE tree) +{ + if (tree->isNilNode(tree) == ANTLR3_TRUE) + { + pANTLR3_STRING nilNode; + + nilNode = tree->strFactory->newPtr(tree->strFactory, (pANTLR3_UINT8)"nil", 3); + + return nilNode; + } + + return ((pANTLR3_COMMON_TREE)(tree->super))->token->getText(((pANTLR3_COMMON_TREE)(tree->super))->token); +} + +static pANTLR3_BASE_TREE +getParent (pANTLR3_BASE_TREE tree) +{ + return & (((pANTLR3_COMMON_TREE)(tree->super))->parent->baseTree); +} + +static void +setParent (pANTLR3_BASE_TREE tree, pANTLR3_BASE_TREE parent) +{ + ((pANTLR3_COMMON_TREE)(tree->super))->parent = parent == NULL ? NULL : ((pANTLR3_COMMON_TREE)(parent->super))->parent; +} + +static void +setChildIndex (pANTLR3_BASE_TREE tree, ANTLR3_INT32 i) +{ + ((pANTLR3_COMMON_TREE)(tree->super))->childIndex = i; +} +static ANTLR3_INT32 +getChildIndex (pANTLR3_BASE_TREE tree ) +{ + return ((pANTLR3_COMMON_TREE)(tree->super))->childIndex; +} + +/** Clean up any child vector that the tree might have, so it can be reused, + * then add it into the reuse stack. + */ +static void +reuse (pANTLR3_BASE_TREE tree) +{ + pANTLR3_COMMON_TREE cTree; + + cTree = (pANTLR3_COMMON_TREE)(tree->super); + + if (cTree->factory != NULL) + { + + if (cTree->baseTree.children != NULL) + { + + cTree->baseTree.children->clear(cTree->baseTree.children); + } + cTree->factory->nilStack->push(cTree->factory->nilStack, tree, NULL); + + } +} diff --git a/antlr/libantlr3c-3.4/src/antlr3commontreeadaptor.c b/antlr/libantlr3c-3.4/src/antlr3commontreeadaptor.c new file mode 100644 index 0000000..abce6f0 --- /dev/null +++ b/antlr/libantlr3c-3.4/src/antlr3commontreeadaptor.c @@ -0,0 +1,496 @@ +/** \file + * This is the standard tree adaptor used by the C runtime unless the grammar + * source file says to use anything different. It embeds a BASE_TREE to which + * it adds its own implementation of anything that the base tree is not + * good for, plus a number of methods that any other adaptor type + * needs to implement too. + * \ingroup pANTLR3_COMMON_TREE_ADAPTOR + */ + +// [The "BSD licence"] +// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC +// http://www.temporal-wave.com +// http://www.linkedin.com/in/jimidle +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. The name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include + +#ifdef ANTLR3_WINDOWS +#pragma warning( disable : 4100 ) +#endif + +/* BASE_TREE_ADAPTOR overrides... */ +static pANTLR3_BASE_TREE dupNode (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE treeNode); +static pANTLR3_BASE_TREE create (pANTLR3_BASE_TREE_ADAPTOR adpator, pANTLR3_COMMON_TOKEN payload); +static pANTLR3_BASE_TREE dbgCreate (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_COMMON_TOKEN payload); +static pANTLR3_COMMON_TOKEN createToken (pANTLR3_BASE_TREE_ADAPTOR adaptor, ANTLR3_UINT32 tokenType, pANTLR3_UINT8 text); +static pANTLR3_COMMON_TOKEN createTokenFromToken (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_COMMON_TOKEN fromToken); +static pANTLR3_COMMON_TOKEN getToken (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE t); +static pANTLR3_STRING getText (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE t); +static ANTLR3_UINT32 getType (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE t); +static pANTLR3_BASE_TREE getChild (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE t, ANTLR3_UINT32 i); +static ANTLR3_UINT32 getChildCount (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE t); +static void replaceChildren (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE parent, ANTLR3_INT32 startChildIndex, ANTLR3_INT32 stopChildIndex, pANTLR3_BASE_TREE t); +static void setDebugEventListener (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_DEBUG_EVENT_LISTENER debugger); +static void setChildIndex (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE t, ANTLR3_INT32 i); +static ANTLR3_INT32 getChildIndex (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE t); +static void setParent (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE child, pANTLR3_BASE_TREE parent); +static pANTLR3_BASE_TREE getParent (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE child); +static void setChild (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE t, ANTLR3_UINT32 i, pANTLR3_BASE_TREE child); +static void deleteChild (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE t, ANTLR3_UINT32 i); +static pANTLR3_BASE_TREE errorNode (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_TOKEN_STREAM ctnstream, pANTLR3_COMMON_TOKEN startToken, pANTLR3_COMMON_TOKEN stopToken, pANTLR3_EXCEPTION e); +/* Methods specific to each tree adaptor + */ +static void setTokenBoundaries (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE t, pANTLR3_COMMON_TOKEN startToken, pANTLR3_COMMON_TOKEN stopToken); +static void dbgSetTokenBoundaries (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE t, pANTLR3_COMMON_TOKEN startToken, pANTLR3_COMMON_TOKEN stopToken); +static ANTLR3_MARKER getTokenStartIndex (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE t); +static ANTLR3_MARKER getTokenStopIndex (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE t); + +static void ctaFree (pANTLR3_BASE_TREE_ADAPTOR adaptor); + +/** Create a new tree adaptor. Note that despite the fact that this is + * creating a new COMMON_TREE adaptor, we return the address of the + * BASE_TREE interface, as should any other adaptor that wishes to be + * used as the tree element of a tree parse/build. It needs to be given the + * address of a valid string factory as we do not know what the originating + * input stream encoding type was. This way we can rely on just using + * the original input stream's string factory or one of the correct type + * which the user supplies us. + */ +ANTLR3_API pANTLR3_BASE_TREE_ADAPTOR +ANTLR3_TREE_ADAPTORNew(pANTLR3_STRING_FACTORY strFactory) +{ + pANTLR3_COMMON_TREE_ADAPTOR cta; + + // First job is to create the memory we need for the tree adaptor interface. + // + cta = (pANTLR3_COMMON_TREE_ADAPTOR) ANTLR3_MALLOC((size_t)(sizeof(ANTLR3_COMMON_TREE_ADAPTOR))); + + if (cta == NULL) + { + return NULL; + } + + // Memory is initialized, so initialize the base tree adaptor + // + antlr3BaseTreeAdaptorInit(&(cta->baseAdaptor), NULL); + + // Install our interface overrides. Strangeness is to allow generated code to treat them + // as returning void * + // + cta->baseAdaptor.dupNode = (void * (*) (pANTLR3_BASE_TREE_ADAPTOR, void *)) + dupNode; + cta->baseAdaptor.create = (void * (*) (pANTLR3_BASE_TREE_ADAPTOR, pANTLR3_COMMON_TOKEN)) + create; + cta->baseAdaptor.createToken = + createToken; + cta->baseAdaptor.createTokenFromToken = + createTokenFromToken; + cta->baseAdaptor.setTokenBoundaries = (void (*) (pANTLR3_BASE_TREE_ADAPTOR, void *, pANTLR3_COMMON_TOKEN, pANTLR3_COMMON_TOKEN)) + setTokenBoundaries; + cta->baseAdaptor.getTokenStartIndex = (ANTLR3_MARKER (*) (pANTLR3_BASE_TREE_ADAPTOR, void *)) + getTokenStartIndex; + cta->baseAdaptor.getTokenStopIndex = (ANTLR3_MARKER (*) (pANTLR3_BASE_TREE_ADAPTOR, void *)) + getTokenStopIndex; + cta->baseAdaptor.getText = (pANTLR3_STRING (*) (pANTLR3_BASE_TREE_ADAPTOR, void *)) + getText; + cta->baseAdaptor.getType = (ANTLR3_UINT32 (*) (pANTLR3_BASE_TREE_ADAPTOR, void *)) + getType; + cta->baseAdaptor.getChild = (void * (*) (pANTLR3_BASE_TREE_ADAPTOR, void *, ANTLR3_UINT32)) + getChild; + cta->baseAdaptor.setChild = (void (*) (pANTLR3_BASE_TREE_ADAPTOR, void *, ANTLR3_UINT32, void *)) + setChild; + cta->baseAdaptor.setParent = (void (*) (pANTLR3_BASE_TREE_ADAPTOR, void *, void *)) + setParent; + cta->baseAdaptor.getParent = (void * (*) (pANTLR3_BASE_TREE_ADAPTOR, void *)) + getParent; + cta->baseAdaptor.setChildIndex = (void (*) (pANTLR3_BASE_TREE_ADAPTOR, void *, ANTLR3_UINT32)) + setChildIndex; + cta->baseAdaptor.deleteChild = (void (*) (pANTLR3_BASE_TREE_ADAPTOR, void *, ANTLR3_UINT32)) + deleteChild; + cta->baseAdaptor.getChildCount = (ANTLR3_UINT32 (*) (pANTLR3_BASE_TREE_ADAPTOR, void *)) + getChildCount; + cta->baseAdaptor.getChildIndex = (ANTLR3_INT32 (*) (pANTLR3_BASE_TREE_ADAPTOR, void *)) + getChildIndex; + cta->baseAdaptor.free = (void (*) (pANTLR3_BASE_TREE_ADAPTOR)) + ctaFree; + cta->baseAdaptor.setDebugEventListener = + setDebugEventListener; + cta->baseAdaptor.replaceChildren = (void (*) (pANTLR3_BASE_TREE_ADAPTOR, void *, ANTLR3_INT32, ANTLR3_INT32, void *)) + replaceChildren; + cta->baseAdaptor.errorNode = (void * (*) (pANTLR3_BASE_TREE_ADAPTOR, pANTLR3_TOKEN_STREAM, pANTLR3_COMMON_TOKEN, pANTLR3_COMMON_TOKEN, pANTLR3_EXCEPTION)) + errorNode; + + // Install the super class pointer + // + cta->baseAdaptor.super = cta; + + // Install a tree factory for creating new tree nodes + // + cta->arboretum = antlr3ArboretumNew(strFactory); + + // Install a token factory for imaginary tokens, these imaginary + // tokens do not require access to the input stream so we can + // dummy the creation of it, but they will need a string factory. + // + cta->baseAdaptor.tokenFactory = antlr3TokenFactoryNew(NULL); + cta->baseAdaptor.tokenFactory->unTruc.strFactory = strFactory; + + // Allow the base tree adaptor to share the tree factory's string factory. + // + cta->baseAdaptor.strFactory = strFactory; + + // Return the address of the base adaptor interface. + // + return &(cta->baseAdaptor); +} + +/// Debugging version of the tree adaptor (not normally called as generated code +/// calls setDebugEventListener instead which changes a normal token stream to +/// a debugging stream and means that a user's instantiation code does not need +/// to be changed just to debug with AW. +/// +ANTLR3_API pANTLR3_BASE_TREE_ADAPTOR +ANTLR3_TREE_ADAPTORDebugNew(pANTLR3_STRING_FACTORY strFactory, pANTLR3_DEBUG_EVENT_LISTENER debugger) +{ + pANTLR3_BASE_TREE_ADAPTOR ta; + + // Create a normal one first + // + ta = ANTLR3_TREE_ADAPTORNew(strFactory); + + if (ta != NULL) + { + // Reinitialize as a debug version + // + antlr3BaseTreeAdaptorInit(ta, debugger); + ta->create = (void * (*) (pANTLR3_BASE_TREE_ADAPTOR, pANTLR3_COMMON_TOKEN)) + dbgCreate; + ta->setTokenBoundaries = (void (*) (pANTLR3_BASE_TREE_ADAPTOR, void *, pANTLR3_COMMON_TOKEN, pANTLR3_COMMON_TOKEN)) + dbgSetTokenBoundaries; + } + + return ta; +} + +/// Causes an existing common tree adaptor to become a debug version +/// +static void +setDebugEventListener (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_DEBUG_EVENT_LISTENER debugger) +{ + // Reinitialize as a debug version + // + antlr3BaseTreeAdaptorInit(adaptor, debugger); + + adaptor->create = (void * (*) (pANTLR3_BASE_TREE_ADAPTOR, pANTLR3_COMMON_TOKEN)) + dbgCreate; + adaptor->setTokenBoundaries = (void (*) (pANTLR3_BASE_TREE_ADAPTOR, void *, pANTLR3_COMMON_TOKEN, pANTLR3_COMMON_TOKEN)) + dbgSetTokenBoundaries; + +} + +static void +ctaFree(pANTLR3_BASE_TREE_ADAPTOR adaptor) +{ + pANTLR3_COMMON_TREE_ADAPTOR cta; + + cta = (pANTLR3_COMMON_TREE_ADAPTOR)(adaptor->super); + + /* Free the tree factory we created + */ + cta->arboretum->close(((pANTLR3_COMMON_TREE_ADAPTOR)(adaptor->super))->arboretum); + + /* Free the token factory we created + */ + adaptor->tokenFactory->close(adaptor->tokenFactory); + + /* Free the super pointer, as it is this that was allocated + * and is the common tree structure. + */ + ANTLR3_FREE(adaptor->super); +} + +/* BASE_TREE_ADAPTOR overrides */ + +static pANTLR3_BASE_TREE +errorNode (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_TOKEN_STREAM ctnstream, pANTLR3_COMMON_TOKEN startToken, pANTLR3_COMMON_TOKEN stopToken, pANTLR3_EXCEPTION e) +{ + // Use the supplied common tree node stream to get another tree from the factory + // TODO: Look at creating the erronode as in Java, but this is complicated by the + // need to track and free the memory allocated to it, so for now, we just + // want something in the tree that isn't a NULL pointer. + // + return adaptor->createTypeText(adaptor, ANTLR3_TOKEN_INVALID, (pANTLR3_UINT8)"Tree Error Node"); + +} + +/** Duplicate the supplied node. + */ +static pANTLR3_BASE_TREE +dupNode (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE treeNode) +{ + return treeNode == NULL ? NULL : treeNode->dupNode(treeNode); +} + +static pANTLR3_BASE_TREE +create (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_COMMON_TOKEN payload) +{ + pANTLR3_BASE_TREE ct; + + /* Create a new common tree as this is what this adaptor deals with + */ + ct = ((pANTLR3_COMMON_TREE_ADAPTOR)(adaptor->super))->arboretum->newFromToken(((pANTLR3_COMMON_TREE_ADAPTOR)(adaptor->super))->arboretum, payload); + + /* But all adaptors return the pointer to the base interface. + */ + return ct; +} +static pANTLR3_BASE_TREE +dbgCreate (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_COMMON_TOKEN payload) +{ + pANTLR3_BASE_TREE ct; + + ct = create(adaptor, payload); + adaptor->debugger->createNode(adaptor->debugger, ct); + + return ct; +} + +/** Tell me how to create a token for use with imaginary token nodes. + * For example, there is probably no input symbol associated with imaginary + * token DECL, but you need to create it as a payload or whatever for + * the DECL node as in ^(DECL type ID). + * + * If you care what the token payload objects' type is, you should + * override this method and any other createToken variant. + */ +static pANTLR3_COMMON_TOKEN +createToken (pANTLR3_BASE_TREE_ADAPTOR adaptor, ANTLR3_UINT32 tokenType, pANTLR3_UINT8 text) +{ + pANTLR3_COMMON_TOKEN newToken; + + newToken = adaptor->tokenFactory->newToken(adaptor->tokenFactory); + + if (newToken != NULL) + { + newToken->textState = ANTLR3_TEXT_CHARP; + newToken->tokText.chars = (pANTLR3_UCHAR)text; + newToken->setType(newToken, tokenType); + newToken->input = adaptor->tokenFactory->input; + newToken->strFactory = adaptor->strFactory; + } + return newToken; +} + +/** Tell me how to create a token for use with imaginary token nodes. + * For example, there is probably no input symbol associated with imaginary + * token DECL, but you need to create it as a payload or whatever for + * the DECL node as in ^(DECL type ID). + * + * This is a variant of createToken where the new token is derived from + * an actual real input token. Typically this is for converting '{' + * tokens to BLOCK etc... You'll see + * + * r : lc='{' ID+ '}' -> ^(BLOCK[$lc] ID+) ; + * + * If you care what the token payload objects' type is, you should + * override this method and any other createToken variant. + * + * NB: this being C it is not so easy to extend the types of creaeteToken. + * We will have to see if anyone needs to do this and add any variants to + * this interface. + */ +static pANTLR3_COMMON_TOKEN +createTokenFromToken (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_COMMON_TOKEN fromToken) +{ + pANTLR3_COMMON_TOKEN newToken; + + newToken = adaptor->tokenFactory->newToken(adaptor->tokenFactory); + + if (newToken != NULL) + { + // Create the text using our own string factory to avoid complicating + // commontoken. + // + pANTLR3_STRING text; + + newToken->toString = fromToken->toString; + + if (fromToken->textState == ANTLR3_TEXT_CHARP) + { + newToken->textState = ANTLR3_TEXT_CHARP; + newToken->tokText.chars = fromToken->tokText.chars; + } + else + { + text = fromToken->getText(fromToken); + newToken->textState = ANTLR3_TEXT_STRING; + newToken->tokText.text = adaptor->strFactory->newPtr(adaptor->strFactory, text->chars, text->len); + } + + newToken->setLine (newToken, fromToken->getLine(fromToken)); + newToken->setTokenIndex (newToken, fromToken->getTokenIndex(fromToken)); + newToken->setCharPositionInLine (newToken, fromToken->getCharPositionInLine(fromToken)); + newToken->setChannel (newToken, fromToken->getChannel(fromToken)); + newToken->setType (newToken, fromToken->getType(fromToken)); + } + + return newToken; +} + +/* Specific methods for a TreeAdaptor */ + +/** Track start/stop token for subtree root created for a rule. + * Only works with CommonTree nodes. For rules that match nothing, + * seems like this will yield start=i and stop=i-1 in a nil node. + * Might be useful info so I'll not force to be i..i. + */ +static void +setTokenBoundaries (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE t, pANTLR3_COMMON_TOKEN startToken, pANTLR3_COMMON_TOKEN stopToken) +{ + ANTLR3_MARKER start; + ANTLR3_MARKER stop; + + pANTLR3_COMMON_TREE ct; + + if (t == NULL) + { + return; + } + + if ( startToken != NULL) + { + start = startToken->getTokenIndex(startToken); + } + else + { + start = 0; + } + + if ( stopToken != NULL) + { + stop = stopToken->getTokenIndex(stopToken); + } + else + { + stop = 0; + } + + ct = (pANTLR3_COMMON_TREE)(t->super); + + ct->startIndex = start; + ct->stopIndex = stop; + +} +static void +dbgSetTokenBoundaries (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE t, pANTLR3_COMMON_TOKEN startToken, pANTLR3_COMMON_TOKEN stopToken) +{ + setTokenBoundaries(adaptor, t, startToken, stopToken); + + if (t != NULL && startToken != NULL && stopToken != NULL) + { + adaptor->debugger->setTokenBoundaries(adaptor->debugger, t, startToken->getTokenIndex(startToken), stopToken->getTokenIndex(stopToken)); + } +} + +static ANTLR3_MARKER +getTokenStartIndex (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE t) +{ + return ((pANTLR3_COMMON_TREE)(t->super))->startIndex; +} + +static ANTLR3_MARKER +getTokenStopIndex (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE t) +{ + return ((pANTLR3_COMMON_TREE)(t->super))->stopIndex; +} + +static pANTLR3_STRING +getText (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE t) +{ + return t->getText(t); +} + +static ANTLR3_UINT32 +getType (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE t) +{ + return t->getType(t); +} + +static void +replaceChildren +(pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE parent, ANTLR3_INT32 startChildIndex, ANTLR3_INT32 stopChildIndex, pANTLR3_BASE_TREE t) +{ + if (parent != NULL) + { + parent->replaceChildren(parent, startChildIndex, stopChildIndex, t); + } +} + +static pANTLR3_BASE_TREE +getChild (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE t, ANTLR3_UINT32 i) +{ + return t->getChild(t, i); +} +static void +setChild (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE t, ANTLR3_UINT32 i, pANTLR3_BASE_TREE child) +{ + t->setChild(t, i, child); +} + +static void +deleteChild (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE t, ANTLR3_UINT32 i) +{ + t->deleteChild(t, i); +} + +static ANTLR3_UINT32 +getChildCount (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE t) +{ + return t->getChildCount(t); +} + +static void +setChildIndex (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE t, ANTLR3_INT32 i) +{ + t->setChildIndex(t, i); +} + +static ANTLR3_INT32 +getChildIndex (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE t) +{ + return t->getChildIndex(t); +} +static void +setParent (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE child, pANTLR3_BASE_TREE parent) +{ + child->setParent(child, parent); +} +static pANTLR3_BASE_TREE +getParent (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE child) +{ + return child->getParent(child); +} diff --git a/antlr/libantlr3c-3.4/src/antlr3commontreenodestream.c b/antlr/libantlr3c-3.4/src/antlr3commontreenodestream.c new file mode 100644 index 0000000..a759d34 --- /dev/null +++ b/antlr/libantlr3c-3.4/src/antlr3commontreenodestream.c @@ -0,0 +1,968 @@ +/// \file +/// Defines the implementation of the common node stream the default +/// tree node stream used by ANTLR. +/// + +// [The "BSD licence"] +// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC +// http://www.temporal-wave.com +// http://www.linkedin.com/in/jimidle +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. The name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include + +#ifdef ANTLR3_WINDOWS +#pragma warning( disable : 4100 ) +#endif + +// COMMON TREE STREAM API +// +static void addNavigationNode (pANTLR3_COMMON_TREE_NODE_STREAM ctns, ANTLR3_UINT32 ttype); +static ANTLR3_BOOLEAN hasUniqueNavigationNodes (pANTLR3_COMMON_TREE_NODE_STREAM ctns); +static pANTLR3_BASE_TREE newDownNode (pANTLR3_COMMON_TREE_NODE_STREAM ctns); +static pANTLR3_BASE_TREE newUpNode (pANTLR3_COMMON_TREE_NODE_STREAM ctns); +static void reset (pANTLR3_COMMON_TREE_NODE_STREAM ctns); +static void push (pANTLR3_COMMON_TREE_NODE_STREAM ctns, ANTLR3_INT32 index); +static ANTLR3_INT32 pop (pANTLR3_COMMON_TREE_NODE_STREAM ctns); +//static ANTLR3_INT32 index (pANTLR3_COMMON_TREE_NODE_STREAM ctns); +static ANTLR3_UINT32 getLookaheadSize (pANTLR3_COMMON_TREE_NODE_STREAM ctns); +// TREE NODE STREAM API +// +static pANTLR3_BASE_TREE_ADAPTOR getTreeAdaptor (pANTLR3_TREE_NODE_STREAM tns); +static pANTLR3_BASE_TREE getTreeSource (pANTLR3_TREE_NODE_STREAM tns); +static pANTLR3_BASE_TREE _LT (pANTLR3_TREE_NODE_STREAM tns, ANTLR3_INT32 k); +static pANTLR3_BASE_TREE get (pANTLR3_TREE_NODE_STREAM tns, ANTLR3_INT32 k); +static void setUniqueNavigationNodes (pANTLR3_TREE_NODE_STREAM tns, ANTLR3_BOOLEAN uniqueNavigationNodes); +static pANTLR3_STRING toString (pANTLR3_TREE_NODE_STREAM tns); +static pANTLR3_STRING toStringSS (pANTLR3_TREE_NODE_STREAM tns, pANTLR3_BASE_TREE start, pANTLR3_BASE_TREE stop); +static void toStringWork (pANTLR3_TREE_NODE_STREAM tns, pANTLR3_BASE_TREE start, pANTLR3_BASE_TREE stop, pANTLR3_STRING buf); +static void replaceChildren (pANTLR3_TREE_NODE_STREAM tns, pANTLR3_BASE_TREE parent, ANTLR3_INT32 startChildIndex, ANTLR3_INT32 stopChildIndex, pANTLR3_BASE_TREE t); + +// INT STREAM API +// +static void consume (pANTLR3_INT_STREAM is); +static ANTLR3_MARKER tindex (pANTLR3_INT_STREAM is); +static ANTLR3_UINT32 _LA (pANTLR3_INT_STREAM is, ANTLR3_INT32 i); +static ANTLR3_MARKER mark (pANTLR3_INT_STREAM is); +static void release (pANTLR3_INT_STREAM is, ANTLR3_MARKER marker); +static void rewindMark (pANTLR3_INT_STREAM is, ANTLR3_MARKER marker); +static void rewindLast (pANTLR3_INT_STREAM is); +static void seek (pANTLR3_INT_STREAM is, ANTLR3_MARKER index); +static ANTLR3_UINT32 size (pANTLR3_INT_STREAM is); + + +// Helper functions +// +static void fillBuffer (pANTLR3_COMMON_TREE_NODE_STREAM ctns, pANTLR3_BASE_TREE t); +static void fillBufferRoot (pANTLR3_COMMON_TREE_NODE_STREAM ctns); + +// Constructors +// +static void antlr3TreeNodeStreamFree (pANTLR3_TREE_NODE_STREAM tns); +static void antlr3CommonTreeNodeStreamFree (pANTLR3_COMMON_TREE_NODE_STREAM ctns); + +ANTLR3_API pANTLR3_TREE_NODE_STREAM +antlr3TreeNodeStreamNew() +{ + pANTLR3_TREE_NODE_STREAM stream; + + // Memory for the interface structure + // + stream = (pANTLR3_TREE_NODE_STREAM) ANTLR3_CALLOC(1, sizeof(ANTLR3_TREE_NODE_STREAM)); + + if (stream == NULL) + { + return NULL; + } + + // Install basic API + // + stream->replaceChildren = replaceChildren; + stream->free = antlr3TreeNodeStreamFree; + + return stream; +} + +static void +antlr3TreeNodeStreamFree(pANTLR3_TREE_NODE_STREAM stream) +{ + ANTLR3_FREE(stream); +} + +ANTLR3_API pANTLR3_COMMON_TREE_NODE_STREAM +antlr3CommonTreeNodeStreamNewTree(pANTLR3_BASE_TREE tree, ANTLR3_UINT32 hint) +{ + pANTLR3_COMMON_TREE_NODE_STREAM stream; + + stream = antlr3CommonTreeNodeStreamNew(tree->strFactory, hint); + + if (stream == NULL) + { + return NULL; + } + stream->root = tree; + + return stream; +} + +ANTLR3_API pANTLR3_COMMON_TREE_NODE_STREAM +antlr3CommonTreeNodeStreamNewStream(pANTLR3_COMMON_TREE_NODE_STREAM inStream) +{ + pANTLR3_COMMON_TREE_NODE_STREAM stream; + + // Memory for the interface structure + // + stream = (pANTLR3_COMMON_TREE_NODE_STREAM) ANTLR3_CALLOC(1, sizeof(ANTLR3_COMMON_TREE_NODE_STREAM)); + + if (stream == NULL) + { + return NULL; + } + + // Copy in all the reusable parts of the originating stream and create new + // pieces where necessary. + // + + // String factory for tree walker + // + stream->stringFactory = inStream->stringFactory; + + // Create an adaptor for the common tree node stream + // + stream->adaptor = inStream->adaptor; + + // Create space for the tree node stream interface + // + stream->tnstream = antlr3TreeNodeStreamNew(); + + if (stream->tnstream == NULL) + { + stream->free (stream); + + return NULL; + } + + // Create space for the INT_STREAM interface + // + stream->tnstream->istream = antlr3IntStreamNew(); + + if (stream->tnstream->istream == NULL) + { + stream->tnstream->free (stream->tnstream); + stream->free (stream); + + return NULL; + } + + // Install the common tree node stream API + // + stream->addNavigationNode = addNavigationNode; + stream->hasUniqueNavigationNodes = hasUniqueNavigationNodes; + stream->newDownNode = newDownNode; + stream->newUpNode = newUpNode; + stream->reset = reset; + stream->push = push; + stream->pop = pop; + stream->getLookaheadSize = getLookaheadSize; + + stream->free = antlr3CommonTreeNodeStreamFree; + + // Install the tree node stream API + // + stream->tnstream->getTreeAdaptor = getTreeAdaptor; + stream->tnstream->getTreeSource = getTreeSource; + stream->tnstream->_LT = _LT; + stream->tnstream->setUniqueNavigationNodes = setUniqueNavigationNodes; + stream->tnstream->toString = toString; + stream->tnstream->toStringSS = toStringSS; + stream->tnstream->toStringWork = toStringWork; + stream->tnstream->get = get; + + // Install INT_STREAM interface + // + stream->tnstream->istream->consume = consume; + stream->tnstream->istream->index = tindex; + stream->tnstream->istream->_LA = _LA; + stream->tnstream->istream->mark = mark; + stream->tnstream->istream->release = release; + stream->tnstream->istream->rewind = rewindMark; + stream->tnstream->istream->rewindLast = rewindLast; + stream->tnstream->istream->seek = seek; + stream->tnstream->istream->size = size; + + // Initialize data elements of INT stream + // + stream->tnstream->istream->type = ANTLR3_COMMONTREENODE; + stream->tnstream->istream->super = (stream->tnstream); + + // Initialize data elements of TREE stream + // + stream->tnstream->ctns = stream; + + // Initialize data elements of the COMMON TREE NODE stream + // + stream->super = NULL; + stream->uniqueNavigationNodes = ANTLR3_FALSE; + stream->markers = NULL; + stream->nodeStack = inStream->nodeStack; + + // Create the node list map + // + stream->nodes = antlr3VectorNew(DEFAULT_INITIAL_BUFFER_SIZE); + stream->p = -1; + + // Install the navigation nodes + // + + // Install the navigation nodes + // + antlr3SetCTAPI(&(stream->UP)); + antlr3SetCTAPI(&(stream->DOWN)); + antlr3SetCTAPI(&(stream->EOF_NODE)); + antlr3SetCTAPI(&(stream->INVALID_NODE)); + + stream->UP.token = inStream->UP.token; + inStream->UP.token->strFactory = stream->stringFactory; + stream->DOWN.token = inStream->DOWN.token; + inStream->DOWN.token->strFactory = stream->stringFactory; + stream->EOF_NODE.token = inStream->EOF_NODE.token; + inStream->EOF_NODE.token->strFactory = stream->stringFactory; + stream->INVALID_NODE.token = inStream->INVALID_NODE.token; + inStream->INVALID_NODE.token->strFactory= stream->stringFactory; + + // Reuse the root tree of the originating stream + // + stream->root = inStream->root; + + // Signal that this is a rewriting stream so we don't + // free the originating tree. Anything that we rewrite or + // duplicate here will be done through the adaptor or + // the original tree factory. + // + stream->isRewriter = ANTLR3_TRUE; + return stream; +} + +ANTLR3_API pANTLR3_COMMON_TREE_NODE_STREAM +antlr3CommonTreeNodeStreamNew(pANTLR3_STRING_FACTORY strFactory, ANTLR3_UINT32 hint) +{ + pANTLR3_COMMON_TREE_NODE_STREAM stream; + pANTLR3_COMMON_TOKEN token; + + // Memory for the interface structure + // + stream = (pANTLR3_COMMON_TREE_NODE_STREAM) ANTLR3_CALLOC(1, sizeof(ANTLR3_COMMON_TREE_NODE_STREAM)); + + if (stream == NULL) + { + return NULL; + } + + // String factory for tree walker + // + stream->stringFactory = strFactory; + + // Create an adaptor for the common tree node stream + // + stream->adaptor = ANTLR3_TREE_ADAPTORNew(strFactory); + + if (stream->adaptor == NULL) + { + stream->free(stream); + return NULL; + } + + // Create space for the tree node stream interface + // + stream->tnstream = antlr3TreeNodeStreamNew(); + + if (stream->tnstream == NULL) + { + stream->adaptor->free (stream->adaptor); + stream->free (stream); + + return NULL; + } + + // Create space for the INT_STREAM interface + // + stream->tnstream->istream = antlr3IntStreamNew(); + + if (stream->tnstream->istream == NULL) + { + stream->adaptor->free (stream->adaptor); + stream->tnstream->free (stream->tnstream); + stream->free (stream); + + return NULL; + } + + // Install the common tree node stream API + // + stream->addNavigationNode = addNavigationNode; + stream->hasUniqueNavigationNodes = hasUniqueNavigationNodes; + stream->newDownNode = newDownNode; + stream->newUpNode = newUpNode; + stream->reset = reset; + stream->push = push; + stream->pop = pop; + + stream->free = antlr3CommonTreeNodeStreamFree; + + // Install the tree node stream API + // + stream->tnstream->getTreeAdaptor = getTreeAdaptor; + stream->tnstream->getTreeSource = getTreeSource; + stream->tnstream->_LT = _LT; + stream->tnstream->setUniqueNavigationNodes = setUniqueNavigationNodes; + stream->tnstream->toString = toString; + stream->tnstream->toStringSS = toStringSS; + stream->tnstream->toStringWork = toStringWork; + stream->tnstream->get = get; + + // Install INT_STREAM interface + // + stream->tnstream->istream->consume = consume; + stream->tnstream->istream->index = tindex; + stream->tnstream->istream->_LA = _LA; + stream->tnstream->istream->mark = mark; + stream->tnstream->istream->release = release; + stream->tnstream->istream->rewind = rewindMark; + stream->tnstream->istream->rewindLast = rewindLast; + stream->tnstream->istream->seek = seek; + stream->tnstream->istream->size = size; + + // Initialize data elements of INT stream + // + stream->tnstream->istream->type = ANTLR3_COMMONTREENODE; + stream->tnstream->istream->super = (stream->tnstream); + + // Initialize data elements of TREE stream + // + stream->tnstream->ctns = stream; + + // Initialize data elements of the COMMON TREE NODE stream + // + stream->super = NULL; + stream->uniqueNavigationNodes = ANTLR3_FALSE; + stream->markers = NULL; + stream->nodeStack = antlr3StackNew(INITIAL_CALL_STACK_SIZE); + + // Create the node list map + // + if (hint == 0) + { + hint = DEFAULT_INITIAL_BUFFER_SIZE; + } + stream->nodes = antlr3VectorNew(hint); + stream->p = -1; + + // Install the navigation nodes + // + antlr3SetCTAPI(&(stream->UP)); + antlr3SetCTAPI(&(stream->DOWN)); + antlr3SetCTAPI(&(stream->EOF_NODE)); + antlr3SetCTAPI(&(stream->INVALID_NODE)); + + token = antlr3CommonTokenNew(ANTLR3_TOKEN_UP); + token->strFactory = strFactory; + token->textState = ANTLR3_TEXT_CHARP; + token->tokText.chars = (pANTLR3_UCHAR)"UP"; + stream->UP.token = token; + + token = antlr3CommonTokenNew(ANTLR3_TOKEN_DOWN); + token->strFactory = strFactory; + token->textState = ANTLR3_TEXT_CHARP; + token->tokText.chars = (pANTLR3_UCHAR)"DOWN"; + stream->DOWN.token = token; + + token = antlr3CommonTokenNew(ANTLR3_TOKEN_EOF); + token->strFactory = strFactory; + token->textState = ANTLR3_TEXT_CHARP; + token->tokText.chars = (pANTLR3_UCHAR)"EOF"; + stream->EOF_NODE.token = token; + + token = antlr3CommonTokenNew(ANTLR3_TOKEN_INVALID); + token->strFactory = strFactory; + token->textState = ANTLR3_TEXT_CHARP; + token->tokText.chars = (pANTLR3_UCHAR)"INVALID"; + stream->INVALID_NODE.token = token; + + + return stream; +} + +/// Free up any resources that belong to this common tree node stream. +/// +static void antlr3CommonTreeNodeStreamFree (pANTLR3_COMMON_TREE_NODE_STREAM ctns) +{ + + // If this is a rewrting stream, then certain resources + // belong to the originating node stream and we do not + // free them here. + // + if (ctns->isRewriter != ANTLR3_TRUE) + { + ctns->adaptor ->free (ctns->adaptor); + + if (ctns->nodeStack != NULL) + { + ctns->nodeStack->free(ctns->nodeStack); + } + + ANTLR3_FREE(ctns->INVALID_NODE.token); + ANTLR3_FREE(ctns->EOF_NODE.token); + ANTLR3_FREE(ctns->DOWN.token); + ANTLR3_FREE(ctns->UP.token); + } + + if (ctns->nodes != NULL) + { + ctns->nodes ->free (ctns->nodes); + } + ctns->tnstream->istream ->free (ctns->tnstream->istream); + ctns->tnstream ->free (ctns->tnstream); + + + ANTLR3_FREE(ctns); +} + +// ------------------------------------------------------------------------------ +// Local helpers +// + +/// Walk and fill the tree node buffer from the root tree +/// +static void +fillBufferRoot(pANTLR3_COMMON_TREE_NODE_STREAM ctns) +{ + // Call the generic buffer routine with the root as the + // argument + // + fillBuffer(ctns, ctns->root); + ctns->p = 0; // Indicate we are at buffer start +} + +/// Walk tree with depth-first-search and fill nodes buffer. +/// Don't add in DOWN, UP nodes if the supplied tree is a list (t is isNilNode) +// such as the root tree is. +/// +static void +fillBuffer(pANTLR3_COMMON_TREE_NODE_STREAM ctns, pANTLR3_BASE_TREE t) +{ + ANTLR3_BOOLEAN nilNode; + ANTLR3_UINT32 nCount; + ANTLR3_UINT32 c; + + nilNode = ctns->adaptor->isNilNode(ctns->adaptor, t); + + // If the supplied node is not a nil (list) node then we + // add in the node itself to the vector + // + if (nilNode == ANTLR3_FALSE) + { + ctns->nodes->add(ctns->nodes, t, NULL); + } + + // Only add a DOWN node if the tree is not a nil tree and + // the tree does have children. + // + nCount = t->getChildCount(t); + + if (nilNode == ANTLR3_FALSE && nCount>0) + { + ctns->addNavigationNode(ctns, ANTLR3_TOKEN_DOWN); + } + + // We always add any children the tree contains, which is + // a recursive call to this function, which will cause similar + // recursion and implement a depth first addition + // + for (c = 0; c < nCount; c++) + { + fillBuffer(ctns, ctns->adaptor->getChild(ctns->adaptor, t, c)); + } + + // If the tree had children and was not a nil (list) node, then we + // we need to add an UP node here to match the DOWN node + // + if (nilNode == ANTLR3_FALSE && nCount > 0) + { + ctns->addNavigationNode(ctns, ANTLR3_TOKEN_UP); + } +} + + +// ------------------------------------------------------------------------------ +// Interface functions +// + +/// Reset the input stream to the start of the input nodes. +/// +static void +reset (pANTLR3_COMMON_TREE_NODE_STREAM ctns) +{ + if (ctns->p != -1) + { + ctns->p = 0; + } + ctns->tnstream->istream->lastMarker = 0; + + + // Free and reset the node stack only if this is not + // a rewriter, which is going to reuse the originating + // node streams node stack + // + if (ctns->isRewriter != ANTLR3_TRUE) + { + if (ctns->nodeStack != NULL) + { + ctns->nodeStack->free(ctns->nodeStack); + ctns->nodeStack = antlr3StackNew(INITIAL_CALL_STACK_SIZE); + } + } +} + + +static pANTLR3_BASE_TREE +LB(pANTLR3_TREE_NODE_STREAM tns, ANTLR3_INT32 k) +{ + if ( k==0) + { + return &(tns->ctns->INVALID_NODE.baseTree); + } + + if ( (tns->ctns->p - k) < 0) + { + return &(tns->ctns->INVALID_NODE.baseTree); + } + + return tns->ctns->nodes->get(tns->ctns->nodes, tns->ctns->p - k); +} + +/// Get tree node at current input pointer + i ahead where i=1 is next node. +/// i<0 indicates nodes in the past. So -1 is previous node and -2 is +/// two nodes ago. LT(0) is undefined. For i>=n, return null. +/// Return null for LT(0) and any index that results in an absolute address +/// that is negative. +/// +/// This is analogous to the _LT() method of the TokenStream, but this +/// returns a tree node instead of a token. Makes code gen identical +/// for both parser and tree grammars. :) +/// +static pANTLR3_BASE_TREE +_LT (pANTLR3_TREE_NODE_STREAM tns, ANTLR3_INT32 k) +{ + if (tns->ctns->p == -1) + { + fillBufferRoot(tns->ctns); + } + + if (k < 0) + { + return LB(tns, -k); + } + else if (k == 0) + { + return &(tns->ctns->INVALID_NODE.baseTree); + } + + // k was a legitimate request, + // + if (( tns->ctns->p + k - 1) >= (ANTLR3_INT32)(tns->ctns->nodes->count)) + { + return &(tns->ctns->EOF_NODE.baseTree); + } + + return tns->ctns->nodes->get(tns->ctns->nodes, tns->ctns->p + k - 1); +} + +/// Where is this stream pulling nodes from? This is not the name, but +/// the object that provides node objects. +/// +static pANTLR3_BASE_TREE +getTreeSource (pANTLR3_TREE_NODE_STREAM tns) +{ + return tns->ctns->root; +} + +/// Consume the next node from the input stream +/// +static void +consume (pANTLR3_INT_STREAM is) +{ + pANTLR3_TREE_NODE_STREAM tns; + pANTLR3_COMMON_TREE_NODE_STREAM ctns; + + tns = (pANTLR3_TREE_NODE_STREAM)(is->super); + ctns = tns->ctns; + + if (ctns->p == -1) + { + fillBufferRoot(ctns); + } + ctns->p++; +} + +static ANTLR3_UINT32 +_LA (pANTLR3_INT_STREAM is, ANTLR3_INT32 i) +{ + pANTLR3_TREE_NODE_STREAM tns; + pANTLR3_BASE_TREE t; + + tns = (pANTLR3_TREE_NODE_STREAM)(is->super); + + // Ask LT for the 'token' at that position + // + t = tns->_LT(tns, i); + + if (t == NULL) + { + return ANTLR3_TOKEN_INVALID; + } + + // Token node was there so return the type of it + // + return t->getType(t); +} + +/// Mark the state of the input stream so that we can come back to it +/// after a syntactic predicate and so on. +/// +static ANTLR3_MARKER +mark (pANTLR3_INT_STREAM is) +{ + pANTLR3_TREE_NODE_STREAM tns; + pANTLR3_COMMON_TREE_NODE_STREAM ctns; + + tns = (pANTLR3_TREE_NODE_STREAM)(is->super); + ctns = tns->ctns; + + if (tns->ctns->p == -1) + { + fillBufferRoot(tns->ctns); + } + + // Return the current mark point + // + ctns->tnstream->istream->lastMarker = ctns->tnstream->istream->index(ctns->tnstream->istream); + + return ctns->tnstream->istream->lastMarker; +} + +static void +release (pANTLR3_INT_STREAM is, ANTLR3_MARKER marker) +{ +} + +/// Rewind the current state of the tree walk to the state it +/// was in when mark() was called and it returned marker. Also, +/// wipe out the lookahead which will force reloading a few nodes +/// but it is better than making a copy of the lookahead buffer +/// upon mark(). +/// +static void +rewindMark (pANTLR3_INT_STREAM is, ANTLR3_MARKER marker) +{ + is->seek(is, marker); +} + +static void +rewindLast (pANTLR3_INT_STREAM is) +{ + is->seek(is, is->lastMarker); +} + +/// consume() ahead until we hit index. Can't just jump ahead--must +/// spit out the navigation nodes. +/// +static void +seek (pANTLR3_INT_STREAM is, ANTLR3_MARKER index) +{ + pANTLR3_TREE_NODE_STREAM tns; + pANTLR3_COMMON_TREE_NODE_STREAM ctns; + + tns = (pANTLR3_TREE_NODE_STREAM)(is->super); + ctns = tns->ctns; + + ctns->p = ANTLR3_UINT32_CAST(index); +} + +static ANTLR3_MARKER +tindex (pANTLR3_INT_STREAM is) +{ + pANTLR3_TREE_NODE_STREAM tns; + pANTLR3_COMMON_TREE_NODE_STREAM ctns; + + tns = (pANTLR3_TREE_NODE_STREAM)(is->super); + ctns = tns->ctns; + + return (ANTLR3_MARKER)(ctns->p); +} + +/// Expensive to compute the size of the whole tree while parsing. +/// This method only returns how much input has been seen so far. So +/// after parsing it returns true size. +/// +static ANTLR3_UINT32 +size (pANTLR3_INT_STREAM is) +{ + pANTLR3_TREE_NODE_STREAM tns; + pANTLR3_COMMON_TREE_NODE_STREAM ctns; + + tns = (pANTLR3_TREE_NODE_STREAM)(is->super); + ctns = tns->ctns; + + if (ctns->p == -1) + { + fillBufferRoot(ctns); + } + + return ctns->nodes->size(ctns->nodes); +} + +/// As we flatten the tree, we use UP, DOWN nodes to represent +/// the tree structure. When debugging we need unique nodes +/// so instantiate new ones when uniqueNavigationNodes is true. +/// +static void +addNavigationNode (pANTLR3_COMMON_TREE_NODE_STREAM ctns, ANTLR3_UINT32 ttype) +{ + pANTLR3_BASE_TREE node; + + node = NULL; + + if (ttype == ANTLR3_TOKEN_DOWN) + { + if (ctns->hasUniqueNavigationNodes(ctns) == ANTLR3_TRUE) + { + node = ctns->newDownNode(ctns); + } + else + { + node = &(ctns->DOWN.baseTree); + } + } + else + { + if (ctns->hasUniqueNavigationNodes(ctns) == ANTLR3_TRUE) + { + node = ctns->newUpNode(ctns); + } + else + { + node = &(ctns->UP.baseTree); + } + } + + // Now add the node we decided upon. + // + ctns->nodes->add(ctns->nodes, node, NULL); +} + + +static pANTLR3_BASE_TREE_ADAPTOR +getTreeAdaptor (pANTLR3_TREE_NODE_STREAM tns) +{ + return tns->ctns->adaptor; +} + +static ANTLR3_BOOLEAN +hasUniqueNavigationNodes (pANTLR3_COMMON_TREE_NODE_STREAM ctns) +{ + return ctns->uniqueNavigationNodes; +} + +static void +setUniqueNavigationNodes (pANTLR3_TREE_NODE_STREAM tns, ANTLR3_BOOLEAN uniqueNavigationNodes) +{ + tns->ctns->uniqueNavigationNodes = uniqueNavigationNodes; +} + + +/// Print out the entire tree including DOWN/UP nodes. Uses +/// a recursive walk. Mostly useful for testing as it yields +/// the token types not text. +/// +static pANTLR3_STRING +toString (pANTLR3_TREE_NODE_STREAM tns) +{ + + return tns->toStringSS(tns, tns->ctns->root, NULL); +} + +static pANTLR3_STRING +toStringSS (pANTLR3_TREE_NODE_STREAM tns, pANTLR3_BASE_TREE start, pANTLR3_BASE_TREE stop) +{ + pANTLR3_STRING buf; + + buf = tns->ctns->stringFactory->newRaw(tns->ctns->stringFactory); + + tns->toStringWork(tns, start, stop, buf); + + return buf; +} + +static void +toStringWork (pANTLR3_TREE_NODE_STREAM tns, pANTLR3_BASE_TREE p, pANTLR3_BASE_TREE stop, pANTLR3_STRING buf) +{ + + ANTLR3_UINT32 n; + ANTLR3_UINT32 c; + + if (!p->isNilNode(p) ) + { + pANTLR3_STRING text; + + text = p->toString(p); + + if (text == NULL) + { + text = tns->ctns->stringFactory->newRaw(tns->ctns->stringFactory); + + text->addc (text, ' '); + text->addi (text, p->getType(p)); + } + + buf->appendS(buf, text); + } + + if (p == stop) + { + return; /* Finished */ + } + + n = p->getChildCount(p); + + if (n > 0 && ! p->isNilNode(p) ) + { + buf->addc (buf, ' '); + buf->addi (buf, ANTLR3_TOKEN_DOWN); + } + + for (c = 0; cgetChild(p, c); + tns->toStringWork(tns, child, stop, buf); + } + + if (n > 0 && ! p->isNilNode(p) ) + { + buf->addc (buf, ' '); + buf->addi (buf, ANTLR3_TOKEN_UP); + } +} + +static ANTLR3_UINT32 +getLookaheadSize (pANTLR3_COMMON_TREE_NODE_STREAM ctns) +{ + return ctns->tail < ctns->head + ? (ctns->lookAheadLength - ctns->head + ctns->tail) + : (ctns->tail - ctns->head); +} + +static pANTLR3_BASE_TREE +newDownNode (pANTLR3_COMMON_TREE_NODE_STREAM ctns) +{ + pANTLR3_COMMON_TREE dNode; + pANTLR3_COMMON_TOKEN token; + + token = antlr3CommonTokenNew(ANTLR3_TOKEN_DOWN); + token->textState = ANTLR3_TEXT_CHARP; + token->tokText.chars = (pANTLR3_UCHAR)"DOWN"; + dNode = antlr3CommonTreeNewFromToken(token); + + return &(dNode->baseTree); +} + +static pANTLR3_BASE_TREE +newUpNode (pANTLR3_COMMON_TREE_NODE_STREAM ctns) +{ + pANTLR3_COMMON_TREE uNode; + pANTLR3_COMMON_TOKEN token; + + token = antlr3CommonTokenNew(ANTLR3_TOKEN_UP); + token->textState = ANTLR3_TEXT_CHARP; + token->tokText.chars = (pANTLR3_UCHAR)"UP"; + uNode = antlr3CommonTreeNewFromToken(token); + + return &(uNode->baseTree); +} + +/// Replace from start to stop child index of parent with t, which might +/// be a list. Number of children may be different +/// after this call. The stream is notified because it is walking the +/// tree and might need to know you are monkey-ing with the underlying +/// tree. Also, it might be able to modify the node stream to avoid +/// re-streaming for future phases. +/// +/// If parent is null, don't do anything; must be at root of overall tree. +/// Can't replace whatever points to the parent externally. Do nothing. +/// +static void +replaceChildren (pANTLR3_TREE_NODE_STREAM tns, pANTLR3_BASE_TREE parent, ANTLR3_INT32 startChildIndex, ANTLR3_INT32 stopChildIndex, pANTLR3_BASE_TREE t) +{ + if (parent != NULL) + { + pANTLR3_BASE_TREE_ADAPTOR adaptor; + pANTLR3_COMMON_TREE_ADAPTOR cta; + + adaptor = tns->getTreeAdaptor(tns); + cta = (pANTLR3_COMMON_TREE_ADAPTOR)(adaptor->super); + + adaptor->replaceChildren(adaptor, parent, startChildIndex, stopChildIndex, t); + } +} + +static pANTLR3_BASE_TREE +get (pANTLR3_TREE_NODE_STREAM tns, ANTLR3_INT32 k) +{ + if (tns->ctns->p == -1) + { + fillBufferRoot(tns->ctns); + } + + return tns->ctns->nodes->get(tns->ctns->nodes, k); +} + +static void +push (pANTLR3_COMMON_TREE_NODE_STREAM ctns, ANTLR3_INT32 index) +{ + ctns->nodeStack->push(ctns->nodeStack, ANTLR3_FUNC_PTR(ctns->p), NULL); // Save current index + ctns->tnstream->istream->seek(ctns->tnstream->istream, index); +} + +static ANTLR3_INT32 +pop (pANTLR3_COMMON_TREE_NODE_STREAM ctns) +{ + ANTLR3_INT32 retVal; + + retVal = ANTLR3_UINT32_CAST(ctns->nodeStack->pop(ctns->nodeStack)); + ctns->tnstream->istream->seek(ctns->tnstream->istream, retVal); + return retVal; +} diff --git a/antlr/libantlr3c-3.4/src/antlr3convertutf.c b/antlr/libantlr3c-3.4/src/antlr3convertutf.c new file mode 100644 index 0000000..7c2f060 --- /dev/null +++ b/antlr/libantlr3c-3.4/src/antlr3convertutf.c @@ -0,0 +1,532 @@ +/* + * Copyright 2001-2004 Unicode, Inc. + * + * Disclaimer + * + * This source code is provided as is by Unicode, Inc. No claims are + * made as to fitness for any particular purpose. No warranties of any + * kind are expressed or implied. The recipient agrees to determine + * applicability of information provided. If this file has been + * purchased on magnetic or optical media from Unicode, Inc., the + * sole remedy for any claim will be exchange of defective media + * within 90 days of receipt. + * + * Limitations on Rights to Redistribute This Code + * + * Unicode, Inc. hereby grants the right to freely use the information + * supplied in this file in the creation of products supporting the + * Unicode Standard, and to make copies of this file in any form + * for internal or external distribution as long as this notice + * remains attached. + */ + +/* --------------------------------------------------------------------- + + Conversions between UTF32, UTF-16, and UTF-8. Source code file. + Author: Mark E. Davis, 1994. + Rev History: Rick McGowan, fixes & updates May 2001. + Sept 2001: fixed const & error conditions per + mods suggested by S. Parent & A. Lillich. + June 2002: Tim Dodd added detection and handling of incomplete + source sequences, enhanced error detection, added casts + to eliminate compiler warnings. + July 2003: slight mods to back out aggressive FFFE detection. + Jan 2004: updated switches in from-UTF8 conversions. + Oct 2004: updated to use UNI_MAX_LEGAL_UTF32 in UTF-32 conversions. + + See the header file "ConvertUTF.h" for complete documentation. + +------------------------------------------------------------------------ */ + + +#include "antlr3convertutf.h" + +#ifdef CVTUTF_DEBUG +#include +#endif + + + +/* --------------------------------------------------------------------- */ + +ConversionResult ConvertUTF32toUTF16 ( + const UTF32** sourceStart, const UTF32* sourceEnd, + UTF16** targetStart, UTF16* targetEnd, ConversionFlags flags) { + ConversionResult result = conversionOK; + const UTF32* source = *sourceStart; + UTF16* target = *targetStart; + while (source < sourceEnd) { + UTF32 ch; + if (target >= targetEnd) { + result = targetExhausted; break; + } + ch = *source++; + if (ch <= UNI_MAX_BMP) { /* Target is a character <= 0xFFFF */ + /* UTF-16 surrogate values are illegal in UTF-32; 0xffff or 0xfffe are both reserved values */ + if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_LOW_END) { + if (flags == strictConversion) { + --source; /* return to the illegal value itself */ + result = sourceIllegal; + break; + } else { + *target++ = UNI_REPLACEMENT_CHAR; + } + } else { + *target++ = (UTF16)ch; /* normal case */ + } + } else if (ch > UNI_MAX_LEGAL_UTF32) { + if (flags == strictConversion) { + result = sourceIllegal; + } else { + *target++ = UNI_REPLACEMENT_CHAR; + } + } else { + /* target is a character in range 0xFFFF - 0x10FFFF. */ + if (target + 1 >= targetEnd) { + --source; /* Back up source pointer! */ + result = targetExhausted; break; + } + ch -= halfBase; + *target++ = (UTF16)((ch >> halfShift) + UNI_SUR_HIGH_START); + *target++ = (UTF16)((ch & halfMask) + UNI_SUR_LOW_START); + } + } + *sourceStart = source; + *targetStart = target; + return result; +} + +/* --------------------------------------------------------------------- */ + +ConversionResult ConvertUTF16toUTF32 ( + const UTF16** sourceStart, const UTF16* sourceEnd, + UTF32** targetStart, UTF32* targetEnd, ConversionFlags flags) { + ConversionResult result = conversionOK; + const UTF16* source = *sourceStart; + UTF32* target = *targetStart; + UTF32 ch, ch2; + while (source < sourceEnd) { + const UTF16* oldSource = source; /* In case we have to back up because of target overflow. */ + ch = *source++; + /* If we have a surrogate pair, convert to UTF32 first. */ + if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_HIGH_END) { + /* If the 16 bits following the high surrogate are in the source buffer... */ + if (source < sourceEnd) { + ch2 = *source; + /* If it's a low surrogate, convert to UTF32. */ + if (ch2 >= UNI_SUR_LOW_START && ch2 <= UNI_SUR_LOW_END) { + ch = ((ch - UNI_SUR_HIGH_START) << halfShift) + + (ch2 - UNI_SUR_LOW_START) + halfBase; + ++source; + } else if (flags == strictConversion) { /* it's an unpaired high surrogate */ + --source; /* return to the illegal value itself */ + result = sourceIllegal; + break; + } + } else { /* We don't have the 16 bits following the high surrogate. */ + --source; /* return to the high surrogate */ + result = sourceExhausted; + break; + } + } else if (flags == strictConversion) { + /* UTF-16 surrogate values are illegal in UTF-32 */ + if (ch >= UNI_SUR_LOW_START && ch <= UNI_SUR_LOW_END) { + --source; /* return to the illegal value itself */ + result = sourceIllegal; + break; + } + } + if (target >= targetEnd) { + source = oldSource; /* Back up source pointer! */ + result = targetExhausted; break; + } + *target++ = ch; + } + *sourceStart = source; + *targetStart = target; +#ifdef CVTUTF_DEBUG +if (result == sourceIllegal) { + ANTLR3_FPRINTF(stderr, "ConvertUTF16toUTF32 illegal seq 0x%04x,%04x\n", ch, ch2); + fflush(stderr); +} +#endif + return result; +} + +/* --------------------------------------------------------------------- */ + +/* + * Index into the table below with the first byte of a UTF-8 sequence to + * get the number of trailing bytes that are supposed to follow it. + * Note that *legal* UTF-8 values can't have 4 or 5-bytes. The table is + * left as-is for anyone who may want to do such conversion, which was + * allowed in earlier algorithms. + */ +static const char trailingBytesForUTF8[256] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, + 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, 3,3,3,3,3,3,3,3,4,4,4,4,5,5,5,5 +}; + +/* + * Magic values subtracted from a buffer value during UTF8 conversion. + * This table contains as many values as there might be trailing bytes + * in a UTF-8 sequence. + */ +static const UTF32 offsetsFromUTF8[6] = { 0x00000000UL, 0x00003080UL, 0x000E2080UL, + 0x03C82080UL, 0xFA082080UL, 0x82082080UL }; + +/* + * Once the bits are split out into bytes of UTF-8, this is a mask OR-ed + * into the first byte, depending on how many bytes follow. There are + * as many entries in this table as there are UTF-8 sequence types. + * (I.e., one byte sequence, two byte... etc.). Remember that sequencs + * for *legal* UTF-8 will be 4 or fewer bytes total. + */ +static const UTF8 firstByteMark[7] = { 0x00, 0x00, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC }; + +/* --------------------------------------------------------------------- */ + +/* The interface converts a whole buffer to avoid function-call overhead. + * Constants have been gathered. Loops & conditionals have been removed as + * much as possible for efficiency, in favor of drop-through switches. + * (See "Note A" at the bottom of the file for equivalent code.) + * If your compiler supports it, the "isLegalUTF8" call can be turned + * into an inline function. + */ + +/* --------------------------------------------------------------------- */ + +ConversionResult ConvertUTF16toUTF8 ( + const UTF16** sourceStart, const UTF16* sourceEnd, + UTF8** targetStart, UTF8* targetEnd, ConversionFlags flags) { + ConversionResult result = conversionOK; + const UTF16* source = *sourceStart; + UTF8* target = *targetStart; + while (source < sourceEnd) { + UTF32 ch; + unsigned short bytesToWrite = 0; + const UTF32 byteMask = 0xBF; + const UTF32 byteMark = 0x80; + const UTF16* oldSource = source; /* In case we have to back up because of target overflow. */ + ch = *source++; + /* If we have a surrogate pair, convert to UTF32 first. */ + if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_HIGH_END) { + /* If the 16 bits following the high surrogate are in the source buffer... */ + if (source < sourceEnd) { + UTF32 ch2 = *source; + /* If it's a low surrogate, convert to UTF32. */ + if (ch2 >= UNI_SUR_LOW_START && ch2 <= UNI_SUR_LOW_END) { + ch = ((ch - UNI_SUR_HIGH_START) << halfShift) + + (ch2 - UNI_SUR_LOW_START) + halfBase; + ++source; + } else if (flags == strictConversion) { /* it's an unpaired high surrogate */ + --source; /* return to the illegal value itself */ + result = sourceIllegal; + break; + } + } else { /* We don't have the 16 bits following the high surrogate. */ + --source; /* return to the high surrogate */ + result = sourceExhausted; + break; + } + } else if (flags == strictConversion) { + /* UTF-16 surrogate values are illegal in UTF-32 */ + if (ch >= UNI_SUR_LOW_START && ch <= UNI_SUR_LOW_END) { + --source; /* return to the illegal value itself */ + result = sourceIllegal; + break; + } + } + /* Figure out how many bytes the result will require */ + if (ch < (UTF32)0x80) { bytesToWrite = 1; + } else if (ch < (UTF32)0x800) { bytesToWrite = 2; + } else if (ch < (UTF32)0x10000) { bytesToWrite = 3; + } else if (ch < (UTF32)0x110000) { bytesToWrite = 4; + } else { bytesToWrite = 3; + ch = UNI_REPLACEMENT_CHAR; + } + + target += bytesToWrite; + if (target > targetEnd) { + source = oldSource; /* Back up source pointer! */ + target -= bytesToWrite; result = targetExhausted; break; + } + switch (bytesToWrite) { /* note: everything falls through. */ + case 4: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6; + case 3: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6; + case 2: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6; + case 1: *--target = (UTF8)(ch | firstByteMark[bytesToWrite]); + } + target += bytesToWrite; + } + *sourceStart = source; + *targetStart = target; + return result; +} + +/* --------------------------------------------------------------------- */ + +/* + * Utility routine to tell whether a sequence of bytes is legal UTF-8. + * This must be called with the length pre-determined by the first byte. + * If not calling this from ConvertUTF8to*, then the length can be set by: + * length = trailingBytesForUTF8[*source]+1; + * and the sequence is illegal right away if there aren't that many bytes + * available. + * If presented with a length > 4, this returns false. The Unicode + * definition of UTF-8 goes up to 4-byte sequences. + */ + +static ANTLR3_BOOLEAN +isLegalUTF8(const UTF8 *source, int length) { + UTF8 a; + const UTF8 *srcptr = source+length; + switch (length) { + default: return false; + /* Everything else falls through when "true"... */ + case 4: if ((a = (*--srcptr)) < 0x80 || a > 0xBF) return false; + case 3: if ((a = (*--srcptr)) < 0x80 || a > 0xBF) return false; + case 2: if ((a = (*--srcptr)) > 0xBF) return false; + + switch (*source) { + /* no fall-through in this inner switch */ + case 0xE0: if (a < 0xA0) return false; break; + case 0xED: if (a > 0x9F) return false; break; + case 0xF0: if (a < 0x90) return false; break; + case 0xF4: if (a > 0x8F) return false; break; + default: if (a < 0x80) return false; + } + + case 1: if (*source >= 0x80 && *source < 0xC2) return false; + } + if (*source > 0xF4) return false; + return true; +} + +/* --------------------------------------------------------------------- */ + +/* + * Exported function to return whether a UTF-8 sequence is legal or not. + * This is not used here; it's just exported. + */ +ANTLR3_BOOLEAN +isLegalUTF8Sequence(const UTF8 *source, const UTF8 *sourceEnd) { + int length = trailingBytesForUTF8[*source]+1; + if (source+length > sourceEnd) { + return false; + } + return isLegalUTF8(source, length); +} + +/* --------------------------------------------------------------------- */ + +ConversionResult ConvertUTF8toUTF16 ( + const UTF8** sourceStart, const UTF8* sourceEnd, + UTF16** targetStart, UTF16* targetEnd, ConversionFlags flags) { + ConversionResult result = conversionOK; + const UTF8* source = *sourceStart; + UTF16* target = *targetStart; + while (source < sourceEnd) { + UTF32 ch = 0; + unsigned short extraBytesToRead = trailingBytesForUTF8[*source]; + if (source + extraBytesToRead >= sourceEnd) { + result = sourceExhausted; break; + } + /* Do this check whether lenient or strict */ + if (! isLegalUTF8(source, extraBytesToRead+1)) { + result = sourceIllegal; + break; + } + /* + * The cases all fall through. See "Note A" below. + */ + switch (extraBytesToRead) { + case 5: ch += *source++; ch <<= 6; /* remember, illegal UTF-8 */ + case 4: ch += *source++; ch <<= 6; /* remember, illegal UTF-8 */ + case 3: ch += *source++; ch <<= 6; + case 2: ch += *source++; ch <<= 6; + case 1: ch += *source++; ch <<= 6; + case 0: ch += *source++; + } + ch -= offsetsFromUTF8[extraBytesToRead]; + + if (target >= targetEnd) { + source -= (extraBytesToRead+1); /* Back up source pointer! */ + result = targetExhausted; break; + } + if (ch <= UNI_MAX_BMP) { /* Target is a character <= 0xFFFF */ + /* UTF-16 surrogate values are illegal in UTF-32 */ + if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_LOW_END) { + if (flags == strictConversion) { + source -= (extraBytesToRead+1); /* return to the illegal value itself */ + result = sourceIllegal; + break; + } else { + *target++ = UNI_REPLACEMENT_CHAR; + } + } else { + *target++ = (UTF16)ch; /* normal case */ + } + } else if (ch > UNI_MAX_UTF16) { + if (flags == strictConversion) { + result = sourceIllegal; + source -= (extraBytesToRead+1); /* return to the start */ + break; /* Bail out; shouldn't continue */ + } else { + *target++ = UNI_REPLACEMENT_CHAR; + } + } else { + /* target is a character in range 0xFFFF - 0x10FFFF. */ + if (target + 1 >= targetEnd) { + source -= (extraBytesToRead+1); /* Back up source pointer! */ + result = targetExhausted; break; + } + ch -= halfBase; + *target++ = (UTF16)((ch >> halfShift) + UNI_SUR_HIGH_START); + *target++ = (UTF16)((ch & halfMask) + UNI_SUR_LOW_START); + } + } + *sourceStart = source; + *targetStart = target; + return result; +} + +/* --------------------------------------------------------------------- */ + +ConversionResult ConvertUTF32toUTF8 ( + const UTF32** sourceStart, const UTF32* sourceEnd, + UTF8** targetStart, UTF8* targetEnd, ConversionFlags flags) { + ConversionResult result = conversionOK; + const UTF32* source = *sourceStart; + UTF8* target = *targetStart; + while (source < sourceEnd) { + UTF32 ch; + unsigned short bytesToWrite = 0; + const UTF32 byteMask = 0xBF; + const UTF32 byteMark = 0x80; + ch = *source++; + if (flags == strictConversion ) { + /* UTF-16 surrogate values are illegal in UTF-32 */ + if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_LOW_END) { + --source; /* return to the illegal value itself */ + result = sourceIllegal; + break; + } + } + /* + * Figure out how many bytes the result will require. Turn any + * illegally large UTF32 things (> Plane 17) into replacement chars. + */ + if (ch < (UTF32)0x80) { bytesToWrite = 1; + } else if (ch < (UTF32)0x800) { bytesToWrite = 2; + } else if (ch < (UTF32)0x10000) { bytesToWrite = 3; + } else if (ch <= UNI_MAX_LEGAL_UTF32) { bytesToWrite = 4; + } else { bytesToWrite = 3; + ch = UNI_REPLACEMENT_CHAR; + result = sourceIllegal; + } + + target += bytesToWrite; + if (target > targetEnd) { + --source; /* Back up source pointer! */ + target -= bytesToWrite; result = targetExhausted; break; + } + switch (bytesToWrite) { /* note: everything falls through. */ + case 4: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6; + case 3: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6; + case 2: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6; + case 1: *--target = (UTF8) (ch | firstByteMark[bytesToWrite]); + } + target += bytesToWrite; + } + *sourceStart = source; + *targetStart = target; + return result; +} + +/* --------------------------------------------------------------------- */ + +ConversionResult ConvertUTF8toUTF32 ( + const UTF8** sourceStart, const UTF8* sourceEnd, + UTF32** targetStart, UTF32* targetEnd, ConversionFlags flags) { + ConversionResult result = conversionOK; + const UTF8* source = *sourceStart; + UTF32* target = *targetStart; + while (source < sourceEnd) { + UTF32 ch = 0; + unsigned short extraBytesToRead = trailingBytesForUTF8[*source]; + if (source + extraBytesToRead >= sourceEnd) { + result = sourceExhausted; break; + } + /* Do this check whether lenient or strict */ + if (! isLegalUTF8(source, extraBytesToRead+1)) { + result = sourceIllegal; + break; + } + /* + * The cases all fall through. See "Note A" below. + */ + switch (extraBytesToRead) { + case 5: ch += *source++; ch <<= 6; + case 4: ch += *source++; ch <<= 6; + case 3: ch += *source++; ch <<= 6; + case 2: ch += *source++; ch <<= 6; + case 1: ch += *source++; ch <<= 6; + case 0: ch += *source++; + } + ch -= offsetsFromUTF8[extraBytesToRead]; + + if (target >= targetEnd) { + source -= (extraBytesToRead+1); /* Back up the source pointer! */ + result = targetExhausted; break; + } + if (ch <= UNI_MAX_LEGAL_UTF32) { + /* + * UTF-16 surrogate values are illegal in UTF-32, and anything + * over Plane 17 (> 0x10FFFF) is illegal. + */ + if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_LOW_END) { + if (flags == strictConversion) { + source -= (extraBytesToRead+1); /* return to the illegal value itself */ + result = sourceIllegal; + break; + } else { + *target++ = UNI_REPLACEMENT_CHAR; + } + } else { + *target++ = ch; + } + } else { /* i.e., ch > UNI_MAX_LEGAL_UTF32 */ + result = sourceIllegal; + *target++ = UNI_REPLACEMENT_CHAR; + } + } + *sourceStart = source; + *targetStart = target; + return result; +} + +/* --------------------------------------------------------------------- + + Note A. + The fall-through switches in UTF-8 reading code save a + temp variable, some decrements & conditionals. The switches + are equivalent to the following loop: + { + int tmpBytesToRead = extraBytesToRead+1; + do { + ch += *source++; + --tmpBytesToRead; + if (tmpBytesToRead) ch <<= 6; + } while (tmpBytesToRead > 0); + } + In UTF-8 writing code, the switches on "bytesToWrite" are + similarly unrolled loops. + + --------------------------------------------------------------------- */ diff --git a/antlr/libantlr3c-3.4/src/antlr3cyclicdfa.c b/antlr/libantlr3c-3.4/src/antlr3cyclicdfa.c new file mode 100644 index 0000000..82e7222 --- /dev/null +++ b/antlr/libantlr3c-3.4/src/antlr3cyclicdfa.c @@ -0,0 +1,204 @@ +/** Support functions for traversing cyclic DFA states as laid + * out in static initialized structures by the code generator. + * + * A DFA implemented as a set of transition tables. + * + * Any state that has a semantic predicate edge is special; those states + * are generated with if-then-else structures in a ->specialStateTransition() + * which is generated by cyclicDFA template. + * + * There are at most 32767 states (16-bit signed short). + * Could get away with byte sometimes but would have to generate different + * types and the simulation code too. For a point of reference, the Java + * lexer's Tokens rule DFA has 326 states roughly. + */ + +// [The "BSD licence"] +// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC +// http://www.temporal-wave.com +// http://www.linkedin.com/in/jimidle +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. The name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include +#include + +#ifdef ANTLR3_WINDOWS +#pragma warning( disable : 4100 ) +#endif + +static void +noViableAlt(pANTLR3_BASE_RECOGNIZER rec, pANTLR3_CYCLIC_DFA cdfa, ANTLR3_UINT32 s) +{ + // In backtracking mode, we just set the failed flag so that the + // alt can just exit right now. If we are parsing though, then + // we want the exception to be raised. + // + if (rec->state->backtracking > 0) + { + rec->state->failed = ANTLR3_TRUE; + } + else + { + rec->exConstruct(rec); + rec->state->exception->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION; + rec->state->exception->message = cdfa->description; + rec->state->exception->decisionNum = cdfa->decisionNumber; + rec->state->exception->state = s; + } +} + +/** From the input stream, predict what alternative will succeed + * using this DFA (representing the covering regular approximation + * to the underlying CFL). Return an alternative number 1..n. Throw + * an exception upon error. + */ +ANTLR3_API ANTLR3_INT32 +antlr3dfapredict (void * ctx, pANTLR3_BASE_RECOGNIZER rec, pANTLR3_INT_STREAM is, pANTLR3_CYCLIC_DFA cdfa) +{ + ANTLR3_MARKER mark; + ANTLR3_INT32 s; + ANTLR3_INT32 specialState; + ANTLR3_INT32 c; + + mark = is->mark(is); /* Store where we are right now */ + s = 0; /* Always start with state 0 */ + + for (;;) + { + /* Pick out any special state entry for this state + */ + specialState = cdfa->special[s]; + + /* Transition the special state and consume an input token + */ + if (specialState >= 0) + { + s = cdfa->specialStateTransition(ctx, rec, is, cdfa, specialState); + + // Error? + // + if (s<0) + { + // If the predicate/rule raised an exception then we leave it + // in tact, else we have an NVA. + // + if (rec->state->error != ANTLR3_TRUE) + { + noViableAlt(rec,cdfa, s); + } + is->rewind(is, mark); + return 0; + } + is->consume(is); + continue; + } + + /* Accept state? + */ + if (cdfa->accept[s] >= 1) + { + is->rewind(is, mark); + return cdfa->accept[s]; + } + + /* Look for a normal transition state based upon the input token element + */ + c = is->_LA(is, 1); + + /* Check against min and max for this state + */ + if (c>= cdfa->min[s] && c <= cdfa->max[s]) + { + ANTLR3_INT32 snext; + + /* What is the next state? + */ + snext = cdfa->transition[s][c - cdfa->min[s]]; + + if (snext < 0) + { + /* Was in range but not a normal transition + * must check EOT, which is like the else clause. + * eot[s]>=0 indicates that an EOT edge goes to another + * state. + */ + if (cdfa->eot[s] >= 0) + { + s = cdfa->eot[s]; + is->consume(is); + continue; + } + noViableAlt(rec,cdfa, s); + is->rewind(is, mark); + return 0; + } + + /* New current state - move to it + */ + s = snext; + is->consume(is); + continue; + } + /* EOT Transition? + */ + if (cdfa->eot[s] >= 0) + { + s = cdfa->eot[s]; + is->consume(is); + continue; + } + /* EOF transition to accept state? + */ + if ( c == ANTLR3_TOKEN_EOF && cdfa->eof[s] >= 0) + { + is->rewind(is, mark); + return cdfa->accept[cdfa->eof[s]]; + } + + /* No alt, so bomb + */ + noViableAlt(rec, cdfa, s); + is->rewind(is, mark); + return 0; + } + +} + +/** Default special state implementation + */ +ANTLR3_API ANTLR3_INT32 +antlr3dfaspecialStateTransition (void * ctx, pANTLR3_BASE_RECOGNIZER recognizer, pANTLR3_INT_STREAM is, pANTLR3_CYCLIC_DFA dfa, ANTLR3_INT32 s) +{ + return -1; +} + +/* Default special transition implementation + */ +ANTLR3_API ANTLR3_INT32 +antlr3dfaspecialTransition (void * ctx, pANTLR3_BASE_RECOGNIZER recognizer, pANTLR3_INT_STREAM is, pANTLR3_CYCLIC_DFA dfa, ANTLR3_INT32 s) +{ + return 0; +} diff --git a/antlr/libantlr3c-3.4/src/antlr3debughandlers.c b/antlr/libantlr3c-3.4/src/antlr3debughandlers.c new file mode 100644 index 0000000..d5f177a --- /dev/null +++ b/antlr/libantlr3c-3.4/src/antlr3debughandlers.c @@ -0,0 +1,1047 @@ +/// \file +/// Provides the debugging functions invoked by a recognizer +/// built using the debug generator mode of the antlr tool. +/// See antlr3debugeventlistener.h for documentation. +/// + +// [The "BSD licence"] +// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC +// http://www.temporal-wave.com +// http://www.linkedin.com/in/jimidle +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. The name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include + +// Not everyone wishes to include the debugger stuff in their final deployment because +// it will then rely on being linked with the socket libraries. Hence if the programmer turns +// off the debugging, we do some dummy stuff that satifies compilers etc but means there is +// no debugger and no reliance on the socket librarires. If you set this flag, then using the -debug +// option to generate your code will produce code that just crashes, but then I presme you are smart +// enough to realize that building the libraries without debugger support means you can't call the +// debugger ;-) +// +#ifdef ANTLR3_NODEBUGGER +ANTLR3_API pANTLR3_DEBUG_EVENT_LISTENER +antlr3DebugListenerNew() +{ + ANTLR3_PRINTF("C runtime was compiled without debugger support. This program will crash!!"); + return NULL; +} +#else + +static ANTLR3_BOOLEAN handshake (pANTLR3_DEBUG_EVENT_LISTENER delboy); +static void enterRule (pANTLR3_DEBUG_EVENT_LISTENER delboy, const char * grammarFileName, const char * ruleName); +static void enterAlt (pANTLR3_DEBUG_EVENT_LISTENER delboy, int alt); +static void exitRule (pANTLR3_DEBUG_EVENT_LISTENER delboy, const char * grammarFileName, const char * ruleName); +static void enterSubRule (pANTLR3_DEBUG_EVENT_LISTENER delboy, int decisionNumber); +static void exitSubRule (pANTLR3_DEBUG_EVENT_LISTENER delboy, int decisionNumber); +static void enterDecision (pANTLR3_DEBUG_EVENT_LISTENER delboy, int decisionNumber); +static void exitDecision (pANTLR3_DEBUG_EVENT_LISTENER delboy, int decisionNumber); +static void consumeToken (pANTLR3_DEBUG_EVENT_LISTENER delboy, pANTLR3_COMMON_TOKEN t); +static void consumeHiddenToken (pANTLR3_DEBUG_EVENT_LISTENER delboy, pANTLR3_COMMON_TOKEN t); +static void LT (pANTLR3_DEBUG_EVENT_LISTENER delboy, int i, pANTLR3_COMMON_TOKEN t); +static void mark (pANTLR3_DEBUG_EVENT_LISTENER delboy, ANTLR3_MARKER marker); +static void rewindMark (pANTLR3_DEBUG_EVENT_LISTENER delboy, ANTLR3_MARKER marker); +static void rewindLast (pANTLR3_DEBUG_EVENT_LISTENER delboy); +static void beginBacktrack (pANTLR3_DEBUG_EVENT_LISTENER delboy, int level); +static void endBacktrack (pANTLR3_DEBUG_EVENT_LISTENER delboy, int level, ANTLR3_BOOLEAN successful); +static void location (pANTLR3_DEBUG_EVENT_LISTENER delboy, int line, int pos); +static void recognitionException (pANTLR3_DEBUG_EVENT_LISTENER delboy, pANTLR3_EXCEPTION e); +static void beginResync (pANTLR3_DEBUG_EVENT_LISTENER delboy); +static void endResync (pANTLR3_DEBUG_EVENT_LISTENER delboy); +static void semanticPredicate (pANTLR3_DEBUG_EVENT_LISTENER delboy, ANTLR3_BOOLEAN result, const char * predicate); +static void commence (pANTLR3_DEBUG_EVENT_LISTENER delboy); +static void terminate (pANTLR3_DEBUG_EVENT_LISTENER delboy); +static void consumeNode (pANTLR3_DEBUG_EVENT_LISTENER delboy, pANTLR3_BASE_TREE t); +static void LTT (pANTLR3_DEBUG_EVENT_LISTENER delboy, int i, pANTLR3_BASE_TREE t); +static void nilNode (pANTLR3_DEBUG_EVENT_LISTENER delboy, pANTLR3_BASE_TREE t); +static void errorNode (pANTLR3_DEBUG_EVENT_LISTENER delboy, pANTLR3_BASE_TREE t); +static void createNode (pANTLR3_DEBUG_EVENT_LISTENER delboy, pANTLR3_BASE_TREE t); +static void createNodeTok (pANTLR3_DEBUG_EVENT_LISTENER delboy, pANTLR3_BASE_TREE node, pANTLR3_COMMON_TOKEN token); +static void becomeRoot (pANTLR3_DEBUG_EVENT_LISTENER delboy, pANTLR3_BASE_TREE newRoot, pANTLR3_BASE_TREE oldRoot); +static void addChild (pANTLR3_DEBUG_EVENT_LISTENER delboy, pANTLR3_BASE_TREE root, pANTLR3_BASE_TREE child); +static void setTokenBoundaries (pANTLR3_DEBUG_EVENT_LISTENER delboy, pANTLR3_BASE_TREE t, ANTLR3_MARKER tokenStartIndex, ANTLR3_MARKER tokenStopIndex); +static void ack (pANTLR3_DEBUG_EVENT_LISTENER delboy); + +/// Create and initialize a new debug event listener that can be connected to +/// by ANTLRWorks and any other debugger via a socket. +/// +ANTLR3_API pANTLR3_DEBUG_EVENT_LISTENER +antlr3DebugListenerNew() +{ + pANTLR3_DEBUG_EVENT_LISTENER delboy; + + delboy = ANTLR3_CALLOC(1, sizeof(ANTLR3_DEBUG_EVENT_LISTENER)); + + if (delboy == NULL) + { + return NULL; + } + + // Initialize the API + // + delboy->addChild = addChild; + delboy->becomeRoot = becomeRoot; + delboy->beginBacktrack = beginBacktrack; + delboy->beginResync = beginResync; + delboy->commence = commence; + delboy->consumeHiddenToken = consumeHiddenToken; + delboy->consumeNode = consumeNode; + delboy->consumeToken = consumeToken; + delboy->createNode = createNode; + delboy->createNodeTok = createNodeTok; + delboy->endBacktrack = endBacktrack; + delboy->endResync = endResync; + delboy->enterAlt = enterAlt; + delboy->enterDecision = enterDecision; + delboy->enterRule = enterRule; + delboy->enterSubRule = enterSubRule; + delboy->exitDecision = exitDecision; + delboy->exitRule = exitRule; + delboy->exitSubRule = exitSubRule; + delboy->handshake = handshake; + delboy->location = location; + delboy->LT = LT; + delboy->LTT = LTT; + delboy->mark = mark; + delboy->nilNode = nilNode; + delboy->recognitionException = recognitionException; + delboy->rewind = rewindMark; + delboy->rewindLast = rewindLast; + delboy->semanticPredicate = semanticPredicate; + delboy->setTokenBoundaries = setTokenBoundaries; + delboy->terminate = terminate; + delboy->errorNode = errorNode; + + delboy->PROTOCOL_VERSION = 2; // ANTLR 3.1 is at protocol version 2 + + delboy->port = DEFAULT_DEBUGGER_PORT; + + return delboy; +} + +pANTLR3_DEBUG_EVENT_LISTENER +antlr3DebugListenerNewPort(ANTLR3_UINT32 port) +{ + pANTLR3_DEBUG_EVENT_LISTENER delboy; + + delboy = antlr3DebugListenerNew(); + + if (delboy != NULL) + { + delboy->port = port; + } + + return delboy; +} + +//-------------------------------------------------------------------------------- +// Support functions for sending stuff over the socket interface +// +static int +sockSend(SOCKET sock, const char * ptr, int len) +{ + int sent; + int thisSend; + + sent = 0; + + while (sent < len) + { + // Send as many bytes as we can + // + thisSend = send(sock, ptr, len - sent, 0); + + // Check for errors and tell the user if we got one + // + if (thisSend == -1) + { + return ANTLR3_FALSE; + } + + // Increment our offset by how many we were able to send + // + ptr += thisSend; + sent += thisSend; + } + return ANTLR3_TRUE; +} + +static ANTLR3_BOOLEAN +handshake (pANTLR3_DEBUG_EVENT_LISTENER delboy) +{ + /// Connection structure with which to wait and accept a connection from + /// a debugger. + /// + SOCKET serverSocket; + + // Connection structures to deal with the client after we accept the connection + // and the server while we accept a connection. + // + ANTLR3_SOCKADDRT client; + ANTLR3_SOCKADDRT server; + + // Buffer to construct our message in + // + char message[256]; + + // Specifies the length of the connection structure to accept() + // Windows use int, everyone else uses size_t + // + ANTLR3_SALENT sockaddr_len; + + // Option holder for setsockopt() + // + int optVal; + + if (delboy->initialized == ANTLR3_FALSE) + { + // Windows requires us to initialize WinSock. + // +#ifdef ANTLR3_WINDOWS + { + WORD wVersionRequested; + WSADATA wsaData; + int err; // Return code from WSAStartup + + // We must initialise the Windows socket system when the DLL is loaded. + // We are asking for Winsock 1.1 or better as we don't need anything + // too complicated for this. + // + wVersionRequested = MAKEWORD( 1, 1); + + err = WSAStartup( wVersionRequested, &wsaData ); + + if ( err != 0 ) + { + // Tell the user that we could not find a usable + // WinSock DLL + // + return FALSE; + } + } +#endif + + // Create the server socket, we are the server because we just wait until + // a debugger connects to the port we are listening on. + // + serverSocket = socket(AF_INET, SOCK_STREAM, 0); + + if (serverSocket == INVALID_SOCKET) + { + return ANTLR3_FALSE; + } + + // Set the listening port + // + server.sin_port = htons((unsigned short)delboy->port); + server.sin_family = AF_INET; + server.sin_addr.s_addr = htonl (INADDR_ANY); + + // We could allow a rebind on the same addr/port pair I suppose, but + // I imagine that most people will just want to start debugging one parser at once. + // Maybe change this at some point, but rejecting the bind at this point will ensure + // that people realize they have left something running in the background. + // + if (bind(serverSocket, (pANTLR3_SOCKADDRC)&server, sizeof(server)) == -1) + { + return ANTLR3_FALSE; + } + + // We have bound the socket to the port and address so we now ask the TCP subsystem + // to start listening on that address/port + // + if (listen(serverSocket, 1) == -1) + { + // Some error, just fail + // + return ANTLR3_FALSE; + } + + // Now we can try to accept a connection on the port + // + sockaddr_len = sizeof(client); + delboy->socket = accept(serverSocket, (pANTLR3_SOCKADDRC)&client, &sockaddr_len); + + // Having accepted a connection, we can stop listening and close down the socket + // + shutdown (serverSocket, 0x02); + ANTLR3_CLOSESOCKET (serverSocket); + + if (delboy->socket == -1) + { + return ANTLR3_FALSE; + } + + // Disable Nagle as this is essentially a chat exchange + // + optVal = 1; + setsockopt(delboy->socket, SOL_SOCKET, TCP_NODELAY, (const void *)&optVal, sizeof(optVal)); + + } + + // We now have a good socket connection with the debugging client, so we + // send it the protocol version we are using and what the name of the grammar + // is that we represent. + // + sprintf (message, "ANTLR %d\n", delboy->PROTOCOL_VERSION); + sockSend (delboy->socket, message, (int)strlen(message)); + sprintf (message, "grammar \"%s\n", delboy->grammarFileName->chars); + sockSend (delboy->socket, message, (int)strlen(message)); + ack (delboy); + + delboy->initialized = ANTLR3_TRUE; + + return ANTLR3_TRUE; +} + +// Send the supplied text and wait for an ack from the client +static void +transmit(pANTLR3_DEBUG_EVENT_LISTENER delboy, const char * ptr) +{ + sockSend(delboy->socket, ptr, (int)strlen(ptr)); + ack(delboy); +} + +static void +ack (pANTLR3_DEBUG_EVENT_LISTENER delboy) +{ + // Local buffer to read the next character in to + // + char buffer; + int rCount; + + // Ack terminates in a line feed, so we just wait for + // one of those. Speed is not of the essence so we don't need + // to buffer the input or anything. + // + do + { + rCount = recv(delboy->socket, &buffer, 1, 0); + } + while (rCount == 1 && buffer != '\n'); + + // If the socket ws closed on us, then we will get an error or + // (with a graceful close), 0. We can assume the the debugger stopped for some reason + // (such as Java crashing again). Therefore we just exit the program + // completely if we don't get the terminating '\n' for the ack. + // + if (rCount != 1) + { + ANTLR3_PRINTF("Exiting debugger as remote client closed the socket\n"); + ANTLR3_PRINTF("Received char count was %d, and last char received was %02X\n", rCount, buffer); + exit(0); + } +} + +// Given a buffer string and a source string, serialize the +// text, escaping any newlines and linefeeds. We have no need +// for speed here, this is the debugger. +// +void +serializeText(pANTLR3_STRING buffer, pANTLR3_STRING text) +{ + ANTLR3_UINT32 c; + ANTLR3_UCHAR character; + + // strings lead in with a " + // + buffer->append(buffer, "\t\""); + + if (text == NULL) + { + return; + } + + // Now we replace linefeeds, newlines and the escape + // leadin character '%' with their hex equivalents + // prefixed by '%' + // + for (c = 0; c < text->len; c++) + { + switch (character = text->charAt(text, c)) + { + case '\n': + + buffer->append(buffer, "%0A"); + break; + + case '\r': + + buffer->append(buffer, "%0D"); + break; + + case '\\': + + buffer->append(buffer, "%25"); + break; + + // Other characters: The Song Remains the Same. + // + default: + + buffer->addc(buffer, character); + break; + } + } +} + +// Given a token, create a stringified version of it, in the supplied +// buffer. We create a string for this in the debug 'object', if there +// is not one there already, and then reuse it here if asked to do this +// again. +// +pANTLR3_STRING +serializeToken(pANTLR3_DEBUG_EVENT_LISTENER delboy, pANTLR3_COMMON_TOKEN t) +{ + // Do we already have a serialization buffer? + // + if (delboy->tokenString == NULL) + { + // No, so create one, using the string factory that + // the grammar name used, which is guaranteed to exist. + // 64 bytes will do us here for starters. + // + delboy->tokenString = delboy->grammarFileName->factory->newSize(delboy->grammarFileName->factory, 64); + } + + // Empty string + // + delboy->tokenString->set(delboy->tokenString, (const char *)""); + + // Now we serialize the elements of the token.Note that the debugger only + // uses 32 bits. + // + delboy->tokenString->addi(delboy->tokenString, (ANTLR3_INT32)(t->getTokenIndex(t))); + delboy->tokenString->addc(delboy->tokenString, '\t'); + delboy->tokenString->addi(delboy->tokenString, (ANTLR3_INT32)(t->getType(t))); + delboy->tokenString->addc(delboy->tokenString, '\t'); + delboy->tokenString->addi(delboy->tokenString, (ANTLR3_INT32)(t->getChannel(t))); + delboy->tokenString->addc(delboy->tokenString, '\t'); + delboy->tokenString->addi(delboy->tokenString, (ANTLR3_INT32)(t->getLine(t))); + delboy->tokenString->addc(delboy->tokenString, '\t'); + delboy->tokenString->addi(delboy->tokenString, (ANTLR3_INT32)(t->getCharPositionInLine(t))); + + // Now send the text that the token represents. + // + serializeText(delboy->tokenString, t->getText(t)); + + // Finally, as the debugger is a Java program it will expect to get UTF-8 + // encoded strings. We don't use UTF-8 internally to the C runtime, so we + // must force encode it. We have a method to do this in the string class, but + // it returns malloc space that we must free afterwards. + // + return delboy->tokenString->toUTF8(delboy->tokenString); +} + +// Given a tree node, create a stringified version of it in the supplied +// buffer. +// +pANTLR3_STRING +serializeNode(pANTLR3_DEBUG_EVENT_LISTENER delboy, pANTLR3_BASE_TREE node) +{ + pANTLR3_COMMON_TOKEN token; + + + // Do we already have a serialization buffer? + // + if (delboy->tokenString == NULL) + { + // No, so create one, using the string factory that + // the grammar name used, which is guaranteed to exist. + // 64 bytes will do us here for starters. + // + delboy->tokenString = delboy->grammarFileName->factory->newSize(delboy->grammarFileName->factory, 64); + } + + // Empty string + // + delboy->tokenString->set(delboy->tokenString, (const char *)""); + + // Protect against bugs/errors etc + // + if (node == NULL) + { + return delboy->tokenString; + } + + // Now we serialize the elements of the node.Note that the debugger only + // uses 32 bits. + // + delboy->tokenString->addc(delboy->tokenString, '\t'); + + // Adaptor ID + // + delboy->tokenString->addi(delboy->tokenString, delboy->adaptor->getUniqueID(delboy->adaptor, node)); + delboy->tokenString->addc(delboy->tokenString, '\t'); + + // Type of the current token (which may be imaginary) + // + delboy->tokenString->addi(delboy->tokenString, delboy->adaptor->getType(delboy->adaptor, node)); + + // See if we have an actual token or just an imaginary + // + token = delboy->adaptor->getToken(delboy->adaptor, node); + + delboy->tokenString->addc(delboy->tokenString, '\t'); + if (token != NULL) + { + // Real token + // + delboy->tokenString->addi(delboy->tokenString, (ANTLR3_INT32)(token->getLine(token))); + delboy->tokenString->addc(delboy->tokenString, ' '); + delboy->tokenString->addi(delboy->tokenString, (ANTLR3_INT32)(token->getCharPositionInLine(token))); + } + else + { + // Imaginary tokens have no location + // + delboy->tokenString->addi(delboy->tokenString, -1); + delboy->tokenString->addc(delboy->tokenString, '\t'); + delboy->tokenString->addi(delboy->tokenString, -1); + } + + // Start Index of the node + // + delboy->tokenString->addc(delboy->tokenString, '\t'); + delboy->tokenString->addi(delboy->tokenString, (ANTLR3_UINT32)(delboy->adaptor->getTokenStartIndex(delboy->adaptor, node))); + + // Now send the text that the node represents. + // + serializeText(delboy->tokenString, delboy->adaptor->getText(delboy->adaptor, node)); + + // Finally, as the debugger is a Java program it will expect to get UTF-8 + // encoded strings. We don't use UTF-8 internally to the C runtime, so we + // must force encode it. We have a method to do this in the string class, but + // there is no utf8 string implementation as of yet + // + return delboy->tokenString->toUTF8(delboy->tokenString); +} + +//------------------------------------------------------------------------------------------------------------------ +// EVENTS +// +static void +enterRule (pANTLR3_DEBUG_EVENT_LISTENER delboy, const char * grammarFileName, const char * ruleName) +{ + char buffer[512]; + + // Create the message (speed is not of the essence) + // + sprintf(buffer, "enterRule\t%s\t%s\n", grammarFileName, ruleName); + transmit(delboy, buffer); +} + +static void +enterAlt (pANTLR3_DEBUG_EVENT_LISTENER delboy, int alt) +{ + char buffer[512]; + + // Create the message (speed is not of the essence) + // + sprintf(buffer, "enterAlt\t%d\n", alt); + transmit(delboy, buffer); +} + +static void +exitRule (pANTLR3_DEBUG_EVENT_LISTENER delboy, const char * grammarFileName, const char * ruleName) +{ + char buffer[512]; + + // Create the message (speed is not of the essence) + // + sprintf(buffer, "exitRule\t%s\t%s\n", grammarFileName, ruleName); + transmit(delboy, buffer); +} + +static void +enterSubRule (pANTLR3_DEBUG_EVENT_LISTENER delboy, int decisionNumber) +{ + char buffer[512]; + + // Create the message (speed is not of the essence) + // + sprintf(buffer, "enterSubRule\t%d\n", decisionNumber); + transmit(delboy, buffer); +} + +static void +exitSubRule (pANTLR3_DEBUG_EVENT_LISTENER delboy, int decisionNumber) +{ + char buffer[512]; + + // Create the message (speed is not of the essence) + // + sprintf(buffer, "exitSubRule\t%d\n", decisionNumber); + transmit(delboy, buffer); +} + +static void +enterDecision (pANTLR3_DEBUG_EVENT_LISTENER delboy, int decisionNumber) +{ + char buffer[512]; + + // Create the message (speed is not of the essence) + // + sprintf(buffer, "enterDecision\t%d\n", decisionNumber); + transmit(delboy, buffer); + +} + +static void +exitDecision (pANTLR3_DEBUG_EVENT_LISTENER delboy, int decisionNumber) +{ + char buffer[512]; + + // Create the message (speed is not of the essence) + // + sprintf(buffer, "exitDecision\t%d\n", decisionNumber); + transmit(delboy, buffer); +} + +static void +consumeToken (pANTLR3_DEBUG_EVENT_LISTENER delboy, pANTLR3_COMMON_TOKEN t) +{ + pANTLR3_STRING msg; + + // Create the serialized token + // + msg = serializeToken(delboy, t); + + // Insert the debug event indicator + // + msg->insert8(msg, 0, "consumeToken\t"); + + msg->addc(msg, '\n'); + + // Transmit the message and wait for ack + // + transmit(delboy, (const char *)(msg->chars)); +} + +static void +consumeHiddenToken (pANTLR3_DEBUG_EVENT_LISTENER delboy, pANTLR3_COMMON_TOKEN t) +{ + pANTLR3_STRING msg; + + // Create the serialized token + // + msg = serializeToken(delboy, t); + + // Insert the debug event indicator + // + msg->insert8(msg, 0, "consumeHiddenToken\t"); + + msg->addc(msg, '\n'); + + // Transmit the message and wait for ack + // + transmit(delboy, (const char *)(msg->chars)); +} + +// Looking at the next token event. +// +static void +LT (pANTLR3_DEBUG_EVENT_LISTENER delboy, int i, pANTLR3_COMMON_TOKEN t) +{ + pANTLR3_STRING msg; + + if (t != NULL) + { + // Create the serialized token + // + msg = serializeToken(delboy, t); + + // Insert the index parameter + // + msg->insert8(msg, 0, "\t"); + msg->inserti(msg, 0, i); + + // Insert the debug event indicator + // + msg->insert8(msg, 0, "LT\t"); + + msg->addc(msg, '\n'); + + // Transmit the message and wait for ack + // + transmit(delboy, (const char *)(msg->chars)); + } +} + +static void +mark (pANTLR3_DEBUG_EVENT_LISTENER delboy, ANTLR3_MARKER marker) +{ + char buffer[128]; + + sprintf(buffer, "mark\t%d\n", (ANTLR3_UINT32)(marker & 0xFFFFFFFF)); + + // Transmit the message and wait for ack + // + transmit(delboy, buffer); +} + +static void +rewindMark (pANTLR3_DEBUG_EVENT_LISTENER delboy, ANTLR3_MARKER marker) +{ + char buffer[128]; + + sprintf(buffer, "rewind\t%d\n", (ANTLR3_UINT32)(marker & 0xFFFFFFFF)); + + // Transmit the message and wait for ack + // + transmit(delboy, buffer); + +} + +static void +rewindLast (pANTLR3_DEBUG_EVENT_LISTENER delboy) +{ + transmit(delboy, (const char *)"rewind\n"); +} + +static void +beginBacktrack (pANTLR3_DEBUG_EVENT_LISTENER delboy, int level) +{ + char buffer[128]; + + sprintf(buffer, "beginBacktrack\t%d\n", (ANTLR3_UINT32)(level & 0xFFFFFFFF)); + + // Transmit the message and wait for ack + // + transmit(delboy, buffer); +} + +static void +endBacktrack (pANTLR3_DEBUG_EVENT_LISTENER delboy, int level, ANTLR3_BOOLEAN successful) +{ + char buffer[128]; + + sprintf(buffer, "endBacktrack\t%d\t%d\n", level, successful); + + // Transmit the message and wait for ack + // + transmit(delboy, buffer); +} + +static void +location (pANTLR3_DEBUG_EVENT_LISTENER delboy, int line, int pos) +{ + char buffer[128]; + + sprintf(buffer, "location\t%d\t%d\n", line, pos); + + // Transmit the message and wait for ack + // + transmit(delboy, buffer); +} + +static void +recognitionException (pANTLR3_DEBUG_EVENT_LISTENER delboy, pANTLR3_EXCEPTION e) +{ + char buffer[256]; + + sprintf(buffer, "exception\t%s\t%d\t%d\t%d\n", (char *)(e->name), (ANTLR3_INT32)(e->index), e->line, e->charPositionInLine); + + // Transmit the message and wait for ack + // + transmit(delboy, buffer); +} + +static void +beginResync (pANTLR3_DEBUG_EVENT_LISTENER delboy) +{ + transmit(delboy, (const char *)"beginResync\n"); +} + +static void +endResync (pANTLR3_DEBUG_EVENT_LISTENER delboy) +{ + transmit(delboy, (const char *)"endResync\n"); +} + +static void +semanticPredicate (pANTLR3_DEBUG_EVENT_LISTENER delboy, ANTLR3_BOOLEAN result, const char * predicate) +{ + unsigned char * buffer; + unsigned char * out; + + if (predicate != NULL) + { + buffer = (unsigned char *)ANTLR3_MALLOC(64 + 2*strlen(predicate)); + + if (buffer != NULL) + { + out = buffer + sprintf((char *)buffer, "semanticPredicate\t%s\t", result == ANTLR3_TRUE ? "true" : "false"); + + while (*predicate != '\0') + { + switch(*predicate) + { + case '\n': + + *out++ = '%'; + *out++ = '0'; + *out++ = 'A'; + break; + + case '\r': + + *out++ = '%'; + *out++ = '0'; + *out++ = 'D'; + break; + + case '%': + + *out++ = '%'; + *out++ = '0'; + *out++ = 'D'; + break; + + + default: + + *out++ = *predicate; + break; + } + + predicate++; + } + *out++ = '\n'; + *out++ = '\0'; + } + + // Send it and wait for the ack + // + transmit(delboy, (const char *)buffer); + } +} + +#ifdef ANTLR3_WINDOWS +#pragma warning (push) +#pragma warning (disable : 4100) +#endif + +static void +commence (pANTLR3_DEBUG_EVENT_LISTENER delboy) +{ + // Nothing to see here + // +} + +#ifdef ANTLR3_WINDOWS +#pragma warning (pop) +#endif + +static void +terminate (pANTLR3_DEBUG_EVENT_LISTENER delboy) +{ + // Terminate sequence + // + sockSend(delboy->socket, "terminate\n", 10); // Send out the command +} + +//---------------------------------------------------------------- +// Tree parsing events +// +static void +consumeNode (pANTLR3_DEBUG_EVENT_LISTENER delboy, pANTLR3_BASE_TREE t) +{ + pANTLR3_STRING buffer; + + buffer = serializeNode (delboy, t); + + // Now prepend the command + // + buffer->insert8 (buffer, 0, "consumeNode\t"); + buffer->addc (buffer, '\n'); + + // Send to the debugger and wait for the ack + // + transmit (delboy, (const char *)(delboy->tokenString->toUTF8(delboy->tokenString)->chars)); +} + +static void +LTT (pANTLR3_DEBUG_EVENT_LISTENER delboy, int i, pANTLR3_BASE_TREE t) +{ + pANTLR3_STRING buffer; + + buffer = serializeNode (delboy, t); + + // Now prepend the command + // + buffer->insert8 (buffer, 0, "\t"); + buffer->inserti (buffer, 0, i); + buffer->insert8 (buffer, 0, "LN\t"); + buffer->addc (buffer, '\n'); + + // Send to the debugger and wait for the ack + // + transmit (delboy, (const char *)(delboy->tokenString->toUTF8(delboy->tokenString)->chars)); +} + +static void +nilNode (pANTLR3_DEBUG_EVENT_LISTENER delboy, pANTLR3_BASE_TREE t) +{ + char buffer[128]; + sprintf(buffer, "nilNode\t%d\n", delboy->adaptor->getUniqueID(delboy->adaptor, t)); + transmit(delboy, buffer); +} + +static void +createNode (pANTLR3_DEBUG_EVENT_LISTENER delboy, pANTLR3_BASE_TREE t) +{ + // Do we already have a serialization buffer? + // + if (delboy->tokenString == NULL) + { + // No, so create one, using the string factory that + // the grammar name used, which is guaranteed to exist. + // 64 bytes will do us here for starters. + // + delboy->tokenString = delboy->grammarFileName->factory->newSize(delboy->grammarFileName->factory, 64); + } + + // Empty string + // + delboy->tokenString->set8(delboy->tokenString, (const char *)"createNodeFromTokenElements "); + + // Now we serialize the elements of the node.Note that the debugger only + // uses 32 bits. + // + // Adaptor ID + // + delboy->tokenString->addi(delboy->tokenString, delboy->adaptor->getUniqueID(delboy->adaptor, t)); + delboy->tokenString->addc(delboy->tokenString, '\t'); + + // Type of the current token (which may be imaginary) + // + delboy->tokenString->addi(delboy->tokenString, delboy->adaptor->getType(delboy->adaptor, t)); + + // The text that this node represents + // + serializeText(delboy->tokenString, delboy->adaptor->getText(delboy->adaptor, t)); + delboy->tokenString->addc(delboy->tokenString, '\n'); + + // Finally, as the debugger is a Java program it will expect to get UTF-8 + // encoded strings. We don't use UTF-8 internally to the C runtime, so we + // must force encode it. We have a method to do this in the string class, but + // there is no utf8 string implementation as of yet + // + transmit(delboy, (const char *)(delboy->tokenString->toUTF8(delboy->tokenString)->chars)); + +} +static void +errorNode (pANTLR3_DEBUG_EVENT_LISTENER delboy, pANTLR3_BASE_TREE t) +{ + // Do we already have a serialization buffer? + // + if (delboy->tokenString == NULL) + { + // No, so create one, using the string factory that + // the grammar name used, which is guaranteed to exist. + // 64 bytes will do us here for starters. + // + delboy->tokenString = delboy->grammarFileName->factory->newSize(delboy->grammarFileName->factory, 64); + } + + // Empty string + // + delboy->tokenString->set8(delboy->tokenString, (const char *)"errorNode\t"); + + // Now we serialize the elements of the node.Note that the debugger only + // uses 32 bits. + // + // Adaptor ID + // + delboy->tokenString->addi(delboy->tokenString, delboy->adaptor->getUniqueID(delboy->adaptor, t)); + delboy->tokenString->addc(delboy->tokenString, '\t'); + + // Type of the current token (which is an error) + // + delboy->tokenString->addi(delboy->tokenString, ANTLR3_TOKEN_INVALID); + + // The text that this node represents + // + serializeText(delboy->tokenString, delboy->adaptor->getText(delboy->adaptor, t)); + delboy->tokenString->addc(delboy->tokenString, '\n'); + + // Finally, as the debugger is a Java program it will expect to get UTF-8 + // encoded strings. We don't use UTF-8 internally to the C runtime, so we + // must force encode it. We have a method to do this in the string class, but + // there is no utf8 string implementation as of yet + // + transmit(delboy, (const char *)(delboy->tokenString->toUTF8(delboy->tokenString)->chars)); + +} + +static void +createNodeTok (pANTLR3_DEBUG_EVENT_LISTENER delboy, pANTLR3_BASE_TREE node, pANTLR3_COMMON_TOKEN token) +{ + char buffer[128]; + + sprintf(buffer, "createNode\t%d\t%d\n", delboy->adaptor->getUniqueID(delboy->adaptor, node), (ANTLR3_UINT32)token->getTokenIndex(token)); + + transmit(delboy, buffer); +} + +static void +becomeRoot (pANTLR3_DEBUG_EVENT_LISTENER delboy, pANTLR3_BASE_TREE newRoot, pANTLR3_BASE_TREE oldRoot) +{ + char buffer[128]; + + sprintf(buffer, "becomeRoot\t%d\t%d\n", delboy->adaptor->getUniqueID(delboy->adaptor, newRoot), + delboy->adaptor->getUniqueID(delboy->adaptor, oldRoot) + ); + transmit(delboy, buffer); +} + + +static void +addChild (pANTLR3_DEBUG_EVENT_LISTENER delboy, pANTLR3_BASE_TREE root, pANTLR3_BASE_TREE child) +{ + char buffer[128]; + + sprintf(buffer, "addChild\t%d\t%d\n", delboy->adaptor->getUniqueID(delboy->adaptor, root), + delboy->adaptor->getUniqueID(delboy->adaptor, child) + ); + transmit(delboy, buffer); +} + +static void +setTokenBoundaries (pANTLR3_DEBUG_EVENT_LISTENER delboy, pANTLR3_BASE_TREE t, ANTLR3_MARKER tokenStartIndex, ANTLR3_MARKER tokenStopIndex) +{ + char buffer[128]; + + sprintf(buffer, "becomeRoot\t%d\t%d\t%d\n", delboy->adaptor->getUniqueID(delboy->adaptor, t), + (ANTLR3_UINT32)tokenStartIndex, + (ANTLR3_UINT32)tokenStopIndex + ); + transmit(delboy, buffer); +} +#endif + diff --git a/antlr/libantlr3c-3.4/src/antlr3encodings.c b/antlr/libantlr3c-3.4/src/antlr3encodings.c new file mode 100644 index 0000000..c7a4b77 --- /dev/null +++ b/antlr/libantlr3c-3.4/src/antlr3encodings.c @@ -0,0 +1,50 @@ +/** \File + * Provides basic utility functions to convert between + * the various Unicode character conversions. There are of + * course various packages that could be used instead of these + * functions, but then the Antlr 3 C runtime would be dependant + * on the particular package. Using ICU for this is a good idea if + * your project is already dependant on it. + */ + +// [The "BSD licence"] +// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC +// http://www.temporal-wave.com +// http://www.linkedin.com/in/jimidle +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. The name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include + +/// Convert 8 bit character to ANTLR char form. +/// +/// \param[in] inc Input character to transform from 8 bit form. +/// \return ANTLR3_UCHAR encoding of the character. +/// +ANTLR3_API +ANTLR3_UCHAR antlr3c8toAntlrc(ANTLR3_INT8 inc) +{ + return (ANTLR3_UCHAR)(inc); +} diff --git a/antlr/libantlr3c-3.4/src/antlr3exception.c b/antlr/libantlr3c-3.4/src/antlr3exception.c new file mode 100644 index 0000000..339721c --- /dev/null +++ b/antlr/libantlr3c-3.4/src/antlr3exception.c @@ -0,0 +1,190 @@ +/** \file + * Contains default functions for creating and destroying as well as + * otherwise handling ANTLR3 standard exception structures. + */ + +// [The "BSD licence"] +// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC +// http://www.temporal-wave.com +// http://www.linkedin.com/in/jimidle +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. The name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include + +static void antlr3ExceptionPrint(pANTLR3_EXCEPTION ex); +static void antlr3ExceptionFree (pANTLR3_EXCEPTION ex); + +/** + * \brief + * Creates a new ANTLR3 exception structure + * + * \param[in] exception + * One of the ANTLR3_xxx_EXCEPTION indicators such as #ANTLR3_RECOGNITION_EXCEPTION + * + * \param[in] message + * Pointer to message string + * + * \param[in] freeMessage + * Set to ANTLR3_TRUE if the message parameter should be freed by a call to + * ANTLR3_FREE() when the exception is destroyed. + * + * \returns + * Pointer to newly initialized exception structure, or an ANTLR3_ERR_xx defined value + * upon failure. + * + * An exception is 'thrown' by a recognizer when input is seen that is not predicted by + * the grammar productions or when some other error condition occurs. In C we do not have + * the luxury of try and catch blocks, so exceptions are added in the order they occur to + * a list in the baserecognizer structure. The last one to be thrown is inserted at the head of + * the list and the one currently installed is pointed to by the newly installed exception. + * + * \remarks + * After an exception is created, you may add a pointer to your own structure and a pointer + * to a function to free this structure when the exception is destroyed. + * + * \see + * ANTLR3_EXCEPTION + */ +pANTLR3_EXCEPTION +antlr3ExceptionNew(ANTLR3_UINT32 exception, void * name, void * message, ANTLR3_BOOLEAN freeMessage) +{ + pANTLR3_EXCEPTION ex; + + /* Allocate memory for the structure + */ + ex = (pANTLR3_EXCEPTION) ANTLR3_CALLOC(1, sizeof(ANTLR3_EXCEPTION)); + + /* Check for memory allocation + */ + if (ex == NULL) + { + return NULL; + } + + ex->name = name; /* Install exception name */ + ex->type = exception; /* Install the exception number */ + ex->message = message; /* Install message string */ + + /* Indicate whether the string should be freed if exception is destroyed + */ + ex->freeMessage = freeMessage; + + /* Install the API + */ + ex->print = antlr3ExceptionPrint; + ex->freeEx = antlr3ExceptionFree; + + return ex; +} + +/** + * \brief + * Prints out the message in all the exceptions in the supplied chain. + * + * \param[in] ex + * Pointer to the exception structure to print. + * + * \remarks + * You may wish to override this function by installing a pointer to a new function + * in the base recognizer context structure. + * + * \see + * ANTLR3_BASE_RECOGNIZER + */ +static void +antlr3ExceptionPrint(pANTLR3_EXCEPTION ex) +{ + /* Ensure valid pointer + */ + while (ex != NULL) + { + /* Number if no message, else the message + */ + if (ex->message == NULL) + { + ANTLR3_FPRINTF(stderr, "ANTLR3_EXCEPTION number %d (%08X).\n", ex->type, ex->type); + } + else + { + ANTLR3_FPRINTF(stderr, "ANTLR3_EXCEPTION: %s\n", (char *)(ex->message)); + } + + /* Move to next in the chain (if any) + */ + ex = ex->nextException; + } + + return; +} + +/** + * \brief + * Frees up a chain of ANTLR3 exceptions + * + * \param[in] ex + * Pointer to the first exception in the chain to free. + * + * \see + * ANTLR3_EXCEPTION + */ +static void +antlr3ExceptionFree(pANTLR3_EXCEPTION ex) +{ + pANTLR3_EXCEPTION next; + + /* Ensure valid pointer + */ + while (ex != NULL) + { + /* Pick up anythign following now, before we free the + * current memory block. + */ + next = ex->nextException; + + /* Free the message pointer if advised to + */ + if (ex->freeMessage == ANTLR3_TRUE) + { + ANTLR3_FREE(ex->message); + } + + /* Call the programmer's custom free routine if advised to + */ + if (ex->freeCustom != NULL) + { + ex->freeCustom(ex->custom); + } + + /* Free the actual structure itself + */ + ANTLR3_FREE(ex); + + ex = next; + } + + return; +} + diff --git a/antlr/libantlr3c-3.4/src/antlr3filestream.c b/antlr/libantlr3c-3.4/src/antlr3filestream.c new file mode 100644 index 0000000..4430ffe --- /dev/null +++ b/antlr/libantlr3c-3.4/src/antlr3filestream.c @@ -0,0 +1,474 @@ +/** \file + * \brief The ANTLR3 C filestream is used when the source character stream + * is a filesystem based input set and all the characters in the filestream + * can be loaded at once into memory and away the lexer goes. + * + * A number of initializers are provided in order that various character + * sets can be supported from input files. The ANTLR3 C runtime expects + * to deal with UTF32 characters only (the reasons for this are to + * do with the simplification of C code when using this form of Unicode + * encoding, though this is not a panacea. More information can be + * found on this by consulting: + * - http://www.unicode.org/versions/Unicode4.0.0/ch02.pdf#G11178 + * Where a well grounded discussion of the encoding formats available + * may be found. + * + */ + +// [The "BSD licence"] +// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC +// http://www.temporal-wave.com +// http://www.linkedin.com/in/jimidle +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. The name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include + +static void setupInputStream (pANTLR3_INPUT_STREAM input); +static pANTLR3_INPUT_STREAM antlr3CreateFileStream (pANTLR3_UINT8 fileName); +static pANTLR3_INPUT_STREAM antlr3CreateStringStream (pANTLR3_UINT8 data); + +ANTLR3_API pANTLR3_INPUT_STREAM +antlr3FileStreamNew(pANTLR3_UINT8 fileName, ANTLR3_UINT32 encoding) +{ + pANTLR3_INPUT_STREAM input; + + // First order of business is to read the file into some buffer space + // as just straight 8 bit bytes. Then we will work out the encoding and + // byte order and adjust the API functions that are installed for the + // default 8Bit stream accordingly. + // + input = antlr3CreateFileStream(fileName); + if (input == NULL) + { + return NULL; + } + + // We have the data in memory now so we can deal with it according to + // the encoding scheme we were given by the user. + // + input->encoding = encoding; + + // Now we need to work out the endian type and install any + // API functions that differ from 8Bit + // + setupInputStream(input); + + // Now we can set up the file name + // + input->istream->streamName = input->strFactory->newStr8(input->strFactory, fileName); + input->fileName = input->istream->streamName; + + return input; +} + + +ANTLR3_API pANTLR3_INPUT_STREAM +antlr3StringStreamNew(pANTLR3_UINT8 data, ANTLR3_UINT32 encoding, ANTLR3_UINT32 size, pANTLR3_UINT8 name) +{ + pANTLR3_INPUT_STREAM input; + + // First order of business is to set up the stream and install the data pointer. + // Then we will work out the encoding and byte order and adjust the API functions that are installed for the + // default 8Bit stream accordingly. + // + input = antlr3CreateStringStream(data); + if (input == NULL) + { + return NULL; + } + + // Size (in bytes) of the given 'string' + // + input->sizeBuf = size; + + // We have the data in memory now so we can deal with it according to + // the encoding scheme we were given by the user. + // + input->encoding = encoding; + + // Now we need to work out the endian type and install any + // API functions that differ from 8Bit + // + setupInputStream(input); + + // Now we can set up the file name + // + input->istream->streamName = input->strFactory->newStr8(input->strFactory, name); + input->fileName = input->istream->streamName; + + return input; +} + + +/// Determine endianess of the input stream and install the +/// API required for the encoding in that format. +/// +static void +setupInputStream(pANTLR3_INPUT_STREAM input) +{ + ANTLR3_BOOLEAN isBigEndian; + + // Used to determine the endianness of the machine we are currently + // running on. + // + ANTLR3_UINT16 bomTest = 0xFEFF; + + // What endianess is the machine we are running on? If the incoming + // encoding endianess is the same as this machine's natural byte order + // then we can use more efficient API calls. + // + if (*((pANTLR3_UINT8)(&bomTest)) == 0xFE) + { + isBigEndian = ANTLR3_TRUE; + } + else + { + isBigEndian = ANTLR3_FALSE; + } + + // What encoding did the user tell us {s}he thought it was? I am going + // to get sick of the questions on antlr-interest, I know I am. + // + switch (input->encoding) + { + case ANTLR3_ENC_UTF8: + + // See if there is a BOM at the start of this UTF-8 sequence + // and just eat it if there is. Windows .TXT files have this for instance + // as it identifies UTF-8 even though it is of no consequence for byte order + // as UTF-8 does not have a byte order. + // + if ( (ANTLR3_UINT8)(*((pANTLR3_UINT8)input->nextChar)) == 0xEF + && (ANTLR3_UINT8)(*((pANTLR3_UINT8)input->nextChar+1)) == 0xBB + && (ANTLR3_UINT8)(*((pANTLR3_UINT8)input->nextChar+2)) == 0xBF + ) + { + // The UTF8 BOM is present so skip it + // + input->nextChar = (void *)((pANTLR3_UINT8)input->nextChar + 3); + } + + // Install the UTF8 input routines + // + antlr3UTF8SetupStream(input); + break; + + case ANTLR3_ENC_UTF16: + + // See if there is a BOM at the start of the input. If not then + // we assume that the byte order is the natural order of this + // machine (or it is really UCS2). If there is a BOM we determine if the encoding + // is the same as the natural order of this machine. + // + if ( (ANTLR3_UINT8)(*((pANTLR3_UINT8)input->nextChar)) == 0xFE + && (ANTLR3_UINT8)(*((pANTLR3_UINT8)input->nextChar+1)) == 0xFF + ) + { + // BOM Present, indicates Big Endian + // + input->nextChar = (void *)((pANTLR3_UINT8)input->nextChar + 2); + + antlr3UTF16SetupStream(input, isBigEndian, ANTLR3_TRUE); + } + else if ( (ANTLR3_UINT8)(*((pANTLR3_UINT8)input->nextChar)) == 0xFF + && (ANTLR3_UINT8)(*((pANTLR3_UINT8)input->nextChar+1)) == 0xFE + ) + { + // BOM present, indicates Little Endian + // + input->nextChar = (void *)((pANTLR3_UINT8)input->nextChar + 2); + + antlr3UTF16SetupStream(input, isBigEndian, ANTLR3_FALSE); + } + else + { + // No BOM present, assume local computer byte order + // + antlr3UTF16SetupStream(input, isBigEndian, isBigEndian); + } + break; + + case ANTLR3_ENC_UTF32: + + // See if there is a BOM at the start of the input. If not then + // we assume that the byte order is the natural order of this + // machine. If there is we determine if the encoding + // is the same as the natural order of this machine. + // + if ( (ANTLR3_UINT8)(*((pANTLR3_UINT8)input->nextChar)) == 0x00 + && (ANTLR3_UINT8)(*((pANTLR3_UINT8)input->nextChar+1)) == 0x00 + && (ANTLR3_UINT8)(*((pANTLR3_UINT8)input->nextChar+2)) == 0xFE + && (ANTLR3_UINT8)(*((pANTLR3_UINT8)input->nextChar+3)) == 0xFF + ) + { + // BOM Present, indicates Big Endian + // + input->nextChar = (void *)((pANTLR3_UINT8)input->nextChar + 4); + + antlr3UTF32SetupStream(input, isBigEndian, ANTLR3_TRUE); + } + else if ( (ANTLR3_UINT8)(*((pANTLR3_UINT8)input->nextChar)) == 0xFF + && (ANTLR3_UINT8)(*((pANTLR3_UINT8)input->nextChar+1)) == 0xFE + && (ANTLR3_UINT8)(*((pANTLR3_UINT8)input->nextChar+1)) == 0x00 + && (ANTLR3_UINT8)(*((pANTLR3_UINT8)input->nextChar+1)) == 0x00 + ) + { + // BOM present, indicates Little Endian + // + input->nextChar = (void *)((pANTLR3_UINT8)input->nextChar + 4); + + antlr3UTF32SetupStream(input, isBigEndian, ANTLR3_FALSE); + } + else + { + // No BOM present, assume local computer byte order + // + antlr3UTF32SetupStream(input, isBigEndian, isBigEndian); + } + break; + + case ANTLR3_ENC_UTF16BE: + + // Encoding is definately Big Endian with no BOM + // + antlr3UTF16SetupStream(input, isBigEndian, ANTLR3_TRUE); + break; + + case ANTLR3_ENC_UTF16LE: + + // Encoding is definately Little Endian with no BOM + // + antlr3UTF16SetupStream(input, isBigEndian, ANTLR3_FALSE); + break; + + case ANTLR3_ENC_UTF32BE: + + // Encoding is definately Big Endian with no BOM + // + antlr3UTF32SetupStream(input, isBigEndian, ANTLR3_TRUE); + break; + + case ANTLR3_ENC_UTF32LE: + + // Encoding is definately Little Endian with no BOM + // + antlr3UTF32SetupStream(input, isBigEndian, ANTLR3_FALSE); + break; + + case ANTLR3_ENC_EBCDIC: + + // EBCDIC is basically the same as ASCII but with an on the + // fly translation to ASCII + // + antlr3EBCDICSetupStream(input); + break; + + case ANTLR3_ENC_8BIT: + default: + + // Standard 8bit/ASCII + // + antlr38BitSetupStream(input); + break; + } +} + +/** \brief Use the contents of an operating system file as the input + * for an input stream. + * + * \param fileName Name of operating system file to read. + * \return + * - Pointer to new input stream context upon success + * - One of the ANTLR3_ERR_ defines on error. + */ +static pANTLR3_INPUT_STREAM +antlr3CreateFileStream(pANTLR3_UINT8 fileName) +{ + // Pointer to the input stream we are going to create + // + pANTLR3_INPUT_STREAM input; + ANTLR3_UINT32 status; + + if (fileName == NULL) + { + return NULL; + } + + // Allocate memory for the input stream structure + // + input = (pANTLR3_INPUT_STREAM) + ANTLR3_CALLOC(1, sizeof(ANTLR3_INPUT_STREAM)); + + if (input == NULL) + { + return NULL; + } + + // Structure was allocated correctly, now we can read the file. + // + status = antlr3read8Bit(input, fileName); + + // Call the common 8 bit input stream handler + // initialization. + // + antlr3GenericSetupStream(input); + + // However if the file was not there or something then we + // need to close. Have to wait until here as we cannot call + // close until the API is installed of course. + // + if (status != ANTLR3_SUCCESS) + { + input->close(input); + return NULL; + } + + return input; +} + +ANTLR3_API ANTLR3_UINT32 +antlr3read8Bit(pANTLR3_INPUT_STREAM input, pANTLR3_UINT8 fileName) +{ + ANTLR3_FDSC infile; + ANTLR3_UINT32 fSize; + + /* Open the OS file in read binary mode + */ + infile = antlr3Fopen(fileName, "rb"); + + /* Check that it was there + */ + if (infile == NULL) + { + return (ANTLR3_UINT32)ANTLR3_ERR_NOFILE; + } + + /* It was there, so we can read the bytes now + */ + fSize = antlr3Fsize(fileName); /* Size of input file */ + + /* Allocate buffer for this input set + */ + input->data = ANTLR3_MALLOC((size_t)fSize); + input->sizeBuf = fSize; + + if (input->data == NULL) + { + return (ANTLR3_UINT32)ANTLR3_ERR_NOMEM; + } + + input->isAllocated = ANTLR3_TRUE; + + /* Now we read the file. Characters are not converted to + * the internal ANTLR encoding until they are read from the buffer + */ + antlr3Fread(infile, fSize, input->data); + + /* And close the file handle + */ + antlr3Fclose(infile); + + return ANTLR3_SUCCESS; +} + +/** \brief Open an operating system file and return the descriptor + * We just use the common open() and related functions here. + * Later we might find better ways on systems + * such as Windows and OpenVMS for instance. But the idea is to read the + * while file at once anyway, so it may be irrelevant. + */ +ANTLR3_API ANTLR3_FDSC +antlr3Fopen(pANTLR3_UINT8 filename, const char * mode) +{ + return (ANTLR3_FDSC)fopen((const char *)filename, mode); +} + +/** \brief Close an operating system file and free any handles + * etc. + */ +ANTLR3_API void +antlr3Fclose(ANTLR3_FDSC fd) +{ + fclose(fd); +} +ANTLR3_API ANTLR3_UINT32 +antlr3Fsize(pANTLR3_UINT8 fileName) +{ + struct _stat statbuf; + + _stat((const char *)fileName, &statbuf); + + return (ANTLR3_UINT32)statbuf.st_size; +} + +ANTLR3_API ANTLR3_UINT32 +antlr3Fread(ANTLR3_FDSC fdsc, ANTLR3_UINT32 count, void * data) +{ + return (ANTLR3_UINT32)fread(data, (size_t)count, 1, fdsc); +} + + +/** \brief Use the supplied 'string' as input to the stream + * + * \param data Pointer to the input data + * \return + * - Pointer to new input stream context upon success + * - NULL defines on error. + */ +static pANTLR3_INPUT_STREAM +antlr3CreateStringStream(pANTLR3_UINT8 data) +{ + // Pointer to the input stream we are going to create + // + pANTLR3_INPUT_STREAM input; + + if (data == NULL) + { + return NULL; + } + + // Allocate memory for the input stream structure + // + input = (pANTLR3_INPUT_STREAM) + ANTLR3_CALLOC(1, sizeof(ANTLR3_INPUT_STREAM)); + + if (input == NULL) + { + return NULL; + } + + // Structure was allocated correctly, now we can install the pointer + // + input->data = data; + input->isAllocated = ANTLR3_FALSE; + + // Call the common 8 bit input stream handler + // initialization. + // + antlr3GenericSetupStream(input); + + return input; +} \ No newline at end of file diff --git a/antlr/libantlr3c-3.4/src/antlr3inputstream.c b/antlr/libantlr3c-3.4/src/antlr3inputstream.c new file mode 100644 index 0000000..e3f1c26 --- /dev/null +++ b/antlr/libantlr3c-3.4/src/antlr3inputstream.c @@ -0,0 +1,2050 @@ +/// \file +/// Base functions to initialize and manipulate any input stream +/// + +// [The "BSD licence"] +// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC +// http://www.temporal-wave.com +// http://www.linkedin.com/in/jimidle +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. The name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include + +// ----------------------------------- +// Generic 8 bit input such as latin-1 +// + +// 8Bit INT Stream API +// +static void antlr38BitConsume (pANTLR3_INT_STREAM is); +static ANTLR3_UCHAR antlr38BitLA (pANTLR3_INT_STREAM is, ANTLR3_INT32 la); +static ANTLR3_UCHAR antlr38BitLA_ucase (pANTLR3_INT_STREAM is, ANTLR3_INT32 la); +static ANTLR3_MARKER antlr38BitIndex (pANTLR3_INT_STREAM is); +static ANTLR3_MARKER antlr38BitMark (pANTLR3_INT_STREAM is); +static void antlr38BitRewind (pANTLR3_INT_STREAM is, ANTLR3_MARKER mark); +static void antlr38BitRewindLast (pANTLR3_INT_STREAM is); +static void antlr38BitRelease (pANTLR3_INT_STREAM is, ANTLR3_MARKER mark); +static void antlr38BitSeek (pANTLR3_INT_STREAM is, ANTLR3_MARKER seekPoint); +static pANTLR3_STRING antlr38BitGetSourceName (pANTLR3_INT_STREAM is); + +// 8Bit Charstream API functions +// +static void antlr3InputClose (pANTLR3_INPUT_STREAM input); +static void antlr3InputReset (pANTLR3_INPUT_STREAM input); +static void antlr38BitReuse (pANTLR3_INPUT_STREAM input, pANTLR3_UINT8 inString, ANTLR3_UINT32 size, pANTLR3_UINT8 name); +static void * antlr38BitLT (pANTLR3_INPUT_STREAM input, ANTLR3_INT32 lt); +static ANTLR3_UINT32 antlr38BitSize (pANTLR3_INPUT_STREAM input); +static pANTLR3_STRING antlr38BitSubstr (pANTLR3_INPUT_STREAM input, ANTLR3_MARKER start, ANTLR3_MARKER stop); +static ANTLR3_UINT32 antlr38BitGetLine (pANTLR3_INPUT_STREAM input); +static void * antlr38BitGetLineBuf (pANTLR3_INPUT_STREAM input); +static ANTLR3_UINT32 antlr38BitGetCharPosition (pANTLR3_INPUT_STREAM input); +static void antlr38BitSetLine (pANTLR3_INPUT_STREAM input, ANTLR3_UINT32 line); +static void antlr38BitSetCharPosition (pANTLR3_INPUT_STREAM input, ANTLR3_UINT32 position); +static void antlr38BitSetNewLineChar (pANTLR3_INPUT_STREAM input, ANTLR3_UINT32 newlineChar); +static void antlr38BitSetUcaseLA (pANTLR3_INPUT_STREAM input, ANTLR3_BOOLEAN flag); + +// ----------------------------------- +// UTF16 (also covers UCS2) +// +// INT Stream API +// +static void antlr3UTF16Consume (pANTLR3_INT_STREAM is); +static ANTLR3_UCHAR antlr3UTF16LA (pANTLR3_INT_STREAM is, ANTLR3_INT32 la); +static void antlr3UTF16ConsumeLE (pANTLR3_INT_STREAM is); +static ANTLR3_UCHAR antlr3UTF16LALE (pANTLR3_INT_STREAM is, ANTLR3_INT32 la); +static void antlr3UTF16ConsumeBE (pANTLR3_INT_STREAM is); +static ANTLR3_UCHAR antlr3UTF16LABE (pANTLR3_INT_STREAM is, ANTLR3_INT32 la); +static ANTLR3_MARKER antlr3UTF16Index (pANTLR3_INT_STREAM is); +static void antlr3UTF16Seek (pANTLR3_INT_STREAM is, ANTLR3_MARKER seekPoint); + +// UTF16 Charstream API functions +// +static pANTLR3_STRING antlr3UTF16Substr (pANTLR3_INPUT_STREAM input, ANTLR3_MARKER start, ANTLR3_MARKER stop); + +// ----------------------------------- +// UTF32 (also covers UCS2) +// +// INT Stream API +// +static void antlr3UTF32Consume (pANTLR3_INT_STREAM is); +static ANTLR3_UCHAR antlr3UTF32LA (pANTLR3_INT_STREAM is, ANTLR3_INT32 la); +static ANTLR3_UCHAR antlr3UTF32LALE (pANTLR3_INT_STREAM is, ANTLR3_INT32 la); +static ANTLR3_UCHAR antlr3UTF32LABE (pANTLR3_INT_STREAM is, ANTLR3_INT32 la); +static ANTLR3_MARKER antlr3UTF32Index (pANTLR3_INT_STREAM is); +static void antlr3UTF32Seek (pANTLR3_INT_STREAM is, ANTLR3_MARKER seekPoint); + +// UTF16 Charstream API functions +// +static pANTLR3_STRING antlr3UTF32Substr (pANTLR3_INPUT_STREAM input, ANTLR3_MARKER start, ANTLR3_MARKER stop); + +// ------------------------------------ +// UTF-8 +// +static void antlr3UTF8Consume (pANTLR3_INT_STREAM is); +static ANTLR3_UCHAR antlr3UTF8LA (pANTLR3_INT_STREAM is, ANTLR3_INT32 la); + +// ------------------------------------ +// EBCDIC +// +static ANTLR3_UCHAR antlr3EBCDICLA (pANTLR3_INT_STREAM is, ANTLR3_INT32 la); + +/// \brief Common function to setup function interface for an 8 bit input stream. +/// +/// \param input Input stream context pointer +/// +/// \remark +/// - Many of the 8 bit oriented file stream handling functions will be usable +/// by any or at least some, other input streams. Therefore it is perfectly acceptable +/// to call this function to install the 8Bit handler then override just those functions +/// that would not work for the particular input encoding, such as consume for instance. +/// +void +antlr38BitSetupStream (pANTLR3_INPUT_STREAM input) +{ + // Build a string factory for this stream + // + input->strFactory = antlr3StringFactoryNew(input->encoding); + + // Default stream API set up is for 8Bit, so we are done + // +} + +void +antlr3GenericSetupStream (pANTLR3_INPUT_STREAM input) +{ + /* Install function pointers for an 8 bit input + */ + + /* Allocate stream interface + */ + input->istream = antlr3IntStreamNew(); + input->istream->type = ANTLR3_CHARSTREAM; + input->istream->super = input; + + /* Intstream API + */ + input->istream->consume = antlr38BitConsume; // Consume the next 8 bit character in the buffer + input->istream->_LA = antlr38BitLA; // Return the UTF32 character at offset n (1 based) + input->istream->index = antlr38BitIndex; // Current index (offset from first character + input->istream->mark = antlr38BitMark; // Record the current lex state for later restore + input->istream->rewind = antlr38BitRewind; // How to rewind the input + input->istream->rewindLast = antlr38BitRewindLast; // How to rewind the input + input->istream->seek = antlr38BitSeek; // How to seek to a specific point in the stream + input->istream->release = antlr38BitRelease; // Reset marks after mark n + input->istream->getSourceName = antlr38BitGetSourceName; // Return a string that names the input source + + /* Charstream API + */ + input->close = antlr3InputClose; // Close down the stream completely + input->free = antlr3InputClose; // Synonym for free + input->reset = antlr3InputReset; // Reset input to start + input->reuse = antlr38BitReuse; // Install a new input string and reset + input->_LT = antlr38BitLT; // Same as _LA for 8 bit file + input->size = antlr38BitSize; // Return the size of the input buffer + input->substr = antlr38BitSubstr; // Return a string from the input stream + input->getLine = antlr38BitGetLine; // Return the current line number in the input stream + input->getLineBuf = antlr38BitGetLineBuf; // Return a pointer to the start of the current line being consumed + input->getCharPositionInLine = antlr38BitGetCharPosition; // Return the offset into the current line of input + input->setLine = antlr38BitSetLine; // Set the input stream line number (does not set buffer pointers) + input->setCharPositionInLine = antlr38BitSetCharPosition; // Set the offset in to the current line (does not set any pointers) + input->SetNewLineChar = antlr38BitSetNewLineChar; // Set the value of the newline trigger character + input->setUcaseLA = antlr38BitSetUcaseLA; // Changes the LA function to return upper case always + + input->charByteSize = 1; // Size in bytes of characters in this stream. + + /* Initialize entries for tables etc + */ + input->markers = NULL; + + /* Set up the input stream brand new + */ + input->reset(input); + + /* Install default line separator character (it can be replaced + * by the grammar programmer later) + */ + input->SetNewLineChar(input, (ANTLR3_UCHAR)'\n'); +} + +static pANTLR3_STRING +antlr38BitGetSourceName(pANTLR3_INT_STREAM is) +{ + return is->streamName; +} + +/** \brief Close down an input stream and free any memory allocated by it. + * + * \param input Input stream context pointer + */ +static void +antlr3InputClose(pANTLR3_INPUT_STREAM input) +{ + // Close any markers in the input stream + // + if (input->markers != NULL) + { + input->markers->free(input->markers); + input->markers = NULL; + } + + // Close the string factory + // + if (input->strFactory != NULL) + { + input->strFactory->close(input->strFactory); + } + + // Free the input stream buffer if we allocated it + // + if (input->isAllocated && input->data != NULL) + { + ANTLR3_FREE(input->data); + input->data = NULL; + } + + input->istream->free(input->istream); + + // Finally, free the space for the structure itself + // + ANTLR3_FREE(input); + + // Done + // +} + +static void +antlr38BitSetUcaseLA (pANTLR3_INPUT_STREAM input, ANTLR3_BOOLEAN flag) +{ + if (flag) + { + // Return the upper case version of the characters + // + input->istream->_LA = antlr38BitLA_ucase; + } + else + { + // Return the raw characters as they are in the buffer + // + input->istream->_LA = antlr38BitLA; + } +} + + +/** \brief Reset a re-startable input stream to the start + * + * \param input Input stream context pointer + */ +static void +antlr3InputReset(pANTLR3_INPUT_STREAM input) +{ + + input->nextChar = input->data; /* Input at first character */ + input->line = 1; /* starts at line 1 */ + input->charPositionInLine = -1; + input->currentLine = input->data; + input->markDepth = 0; /* Reset markers */ + + /* Clear out up the markers table if it is there + */ + if (input->markers != NULL) + { + input->markers->clear(input->markers); + } + else + { + /* Install a new markers table + */ + input->markers = antlr3VectorNew(0); + } +} + +/** Install a new source code in to a working input stream so that the + * input stream can be reused. + */ +static void +antlr38BitReuse(pANTLR3_INPUT_STREAM input, pANTLR3_UINT8 inString, ANTLR3_UINT32 size, pANTLR3_UINT8 name) +{ + input->isAllocated = ANTLR3_FALSE; + input->data = inString; + input->sizeBuf = size; + + // Now we can set up the file name. As we are reusing the stream, there may already + // be a string that we can reuse for holding the filename. + // + if (input->istream->streamName == NULL) + { + input->istream->streamName = input->strFactory->newStr(input->strFactory, name == NULL ? (pANTLR3_UINT8)"-memory-" : name); + input->fileName = input->istream->streamName; + } + else + { + input->istream->streamName->set(input->istream->streamName, (name == NULL ? (const char *)"-memory-" : (const char *)name)); + } + + input->reset(input); +} + +/** \brief Consume the next character in an 8 bit input stream + * + * \param input Input stream context pointer + */ +static void +antlr38BitConsume(pANTLR3_INT_STREAM is) +{ + pANTLR3_INPUT_STREAM input; + + input = ((pANTLR3_INPUT_STREAM) (is->super)); + + if ((pANTLR3_UINT8)(input->nextChar) < (((pANTLR3_UINT8)input->data) + input->sizeBuf)) + { + /* Indicate one more character in this line + */ + input->charPositionInLine++; + + if ((ANTLR3_UCHAR)(*((pANTLR3_UINT8)input->nextChar)) == input->newlineChar) + { + /* Reset for start of a new line of input + */ + input->line++; + input->charPositionInLine = 0; + input->currentLine = (void *)(((pANTLR3_UINT8)input->nextChar) + 1); + } + + /* Increment to next character position + */ + input->nextChar = (void *)(((pANTLR3_UINT8)input->nextChar) + 1); + } +} + +/** \brief Return the input element assuming an 8 bit ascii input + * + * \param[in] input Input stream context pointer + * \param[in] la 1 based offset of next input stream element + * + * \return Next input character in internal ANTLR3 encoding (UTF32) + */ +static ANTLR3_UCHAR +antlr38BitLA(pANTLR3_INT_STREAM is, ANTLR3_INT32 la) +{ + pANTLR3_INPUT_STREAM input; + + input = ((pANTLR3_INPUT_STREAM) (is->super)); + + if (( ((pANTLR3_UINT8)input->nextChar) + la - 1) >= (((pANTLR3_UINT8)input->data) + input->sizeBuf)) + { + return ANTLR3_CHARSTREAM_EOF; + } + else + { + return (ANTLR3_UCHAR)(*((pANTLR3_UINT8)input->nextChar + la - 1)); + } +} + +/** \brief Return the input element assuming an 8 bit input and + * always return the UPPER CASE character. + * Note that this is 8 bit and so we assume that the toupper + * function will use the correct locale for 8 bits. + * + * \param[in] input Input stream context pointer + * \param[in] la 1 based offset of next input stream element + * + * \return Next input character in internal ANTLR3 encoding (UTF32) + */ +static ANTLR3_UCHAR +antlr38BitLA_ucase (pANTLR3_INT_STREAM is, ANTLR3_INT32 la) +{ + pANTLR3_INPUT_STREAM input; + + input = ((pANTLR3_INPUT_STREAM) (is->super)); + + if (( ((pANTLR3_UINT8)input->nextChar) + la - 1) >= (((pANTLR3_UINT8)input->data) + input->sizeBuf)) + { + return ANTLR3_CHARSTREAM_EOF; + } + else + { + return (ANTLR3_UCHAR)toupper((*((pANTLR3_UINT8)input->nextChar + la - 1))); + } +} + + +/** \brief Return the input element assuming an 8 bit ascii input + * + * \param[in] input Input stream context pointer + * \param[in] lt 1 based offset of next input stream element + * + * \return Next input character in internal ANTLR3 encoding (UTF32) + */ +static void * +antlr38BitLT(pANTLR3_INPUT_STREAM input, ANTLR3_INT32 lt) +{ + /* Casting is horrible but it means no warnings and LT should never be called + * on a character stream anyway I think. If it is then, the void * will need to be + * cast back in a similar manner. Yuck! But this means that LT for Token streams and + * tree streams is correct. + */ + return (ANTLR3_FUNC_PTR(input->istream->_LA(input->istream, lt))); +} + +/** \brief Calculate the current index in the output stream. + * \param[in] input Input stream context pointer + */ +static ANTLR3_MARKER +antlr38BitIndex(pANTLR3_INT_STREAM is) +{ + pANTLR3_INPUT_STREAM input; + + input = ((pANTLR3_INPUT_STREAM) (is->super)); + + return (ANTLR3_MARKER)(((pANTLR3_UINT8)input->nextChar)); +} + +/** \brief Return the size of the current input stream, as an 8Bit file + * which in this case is the total input. Other implementations may provide + * more sophisticated implementations to deal with non-recoverable streams + * and so on. + * + * \param[in] input Input stream context pointer + */ +static ANTLR3_UINT32 +antlr38BitSize(pANTLR3_INPUT_STREAM input) +{ + return input->sizeBuf; +} + +/** \brief Mark the current input point in an 8Bit 8 bit stream + * such as a file stream, where all the input is available in the + * buffer. + * + * \param[in] is Input stream context pointer + */ +static ANTLR3_MARKER +antlr38BitMark (pANTLR3_INT_STREAM is) +{ + pANTLR3_LEX_STATE state; + pANTLR3_INPUT_STREAM input; + + input = ((pANTLR3_INPUT_STREAM) (is->super)); + + /* New mark point + */ + input->markDepth++; + + /* See if we are revisiting a mark as we can just reuse the vector + * entry if we are, otherwise, we need a new one + */ + if (input->markDepth > input->markers->count) + { + state = ANTLR3_MALLOC(sizeof(ANTLR3_LEX_STATE)); + + /* Add it to the table + */ + input->markers->add(input->markers, state, ANTLR3_FREE_FUNC); /* No special structure, just free() on delete */ + } + else + { + state = (pANTLR3_LEX_STATE)input->markers->get(input->markers, input->markDepth - 1); + + /* Assume no errors for speed, it will just blow up if the table failed + * for some reasons, hence lots of unit tests on the tables ;-) + */ + } + + /* We have created or retrieved the state, so update it with the current + * elements of the lexer state. + */ + state->charPositionInLine = input->charPositionInLine; + state->currentLine = input->currentLine; + state->line = input->line; + state->nextChar = input->nextChar; + + is->lastMarker = input->markDepth; + + /* And that's it + */ + return input->markDepth; +} +/** \brief Rewind the lexer input to the state specified by the last produced mark. + * + * \param[in] input Input stream context pointer + * + * \remark + * Assumes 8 Bit input stream. + */ +static void +antlr38BitRewindLast (pANTLR3_INT_STREAM is) +{ + is->rewind(is, is->lastMarker); +} + +/** \brief Rewind the lexer input to the state specified by the supplied mark. + * + * \param[in] input Input stream context pointer + * + * \remark + * Assumes 8 Bit input stream. + */ +static void +antlr38BitRewind (pANTLR3_INT_STREAM is, ANTLR3_MARKER mark) +{ + pANTLR3_LEX_STATE state; + pANTLR3_INPUT_STREAM input; + + input = ((pANTLR3_INPUT_STREAM) is->super); + + /* Perform any clean up of the marks + */ + input->istream->release(input->istream, mark); + + /* Find the supplied mark state + */ + state = (pANTLR3_LEX_STATE)input->markers->get(input->markers, (ANTLR3_UINT32)(mark - 1)); + + /* Seek input pointer to the requested point (note we supply the void *pointer + * to whatever is implementing the int stream to seek). + */ + antlr38BitSeek(is, (ANTLR3_MARKER)(state->nextChar)); + + /* Reset to the reset of the information in the mark + */ + input->charPositionInLine = state->charPositionInLine; + input->currentLine = state->currentLine; + input->line = state->line; + input->nextChar = state->nextChar; + + /* And we are done + */ +} + +/** \brief Rewind the lexer input to the state specified by the supplied mark. + * + * \param[in] input Input stream context pointer + * + * \remark + * Assumes 8 Bit input stream. + */ +static void +antlr38BitRelease (pANTLR3_INT_STREAM is, ANTLR3_MARKER mark) +{ + pANTLR3_INPUT_STREAM input; + + input = ((pANTLR3_INPUT_STREAM) (is->super)); + + /* We don't do much here in fact as we never free any higher marks in + * the hashtable as we just resuse any memory allocated for them. + */ + input->markDepth = (ANTLR3_UINT32)(mark - 1); +} + +/** \brief Rewind the lexer input to the state specified by the supplied mark. + * + * \param[in] input Input stream context pointer + * + * \remark + * Assumes 8 Bit input stream. + */ +static void +antlr38BitSeek (pANTLR3_INT_STREAM is, ANTLR3_MARKER seekPoint) +{ + ANTLR3_INT32 count; + pANTLR3_INPUT_STREAM input; + + input = ANTLR3_FUNC_PTR(((pANTLR3_INPUT_STREAM) is->super)); + + /* If the requested seek point is less than the current + * input point, then we assume that we are resetting from a mark + * and do not need to scan, but can just set to there. + */ + if (seekPoint <= (ANTLR3_MARKER)(input->nextChar)) + { + input->nextChar = ((pANTLR3_UINT8) seekPoint); + } + else + { + count = (ANTLR3_UINT32)(seekPoint - (ANTLR3_MARKER)(input->nextChar)); + + while (count--) + { + is->consume(is); + } + } +} +/** Return a substring of the 8 bit input stream in + * newly allocated memory. + * + * \param input Input stream context pointer + * \param start Offset in input stream where the string starts + * \param stop Offset in the input stream where the string ends. + */ +static pANTLR3_STRING +antlr38BitSubstr (pANTLR3_INPUT_STREAM input, ANTLR3_MARKER start, ANTLR3_MARKER stop) +{ + return input->strFactory->newPtr(input->strFactory, (pANTLR3_UINT8)start, (ANTLR3_UINT32)(stop - start + 1)); +} + +/** \brief Return the line number as understood by the 8 bit input stream. + * + * \param input Input stream context pointer + * \return Line number in input stream that we believe we are working on. + */ +static ANTLR3_UINT32 +antlr38BitGetLine (pANTLR3_INPUT_STREAM input) +{ + return input->line; +} + +/** Return a pointer into the input stream that points at the start + * of the current input line as triggered by the end of line character installed + * for the stream ('\n' unless told differently). + * + * \param[in] input + */ +static void * +antlr38BitGetLineBuf (pANTLR3_INPUT_STREAM input) +{ + return input->currentLine; +} + +/** Return the current offset in to the current line in the input stream. + * + * \param input Input stream context pointer + * \return Current line offset + */ +static ANTLR3_UINT32 +antlr38BitGetCharPosition (pANTLR3_INPUT_STREAM input) +{ + return input->charPositionInLine; +} + +/** Set the current line number as understood by the input stream. + * + * \param input Input stream context pointer + * \param line Line number to tell the input stream we are on + * + * \remark + * This function does not change any pointers, it just allows the programmer to set the + * line number according to some external criterion, such as finding a lexed directive + * like: #nnn "file.c" for instance, such that error reporting and so on in is in sync + * with some original source format. + */ +static void +antlr38BitSetLine (pANTLR3_INPUT_STREAM input, ANTLR3_UINT32 line) +{ + input->line = line; +} + +/** Set the current offset in the current line to be a particular setting. + * + * \param[in] input Input stream context pointer + * \param[in] position New setting for current offset. + * + * \remark + * This does not set the actual pointers in the input stream, it is purely for reporting + * purposes and so on as per antlr38BitSetLine(); + */ +static void +antlr38BitSetCharPosition (pANTLR3_INPUT_STREAM input, ANTLR3_UINT32 position) +{ + input->charPositionInLine = position; +} + +/** Set the newline trigger character in the input stream to the supplied parameter. + * + * \param[in] input Input stream context pointer + * \param[in] newlineChar Character to set to be the newline trigger. + * + * \remark + * - The supplied newLineChar is in UTF32 encoding (which means ASCII and latin1 etc + * are the same encodings), but the input stream catered to by this function is 8 bit + * only, so it is up to the programmer to ensure that the character supplied is valid. + */ +static void +antlr38BitSetNewLineChar (pANTLR3_INPUT_STREAM input, ANTLR3_UINT32 newlineChar) +{ + input->newlineChar = newlineChar; +} + + +/// \brief Common function to setup function interface for a UTF16 or UCS2 input stream. +/// +/// \param input Input stream context pointer +/// +/// \remark +/// - Strictly speaking, there is no such thing as a UCS2 input stream as the term +/// tends to confuse the notions of character encoding, unicode and so on. UCS2 is +/// essentially UTF16 without any surrogates and so the standard UTF16 +/// input stream is able to handle it without any special code. +/// +void +antlr3UTF16SetupStream (pANTLR3_INPUT_STREAM input, ANTLR3_BOOLEAN machineBigEndian, ANTLR3_BOOLEAN inputBigEndian) +{ + // Build a string factory for this stream. This is a UTF16 string factory which is a standard + // part of the ANTLR3 string. The string factory is then passed through the whole chain + // of lexer->parser->tree->treeparser and so on. + // + input->strFactory = antlr3StringFactoryNew(input->encoding); + + // Generic API that does not care about endianess. + // + input->istream->index = antlr3UTF16Index; // Calculate current index in input stream, UTF16 based + input->substr = antlr3UTF16Substr; // Return a string from the input stream + input->istream->seek = antlr3UTF16Seek; // How to seek to a specific point in the stream + + // We must install different UTF16 routines according to whether the input + // is the same endianess as the machine we are executing upon or not. If it is not + // then we must install methods that can convert the endianess on the fly as they go + // + + switch (machineBigEndian) + { + case ANTLR3_TRUE: + + // Machine is Big Endian, if the input is also then install the + // methods that do not access input by bytes and reverse them. + // Otherwise install endian aware methods. + // + if (inputBigEndian == ANTLR3_TRUE) + { + // Input is machine compatible + // + input->istream->consume = antlr3UTF16Consume; // Consume the next UTF16 character in the buffer + input->istream->_LA = antlr3UTF16LA; // Return the UTF32 character at offset n (1 based) + } + else + { + // Need to use methods that know that the input is little endian + // + input->istream->consume = antlr3UTF16ConsumeLE; // Consume the next UTF16 character in the buffer + input->istream->_LA = antlr3UTF16LALE; // Return the UTF32 character at offset n (1 based) + } + break; + + case ANTLR3_FALSE: + + // Machine is Little Endian, if the input is also then install the + // methods that do not access input by bytes and reverse them. + // Otherwise install endian aware methods. + // + if (inputBigEndian == ANTLR3_FALSE) + { + // Input is machine compatible + // + input->istream->consume = antlr3UTF16Consume; // Consume the next UTF16 character in the buffer + input->istream->_LA = antlr3UTF16LA; // Return the UTF32 character at offset n (1 based) + } + else + { + // Need to use methods that know that the input is Big Endian + // + input->istream->consume = antlr3UTF16ConsumeBE; // Consume the next UTF16 character in the buffer + input->istream->_LA = antlr3UTF16LABE; // Return the UTF32 character at offset n (1 based) + } + break; + } + + + input->charByteSize = 2; // Size in bytes of characters in this stream. + +} + +/// \brief Consume the next character in a UTF16 input stream +/// +/// \param input Input stream context pointer +/// +static void +antlr3UTF16Consume(pANTLR3_INT_STREAM is) +{ + pANTLR3_INPUT_STREAM input; + UTF32 ch; + UTF32 ch2; + + input = ((pANTLR3_INPUT_STREAM) (is->super)); + + // Buffer size is always in bytes + // + if ((pANTLR3_UINT8)(input->nextChar) < (((pANTLR3_UINT8)input->data) + input->sizeBuf)) + { + // Indicate one more character in this line + // + input->charPositionInLine++; + + if ((ANTLR3_UCHAR)(*((pANTLR3_UINT16)input->nextChar)) == input->newlineChar) + { + // Reset for start of a new line of input + // + input->line++; + input->charPositionInLine = 0; + input->currentLine = (void *)(((pANTLR3_UINT16)input->nextChar) + 1); + } + + // Increment to next character position, accounting for any surrogates + // + // Next char in natural machine byte order + // + ch = *((UTF16*)input->nextChar); + + // We consumed one 16 bit character + // + input->nextChar = (void *)(((pANTLR3_UINT16)input->nextChar) + 1); + + // If we have a surrogate pair then we need to consume + // a following valid LO surrogate. + // + if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_HIGH_END) { + + // If the 16 bits following the high surrogate are in the source buffer... + // + if ((pANTLR3_UINT8)(input->nextChar) < (((pANTLR3_UINT8)input->data) + input->sizeBuf)) + { + // Next character is in natural machine byte order + // + ch2 = *((UTF16*)input->nextChar); + + // If it's a valid low surrogate, consume it + // + if (ch2 >= UNI_SUR_LOW_START && ch2 <= UNI_SUR_LOW_END) + { + // We consumed one 16 bit character + // + input->nextChar = (void *)(((pANTLR3_UINT16)input->nextChar) + 1); + } + // Note that we ignore a valid hi surrogate that has no lo surrogate to go with + // it. + // + } + // Note that we ignore a valid hi surrogate that has no lo surrogate to go with + // it because the buffer ended + // + } + // Note that we did not check for an invalid low surrogate here, or that fact that the + // lo surrogate was missing. We just picked out one 16 bit character unless the character + // was a valid hi surrogate, in whcih case we consumed two 16 bit characters. + // + } +} + +/// \brief Return the input element assuming an 8 bit ascii input +/// +/// \param[in] input Input stream context pointer +/// \param[in] la 1 based offset of next input stream element +/// +/// \return Next input character in internal ANTLR3 encoding (UTF32) +/// +static ANTLR3_UCHAR +antlr3UTF16LA(pANTLR3_INT_STREAM is, ANTLR3_INT32 la) +{ + pANTLR3_INPUT_STREAM input; + UTF32 ch; + UTF32 ch2; + UTF16 * nextChar; + + // Find the input interface and where we are currently pointing to + // in the input stream + // + input = ((pANTLR3_INPUT_STREAM) (is->super)); + nextChar = input->nextChar; + + // If a positive offset then advance forward, else retreat + // + if (la >= 0) + { + while (--la > 0 && (pANTLR3_UINT8)nextChar < ((pANTLR3_UINT8)input->data) + input->sizeBuf ) + { + // Advance our copy of the input pointer + // + // Next char in natural machine byte order + // + ch = *nextChar++; + + // If we have a surrogate pair then we need to consume + // a following valid LO surrogate. + // + if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_HIGH_END) + { + // If the 16 bits following the high surrogate are in the source buffer... + // + if ((pANTLR3_UINT8)(nextChar) < (((pANTLR3_UINT8)input->data) + input->sizeBuf)) + { + // Next character is in natural machine byte order + // + ch2 = *nextChar; + + // If it's a valid low surrogate, consume it + // + if (ch2 >= UNI_SUR_LOW_START && ch2 <= UNI_SUR_LOW_END) + { + // We consumed one 16 bit character + // + nextChar++; + } + // Note that we ignore a valid hi surrogate that has no lo surrogate to go with + // it. + // + } + // Note that we ignore a valid hi surrogate that has no lo surrogate to go with + // it because the buffer ended + // + } + // Note that we did not check for an invalid low surrogate here, or that fact that the + // lo surrogate was missing. We just picked out one 16 bit character unless the character + // was a valid hi surrogate, in whcih case we consumed two 16 bit characters. + // + } + } + else + { + // We need to go backwards from our input point + // + while (la++ < 0 && (pANTLR3_UINT8)nextChar > (pANTLR3_UINT8)input->data ) + { + // Get the previous 16 bit character + // + ch = *--nextChar; + + // If we found a low surrogate then go back one more character if + // the hi surrogate is there + // + if (ch >= UNI_SUR_LOW_START && ch <= UNI_SUR_LOW_END) + { + ch2 = *(nextChar-1); + if (ch2 >= UNI_SUR_HIGH_START && ch2 <= UNI_SUR_HIGH_END) + { + // Yes, there is a high surrogate to match it so decrement one more and point to that + // + nextChar--; + } + } + } + } + + // Our local copy of nextChar is now pointing to either the correct character or end of file + // + // Input buffer size is always in bytes + // + if ( (pANTLR3_UINT8)nextChar >= (((pANTLR3_UINT8)input->data) + input->sizeBuf)) + { + return ANTLR3_CHARSTREAM_EOF; + } + else + { + // Pick up the next 16 character (native machine byte order) + // + ch = *nextChar++; + + // If we have a surrogate pair then we need to consume + // a following valid LO surrogate. + // + if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_HIGH_END) + { + // If the 16 bits following the high surrogate are in the source buffer... + // + if ((pANTLR3_UINT8)(nextChar) < (((pANTLR3_UINT8)input->data) + input->sizeBuf)) + { + // Next character is in natural machine byte order + // + ch2 = *nextChar; + + // If it's a valid low surrogate, consume it + // + if (ch2 >= UNI_SUR_LOW_START && ch2 <= UNI_SUR_LOW_END) + { + // Construct the UTF32 code point + // + ch = ((ch - UNI_SUR_HIGH_START) << halfShift) + + (ch2 - UNI_SUR_LOW_START) + halfBase; + } + // Note that we ignore a valid hi surrogate that has no lo surrogate to go with + // it. + // + } + // Note that we ignore a valid hi surrogate that has no lo surrogate to go with + // it because the buffer ended + // + } + } + return ch; +} + + +/// \brief Calculate the current index in the output stream. +/// \param[in] input Input stream context pointer +/// +static ANTLR3_MARKER +antlr3UTF16Index(pANTLR3_INT_STREAM is) +{ + pANTLR3_INPUT_STREAM input; + + input = ((pANTLR3_INPUT_STREAM) (is->super)); + + return (ANTLR3_MARKER)(input->nextChar); +} + +/// \brief Rewind the lexer input to the state specified by the supplied mark. +/// +/// \param[in] input Input stream context pointer +/// +/// \remark +/// Assumes UTF16 input stream. +/// +static void +antlr3UTF16Seek (pANTLR3_INT_STREAM is, ANTLR3_MARKER seekPoint) +{ + pANTLR3_INPUT_STREAM input; + + input = ((pANTLR3_INPUT_STREAM) is->super); + + // If the requested seek point is less than the current + // input point, then we assume that we are resetting from a mark + // and do not need to scan, but can just set to there as rewind will + // reset line numbers and so on. + // + if (seekPoint <= (ANTLR3_MARKER)(input->nextChar)) + { + input->nextChar = (void *)seekPoint; + } + else + { + // Call consume until we reach the asked for seek point or EOF + // + while (is->_LA(is, 1) != ANTLR3_CHARSTREAM_EOF && seekPoint < (ANTLR3_MARKER)input->nextChar) + { + is->consume(is); + } + } +} +/// \brief Return a substring of the UTF16 input stream in +/// newly allocated memory. +/// +/// \param input Input stream context pointer +/// \param start Offset in input stream where the string starts +/// \param stop Offset in the input stream where the string ends. +/// +static pANTLR3_STRING +antlr3UTF16Substr (pANTLR3_INPUT_STREAM input, ANTLR3_MARKER start, ANTLR3_MARKER stop) +{ + return input->strFactory->newPtr(input->strFactory, (pANTLR3_UINT8)start, ((ANTLR3_UINT32_CAST(stop - start))/2) + 1); +} + +/// \brief Consume the next character in a UTF16 input stream when the input is Little Endian and the machine is not +/// Note that the UTF16 routines do not do any substantial verification of the input stream as for performance +/// sake, we assume it is validly encoded. So if a low surrogate is found at the curent input position then we +/// just consume it. Surrogate pairs should be seen as Hi, Lo. So if we have a Lo first, then the input stream +/// is fubar but we just ignore that. +/// +/// \param input Input stream context pointer +/// +static void +antlr3UTF16ConsumeLE(pANTLR3_INT_STREAM is) +{ + pANTLR3_INPUT_STREAM input; + UTF32 ch; + UTF32 ch2; + + input = ((pANTLR3_INPUT_STREAM) (is->super)); + + // Buffer size is always in bytes + // + if ((pANTLR3_UINT8)(input->nextChar) < (((pANTLR3_UINT8)input->data) + input->sizeBuf)) + { + // Indicate one more character in this line + // + input->charPositionInLine++; + + if ((ANTLR3_UCHAR)(*((pANTLR3_UINT16)input->nextChar)) == input->newlineChar) + { + // Reset for start of a new line of input + // + input->line++; + input->charPositionInLine = 0; + input->currentLine = (void *)(((pANTLR3_UINT16)input->nextChar) + 1); + } + + // Increment to next character position, accounting for any surrogates + // + // Next char in litle endian form + // + ch = *((pANTLR3_UINT8)input->nextChar) + (*((pANTLR3_UINT8)input->nextChar + 1) <<8); + + // We consumed one 16 bit character + // + input->nextChar = (void *)(((pANTLR3_UINT16)input->nextChar) + 1); + + // If we have a surrogate pair then we need to consume + // a following valid LO surrogate. + // + if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_HIGH_END) { + + // If the 16 bits following the high surrogate are in the source buffer... + // + if ((pANTLR3_UINT8)(input->nextChar) < (((pANTLR3_UINT8)input->data) + input->sizeBuf)) + { + ch2 = *((pANTLR3_UINT8)input->nextChar) + (*((pANTLR3_UINT8)input->nextChar + 1) <<8); + + // If it's a valid low surrogate, consume it + // + if (ch2 >= UNI_SUR_LOW_START && ch2 <= UNI_SUR_LOW_END) + { + // We consumed one 16 bit character + // + input->nextChar = (void *)(((pANTLR3_UINT16)input->nextChar) + 1); + } + // Note that we ignore a valid hi surrogate that has no lo surrogate to go with + // it. + // + } + // Note that we ignore a valid hi surrogate that has no lo surrogate to go with + // it because the buffer ended + // + } + // Note that we did not check for an invalid low surrogate here, or that fact that the + // lo surrogate was missing. We just picked out one 16 bit character unless the character + // was a valid hi surrogate, in whcih case we consumed two 16 bit characters. + // + } +} + +/// \brief Return the input element assuming a UTF16 input when the input is Little Endian and the machine is not +/// +/// \param[in] input Input stream context pointer +/// \param[in] la 1 based offset of next input stream element +/// +/// \return Next input character in internal ANTLR3 encoding (UTF32) +/// +static ANTLR3_UCHAR +antlr3UTF16LALE(pANTLR3_INT_STREAM is, ANTLR3_INT32 la) +{ + pANTLR3_INPUT_STREAM input; + UTF32 ch; + UTF32 ch2; + pANTLR3_UCHAR nextChar; + + // Find the input interface and where we are currently pointing to + // in the input stream + // + input = ((pANTLR3_INPUT_STREAM) (is->super)); + nextChar = input->nextChar; + + // If a positive offset then advance forward, else retreat + // + if (la >= 0) + { + while (--la > 0 && (pANTLR3_UINT8)nextChar < ((pANTLR3_UINT8)input->data) + input->sizeBuf ) + { + // Advance our copy of the input pointer + // + // Next char in Little Endian byte order + // + ch = (*nextChar) + (*(nextChar+1) << 8); + nextChar += 2; + + // If we have a surrogate pair then we need to consume + // a following valid LO surrogate. + // + if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_HIGH_END) + { + // If the 16 bits following the high surrogate are in the source buffer... + // + if ((pANTLR3_UINT8)(nextChar) < (((pANTLR3_UINT8)input->data) + input->sizeBuf)) + { + // Next character is in little endian byte order + // + ch2 = (*nextChar) + (*(nextChar+1) << 8); + + // If it's a valid low surrogate, consume it + // + if (ch2 >= UNI_SUR_LOW_START && ch2 <= UNI_SUR_LOW_END) + { + // We consumed one 16 bit character + // + nextChar += 2; + } + // Note that we ignore a valid hi surrogate that has no lo surrogate to go with + // it. + // + } + // Note that we ignore a valid hi surrogate that has no lo surrogate to go with + // it because the buffer ended + // + } + // Note that we did not check for an invalid low surrogate here, or that fact that the + // lo surrogate was missing. We just picked out one 16 bit character unless the character + // was a valid hi surrogate, in whcih case we consumed two 16 bit characters. + // + } + } + else + { + // We need to go backwards from our input point + // + while (la++ < 0 && (pANTLR3_UINT8)nextChar > (pANTLR3_UINT8)input->data ) + { + // Get the previous 16 bit character + // + ch = (*nextChar - 2) + ((*nextChar -1) << 8); + nextChar -= 2; + + // If we found a low surrogate then go back one more character if + // the hi surrogate is there + // + if (ch >= UNI_SUR_LOW_START && ch <= UNI_SUR_LOW_END) + { + ch2 = (*nextChar - 2) + ((*nextChar -1) << 8); + if (ch2 >= UNI_SUR_HIGH_START && ch2 <= UNI_SUR_HIGH_END) + { + // Yes, there is a high surrogate to match it so decrement one more and point to that + // + nextChar -=2; + } + } + } + } + + // Our local copy of nextChar is now pointing to either the correct character or end of file + // + // Input buffer size is always in bytes + // + if ( (pANTLR3_UINT8)nextChar >= (((pANTLR3_UINT8)input->data) + input->sizeBuf)) + { + return ANTLR3_CHARSTREAM_EOF; + } + else + { + // Pick up the next 16 character (little endian byte order) + // + ch = (*nextChar) + (*(nextChar+1) << 8); + nextChar += 2; + + // If we have a surrogate pair then we need to consume + // a following valid LO surrogate. + // + if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_HIGH_END) + { + // If the 16 bits following the high surrogate are in the source buffer... + // + if ((pANTLR3_UINT8)(nextChar) < (((pANTLR3_UINT8)input->data) + input->sizeBuf)) + { + // Next character is in little endian byte order + // + ch2 = (*nextChar) + (*(nextChar+1) << 8); + + // If it's a valid low surrogate, consume it + // + if (ch2 >= UNI_SUR_LOW_START && ch2 <= UNI_SUR_LOW_END) + { + // Construct the UTF32 code point + // + ch = ((ch - UNI_SUR_HIGH_START) << halfShift) + + (ch2 - UNI_SUR_LOW_START) + halfBase; + } + // Note that we ignore a valid hi surrogate that has no lo surrogate to go with + // it. + // + } + // Note that we ignore a valid hi surrogate that has no lo surrogate to go with + // it because the buffer ended + // + } + } + return ch; +} + +/// \brief Consume the next character in a UTF16 input stream when the input is Big Endian and the machine is not +/// +/// \param input Input stream context pointer +/// +static void +antlr3UTF16ConsumeBE(pANTLR3_INT_STREAM is) +{ + pANTLR3_INPUT_STREAM input; + UTF32 ch; + UTF32 ch2; + + input = ((pANTLR3_INPUT_STREAM) (is->super)); + + // Buffer size is always in bytes + // + if ((pANTLR3_UINT8)(input->nextChar) < (((pANTLR3_UINT8)input->data) + input->sizeBuf)) + { + // Indicate one more character in this line + // + input->charPositionInLine++; + + if ((ANTLR3_UCHAR)(*((pANTLR3_UINT16)input->nextChar)) == input->newlineChar) + { + // Reset for start of a new line of input + // + input->line++; + input->charPositionInLine = 0; + input->currentLine = (void *)(((pANTLR3_UINT16)input->nextChar) + 1); + } + + // Increment to next character position, accounting for any surrogates + // + // Next char in big endian form + // + ch = *((pANTLR3_UINT8)input->nextChar + 1) + (*((pANTLR3_UINT8)input->nextChar ) <<8); + + // We consumed one 16 bit character + // + input->nextChar = (void *)(((pANTLR3_UINT16)input->nextChar) + 1); + + // If we have a surrogate pair then we need to consume + // a following valid LO surrogate. + // + if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_HIGH_END) { + + // If the 16 bits following the high surrogate are in the source buffer... + // + if ((pANTLR3_UINT8)(input->nextChar) < (((pANTLR3_UINT8)input->data) + input->sizeBuf)) + { + // Big endian + // + ch2 = *((pANTLR3_UINT8)input->nextChar + 1) + (*((pANTLR3_UINT8)input->nextChar ) <<8); + + // If it's a valid low surrogate, consume it + // + if (ch2 >= UNI_SUR_LOW_START && ch2 <= UNI_SUR_LOW_END) + { + // We consumed one 16 bit character + // + input->nextChar = (void *)(((pANTLR3_UINT16)input->nextChar) + 1); + } + // Note that we ignore a valid hi surrogate that has no lo surrogate to go with + // it. + // + } + // Note that we ignore a valid hi surrogate that has no lo surrogate to go with + // it because the buffer ended + // + } + // Note that we did not check for an invalid low surrogate here, or that fact that the + // lo surrogate was missing. We just picked out one 16 bit character unless the character + // was a valid hi surrogate, in whcih case we consumed two 16 bit characters. + // + } +} + +/// \brief Return the input element assuming a UTF16 input when the input is Little Endian and the machine is not +/// +/// \param[in] input Input stream context pointer +/// \param[in] la 1 based offset of next input stream element +/// +/// \return Next input character in internal ANTLR3 encoding (UTF32) +/// +static ANTLR3_UCHAR +antlr3UTF16LABE(pANTLR3_INT_STREAM is, ANTLR3_INT32 la) +{ + pANTLR3_INPUT_STREAM input; + UTF32 ch; + UTF32 ch2; + pANTLR3_UCHAR nextChar; + + // Find the input interface and where we are currently pointing to + // in the input stream + // + input = ((pANTLR3_INPUT_STREAM) (is->super)); + nextChar = input->nextChar; + + // If a positive offset then advance forward, else retreat + // + if (la >= 0) + { + while (--la > 0 && (pANTLR3_UINT8)nextChar < ((pANTLR3_UINT8)input->data) + input->sizeBuf ) + { + // Advance our copy of the input pointer + // + // Next char in Big Endian byte order + // + ch = ((*nextChar) << 8) + *(nextChar+1); + nextChar += 2; + + // If we have a surrogate pair then we need to consume + // a following valid LO surrogate. + // + if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_HIGH_END) + { + // If the 16 bits following the high surrogate are in the source buffer... + // + if ((pANTLR3_UINT8)(nextChar) < (((pANTLR3_UINT8)input->data) + input->sizeBuf)) + { + // Next character is in big endian byte order + // + ch2 = ((*nextChar) << 8) + *(nextChar+1); + + // If it's a valid low surrogate, consume it + // + if (ch2 >= UNI_SUR_LOW_START && ch2 <= UNI_SUR_LOW_END) + { + // We consumed one 16 bit character + // + nextChar += 2; + } + // Note that we ignore a valid hi surrogate that has no lo surrogate to go with + // it. + // + } + // Note that we ignore a valid hi surrogate that has no lo surrogate to go with + // it because the buffer ended + // + } + // Note that we did not check for an invalid low surrogate here, or that fact that the + // lo surrogate was missing. We just picked out one 16 bit character unless the character + // was a valid hi surrogate, in whcih case we consumed two 16 bit characters. + // + } + } + else + { + // We need to go backwards from our input point + // + while (la++ < 0 && (pANTLR3_UINT8)nextChar > (pANTLR3_UINT8)input->data ) + { + // Get the previous 16 bit character + // + ch = ((*nextChar - 2) << 8) + (*nextChar -1); + nextChar -= 2; + + // If we found a low surrogate then go back one more character if + // the hi surrogate is there + // + if (ch >= UNI_SUR_LOW_START && ch <= UNI_SUR_LOW_END) + { + ch2 = ((*nextChar - 2) << 8) + (*nextChar -1); + if (ch2 >= UNI_SUR_HIGH_START && ch2 <= UNI_SUR_HIGH_END) + { + // Yes, there is a high surrogate to match it so decrement one more and point to that + // + nextChar -=2; + } + } + } + } + + // Our local copy of nextChar is now pointing to either the correct character or end of file + // + // Input buffer size is always in bytes + // + if ( (pANTLR3_UINT8)nextChar >= (((pANTLR3_UINT8)input->data) + input->sizeBuf)) + { + return ANTLR3_CHARSTREAM_EOF; + } + else + { + // Pick up the next 16 character (big endian byte order) + // + ch = ((*nextChar) << 8) + *(nextChar+1); + nextChar += 2; + + // If we have a surrogate pair then we need to consume + // a following valid LO surrogate. + // + if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_HIGH_END) + { + // If the 16 bits following the high surrogate are in the source buffer... + // + if ((pANTLR3_UINT8)(nextChar) < (((pANTLR3_UINT8)input->data) + input->sizeBuf)) + { + // Next character is in big endian byte order + // + ch2 = ((*nextChar) << 8) + *(nextChar+1); + + // If it's a valid low surrogate, consume it + // + if (ch2 >= UNI_SUR_LOW_START && ch2 <= UNI_SUR_LOW_END) + { + // Construct the UTF32 code point + // + ch = ((ch - UNI_SUR_HIGH_START) << halfShift) + + (ch2 - UNI_SUR_LOW_START) + halfBase; + } + // Note that we ignore a valid hi surrogate that has no lo surrogate to go with + // it. + // + } + // Note that we ignore a valid hi surrogate that has no lo surrogate to go with + // it because the buffer ended + // + } + } + return ch; +} + +/// \brief Common function to setup function interface for a UTF3 input stream. +/// +/// \param input Input stream context pointer +/// +void +antlr3UTF32SetupStream (pANTLR3_INPUT_STREAM input, ANTLR3_BOOLEAN machineBigEndian, ANTLR3_BOOLEAN inputBigEndian) +{ + // Build a string factory for this stream. This is a UTF32 string factory which is a standard + // part of the ANTLR3 string. The string factory is then passed through the whole chain of lexer->parser->tree->treeparser + // and so on. + // + input->strFactory = antlr3StringFactoryNew(input->encoding); + + // Generic API that does not care about endianess. + // + input->istream->index = antlr3UTF32Index; // Calculate current index in input stream, UTF16 based + input->substr = antlr3UTF32Substr; // Return a string from the input stream + input->istream->seek = antlr3UTF32Seek; // How to seek to a specific point in the stream + input->istream->consume = antlr3UTF32Consume; // Consume the next UTF32 character in the buffer + + // We must install different UTF32 LA routines according to whether the input + // is the same endianess as the machine we are executing upon or not. If it is not + // then we must install methods that can convert the endianess on the fly as they go + // + switch (machineBigEndian) + { + case ANTLR3_TRUE: + + // Machine is Big Endian, if the input is also then install the + // methods that do not access input by bytes and reverse them. + // Otherwise install endian aware methods. + // + if (inputBigEndian == ANTLR3_TRUE) + { + // Input is machine compatible + // + input->istream->_LA = antlr3UTF32LA; // Return the UTF32 character at offset n (1 based) + } + else + { + // Need to use methods that know that the input is little endian + // + input->istream->_LA = antlr3UTF32LALE; // Return the UTF32 character at offset n (1 based) + } + break; + + case ANTLR3_FALSE: + + // Machine is Little Endian, if the input is also then install the + // methods that do not access input by bytes and reverse them. + // Otherwise install endian aware methods. + // + if (inputBigEndian == ANTLR3_FALSE) + { + // Input is machine compatible + // + input->istream->_LA = antlr3UTF32LA; // Return the UTF32 character at offset n (1 based) + } + else + { + // Need to use methods that know that the input is Big Endian + // + input->istream->_LA = antlr3UTF32LABE; // Return the UTF32 character at offset n (1 based) + } + break; + } + + input->charByteSize = 4; // Size in bytes of characters in this stream. +} + +/** \brief Consume the next character in a UTF32 input stream + * + * \param input Input stream context pointer + */ +static void +antlr3UTF32Consume(pANTLR3_INT_STREAM is) +{ + pANTLR3_INPUT_STREAM input; + + input = ((pANTLR3_INPUT_STREAM) (is->super)); + + // SizeBuf is always in bytes + // + if ((pANTLR3_UINT8)(input->nextChar) < (((pANTLR3_UINT8)input->data) + input->sizeBuf)) + { + /* Indicate one more character in this line + */ + input->charPositionInLine++; + + if ((ANTLR3_UCHAR)(*((pANTLR3_UINT32)input->nextChar)) == input->newlineChar) + { + /* Reset for start of a new line of input + */ + input->line++; + input->charPositionInLine = 0; + input->currentLine = (void *)(((pANTLR3_UINT32)input->nextChar) + 1); + } + + /* Increment to next character position + */ + input->nextChar = (void *)(((pANTLR3_UINT32)input->nextChar) + 1); + } +} + +/// \brief Calculate the current index in the output stream. +/// \param[in] input Input stream context pointer +/// +static ANTLR3_MARKER +antlr3UTF32Index(pANTLR3_INT_STREAM is) +{ + pANTLR3_INPUT_STREAM input; + + input = ((pANTLR3_INPUT_STREAM) (is->super)); + + return (ANTLR3_MARKER)(input->nextChar); +} + +/// \brief Return a substring of the UTF16 input stream in +/// newly allocated memory. +/// +/// \param input Input stream context pointer +/// \param start Offset in input stream where the string starts +/// \param stop Offset in the input stream where the string ends. +/// +static pANTLR3_STRING +antlr3UTF32Substr (pANTLR3_INPUT_STREAM input, ANTLR3_MARKER start, ANTLR3_MARKER stop) +{ + return input->strFactory->newPtr(input->strFactory, (pANTLR3_UINT8)start, ((ANTLR3_UINT32_CAST(stop - start))/4) + 1); +} + +/// \brief Rewind the lexer input to the state specified by the supplied mark. +/// +/// \param[in] input Input stream context pointer +/// +/// \remark +/// Assumes UTF32 input stream. +/// +static void +antlr3UTF32Seek (pANTLR3_INT_STREAM is, ANTLR3_MARKER seekPoint) +{ + pANTLR3_INPUT_STREAM input; + + input = ((pANTLR3_INPUT_STREAM) is->super); + + // If the requested seek point is less than the current + // input point, then we assume that we are resetting from a mark + // and do not need to scan, but can just set to there as rewind will + // reset line numbers and so on. + // + if (seekPoint <= (ANTLR3_MARKER)(input->nextChar)) + { + input->nextChar = (void *)seekPoint; + } + else + { + // Call consume until we reach the asked for seek point or EOF + // + while (is->_LA(is, 1) != ANTLR3_CHARSTREAM_EOF && seekPoint < (ANTLR3_MARKER)input->nextChar) + { + is->consume(is); + } + } +} + +/** \brief Return the input element assuming a UTF32 input in natural machine byte order + * + * \param[in] input Input stream context pointer + * \param[in] la 1 based offset of next input stream element + * + * \return Next input character in internal ANTLR3 encoding (UTF32) + */ +static ANTLR3_UCHAR +antlr3UTF32LA(pANTLR3_INT_STREAM is, ANTLR3_INT32 la) +{ + pANTLR3_INPUT_STREAM input; + + input = ((pANTLR3_INPUT_STREAM) (is->super)); + + if (( ((pANTLR3_UINT8)input->nextChar) + la - 1) >= (((pANTLR3_UINT8)input->data) + input->sizeBuf)) + { + return ANTLR3_CHARSTREAM_EOF; + } + else + { + return (ANTLR3_UCHAR)(*((pANTLR3_UINT32)input->nextChar + la - 1)); + } +} + +/** \brief Return the input element assuming a UTF32 input in little endian byte order + * + * \param[in] input Input stream context pointer + * \param[in] la 1 based offset of next input stream element + * + * \return Next input character in internal ANTLR3 encoding (UTF32) + */ +static ANTLR3_UCHAR +antlr3UTF32LALE(pANTLR3_INT_STREAM is, ANTLR3_INT32 la) +{ + pANTLR3_INPUT_STREAM input; + + input = ((pANTLR3_INPUT_STREAM) (is->super)); + + if (( ((pANTLR3_UINT8)input->nextChar) + la - 1) >= (((pANTLR3_UINT8)input->data) + input->sizeBuf)) + { + return ANTLR3_CHARSTREAM_EOF; + } + else + { + ANTLR3_UCHAR c; + + c = (ANTLR3_UCHAR)(*((pANTLR3_UINT32)input->nextChar + la - 1)); + + // Swap Endianess to Big Endian + // + return (c>>24) | ((c<<8) & 0x00FF0000) | ((c>>8) & 0x0000FF00) | (c<<24); + } +} + +/** \brief Return the input element assuming a UTF32 input in big endian byte order + * + * \param[in] input Input stream context pointer + * \param[in] la 1 based offset of next input stream element + * + * \return Next input character in internal ANTLR3 encoding (UTF32) + * \remark This is the same code as LE version but seprated in case there are better optimisations fo rendinan swap + */ +static ANTLR3_UCHAR +antlr3UTF32LABE(pANTLR3_INT_STREAM is, ANTLR3_INT32 la) +{ + pANTLR3_INPUT_STREAM input; + + input = ((pANTLR3_INPUT_STREAM) (is->super)); + + if (( ((pANTLR3_UINT8)input->nextChar) + la - 1) >= (((pANTLR3_UINT8)input->data) + input->sizeBuf)) + { + return ANTLR3_CHARSTREAM_EOF; + } + else + { + ANTLR3_UCHAR c; + + c = (ANTLR3_UCHAR)(*((pANTLR3_UINT32)input->nextChar + la - 1)); + + // Swap Endianess to Little Endian + // + return (c>>24) | ((c<<8) & 0x00FF0000) | ((c>>8) & 0x0000FF00) | (c<<24); + } +} + + +/// \brief Common function to setup function interface for a UTF8 input stream. +/// +/// \param input Input stream context pointer +/// +void +antlr3UTF8SetupStream (pANTLR3_INPUT_STREAM input) +{ + // Build a string factory for this stream. This is a UTF16 string factory which is a standard + // part of the ANTLR3 string. The string factory is then passed through the whole chain of lexer->parser->tree->treeparser + // and so on. + // + input->strFactory = antlr3StringFactoryNew(input->encoding); + + // Generic API that does not care about endianess. + // + input->istream->consume = antlr3UTF8Consume; // Consume the next UTF32 character in the buffer + input->istream->_LA = antlr3UTF8LA; // Return the UTF32 character at offset n (1 based) + input->charByteSize = 0; // Size in bytes of characters in this stream. +} + +// ------------------------------------------------------ +// Following is from Unicode.org (see antlr3convertutf.c) +// + +/// Index into the table below with the first byte of a UTF-8 sequence to +/// get the number of trailing bytes that are supposed to follow it. +/// Note that *legal* UTF-8 values can't have 4 or 5-bytes. The table is +/// left as-is for anyone who may want to do such conversion, which was +/// allowed in earlier algorithms. +/// +static const ANTLR3_UINT32 trailingBytesForUTF8[256] = { + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, + 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, + 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, 3,3,3,3,3,3,3,3,4,4,4,4,5,5,5,5 +}; + +/// Magic values subtracted from a buffer value during UTF8 conversion. +/// This table contains as many values as there might be trailing bytes +/// in a UTF-8 sequence. +/// +static const UTF32 offsetsFromUTF8[6] = + { 0x00000000UL, 0x00003080UL, 0x000E2080UL, + 0x03C82080UL, 0xFA082080UL, 0x82082080UL + }; + +// End of Unicode.org tables +// ------------------------- + + +/** \brief Consume the next character in a UTF8 input stream + * + * \param input Input stream context pointer + */ +static void +antlr3UTF8Consume(pANTLR3_INT_STREAM is) +{ + pANTLR3_INPUT_STREAM input; + ANTLR3_UINT32 extraBytesToRead; + ANTLR3_UCHAR ch; + pANTLR3_UINT8 nextChar; + + input = ((pANTLR3_INPUT_STREAM) (is->super)); + + nextChar = input->nextChar; + + if (nextChar < (((pANTLR3_UINT8)input->data) + input->sizeBuf)) + { + // Indicate one more character in this line + // + input->charPositionInLine++; + + // Are there more bytes needed to make up the whole thing? + // + extraBytesToRead = trailingBytesForUTF8[*nextChar]; + + if (nextChar + extraBytesToRead >= (((pANTLR3_UINT8)input->data) + input->sizeBuf)) + { + input->nextChar = (((pANTLR3_UINT8)input->data) + input->sizeBuf); + return; + } + + // Cases deliberately fall through (see note A in antlrconvertutf.c) + // Legal UTF8 is only 4 bytes but 6 bytes could be used in old UTF8 so + // we allow it. + // + ch = 0; + switch (extraBytesToRead) { + case 5: ch += *nextChar++; ch <<= 6; + case 4: ch += *nextChar++; ch <<= 6; + case 3: ch += *nextChar++; ch <<= 6; + case 2: ch += *nextChar++; ch <<= 6; + case 1: ch += *nextChar++; ch <<= 6; + case 0: ch += *nextChar++; + } + + // Magically correct the input value + // + ch -= offsetsFromUTF8[extraBytesToRead]; + if (ch == input->newlineChar) + { + /* Reset for start of a new line of input + */ + input->line++; + input->charPositionInLine = 0; + input->currentLine = (void *)nextChar; + } + + // Update input pointer + // + input->nextChar = nextChar; + } +} +/** \brief Return the input element assuming a UTF8 input + * + * \param[in] input Input stream context pointer + * \param[in] la 1 based offset of next input stream element + * + * \return Next input character in internal ANTLR3 encoding (UTF32) + */ +static ANTLR3_UCHAR +antlr3UTF8LA(pANTLR3_INT_STREAM is, ANTLR3_INT32 la) +{ + pANTLR3_INPUT_STREAM input; + ANTLR3_UINT32 extraBytesToRead; + ANTLR3_UCHAR ch; + pANTLR3_UINT8 nextChar; + + input = ((pANTLR3_INPUT_STREAM) (is->super)); + + nextChar = input->nextChar; + + // Do we need to traverse forwards or backwards? + // - LA(0) is treated as LA(1) and we assume that the nextChar is + // already positioned. + // - LA(n+) ; n>1 means we must traverse forward n-1 characters catering for UTF8 encoding + // - LA(-n) means we must traverse backwards n chracters + // + if (la > 1) { + + // Make sure that we have at least one character left before trying to + // loop through the buffer. + // + if (nextChar < (((pANTLR3_UINT8)input->data) + input->sizeBuf)) + { + // Now traverse n-1 characters forward + // + while (--la > 0) + { + // Does the next character require trailing bytes? + // If so advance the pointer by that many bytes as well as advancing + // one position for what will be at least a single byte character. + // + nextChar += trailingBytesForUTF8[*nextChar] + 1; + + // Does that calculation take us past the byte length of the buffer? + // + if (nextChar >= (((pANTLR3_UINT8)input->data) + input->sizeBuf)) + { + return ANTLR3_CHARSTREAM_EOF; + } + } + } + else + { + return ANTLR3_CHARSTREAM_EOF; + } + } + else + { + // LA is negative so we decrease the pointer by n character positions + // + while (nextChar > (pANTLR3_UINT8)input->data && la++ < 0) + { + // Traversing backwards in UTF8 means decermenting by one + // then continuing to decrement while ever a character pattern + // is flagged as being a trailing byte of an encoded code point. + // Trailing UTF8 bytes always start with 10 in binary. We assumne that + // the UTF8 is well formed and do not check boundary conditions + // + nextChar--; + while ((*nextChar & 0xC0) == 0x80) + { + nextChar--; + } + } + } + + // nextChar is now pointing at the UTF8 encoded character that we need to + // decode and return. + // + // Are there more bytes needed to make up the whole thing? + // + extraBytesToRead = trailingBytesForUTF8[*nextChar]; + if (nextChar + extraBytesToRead >= (((pANTLR3_UINT8)input->data) + input->sizeBuf)) + { + return ANTLR3_CHARSTREAM_EOF; + } + + // Cases deliberately fall through (see note A in antlrconvertutf.c) + // + ch = 0; + switch (extraBytesToRead) { + case 5: ch += *nextChar++; ch <<= 6; + case 4: ch += *nextChar++; ch <<= 6; + case 3: ch += *nextChar++; ch <<= 6; + case 2: ch += *nextChar++; ch <<= 6; + case 1: ch += *nextChar++; ch <<= 6; + case 0: ch += *nextChar++; + } + + // Magically correct the input value + // + ch -= offsetsFromUTF8[extraBytesToRead]; + + return ch; +} + +// EBCDIC to ASCII conversion table +// +// This for EBCDIC EDF04 translated to ISO-8859.1 which is the usually accepted POSIX +// translation and the character tables are published all over the interweb. +// +const ANTLR3_UCHAR e2a[256] = +{ + 0x00, 0x01, 0x02, 0x03, 0x85, 0x09, 0x86, 0x7f, + 0x87, 0x8d, 0x8e, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, + 0x10, 0x11, 0x12, 0x13, 0x8f, 0x0a, 0x08, 0x97, + 0x18, 0x19, 0x9c, 0x9d, 0x1c, 0x1d, 0x1e, 0x1f, + 0x80, 0x81, 0x82, 0x83, 0x84, 0x92, 0x17, 0x1b, + 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x05, 0x06, 0x07, + 0x90, 0x91, 0x16, 0x93, 0x94, 0x95, 0x96, 0x04, + 0x98, 0x99, 0x9a, 0x9b, 0x14, 0x15, 0x9e, 0x1a, + 0x20, 0xa0, 0xe2, 0xe4, 0xe0, 0xe1, 0xe3, 0xe5, + 0xe7, 0xf1, 0x60, 0x2e, 0x3c, 0x28, 0x2b, 0x7c, + 0x26, 0xe9, 0xea, 0xeb, 0xe8, 0xed, 0xee, 0xef, + 0xec, 0xdf, 0x21, 0x24, 0x2a, 0x29, 0x3b, 0x9f, + 0x2d, 0x2f, 0xc2, 0xc4, 0xc0, 0xc1, 0xc3, 0xc5, + 0xc7, 0xd1, 0x5e, 0x2c, 0x25, 0x5f, 0x3e, 0x3f, + 0xf8, 0xc9, 0xca, 0xcb, 0xc8, 0xcd, 0xce, 0xcf, + 0xcc, 0xa8, 0x3a, 0x23, 0x40, 0x27, 0x3d, 0x22, + 0xd8, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, + 0x68, 0x69, 0xab, 0xbb, 0xf0, 0xfd, 0xfe, 0xb1, + 0xb0, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, + 0x71, 0x72, 0xaa, 0xba, 0xe6, 0xb8, 0xc6, 0xa4, + 0xb5, 0xaf, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, + 0x79, 0x7a, 0xa1, 0xbf, 0xd0, 0xdd, 0xde, 0xae, + 0xa2, 0xa3, 0xa5, 0xb7, 0xa9, 0xa7, 0xb6, 0xbc, + 0xbd, 0xbe, 0xac, 0x5b, 0x5c, 0x5d, 0xb4, 0xd7, + 0xf9, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, + 0x48, 0x49, 0xad, 0xf4, 0xf6, 0xf2, 0xf3, 0xf5, + 0xa6, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50, + 0x51, 0x52, 0xb9, 0xfb, 0xfc, 0xdb, 0xfa, 0xff, + 0xd9, 0xf7, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, + 0x59, 0x5a, 0xb2, 0xd4, 0xd6, 0xd2, 0xd3, 0xd5, + 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, + 0x38, 0x39, 0xb3, 0x7b, 0xdc, 0x7d, 0xda, 0x7e +}; + +/// \brief Common function to setup function interface for a EBCDIC input stream. +/// +/// \param input Input stream context pointer +/// +void +antlr3EBCDICSetupStream (pANTLR3_INPUT_STREAM input) +{ + // EBCDIC streams can use the standard 8 bit string factory + // + input->strFactory = antlr3StringFactoryNew(input->encoding); + + // Generic API that does not care about endianess. + // + input->istream->_LA = antlr3EBCDICLA; // Return the UTF32 character at offset n (1 based) + input->charByteSize = 1; // Size in bytes of characters in this stream. +} + +/// \brief Return the input element assuming an 8 bit EBCDIC input +/// +/// \param[in] input Input stream context pointer +/// \param[in] la 1 based offset of next input stream element +/// +/// \return Next input character in internal ANTLR3 encoding (UTF32) after translation +/// from EBCDIC to ASCII +/// +static ANTLR3_UCHAR +antlr3EBCDICLA(pANTLR3_INT_STREAM is, ANTLR3_INT32 la) +{ + pANTLR3_INPUT_STREAM input; + + input = ((pANTLR3_INPUT_STREAM) (is->super)); + + if (( ((pANTLR3_UINT8)input->nextChar) + la - 1) >= (((pANTLR3_UINT8)input->data) + input->sizeBuf)) + { + return ANTLR3_CHARSTREAM_EOF; + } + else + { + // Translate the required character via the constant conversion table + // + return e2a[(*((pANTLR3_UINT8)input->nextChar + la - 1))]; + } +} \ No newline at end of file diff --git a/antlr/libantlr3c-3.4/src/antlr3intstream.c b/antlr/libantlr3c-3.4/src/antlr3intstream.c new file mode 100644 index 0000000..b9d49d8 --- /dev/null +++ b/antlr/libantlr3c-3.4/src/antlr3intstream.c @@ -0,0 +1,66 @@ +/// \file +/// Implementation of superclass elements of an ANTLR3 int stream. +/// The only methods required are an allocator and a destructor. +/// \addtogroup pANTLR3_INT_STREAM +/// @{ + +// [The "BSD licence"] +// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC +// http://www.temporal-wave.com +// http://www.linkedin.com/in/jimidle +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. The name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include + +static void freeStream (pANTLR3_INT_STREAM stream); + +ANTLR3_API pANTLR3_INT_STREAM +antlr3IntStreamNew() +{ + pANTLR3_INT_STREAM stream; + + // Allocate memory + // + stream = (pANTLR3_INT_STREAM) ANTLR3_CALLOC(1, sizeof(ANTLR3_INT_STREAM)); + + if (stream == NULL) + { + return NULL; + } + + stream->free = freeStream; + + return stream; +} + +static void +freeStream (pANTLR3_INT_STREAM stream) +{ + ANTLR3_FREE(stream); +} + +/// @} +/// diff --git a/antlr/libantlr3c-3.4/src/antlr3lexer.c b/antlr/libantlr3c-3.4/src/antlr3lexer.c new file mode 100644 index 0000000..d981ab7 --- /dev/null +++ b/antlr/libantlr3c-3.4/src/antlr3lexer.c @@ -0,0 +1,904 @@ +/** \file + * + * Base implementation of an antlr 3 lexer. + * + * An ANTLR3 lexer implements a base recongizer, a token source and + * a lexer interface. It constructs a base recognizer with default + * functions, then overrides any of these that are parser specific (usual + * default implementation of base recognizer. + */ + +// [The "BSD licence"] +// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC +// http://www.temporal-wave.com +// http://www.linkedin.com/in/jimidle +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. The name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include + +static void mTokens (pANTLR3_LEXER lexer); +static void setCharStream (pANTLR3_LEXER lexer, pANTLR3_INPUT_STREAM input); +static void pushCharStream (pANTLR3_LEXER lexer, pANTLR3_INPUT_STREAM input); +static void popCharStream (pANTLR3_LEXER lexer); + +static void emitNew (pANTLR3_LEXER lexer, pANTLR3_COMMON_TOKEN token); +static pANTLR3_COMMON_TOKEN emit (pANTLR3_LEXER lexer); +static ANTLR3_BOOLEAN matchs (pANTLR3_LEXER lexer, ANTLR3_UCHAR * string); +static ANTLR3_BOOLEAN matchc (pANTLR3_LEXER lexer, ANTLR3_UCHAR c); +static ANTLR3_BOOLEAN matchRange (pANTLR3_LEXER lexer, ANTLR3_UCHAR low, ANTLR3_UCHAR high); +static void matchAny (pANTLR3_LEXER lexer); +static void recover (pANTLR3_LEXER lexer); +static ANTLR3_UINT32 getLine (pANTLR3_LEXER lexer); +static ANTLR3_MARKER getCharIndex (pANTLR3_LEXER lexer); +static ANTLR3_UINT32 getCharPositionInLine (pANTLR3_LEXER lexer); +static pANTLR3_STRING getText (pANTLR3_LEXER lexer); +static pANTLR3_COMMON_TOKEN nextToken (pANTLR3_TOKEN_SOURCE toksource); + +static void displayRecognitionError (pANTLR3_BASE_RECOGNIZER rec, pANTLR3_UINT8 * tokenNames); +static void reportError (pANTLR3_BASE_RECOGNIZER rec); +static void * getCurrentInputSymbol (pANTLR3_BASE_RECOGNIZER recognizer, pANTLR3_INT_STREAM istream); +static void * getMissingSymbol (pANTLR3_BASE_RECOGNIZER recognizer, pANTLR3_INT_STREAM istream, pANTLR3_EXCEPTION e, + ANTLR3_UINT32 expectedTokenType, pANTLR3_BITSET_LIST follow); + +static void reset (pANTLR3_BASE_RECOGNIZER rec); + +static void freeLexer (pANTLR3_LEXER lexer); + + +ANTLR3_API pANTLR3_LEXER +antlr3LexerNew(ANTLR3_UINT32 sizeHint, pANTLR3_RECOGNIZER_SHARED_STATE state) +{ + pANTLR3_LEXER lexer; + pANTLR3_COMMON_TOKEN specialT; + + /* Allocate memory + */ + lexer = (pANTLR3_LEXER) ANTLR3_MALLOC(sizeof(ANTLR3_LEXER)); + + if (lexer == NULL) + { + return NULL; + } + + /* Now we need to create the base recognizer + */ + lexer->rec = antlr3BaseRecognizerNew(ANTLR3_TYPE_LEXER, sizeHint, state); + + if (lexer->rec == NULL) + { + lexer->free(lexer); + return NULL; + } + lexer->rec->super = lexer; + + lexer->rec->displayRecognitionError = displayRecognitionError; + lexer->rec->reportError = reportError; + lexer->rec->reset = reset; + lexer->rec->getCurrentInputSymbol = getCurrentInputSymbol; + lexer->rec->getMissingSymbol = getMissingSymbol; + + /* Now install the token source interface + */ + if (lexer->rec->state->tokSource == NULL) + { + lexer->rec->state->tokSource = (pANTLR3_TOKEN_SOURCE)ANTLR3_CALLOC(1, sizeof(ANTLR3_TOKEN_SOURCE)); + + if (lexer->rec->state->tokSource == NULL) + { + lexer->rec->free(lexer->rec); + lexer->free(lexer); + + return NULL; + } + lexer->rec->state->tokSource->super = lexer; + + /* Install the default nextToken() method, which may be overridden + * by generated code, or by anything else in fact. + */ + lexer->rec->state->tokSource->nextToken = nextToken; + lexer->rec->state->tokSource->strFactory = NULL; + + lexer->rec->state->tokFactory = NULL; + } + + /* Install the lexer API + */ + lexer->setCharStream = setCharStream; + lexer->mTokens = (void (*)(void *))(mTokens); + lexer->setCharStream = setCharStream; + lexer->pushCharStream = pushCharStream; + lexer->popCharStream = popCharStream; + lexer->emit = emit; + lexer->emitNew = emitNew; + lexer->matchs = matchs; + lexer->matchc = matchc; + lexer->matchRange = matchRange; + lexer->matchAny = matchAny; + lexer->recover = recover; + lexer->getLine = getLine; + lexer->getCharIndex = getCharIndex; + lexer->getCharPositionInLine = getCharPositionInLine; + lexer->getText = getText; + lexer->free = freeLexer; + + /* Initialise the eof token + */ + specialT = &(lexer->rec->state->tokSource->eofToken); + antlr3SetTokenAPI (specialT); + specialT->setType (specialT, ANTLR3_TOKEN_EOF); + specialT->factoryMade = ANTLR3_TRUE; // Prevent things trying to free() it + specialT->strFactory = NULL; + specialT->textState = ANTLR3_TEXT_NONE; + specialT->custom = NULL; + specialT->user1 = 0; + specialT->user2 = 0; + specialT->user3 = 0; + + // Initialize the skip token. + // + specialT = &(lexer->rec->state->tokSource->skipToken); + antlr3SetTokenAPI (specialT); + specialT->setType (specialT, ANTLR3_TOKEN_INVALID); + specialT->factoryMade = ANTLR3_TRUE; // Prevent things trying to free() it + specialT->strFactory = NULL; + specialT->custom = NULL; + specialT->user1 = 0; + specialT->user2 = 0; + specialT->user3 = 0; + return lexer; +} + +static void +reset (pANTLR3_BASE_RECOGNIZER rec) +{ + pANTLR3_LEXER lexer; + + lexer = rec->super; + + lexer->rec->state->token = NULL; + lexer->rec->state->type = ANTLR3_TOKEN_INVALID; + lexer->rec->state->channel = ANTLR3_TOKEN_DEFAULT_CHANNEL; + lexer->rec->state->tokenStartCharIndex = -1; + lexer->rec->state->tokenStartCharPositionInLine = -1; + lexer->rec->state->tokenStartLine = -1; + + lexer->rec->state->text = NULL; + + // OK - that's all hunky dory, but we may well have had + // a token factory that needs a reset. Do that here + // + if (lexer->rec->state->tokFactory != NULL) + { + lexer->rec->state->tokFactory->reset(lexer->rec->state->tokFactory); + } +} + +/// +/// \brief +/// Returns the next available token from the current input stream. +/// +/// \param toksource +/// Points to the implementation of a token source. The lexer is +/// addressed by the super structure pointer. +/// +/// \returns +/// The next token in the current input stream or the EOF token +/// if there are no more tokens. +/// +/// \remarks +/// Write remarks for nextToken here. +/// +/// \see nextToken +/// +ANTLR3_INLINE static pANTLR3_COMMON_TOKEN +nextTokenStr (pANTLR3_TOKEN_SOURCE toksource) +{ + pANTLR3_LEXER lexer; + pANTLR3_RECOGNIZER_SHARED_STATE state; + pANTLR3_INPUT_STREAM input; + pANTLR3_INT_STREAM istream; + + lexer = (pANTLR3_LEXER)(toksource->super); + state = lexer->rec->state; + input = lexer->input; + istream = input->istream; + + /// Loop until we get a non skipped token or EOF + /// + for (;;) + { + // Get rid of any previous token (token factory takes care of + // any de-allocation when this token is finally used up. + // + state->token = NULL; + state->error = ANTLR3_FALSE; // Start out without an exception + state->failed = ANTLR3_FALSE; + + // Now call the matching rules and see if we can generate a new token + // + for (;;) + { + // Record the start of the token in our input stream. + // + state->channel = ANTLR3_TOKEN_DEFAULT_CHANNEL; + state->tokenStartCharIndex = (ANTLR3_MARKER)(((pANTLR3_UINT8)input->nextChar)); + state->tokenStartCharPositionInLine = input->charPositionInLine; + state->tokenStartLine = input->line; + state->text = NULL; + state->custom = NULL; + state->user1 = 0; + state->user2 = 0; + state->user3 = 0; + + if (istream->_LA(istream, 1) == ANTLR3_CHARSTREAM_EOF) + { + // Reached the end of the current stream, nothing more to do if this is + // the last in the stack. + // + pANTLR3_COMMON_TOKEN teof = &(toksource->eofToken); + + teof->setStartIndex (teof, lexer->getCharIndex(lexer)); + teof->setStopIndex (teof, lexer->getCharIndex(lexer)); + teof->setLine (teof, lexer->getLine(lexer)); + teof->factoryMade = ANTLR3_TRUE; // This isn't really manufactured but it stops things from trying to free it + return teof; + } + + state->token = NULL; + state->error = ANTLR3_FALSE; // Start out without an exception + state->failed = ANTLR3_FALSE; + + // Call the generated lexer, see if it can get a new token together. + // + lexer->mTokens(lexer->ctx); + + if (state->error == ANTLR3_TRUE) + { + // Recognition exception, report it and try to recover. + // + state->failed = ANTLR3_TRUE; + lexer->rec->reportError(lexer->rec); + lexer->recover(lexer); + } + else + { + if (state->token == NULL) + { + // Emit the real token, which adds it in to the token stream basically + // + emit(lexer); + } + else if (state->token == &(toksource->skipToken)) + { + // A real token could have been generated, but "Computer say's naaaaah" and it + // it is just something we need to skip altogether. + // + continue; + } + + // Good token, not skipped, not EOF token + // + return state->token; + } + } + } +} + +/** + * \brief + * Default implementation of the nextToken() call for a lexer. + * + * \param toksource + * Points to the implementation of a token source. The lexer is + * addressed by the super structure pointer. + * + * \returns + * The next token in the current input stream or the EOF token + * if there are no more tokens in any input stream in the stack. + * + * Write detailed description for nextToken here. + * + * \remarks + * Write remarks for nextToken here. + * + * \see nextTokenStr + */ +static pANTLR3_COMMON_TOKEN +nextToken (pANTLR3_TOKEN_SOURCE toksource) +{ + pANTLR3_COMMON_TOKEN tok; + + // Find the next token in the current stream + // + tok = nextTokenStr(toksource); + + // If we got to the EOF token then switch to the previous + // input stream if there were any and just return the + // EOF if there are none. We must check the next token + // in any outstanding input stream we pop into the active + // role to see if it was sitting at EOF after PUSHing the + // stream we just consumed, otherwise we will return EOF + // on the reinstalled input stream, when in actual fact + // there might be more input streams to POP before the + // real EOF of the whole logical inptu stream. Hence we + // use a while loop here until we find somethign in the stream + // that isn't EOF or we reach the actual end of the last input + // stream on the stack. + // + while (tok->type == ANTLR3_TOKEN_EOF) + { + pANTLR3_LEXER lexer; + + lexer = (pANTLR3_LEXER)(toksource->super); + + if (lexer->rec->state->streams != NULL && lexer->rec->state->streams->size(lexer->rec->state->streams) > 0) + { + // We have another input stream in the stack so we + // need to revert to it, then resume the loop to check + // it wasn't sitting at EOF itself. + // + lexer->popCharStream(lexer); + tok = nextTokenStr(toksource); + } + else + { + // There were no more streams on the input stack + // so this EOF is the 'real' logical EOF for + // the input stream. So we just exit the loop and + // return the EOF we have found. + // + break; + } + + } + + // return whatever token we have, which may be EOF + // + return tok; +} + +ANTLR3_API pANTLR3_LEXER +antlr3LexerNewStream(ANTLR3_UINT32 sizeHint, pANTLR3_INPUT_STREAM input, pANTLR3_RECOGNIZER_SHARED_STATE state) +{ + pANTLR3_LEXER lexer; + + // Create a basic lexer first + // + lexer = antlr3LexerNew(sizeHint, state); + + if (lexer != NULL) + { + // Install the input stream and reset the lexer + // + setCharStream(lexer, input); + } + + return lexer; +} + +static void mTokens (pANTLR3_LEXER lexer) +{ + if (lexer) // Fool compiler, avoid pragmas + { + ANTLR3_FPRINTF(stderr, "lexer->mTokens(): Error: No lexer rules were added to the lexer yet!\n"); + } +} + +static void +reportError (pANTLR3_BASE_RECOGNIZER rec) +{ + // Indicate this recognizer had an error while processing. + // + rec->state->errorCount++; + + rec->displayRecognitionError(rec, rec->state->tokenNames); +} + +#ifdef ANTLR3_WINDOWS +#pragma warning( disable : 4100 ) +#endif + +/** Default lexer error handler (works for 8 bit streams only!!!) + */ +static void +displayRecognitionError (pANTLR3_BASE_RECOGNIZER recognizer, pANTLR3_UINT8 * tokenNames) +{ + pANTLR3_LEXER lexer; + pANTLR3_EXCEPTION ex; + pANTLR3_STRING ftext; + + lexer = (pANTLR3_LEXER)(recognizer->super); + ex = lexer->rec->state->exception; + + // See if there is a 'filename' we can use + // + if (ex->name == NULL) + { + ANTLR3_FPRINTF(stderr, "-unknown source-("); + } + else + { + ftext = ex->streamName->to8(ex->streamName); + ANTLR3_FPRINTF(stderr, "%s(", ftext->chars); + } + + ANTLR3_FPRINTF(stderr, "%d) ", recognizer->state->exception->line); + ANTLR3_FPRINTF(stderr, ": lexer error %d :\n\t%s at offset %d, ", + ex->type, + (pANTLR3_UINT8) (ex->message), + ex->charPositionInLine+1 + ); + { + ANTLR3_INT32 width; + + width = ANTLR3_UINT32_CAST(( (pANTLR3_UINT8)(lexer->input->data) + (lexer->input->size(lexer->input) )) - (pANTLR3_UINT8)(ex->index)); + + if (width >= 1) + { + if (isprint(ex->c)) + { + ANTLR3_FPRINTF(stderr, "near '%c' :\n", ex->c); + } + else + { + ANTLR3_FPRINTF(stderr, "near char(%#02X) :\n", (ANTLR3_UINT8)(ex->c)); + } + ANTLR3_FPRINTF(stderr, "\t%.*s\n", width > 20 ? 20 : width ,((pANTLR3_UINT8)ex->index)); + } + else + { + ANTLR3_FPRINTF(stderr, "(end of input).\n\t This indicates a poorly specified lexer RULE\n\t or unterminated input element such as: \"STRING[\"]\n"); + ANTLR3_FPRINTF(stderr, "\t The lexer was matching from line %d, offset %d, which\n\t ", + (ANTLR3_UINT32)(lexer->rec->state->tokenStartLine), + (ANTLR3_UINT32)(lexer->rec->state->tokenStartCharPositionInLine) + ); + width = ANTLR3_UINT32_CAST(((pANTLR3_UINT8)(lexer->input->data)+(lexer->input->size(lexer->input))) - (pANTLR3_UINT8)(lexer->rec->state->tokenStartCharIndex)); + + if (width >= 1) + { + ANTLR3_FPRINTF(stderr, "looks like this:\n\t\t%.*s\n", width > 20 ? 20 : width ,(pANTLR3_UINT8)(lexer->rec->state->tokenStartCharIndex)); + } + else + { + ANTLR3_FPRINTF(stderr, "is also the end of the line, so you must check your lexer rules\n"); + } + } + } +} + +static void setCharStream (pANTLR3_LEXER lexer, pANTLR3_INPUT_STREAM input) +{ + /* Install the input interface + */ + lexer->input = input; + + /* We may need a token factory for the lexer; we don't destroy any existing factory + * until the lexer is destroyed, as people may still be using the tokens it produced. + * TODO: Later I will provide a dup() method for a token so that it can extract itself + * out of the factory. + */ + if (lexer->rec->state->tokFactory == NULL) + { + lexer->rec->state->tokFactory = antlr3TokenFactoryNew(input); + } + else + { + /* When the input stream is being changed on the fly, rather than + * at the start of a new lexer, then we must tell the tokenFactory + * which input stream to adorn the tokens with so that when they + * are asked to provide their original input strings they can + * do so from the correct text stream. + */ + lexer->rec->state->tokFactory->setInputStream(lexer->rec->state->tokFactory, input); + } + + /* Propagate the string factory so that we preserve the encoding form from + * the input stream. + */ + if (lexer->rec->state->tokSource->strFactory == NULL) + { + lexer->rec->state->tokSource->strFactory = input->strFactory; + + // Set the newly acquired string factory up for our pre-made tokens + // for EOF. + // + if (lexer->rec->state->tokSource->eofToken.strFactory == NULL) + { + lexer->rec->state->tokSource->eofToken.strFactory = input->strFactory; + } + } + + /* This is a lexer, install the appropriate exception creator + */ + lexer->rec->exConstruct = antlr3RecognitionExceptionNew; + + /* Set the current token to nothing + */ + lexer->rec->state->token = NULL; + lexer->rec->state->text = NULL; + lexer->rec->state->tokenStartCharIndex = -1; + + /* Copy the name of the char stream to the token source + */ + lexer->rec->state->tokSource->fileName = input->fileName; +} + +/*! + * \brief + * Change to a new input stream, remembering the old one. + * + * \param lexer + * Pointer to the lexer instance to switch input streams for. + * + * \param input + * New input stream to install as the current one. + * + * Switches the current character input stream to + * a new one, saving the old one, which we will revert to at the end of this + * new one. + */ +static void +pushCharStream (pANTLR3_LEXER lexer, pANTLR3_INPUT_STREAM input) +{ + // Do we need a new input stream stack? + // + if (lexer->rec->state->streams == NULL) + { + // This is the first call to stack a new + // stream and so we must create the stack first. + // + lexer->rec->state->streams = antlr3StackNew(0); + + if (lexer->rec->state->streams == NULL) + { + // Could not do this, we just fail to push it. + // TODO: Consider if this is what we want to do, but then + // any programmer can override this method to do something else. + return; + } + } + + // We have a stack, so we can save the current input stream + // into it. + // + lexer->input->istream->mark(lexer->input->istream); + lexer->rec->state->streams->push(lexer->rec->state->streams, lexer->input, NULL); + + // And now we can install this new one + // + lexer->setCharStream(lexer, input); +} + +/*! + * \brief + * Stops using the current input stream and reverts to any prior + * input stream on the stack. + * + * \param lexer + * Description of parameter lexer. + * + * Pointer to a function that abandons the current input stream, whether it + * is empty or not and reverts to the previous stacked input stream. + * + * \remark + * The function fails silently if there are no prior input streams. + */ +static void +popCharStream (pANTLR3_LEXER lexer) +{ + pANTLR3_INPUT_STREAM input; + + // If we do not have a stream stack or we are already at the + // stack bottom, then do nothing. + // + if (lexer->rec->state->streams != NULL && lexer->rec->state->streams->size(lexer->rec->state->streams) > 0) + { + // We just leave the current stream to its fate, we do not close + // it or anything as we do not know what the programmer intended + // for it. This method can always be overridden of course. + // So just find out what was currently saved on the stack and use + // that now, then pop it from the stack. + // + input = (pANTLR3_INPUT_STREAM)(lexer->rec->state->streams->top); + lexer->rec->state->streams->pop(lexer->rec->state->streams); + + // Now install the stream as the current one. + // + lexer->setCharStream(lexer, input); + lexer->input->istream->rewindLast(lexer->input->istream); + } + return; +} + +static void emitNew (pANTLR3_LEXER lexer, pANTLR3_COMMON_TOKEN token) +{ + lexer->rec->state->token = token; /* Voila! */ +} + +static pANTLR3_COMMON_TOKEN +emit (pANTLR3_LEXER lexer) +{ + pANTLR3_COMMON_TOKEN token; + + /* We could check pointers to token factories and so on, but + * we are in code that we want to run as fast as possible + * so we are not checking any errors. So make sure you have installed an input stream before + * trying to emit a new token. + */ + token = lexer->rec->state->tokFactory->newToken(lexer->rec->state->tokFactory); + + /* Install the supplied information, and some other bits we already know + * get added automatically, such as the input stream it is associated with + * (though it can all be overridden of course) + */ + token->type = lexer->rec->state->type; + token->channel = lexer->rec->state->channel; + token->start = lexer->rec->state->tokenStartCharIndex; + token->stop = lexer->getCharIndex(lexer) - 1; + token->line = lexer->rec->state->tokenStartLine; + token->charPosition = lexer->rec->state->tokenStartCharPositionInLine; + + if (lexer->rec->state->text != NULL) + { + token->textState = ANTLR3_TEXT_STRING; + token->tokText.text = lexer->rec->state->text; + } + else + { + token->textState = ANTLR3_TEXT_NONE; + } + token->lineStart = lexer->input->currentLine; + token->user1 = lexer->rec->state->user1; + token->user2 = lexer->rec->state->user2; + token->user3 = lexer->rec->state->user3; + token->custom = lexer->rec->state->custom; + + lexer->rec->state->token = token; + + return token; +} + +/** + * Free the resources allocated by a lexer + */ +static void +freeLexer (pANTLR3_LEXER lexer) +{ + // This may have ben a delegate or delegator lexer, in which case the + // state may already have been freed (and set to NULL therefore) + // so we ignore the state if we don't have it. + // + if (lexer->rec->state != NULL) + { + if (lexer->rec->state->streams != NULL) + { + lexer->rec->state->streams->free(lexer->rec->state->streams); + } + if (lexer->rec->state->tokFactory != NULL) + { + lexer->rec->state->tokFactory->close(lexer->rec->state->tokFactory); + lexer->rec->state->tokFactory = NULL; + } + if (lexer->rec->state->tokSource != NULL) + { + ANTLR3_FREE(lexer->rec->state->tokSource); + lexer->rec->state->tokSource = NULL; + } + } + if (lexer->rec != NULL) + { + lexer->rec->free(lexer->rec); + lexer->rec = NULL; + } + ANTLR3_FREE(lexer); +} + +/** Implementation of matchs for the lexer, overrides any + * base implementation in the base recognizer. + * + * \remark + * Note that the generated code lays down arrays of ints for constant + * strings so that they are int UTF32 form! + */ +static ANTLR3_BOOLEAN +matchs(pANTLR3_LEXER lexer, ANTLR3_UCHAR * string) +{ + while (*string != ANTLR3_STRING_TERMINATOR) + { + if (lexer->input->istream->_LA(lexer->input->istream, 1) != (*string)) + { + if (lexer->rec->state->backtracking > 0) + { + lexer->rec->state->failed = ANTLR3_TRUE; + return ANTLR3_FALSE; + } + + lexer->rec->exConstruct(lexer->rec); + lexer->rec->state->failed = ANTLR3_TRUE; + + /* TODO: Implement exception creation more fully perhaps + */ + lexer->recover(lexer); + return ANTLR3_FALSE; + } + + /* Matched correctly, do consume it + */ + lexer->input->istream->consume(lexer->input->istream); + string++; + + /* Reset any failed indicator + */ + lexer->rec->state->failed = ANTLR3_FALSE; + } + + + return ANTLR3_TRUE; +} + +/** Implementation of matchc for the lexer, overrides any + * base implementation in the base recognizer. + * + * \remark + * Note that the generated code lays down arrays of ints for constant + * strings so that they are int UTF32 form! + */ +static ANTLR3_BOOLEAN +matchc(pANTLR3_LEXER lexer, ANTLR3_UCHAR c) +{ + if (lexer->input->istream->_LA(lexer->input->istream, 1) == c) + { + /* Matched correctly, do consume it + */ + lexer->input->istream->consume(lexer->input->istream); + + /* Reset any failed indicator + */ + lexer->rec->state->failed = ANTLR3_FALSE; + + return ANTLR3_TRUE; + } + + /* Failed to match, exception and recovery time. + */ + if (lexer->rec->state->backtracking > 0) + { + lexer->rec->state->failed = ANTLR3_TRUE; + return ANTLR3_FALSE; + } + + lexer->rec->exConstruct(lexer->rec); + + /* TODO: Implement exception creation more fully perhaps + */ + lexer->recover(lexer); + + return ANTLR3_FALSE; +} + +/** Implementation of match range for the lexer, overrides any + * base implementation in the base recognizer. + * + * \remark + * Note that the generated code lays down arrays of ints for constant + * strings so that they are int UTF32 form! + */ +static ANTLR3_BOOLEAN +matchRange(pANTLR3_LEXER lexer, ANTLR3_UCHAR low, ANTLR3_UCHAR high) +{ + ANTLR3_UCHAR c; + + /* What is in the stream at the moment? + */ + c = lexer->input->istream->_LA(lexer->input->istream, 1); + if ( c >= low && c <= high) + { + /* Matched correctly, consume it + */ + lexer->input->istream->consume(lexer->input->istream); + + /* Reset any failed indicator + */ + lexer->rec->state->failed = ANTLR3_FALSE; + + return ANTLR3_TRUE; + } + + /* Failed to match, execption and recovery time. + */ + + if (lexer->rec->state->backtracking > 0) + { + lexer->rec->state->failed = ANTLR3_TRUE; + return ANTLR3_FALSE; + } + + lexer->rec->exConstruct(lexer->rec); + + /* TODO: Implement exception creation more fully + */ + lexer->recover(lexer); + + return ANTLR3_FALSE; +} + +static void +matchAny (pANTLR3_LEXER lexer) +{ + lexer->input->istream->consume(lexer->input->istream); +} + +static void +recover (pANTLR3_LEXER lexer) +{ + lexer->input->istream->consume(lexer->input->istream); +} + +static ANTLR3_UINT32 +getLine (pANTLR3_LEXER lexer) +{ + return lexer->input->getLine(lexer->input); +} + +static ANTLR3_UINT32 +getCharPositionInLine (pANTLR3_LEXER lexer) +{ + return lexer->input->charPositionInLine; +} + +static ANTLR3_MARKER getCharIndex (pANTLR3_LEXER lexer) +{ + return lexer->input->istream->index(lexer->input->istream); +} + +static pANTLR3_STRING +getText (pANTLR3_LEXER lexer) +{ + if (lexer->rec->state->text) + { + return lexer->rec->state->text; + + } + return lexer->input->substr( + lexer->input, + lexer->rec->state->tokenStartCharIndex, + lexer->getCharIndex(lexer) - lexer->input->charByteSize + ); + +} + +static void * +getCurrentInputSymbol (pANTLR3_BASE_RECOGNIZER recognizer, pANTLR3_INT_STREAM istream) +{ + return NULL; +} + +static void * +getMissingSymbol (pANTLR3_BASE_RECOGNIZER recognizer, pANTLR3_INT_STREAM istream, pANTLR3_EXCEPTION e, + ANTLR3_UINT32 expectedTokenType, pANTLR3_BITSET_LIST follow) +{ + return NULL; +} diff --git a/antlr/libantlr3c-3.4/src/antlr3parser.c b/antlr/libantlr3c-3.4/src/antlr3parser.c new file mode 100644 index 0000000..2b7e0e3 --- /dev/null +++ b/antlr/libantlr3c-3.4/src/antlr3parser.c @@ -0,0 +1,193 @@ +/** \file + * Implementation of the base functionality for an ANTLR3 parser. + */ + +// [The "BSD licence"] +// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC +// http://www.temporal-wave.com +// http://www.linkedin.com/in/jimidle +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. The name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include + +/* Parser API + */ +static void setDebugListener (pANTLR3_PARSER parser, pANTLR3_DEBUG_EVENT_LISTENER dbg); +static void setTokenStream (pANTLR3_PARSER parser, pANTLR3_TOKEN_STREAM); +static pANTLR3_TOKEN_STREAM getTokenStream (pANTLR3_PARSER parser); +static void freeParser (pANTLR3_PARSER parser); + +ANTLR3_API pANTLR3_PARSER +antlr3ParserNewStreamDbg (ANTLR3_UINT32 sizeHint, pANTLR3_TOKEN_STREAM tstream, pANTLR3_DEBUG_EVENT_LISTENER dbg, pANTLR3_RECOGNIZER_SHARED_STATE state) +{ + pANTLR3_PARSER parser; + + parser = antlr3ParserNewStream(sizeHint, tstream, state); + + if (parser == NULL) + { + return NULL; + } + + parser->setDebugListener(parser, dbg); + + return parser; +} + +ANTLR3_API pANTLR3_PARSER +antlr3ParserNew (ANTLR3_UINT32 sizeHint, pANTLR3_RECOGNIZER_SHARED_STATE state) +{ + pANTLR3_PARSER parser; + + /* Allocate memory + */ + parser = (pANTLR3_PARSER) ANTLR3_MALLOC(sizeof(ANTLR3_PARSER)); + + if (parser == NULL) + { + return NULL; + } + + /* Install a base parser + */ + parser->rec = antlr3BaseRecognizerNew(ANTLR3_TYPE_PARSER, sizeHint, state); + + if (parser->rec == NULL) + { + parser->free(parser); + return NULL; + } + + parser->rec->super = parser; + + /* Parser overrides + */ + parser->rec->exConstruct = antlr3MTExceptionNew; + + /* Install the API + */ + parser->setDebugListener = setDebugListener; + parser->setTokenStream = setTokenStream; + parser->getTokenStream = getTokenStream; + + parser->free = freeParser; + + return parser; +} + +ANTLR3_API pANTLR3_PARSER +antlr3ParserNewStream (ANTLR3_UINT32 sizeHint, pANTLR3_TOKEN_STREAM tstream, pANTLR3_RECOGNIZER_SHARED_STATE state) +{ + pANTLR3_PARSER parser; + + parser = antlr3ParserNew(sizeHint, state); + + if (parser == NULL) + { + return NULL; + } + + /* Everything seems to be hunky dory so we can install the + * token stream. + */ + parser->setTokenStream(parser, tstream); + + return parser; +} + +static void +freeParser (pANTLR3_PARSER parser) +{ + if (parser->rec != NULL) + { + // This may have ben a delegate or delegator parser, in which case the + // state may already have been freed (and set to NULL therefore) + // so we ignore the state if we don't have it. + // + if (parser->rec->state != NULL) + { + if (parser->rec->state->following != NULL) + { + parser->rec->state->following->free(parser->rec->state->following); + parser->rec->state->following = NULL; + } + } + parser->rec->free(parser->rec); + parser->rec = NULL; + + } + ANTLR3_FREE(parser); +} + +static void +setDebugListener (pANTLR3_PARSER parser, pANTLR3_DEBUG_EVENT_LISTENER dbg) +{ + // Set the debug listener. There are no methods to override + // because currently the only ones that notify the debugger + // are error reporting and recovery. Hence we can afford to + // check and see if the debugger interface is null or not + // there. If there is ever an occasion for a performance + // sensitive function to use the debugger interface, then + // a replacement function for debug mode should be supplied + // and installed here. + // + parser->rec->debugger = dbg; + + // If there was a tokenstream installed already + // then we need to tell it about the debug interface + // + if (parser->tstream != NULL) + { + parser->tstream->setDebugListener(parser->tstream, dbg); + } +} + +static void +setTokenStream (pANTLR3_PARSER parser, pANTLR3_TOKEN_STREAM tstream) +{ + parser->tstream = tstream; + parser->rec->reset(parser->rec); +} + +static pANTLR3_TOKEN_STREAM +getTokenStream (pANTLR3_PARSER parser) +{ + return parser->tstream; +} + + + + + + + + + + + + + + diff --git a/antlr/libantlr3c-3.4/src/antlr3rewritestreams.c b/antlr/libantlr3c-3.4/src/antlr3rewritestreams.c new file mode 100644 index 0000000..9afb6e1 --- /dev/null +++ b/antlr/libantlr3c-3.4/src/antlr3rewritestreams.c @@ -0,0 +1,844 @@ +/// \file +/// Implementation of token/tree streams that are used by the +/// tree re-write rules to manipulate the tokens and trees produced +/// by rules that are subject to rewrite directives. +/// + +// [The "BSD licence"] +// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC +// http://www.temporal-wave.com +// http://www.linkedin.com/in/jimidle +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. The name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include + +// Static support function forward declarations for the stream types. +// +static void reset (pANTLR3_REWRITE_RULE_ELEMENT_STREAM stream); +static void add (pANTLR3_REWRITE_RULE_ELEMENT_STREAM stream, void * el, void (ANTLR3_CDECL *freePtr)(void *)); +static void * next (pANTLR3_REWRITE_RULE_ELEMENT_STREAM stream); +static pANTLR3_BASE_TREE nextTree (pANTLR3_REWRITE_RULE_ELEMENT_STREAM stream); +static void * nextToken (pANTLR3_REWRITE_RULE_ELEMENT_STREAM stream); +static void * _next (pANTLR3_REWRITE_RULE_ELEMENT_STREAM stream); +static void * dupTok (pANTLR3_REWRITE_RULE_ELEMENT_STREAM stream, void * el); +static void * dupTree (pANTLR3_REWRITE_RULE_ELEMENT_STREAM stream, void * el); +static void * dupTreeNode (pANTLR3_REWRITE_RULE_ELEMENT_STREAM stream, void * el); +static pANTLR3_BASE_TREE toTree (pANTLR3_REWRITE_RULE_ELEMENT_STREAM stream, void * element); +static pANTLR3_BASE_TREE toTreeNode (pANTLR3_REWRITE_RULE_ELEMENT_STREAM stream, void * element); +static ANTLR3_BOOLEAN hasNext (pANTLR3_REWRITE_RULE_ELEMENT_STREAM stream); +static pANTLR3_BASE_TREE nextNode (pANTLR3_REWRITE_RULE_ELEMENT_STREAM stream); +static pANTLR3_BASE_TREE nextNodeNode (pANTLR3_REWRITE_RULE_ELEMENT_STREAM stream); +static pANTLR3_BASE_TREE nextNodeToken (pANTLR3_REWRITE_RULE_ELEMENT_STREAM stream); +static ANTLR3_UINT32 size (pANTLR3_REWRITE_RULE_ELEMENT_STREAM stream); +static void * getDescription (pANTLR3_REWRITE_RULE_ELEMENT_STREAM stream); +static void freeRS (pANTLR3_REWRITE_RULE_ELEMENT_STREAM stream); +static void expungeRS (pANTLR3_REWRITE_RULE_ELEMENT_STREAM stream); + + +// Place a now unused rewrite stream back on the rewrite stream pool +// so we can reuse it if we need to. +// +static void +freeRS (pANTLR3_REWRITE_RULE_ELEMENT_STREAM stream) +{ + // Before placing the stream back in the pool, we + // need to clear any vector it has. This is so any + // free pointers that are associated with the + // entires are called. + // + if (stream->elements != NULL) + { + // Factory generated vectors can be returned to the + // vector factory for later reuse. + // + if (stream->elements->factoryMade == ANTLR3_TRUE) + { + pANTLR3_VECTOR_FACTORY factory = ((pANTLR3_COMMON_TREE_ADAPTOR)(stream->adaptor->super))->arboretum->vFactory; + factory->returnVector(factory, stream->elements); + + stream->elements = NULL; + } + else + { + // Other vectors we clear and allow to be reused if they come off the + // rewrite stream free stack and are reused. + // + stream->elements->clear(stream->elements); + stream->freeElements = ANTLR3_TRUE; + } + } + else + { + stream->freeElements = ANTLR3_FALSE; // Just in case + } + + // Add the stream into the recognizer stream stack vector + // adding the stream memory free routine so that + // it is thrown away when the stack vector is destroyed + // + stream->rec->state->rStreams->add(stream->rec->state->rStreams, stream, (void(*)(void *))expungeRS); +} + +/** Do special nilNode reuse detection for node streams. + */ +static void +freeNodeRS(pANTLR3_REWRITE_RULE_ELEMENT_STREAM stream) +{ + pANTLR3_BASE_TREE tree; + + // Before placing the stream back in the pool, we + // need to clear any vector it has. This is so any + // free pointers that are associated with the + // entires are called. However, if this particular function is called + // then we know that the entries in the stream are definately + // tree nodes. Hence we check to see if any of them were nilNodes as + // if they were, we can reuse them. + // + if (stream->elements != NULL) + { + // We have some elements to traverse + // + ANTLR3_UINT32 i; + + for (i = 1; i<= stream->elements->count; i++) + { + tree = (pANTLR3_BASE_TREE)(stream->elements->elements[i-1].element); + if (tree != NULL && tree->isNilNode(tree)) + { + // Had to remove this for now, check is not comprehensive enough + // tree->reuse(tree); + } + + } + // Factory generated vectors can be returned to the + // vector factory for later reuse. + // + if (stream->elements->factoryMade == ANTLR3_TRUE) + { + pANTLR3_VECTOR_FACTORY factory = ((pANTLR3_COMMON_TREE_ADAPTOR)(stream->adaptor->super))->arboretum->vFactory; + factory->returnVector(factory, stream->elements); + + stream->elements = NULL; + } + else + { + stream->elements->clear(stream->elements); + stream->freeElements = ANTLR3_TRUE; + } + } + else + { + if (stream->singleElement != NULL) + { + tree = (pANTLR3_BASE_TREE)(stream->singleElement); + if (tree->isNilNode(tree)) + { + // Had to remove this for now, check is not comprehensive enough + // tree->reuse(tree); + } + } + stream->singleElement = NULL; + stream->freeElements = ANTLR3_FALSE; // Just in case + } + + // Add the stream into the recognizer stream stack vector + // adding the stream memory free routine so that + // it is thrown away when the stack vector is destroyed + // + stream->rec->state->rStreams->add(stream->rec->state->rStreams, stream, (void(*)(void *))expungeRS); +} +static void +expungeRS(pANTLR3_REWRITE_RULE_ELEMENT_STREAM stream) +{ + + if (stream->freeElements == ANTLR3_TRUE && stream->elements != NULL) + { + stream->elements->free(stream->elements); + } + ANTLR3_FREE(stream); +} + +// Functions for creating streams +// +static pANTLR3_REWRITE_RULE_ELEMENT_STREAM +antlr3RewriteRuleElementStreamNewAE(pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_RECOGNIZER rec, pANTLR3_UINT8 description) +{ + pANTLR3_REWRITE_RULE_ELEMENT_STREAM stream; + + // First - do we already have a rewrite stream that was returned + // to the pool? If we do, then we will just reuse it by resetting + // the generic interface. + // + if (rec->state->rStreams->count > 0) + { + // Remove the entry from the vector. We do not + // cause it to be freed by using remove. + // + stream = rec->state->rStreams->remove(rec->state->rStreams, rec->state->rStreams->count - 1); + + // We found a stream we can reuse. + // If the stream had a vector, then it will have been cleared + // when the freeRS was called that put it in this stack + // + } + else + { + // Ok, we need to allocate a new one as there were none on the stack. + // First job is to create the memory we need. + // + stream = (pANTLR3_REWRITE_RULE_ELEMENT_STREAM) ANTLR3_MALLOC((size_t)(sizeof(ANTLR3_REWRITE_RULE_ELEMENT_STREAM))); + + if (stream == NULL) + { + return NULL; + } + stream->elements = NULL; + stream->freeElements = ANTLR3_FALSE; + } + + // Populate the generic interface + // + stream->rec = rec; + stream->reset = reset; + stream->add = add; + stream->next = next; + stream->nextTree = nextTree; + stream->nextNode = nextNode; + stream->nextToken = nextToken; + stream->_next = _next; + stream->hasNext = hasNext; + stream->size = size; + stream->getDescription = getDescription; + stream->toTree = toTree; + stream->free = freeRS; + stream->singleElement = NULL; + + // Reset the stream to empty. + // + + stream->cursor = 0; + stream->dirty = ANTLR3_FALSE; + + // Install the description + // + stream->elementDescription = description; + + // Install the adaptor + // + stream->adaptor = adaptor; + + return stream; +} + +static pANTLR3_REWRITE_RULE_ELEMENT_STREAM +antlr3RewriteRuleElementStreamNewAEE(pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_RECOGNIZER rec, pANTLR3_UINT8 description, void * oneElement) +{ + pANTLR3_REWRITE_RULE_ELEMENT_STREAM stream; + + // First job is to create the memory we need. + // + stream = antlr3RewriteRuleElementStreamNewAE(adaptor, rec, description); + + if (stream == NULL) + { + return NULL; + } + + // Stream seems good so we need to add the supplied element + // + if (oneElement != NULL) + { + stream->add(stream, oneElement, NULL); + } + return stream; +} + +static pANTLR3_REWRITE_RULE_ELEMENT_STREAM +antlr3RewriteRuleElementStreamNewAEV(pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_RECOGNIZER rec, pANTLR3_UINT8 description, pANTLR3_VECTOR vector) +{ + pANTLR3_REWRITE_RULE_ELEMENT_STREAM stream; + + // First job is to create the memory we need. + // + stream = antlr3RewriteRuleElementStreamNewAE(adaptor, rec, description); + + if (stream == NULL) + { + return stream; + } + + // Stream seems good so we need to install the vector we were + // given. We assume that someone else is going to free the + // vector. + // + if (stream->elements != NULL && stream->elements->factoryMade == ANTLR3_FALSE && stream->freeElements == ANTLR3_TRUE ) + { + stream->elements->free(stream->elements); + } + stream->elements = vector; + stream->freeElements = ANTLR3_FALSE; + return stream; +} + +// Token rewrite stream ... +// +ANTLR3_API pANTLR3_REWRITE_RULE_TOKEN_STREAM +antlr3RewriteRuleTOKENStreamNewAE(pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_RECOGNIZER rec, pANTLR3_UINT8 description) +{ + pANTLR3_REWRITE_RULE_TOKEN_STREAM stream; + + // First job is to create the memory we need. + // + stream = antlr3RewriteRuleElementStreamNewAE(adaptor, rec, description); + + if (stream == NULL) + { + return stream; + } + + // Install the token based overrides + // + stream->dup = dupTok; + stream->nextNode = nextNodeToken; + + // No nextNode implementation for a token rewrite stream + // + return stream; +} + +ANTLR3_API pANTLR3_REWRITE_RULE_TOKEN_STREAM +antlr3RewriteRuleTOKENStreamNewAEE(pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_RECOGNIZER rec, pANTLR3_UINT8 description, void * oneElement) +{ + pANTLR3_REWRITE_RULE_TOKEN_STREAM stream; + + // First job is to create the memory we need. + // + stream = antlr3RewriteRuleElementStreamNewAEE(adaptor, rec, description, oneElement); + + // Install the token based overrides + // + stream->dup = dupTok; + stream->nextNode = nextNodeToken; + + // No nextNode implementation for a token rewrite stream + // + return stream; +} + +ANTLR3_API pANTLR3_REWRITE_RULE_TOKEN_STREAM +antlr3RewriteRuleTOKENStreamNewAEV(pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_RECOGNIZER rec, pANTLR3_UINT8 description, pANTLR3_VECTOR vector) +{ + pANTLR3_REWRITE_RULE_TOKEN_STREAM stream; + + // First job is to create the memory we need. + // + stream = antlr3RewriteRuleElementStreamNewAEV(adaptor, rec, description, vector); + + // Install the token based overrides + // + stream->dup = dupTok; + stream->nextNode = nextNodeToken; + + // No nextNode implementation for a token rewrite stream + // + return stream; +} + +// Subtree rewrite stream +// +ANTLR3_API pANTLR3_REWRITE_RULE_SUBTREE_STREAM +antlr3RewriteRuleSubtreeStreamNewAE(pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_RECOGNIZER rec, pANTLR3_UINT8 description) +{ + pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream; + + // First job is to create the memory we need. + // + stream = antlr3RewriteRuleElementStreamNewAE(adaptor, rec, description); + + if (stream == NULL) + { + return stream; + } + + // Install the subtree based overrides + // + stream->dup = dupTree; + stream->nextNode = nextNode; + stream->free = freeNodeRS; + return stream; + +} +ANTLR3_API pANTLR3_REWRITE_RULE_SUBTREE_STREAM +antlr3RewriteRuleSubtreeStreamNewAEE(pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_RECOGNIZER rec, pANTLR3_UINT8 description, void * oneElement) +{ + pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream; + + // First job is to create the memory we need. + // + stream = antlr3RewriteRuleElementStreamNewAEE(adaptor, rec, description, oneElement); + + if (stream == NULL) + { + return stream; + } + + // Install the subtree based overrides + // + stream->dup = dupTree; + stream->nextNode = nextNode; + stream->free = freeNodeRS; + + return stream; +} + +ANTLR3_API pANTLR3_REWRITE_RULE_SUBTREE_STREAM +antlr3RewriteRuleSubtreeStreamNewAEV(pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_RECOGNIZER rec, pANTLR3_UINT8 description, pANTLR3_VECTOR vector) +{ + pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream; + + // First job is to create the memory we need. + // + stream = antlr3RewriteRuleElementStreamNewAEV(adaptor, rec, description, vector); + + if (stream == NULL) + { + return NULL; + } + + // Install the subtree based overrides + // + stream->dup = dupTree; + stream->nextNode = nextNode; + stream->free = freeNodeRS; + + return stream; +} +// Node rewrite stream ... +// +ANTLR3_API pANTLR3_REWRITE_RULE_NODE_STREAM +antlr3RewriteRuleNODEStreamNewAE(pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_RECOGNIZER rec, pANTLR3_UINT8 description) +{ + pANTLR3_REWRITE_RULE_NODE_STREAM stream; + + // First job is to create the memory we need. + // + stream = antlr3RewriteRuleElementStreamNewAE(adaptor, rec, description); + + if (stream == NULL) + { + return stream; + } + + // Install the node based overrides + // + stream->dup = dupTreeNode; + stream->toTree = toTreeNode; + stream->nextNode = nextNodeNode; + stream->free = freeNodeRS; + + return stream; +} + +ANTLR3_API pANTLR3_REWRITE_RULE_NODE_STREAM +antlr3RewriteRuleNODEStreamNewAEE(pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_RECOGNIZER rec, pANTLR3_UINT8 description, void * oneElement) +{ + pANTLR3_REWRITE_RULE_NODE_STREAM stream; + + // First job is to create the memory we need. + // + stream = antlr3RewriteRuleElementStreamNewAEE(adaptor, rec, description, oneElement); + + // Install the node based overrides + // + stream->dup = dupTreeNode; + stream->toTree = toTreeNode; + stream->nextNode = nextNodeNode; + stream->free = freeNodeRS; + + return stream; +} + +ANTLR3_API pANTLR3_REWRITE_RULE_NODE_STREAM +antlr3RewriteRuleNODEStreamNewAEV(pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_RECOGNIZER rec, pANTLR3_UINT8 description, pANTLR3_VECTOR vector) +{ + pANTLR3_REWRITE_RULE_NODE_STREAM stream; + + // First job is to create the memory we need. + // + stream = antlr3RewriteRuleElementStreamNewAEV(adaptor, rec, description, vector); + + // Install the Node based overrides + // + stream->dup = dupTreeNode; + stream->toTree = toTreeNode; + stream->nextNode = nextNodeNode; + stream->free = freeNodeRS; + + return stream; +} + +//---------------------------------------------------------------------- +// Static support functions + +/// Reset the condition of this stream so that it appears we have +/// not consumed any of its elements. Elements themselves are untouched. +/// +static void +reset (pANTLR3_REWRITE_RULE_ELEMENT_STREAM stream) +{ + stream->dirty = ANTLR3_TRUE; + stream->cursor = 0; +} + +// Add a new pANTLR3_BASE_TREE to this stream +// +static void +add (pANTLR3_REWRITE_RULE_ELEMENT_STREAM stream, void * el, void (ANTLR3_CDECL *freePtr)(void *)) +{ + if (el== NULL) + { + return; + } + // As we may be reusing a stream, we may already have allocated + // a rewrite stream vector. If we have then is will be empty if + // we have either zero or just one element in the rewrite stream + // + if (stream->elements != NULL && stream->elements->count > 0) + { + // We already have >1 entries in the stream. So we can just add this new element to the existing + // collection. + // + stream->elements->add(stream->elements, el, freePtr); + return; + } + if (stream->singleElement == NULL) + { + stream->singleElement = el; + return; + } + + // If we got here then we had only the one element so far + // and we must now create a vector to hold a collection of them + // + if (stream->elements == NULL) + { + pANTLR3_VECTOR_FACTORY factory = ((pANTLR3_COMMON_TREE_ADAPTOR)(stream->adaptor->super))->arboretum->vFactory; + + + stream->elements = factory->newVector(factory); + stream->freeElements = ANTLR3_TRUE; // We 'ummed it, so we play it son. + } + + stream->elements->add (stream->elements, stream->singleElement, freePtr); + stream->elements->add (stream->elements, el, freePtr); + stream->singleElement = NULL; + + return; +} + +/// Return the next element in the stream. If out of elements, throw +/// an exception unless size()==1. If size is 1, then return elements[0]. +/// Return a duplicate node/subtree if stream is out of elements and +/// size==1. If we've already used the element, dup (dirty bit set). +/// +static pANTLR3_BASE_TREE +nextTree(pANTLR3_REWRITE_RULE_ELEMENT_STREAM stream) +{ + ANTLR3_UINT32 n; + void * el; + + n = stream->size(stream); + + if ( stream->dirty || (stream->cursor >=n && n==1) ) + { + // if out of elements and size is 1, dup + // + el = stream->_next(stream); + return stream->dup(stream, el); + } + + // test size above then fetch + // + el = stream->_next(stream); + return el; +} + +/// Return the next element for a caller that wants just the token +/// +static void * +nextToken (pANTLR3_REWRITE_RULE_ELEMENT_STREAM stream) +{ + return stream->_next(stream); +} + +/// Return the next element in the stream. If out of elements, throw +/// an exception unless size()==1. If size is 1, then return elements[0]. +/// +static void * +next (pANTLR3_REWRITE_RULE_ELEMENT_STREAM stream) +{ + ANTLR3_UINT32 s; + + s = stream->size(stream); + if (stream->cursor >= s && s == 1) + { + pANTLR3_BASE_TREE el; + + el = stream->_next(stream); + + return stream->dup(stream, el); + } + + return stream->_next(stream); +} + +/// Do the work of getting the next element, making sure that it's +/// a tree node or subtree. Deal with the optimization of single- +/// element list versus list of size > 1. Throw an exception (or something similar) +/// if the stream is empty or we're out of elements and size>1. +/// You can override in a 'subclass' if necessary. +/// +static void * +_next (pANTLR3_REWRITE_RULE_ELEMENT_STREAM stream) +{ + ANTLR3_UINT32 n; + pANTLR3_BASE_TREE t; + + n = stream->size(stream); + + if (n == 0) + { + // This means that the stream is empty + // + return NULL; // Caller must cope with this + } + + // Traversed all the available elements already? + // + if (stream->cursor >= n) + { + if (n == 1) + { + // Special case when size is single element, it will just dup a lot + // + return stream->toTree(stream, stream->singleElement); + } + + // Out of elements and the size is not 1, so we cannot assume + // that we just duplicate the entry n times (such as ID ent+ -> ^(ID ent)+) + // This means we ran out of elements earlier than was expected. + // + return NULL; // Caller must cope with this + } + + // Elements available either for duping or just available + // + if (stream->singleElement != NULL) + { + stream->cursor++; // Cursor advances even for single element as this tells us to dup() + return stream->toTree(stream, stream->singleElement); + } + + // More than just a single element so we extract it from the + // vector. + // + t = stream->toTree(stream, stream->elements->get(stream->elements, stream->cursor)); + stream->cursor++; + return t; +} + +#ifdef ANTLR3_WINDOWS +#pragma warning(push) +#pragma warning(disable : 4100) +#endif +/// When constructing trees, sometimes we need to dup a token or AST +/// subtree. Dup'ing a token means just creating another AST node +/// around it. For trees, you must call the adaptor.dupTree(). +/// +static void * +dupTok (pANTLR3_REWRITE_RULE_ELEMENT_STREAM stream, void * el) +{ + ANTLR3_FPRINTF(stderr, "dup() cannot be called on a token rewrite stream!!"); + return NULL; +} +#ifdef ANTLR3_WINDOWS +#pragma warning(pop) +#endif + +/// When constructing trees, sometimes we need to dup a token or AST +/// subtree. Dup'ing a token means just creating another AST node +/// around it. For trees, you must call the adaptor.dupTree(). +/// +static void * +dupTree (pANTLR3_REWRITE_RULE_ELEMENT_STREAM stream, void * element) +{ + return stream->adaptor->dupNode(stream->adaptor, (pANTLR3_BASE_TREE)element); +} + +#ifdef ANTLR3_WINDOWS +#pragma warning(push) +#pragma warning(disable : 4100) +#endif +/// When constructing trees, sometimes we need to dup a token or AST +/// subtree. Dup'ing a token means just creating another AST node +/// around it. For trees, you must call the adaptor.dupTree(). +/// +static void * +dupTreeNode (pANTLR3_REWRITE_RULE_ELEMENT_STREAM stream, void * element) +{ + ANTLR3_FPRINTF(stderr, "dup() cannot be called on a node rewrite stream!!!"); + return NULL; +} + + +/// We don;t explicitly convert to a tree unless the call goes to +/// nextTree, which means rewrites are heterogeneous +/// +static pANTLR3_BASE_TREE +toTree (pANTLR3_REWRITE_RULE_ELEMENT_STREAM stream, void * element) +{ + return (pANTLR3_BASE_TREE)element; +} +#ifdef ANTLR3_WINDOWS +#pragma warning(pop) +#endif + +/// Ensure stream emits trees; tokens must be converted to AST nodes. +/// AST nodes can be passed through unmolested. +/// +#ifdef ANTLR3_WINDOWS +#pragma warning(push) +#pragma warning(disable : 4100) +#endif + +static pANTLR3_BASE_TREE +toTreeNode (pANTLR3_REWRITE_RULE_ELEMENT_STREAM stream, void * element) +{ + return stream->adaptor->dupNode(stream->adaptor, (pANTLR3_BASE_TREE)element); +} + +#ifdef ANTLR3_WINDOWS +#pragma warning(pop) +#endif + +/// Returns ANTLR3_TRUE if there is a next element available +/// +static ANTLR3_BOOLEAN +hasNext (pANTLR3_REWRITE_RULE_ELEMENT_STREAM stream) +{ + if ( (stream->singleElement != NULL && stream->cursor < 1) + || (stream->elements != NULL && stream->cursor < stream->elements->size(stream->elements))) + { + return ANTLR3_TRUE; + } + else + { + return ANTLR3_FALSE; + } +} + +/// Get the next token from the list and create a node for it +/// This is the implementation for token streams. +/// +static pANTLR3_BASE_TREE +nextNodeToken(pANTLR3_REWRITE_RULE_ELEMENT_STREAM stream) +{ + return stream->adaptor->create(stream->adaptor, stream->_next(stream)); +} + +static pANTLR3_BASE_TREE +nextNodeNode(pANTLR3_REWRITE_RULE_ELEMENT_STREAM stream) +{ + return stream->_next(stream); +} + +/// Treat next element as a single node even if it's a subtree. +/// This is used instead of next() when the result has to be a +/// tree root node. Also prevents us from duplicating recently-added +/// children; e.g., ^(type ID)+ adds ID to type and then 2nd iteration +/// must dup the type node, but ID has been added. +/// +/// Referencing to a rule result twice is ok; dup entire tree as +/// we can't be adding trees; e.g., expr expr. +/// +static pANTLR3_BASE_TREE +nextNode (pANTLR3_REWRITE_RULE_ELEMENT_STREAM stream) +{ + + ANTLR3_UINT32 n; + pANTLR3_BASE_TREE el = stream->_next(stream); + + n = stream->size(stream); + if (stream->dirty == ANTLR3_TRUE || (stream->cursor > n && n == 1)) + { + // We are out of elements and the size is 1, which means we just + // dup the node that we have + // + return stream->adaptor->dupNode(stream->adaptor, el); + } + + // We were not out of nodes, so the one we received is the one to return + // + return el; +} + +/// Number of elements available in the stream +/// +static ANTLR3_UINT32 +size (pANTLR3_REWRITE_RULE_ELEMENT_STREAM stream) +{ + ANTLR3_UINT32 n = 0; + + /// Should be a count of one if singleElement is set. I copied this + /// logic from the java implementation, which I suspect is just guarding + /// against someone setting singleElement and forgetting to NULL it out + /// + if (stream->singleElement != NULL) + { + n = 1; + } + else + { + if (stream->elements != NULL) + { + return (ANTLR3_UINT32)(stream->elements->count); + } + } + return n; +} + +/// Returns the description string if there is one available (check for NULL). +/// +static void * +getDescription (pANTLR3_REWRITE_RULE_ELEMENT_STREAM stream) +{ + if (stream->elementDescription == NULL) + { + stream->elementDescription = ""; + } + + return stream->elementDescription; +} diff --git a/antlr/libantlr3c-3.4/src/antlr3string.c b/antlr/libantlr3c-3.4/src/antlr3string.c new file mode 100644 index 0000000..b29c020 --- /dev/null +++ b/antlr/libantlr3c-3.4/src/antlr3string.c @@ -0,0 +1,1402 @@ +/** \file + * Implementation of the ANTLR3 string and string factory classes + */ + +// [The "BSD licence"] +// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC +// http://www.temporal-wave.com +// http://www.linkedin.com/in/jimidle +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. The name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include + +/* Factory API + */ +static pANTLR3_STRING newRaw8 (pANTLR3_STRING_FACTORY factory); +static pANTLR3_STRING newRawUTF16 (pANTLR3_STRING_FACTORY factory); +static pANTLR3_STRING newSize8 (pANTLR3_STRING_FACTORY factory, ANTLR3_UINT32 size); +static pANTLR3_STRING newSizeUTF16 (pANTLR3_STRING_FACTORY factory, ANTLR3_UINT32 size); +static pANTLR3_STRING newPtr8 (pANTLR3_STRING_FACTORY factory, pANTLR3_UINT8 string, ANTLR3_UINT32 size); +static pANTLR3_STRING newPtrUTF16_8 (pANTLR3_STRING_FACTORY factory, pANTLR3_UINT8 string, ANTLR3_UINT32 size); +static pANTLR3_STRING newPtrUTF16_UTF16 (pANTLR3_STRING_FACTORY factory, pANTLR3_UINT8 string, ANTLR3_UINT32 size); +static pANTLR3_STRING newStr8 (pANTLR3_STRING_FACTORY factory, pANTLR3_UINT8 string); +static pANTLR3_STRING newStrUTF16_8 (pANTLR3_STRING_FACTORY factory, pANTLR3_UINT8 string); +static pANTLR3_STRING newStrUTF16_UTF16 (pANTLR3_STRING_FACTORY factory, pANTLR3_UINT8 string); +static void destroy (pANTLR3_STRING_FACTORY factory, pANTLR3_STRING string); +static pANTLR3_STRING printable8 (pANTLR3_STRING_FACTORY factory, pANTLR3_STRING string); +static pANTLR3_STRING printableUTF16 (pANTLR3_STRING_FACTORY factory, pANTLR3_STRING string); +static void closeFactory(pANTLR3_STRING_FACTORY factory); + +/* String API + */ +static pANTLR3_UINT8 set8 (pANTLR3_STRING string, const char * chars); +static pANTLR3_UINT8 setUTF16_8 (pANTLR3_STRING string, const char * chars); +static pANTLR3_UINT8 setUTF16_UTF16 (pANTLR3_STRING string, const char * chars); +static pANTLR3_UINT8 append8 (pANTLR3_STRING string, const char * newbit); +static pANTLR3_UINT8 appendUTF16_8 (pANTLR3_STRING string, const char * newbit); +static pANTLR3_UINT8 appendUTF16_UTF16 (pANTLR3_STRING string, const char * newbit); +static pANTLR3_UINT8 insert8 (pANTLR3_STRING string, ANTLR3_UINT32 point, const char * newbit); +static pANTLR3_UINT8 insertUTF16_8 (pANTLR3_STRING string, ANTLR3_UINT32 point, const char * newbit); +static pANTLR3_UINT8 insertUTF16_UTF16 (pANTLR3_STRING string, ANTLR3_UINT32 point, const char * newbit); + +static pANTLR3_UINT8 setS (pANTLR3_STRING string, pANTLR3_STRING chars); +static pANTLR3_UINT8 appendS (pANTLR3_STRING string, pANTLR3_STRING newbit); +static pANTLR3_UINT8 insertS (pANTLR3_STRING string, ANTLR3_UINT32 point, pANTLR3_STRING newbit); + +static pANTLR3_UINT8 addc8 (pANTLR3_STRING string, ANTLR3_UINT32 c); +static pANTLR3_UINT8 addcUTF16 (pANTLR3_STRING string, ANTLR3_UINT32 c); +static pANTLR3_UINT8 addi8 (pANTLR3_STRING string, ANTLR3_INT32 i); +static pANTLR3_UINT8 addiUTF16 (pANTLR3_STRING string, ANTLR3_INT32 i); +static pANTLR3_UINT8 inserti8 (pANTLR3_STRING string, ANTLR3_UINT32 point, ANTLR3_INT32 i); +static pANTLR3_UINT8 insertiUTF16 (pANTLR3_STRING string, ANTLR3_UINT32 point, ANTLR3_INT32 i); + +static ANTLR3_UINT32 compare8 (pANTLR3_STRING string, const char * compStr); +static ANTLR3_UINT32 compareUTF16_8 (pANTLR3_STRING string, const char * compStr); +static ANTLR3_UINT32 compareUTF16_UTF16(pANTLR3_STRING string, const char * compStr); +static ANTLR3_UINT32 compareS (pANTLR3_STRING string, pANTLR3_STRING compStr); +static ANTLR3_UCHAR charAt8 (pANTLR3_STRING string, ANTLR3_UINT32 offset); +static ANTLR3_UCHAR charAtUTF16 (pANTLR3_STRING string, ANTLR3_UINT32 offset); +static pANTLR3_STRING subString8 (pANTLR3_STRING string, ANTLR3_UINT32 startIndex, ANTLR3_UINT32 endIndex); +static pANTLR3_STRING subStringUTF16 (pANTLR3_STRING string, ANTLR3_UINT32 startIndex, ANTLR3_UINT32 endIndex); +static ANTLR3_INT32 toInt32_8 (pANTLR3_STRING string); +static ANTLR3_INT32 toInt32_UTF16 (pANTLR3_STRING string); +static pANTLR3_STRING to8_8 (pANTLR3_STRING string); +static pANTLR3_STRING to8_UTF16 (pANTLR3_STRING string); +static pANTLR3_STRING toUTF8_8 (pANTLR3_STRING string); +static pANTLR3_STRING toUTF8_UTF16 (pANTLR3_STRING string); + +/* Local helpers + */ +static void stringInit8 (pANTLR3_STRING string); +static void stringInitUTF16 (pANTLR3_STRING string); +static void ANTLR3_CDECL stringFree (pANTLR3_STRING string); + +ANTLR3_API pANTLR3_STRING_FACTORY +antlr3StringFactoryNew(ANTLR3_UINT32 encoding) +{ + pANTLR3_STRING_FACTORY factory; + + /* Allocate memory + */ + factory = (pANTLR3_STRING_FACTORY) ANTLR3_CALLOC(1, sizeof(ANTLR3_STRING_FACTORY)); + + if (factory == NULL) + { + return NULL; + } + + /* Now we make a new list to track the strings. + */ + factory->strings = antlr3VectorNew(0); + factory->index = 0; + + if (factory->strings == NULL) + { + ANTLR3_FREE(factory); + return NULL; + } + + // Install the API + // + // TODO: These encodings need equivalent functions to + // UTF16 and 8Bit if I am going to support those encodings in the STRING stuff. + // The STRING stuff was intended as a quick and dirty hack for people that did not + // want to worry about memory and performance very much, but nobody ever reads the + // notes or comments or uses the email list search. I want to discourage using these + // interfaces as it is much more efficient to use the pointers within the tokens + // directly, so I am not implementing the string stuff for the newer encodings. + // We install the standard 8 and 16 bit functions for the UTF 8 and 16 but they + // will not be useful beyond returning the text. + // + switch(encoding) + { + case ANTLR3_ENC_UTF32: + break; + + case ANTLR3_ENC_UTF32BE: + break; + + case ANTLR3_ENC_UTF32LE: + break; + + case ANTLR3_ENC_UTF16BE: + case ANTLR3_ENC_UTF16LE: + case ANTLR3_ENC_UTF16: + + factory->newRaw = newRawUTF16; + factory->newSize = newSizeUTF16; + factory->newPtr = newPtrUTF16_UTF16; + factory->newPtr8 = newPtrUTF16_8; + factory->newStr = newStrUTF16_UTF16; + factory->newStr8 = newStrUTF16_8; + factory->printable = printableUTF16; + factory->destroy = destroy; + factory->close = closeFactory; + break; + + case ANTLR3_ENC_UTF8: + case ANTLR3_ENC_EBCDIC: + case ANTLR3_ENC_8BIT: + default: + + factory->newRaw = newRaw8; + factory->newSize = newSize8; + factory->newPtr = newPtr8; + factory->newPtr8 = newPtr8; + factory->newStr = newStr8; + factory->newStr8 = newStr8; + factory->printable = printable8; + factory->destroy = destroy; + factory->close = closeFactory; + break; + } + return factory; +} + + +/** + * + * \param factory + * \return + */ +static pANTLR3_STRING +newRaw8 (pANTLR3_STRING_FACTORY factory) +{ + pANTLR3_STRING string; + + string = (pANTLR3_STRING) ANTLR3_MALLOC(sizeof(ANTLR3_STRING)); + + if (string == NULL) + { + return NULL; + } + + /* Structure is allocated, now fill in the API etc. + */ + stringInit8(string); + string->factory = factory; + + /* Add the string into the allocated list + */ + factory->strings->set(factory->strings, factory->index, (void *) string, (void (ANTLR3_CDECL *)(void *))(stringFree), ANTLR3_TRUE); + string->index = factory->index++; + + return string; +} +/** + * + * \param factory + * \return + */ +static pANTLR3_STRING +newRawUTF16 (pANTLR3_STRING_FACTORY factory) +{ + pANTLR3_STRING string; + + string = (pANTLR3_STRING) ANTLR3_MALLOC(sizeof(ANTLR3_STRING)); + + if (string == NULL) + { + return NULL; + } + + /* Structure is allocated, now fill in the API etc. + */ + stringInitUTF16(string); + string->factory = factory; + + /* Add the string into the allocated list + */ + factory->strings->set(factory->strings, factory->index, (void *) string, (void (ANTLR3_CDECL *)(void *))(stringFree), ANTLR3_TRUE); + string->index = factory->index++; + + return string; +} +static +void ANTLR3_CDECL stringFree (pANTLR3_STRING string) +{ + /* First free the string itself if there was anything in it + */ + if (string->chars) + { + ANTLR3_FREE(string->chars); + } + + /* Now free the space for this string + */ + ANTLR3_FREE(string); + + return; +} +/** + * + * \param string + * \return + */ +static void +stringInit8 (pANTLR3_STRING string) +{ + string->len = 0; + string->size = 0; + string->chars = NULL; + string->encoding = ANTLR3_ENC_8BIT ; + + /* API for 8 bit strings*/ + + string->set = set8; + string->set8 = set8; + string->append = append8; + string->append8 = append8; + string->insert = insert8; + string->insert8 = insert8; + string->addi = addi8; + string->inserti = inserti8; + string->addc = addc8; + string->charAt = charAt8; + string->compare = compare8; + string->compare8 = compare8; + string->subString = subString8; + string->toInt32 = toInt32_8; + string->to8 = to8_8; + string->toUTF8 = toUTF8_8; + string->compareS = compareS; + string->setS = setS; + string->appendS = appendS; + string->insertS = insertS; + +} +/** + * + * \param string + * \return + */ +static void +stringInitUTF16 (pANTLR3_STRING string) +{ + string->len = 0; + string->size = 0; + string->chars = NULL; + string->encoding = ANTLR3_ENC_8BIT; + + /* API for UTF16 strings */ + + string->set = setUTF16_UTF16; + string->set8 = setUTF16_8; + string->append = appendUTF16_UTF16; + string->append8 = appendUTF16_8; + string->insert = insertUTF16_UTF16; + string->insert8 = insertUTF16_8; + string->addi = addiUTF16; + string->inserti = insertiUTF16; + string->addc = addcUTF16; + string->charAt = charAtUTF16; + string->compare = compareUTF16_UTF16; + string->compare8 = compareUTF16_8; + string->subString = subStringUTF16; + string->toInt32 = toInt32_UTF16; + string->to8 = to8_UTF16; + string->toUTF8 = toUTF8_UTF16; + + string->compareS = compareS; + string->setS = setS; + string->appendS = appendS; + string->insertS = insertS; +} +/** + * + * \param string + * \return + * TODO: Implement UTF-8 + */ +static void +stringInitUTF8 (pANTLR3_STRING string) +{ + string->len = 0; + string->size = 0; + string->chars = NULL; + + /* API */ + +} + +// Convert an 8 bit string into a UTF8 representation, which is in fact just the string itself +// a memcpy as we make no assumptions about the 8 bit encoding. +// +static pANTLR3_STRING +toUTF8_8 (pANTLR3_STRING string) +{ + return string->factory->newPtr(string->factory, (pANTLR3_UINT8)(string->chars), string->len); +} + +// Convert a UTF16 string into a UTF8 representation using the Unicode.org +// supplied C algorithms, which are now contained within the ANTLR3 C runtime +// as permitted by the Unicode license (within the source code antlr3convertutf.c/.h +// UCS2 has the same encoding as UTF16 so we can use UTF16 converter. +// +static pANTLR3_STRING +toUTF8_UTF16 (pANTLR3_STRING string) +{ + + UTF8 * outputEnd; + UTF16 * inputEnd; + pANTLR3_STRING utf8String; + + ConversionResult cResult; + + // Allocate the output buffer, which needs to accommodate potentially + // 3X (in bytes) the input size (in chars). + // + utf8String = string->factory->newStr8(string->factory, (pANTLR3_UINT8)""); + + if (utf8String != NULL) + { + // Free existing allocation + // + ANTLR3_FREE(utf8String->chars); + + // Reallocate according to maximum expected size + // + utf8String->size = string->len *3; + utf8String->chars = (pANTLR3_UINT8)ANTLR3_MALLOC(utf8String->size +1); + + if (utf8String->chars != NULL) + { + inputEnd = (UTF16 *) (string->chars); + outputEnd = (UTF8 *) (utf8String->chars); + + // Call the Unicode converter + // + cResult = ConvertUTF16toUTF8 + ( + (const UTF16**)&inputEnd, + ((const UTF16 *)(string->chars)) + string->len, + &outputEnd, + outputEnd + utf8String->size - 1, + lenientConversion + ); + + // We don't really care if things failed or not here, we just converted + // everything that was vaguely possible and stopped when it wasn't. It is + // up to the grammar programmer to verify that the input is sensible. + // + utf8String->len = ANTLR3_UINT32_CAST(((pANTLR3_UINT8)outputEnd) - utf8String->chars); + + *(outputEnd+1) = '\0'; // Always null terminate + } + } + return utf8String; +} + +/** + * Creates a new string with enough capacity for size 8 bit characters plus a terminator. + * + * \param[in] factory - Pointer to the string factory that owns strings + * \param[in] size - In characters + * \return pointer to the new string. + */ +static pANTLR3_STRING +newSize8 (pANTLR3_STRING_FACTORY factory, ANTLR3_UINT32 size) +{ + pANTLR3_STRING string; + + string = factory->newRaw(factory); + + if (string == NULL) + { + return string; + } + + /* Always add one more byte for a terminator ;-) + */ + string->chars = (pANTLR3_UINT8) ANTLR3_MALLOC((size_t)(sizeof(ANTLR3_UINT8) * (size+1))); + *(string->chars) = '\0'; + string->size = size + 1; + + + return string; +} +/** + * Creates a new string with enough capacity for size UTF16 characters plus a terminator. + * + * \param[in] factory - Pointer to the string factory that owns strings + * \param[in] size - In characters (count double for surrogate pairs!!!) + * \return pointer to the new string. + */ +static pANTLR3_STRING +newSizeUTF16 (pANTLR3_STRING_FACTORY factory, ANTLR3_UINT32 size) +{ + pANTLR3_STRING string; + + string = factory->newRaw(factory); + + if (string == NULL) + { + return string; + } + + /* Always add one more byte for a terminator ;-) + */ + string->chars = (pANTLR3_UINT8) ANTLR3_MALLOC((size_t)(sizeof(ANTLR3_UINT16) * (size+1))); + *(string->chars) = '\0'; + string->size = size+1; /* Size is always in characters, as is len */ + + return string; +} + +/** Creates a new 8 bit string initialized with the 8 bit characters at the + * supplied ptr, of pre-determined size. + * \param[in] factory - Pointer to the string factory that owns the strings + * \param[in] ptr - Pointer to 8 bit encoded characters + * \return pointer to the new string + */ +static pANTLR3_STRING +newPtr8 (pANTLR3_STRING_FACTORY factory, pANTLR3_UINT8 ptr, ANTLR3_UINT32 size) +{ + pANTLR3_STRING string; + + string = factory->newSize(factory, size); + + if (string == NULL) + { + return NULL; + } + + if (size <= 0) + { + return string; + } + + if (ptr != NULL) + { + ANTLR3_MEMMOVE(string->chars, (const void *)ptr, size); + *(string->chars + size) = '\0'; /* Terminate, these strings are usually used for Token streams and printing etc. */ + string->len = size; + } + + return string; +} + +/** Creates a new UTF16 string initialized with the 8 bit characters at the + * supplied 8 bit character ptr, of pre-determined size. + * \param[in] factory - Pointer to the string factory that owns the strings + * \param[in] ptr - Pointer to 8 bit encoded characters + * \return pointer to the new string + */ +static pANTLR3_STRING +newPtrUTF16_8 (pANTLR3_STRING_FACTORY factory, pANTLR3_UINT8 ptr, ANTLR3_UINT32 size) +{ + pANTLR3_STRING string; + + /* newSize accepts size in characters, not bytes + */ + string = factory->newSize(factory, size); + + if (string == NULL) + { + return NULL; + } + + if (size <= 0) + { + return string; + } + + if (ptr != NULL) + { + pANTLR3_UINT16 out; + ANTLR3_INT32 inSize; + + out = (pANTLR3_UINT16)(string->chars); + inSize = size; + + while (inSize-- > 0) + { + *out++ = (ANTLR3_UINT16)(*ptr++); + } + + /* Terminate, these strings are usually used for Token streams and printing etc. + */ + *(((pANTLR3_UINT16)(string->chars)) + size) = '\0'; + + string->len = size; + } + + return string; +} + +/** Creates a new UTF16 string initialized with the UTF16 characters at the + * supplied ptr, of pre-determined size. + * \param[in] factory - Pointer to the string factory that owns the strings + * \param[in] ptr - Pointer to UTF16 encoded characters + * \return pointer to the new string + */ +static pANTLR3_STRING +newPtrUTF16_UTF16 (pANTLR3_STRING_FACTORY factory, pANTLR3_UINT8 ptr, ANTLR3_UINT32 size) +{ + pANTLR3_STRING string; + + string = factory->newSize(factory, size); + + if (string == NULL) + { + return NULL; + } + + if (size <= 0) + { + return string; + } + + if (ptr != NULL) + { + ANTLR3_MEMMOVE(string->chars, (const void *)ptr, (size * sizeof(ANTLR3_UINT16))); + + /* Terminate, these strings are usually used for Token streams and printing etc. + */ + *(((pANTLR3_UINT16)(string->chars)) + size) = '\0'; + string->len = size; + } + + return string; +} + +/** Create a new 8 bit string from the supplied, null terminated, 8 bit string pointer. + * \param[in] factory - Pointer to the string factory that owns strings. + * \param[in] ptr - Pointer to the 8 bit encoded string + * \return Pointer to the newly initialized string + */ +static pANTLR3_STRING +newStr8 (pANTLR3_STRING_FACTORY factory, pANTLR3_UINT8 ptr) +{ + return factory->newPtr8(factory, ptr, (ANTLR3_UINT32)strlen((const char *)ptr)); +} + +/** Create a new UTF16 string from the supplied, null terminated, 8 bit string pointer. + * \param[in] factory - Pointer to the string factory that owns strings. + * \param[in] ptr - Pointer to the 8 bit encoded string + * \return POinter to the newly initialized string + */ +static pANTLR3_STRING +newStrUTF16_8 (pANTLR3_STRING_FACTORY factory, pANTLR3_UINT8 ptr) +{ + return factory->newPtr8(factory, ptr, (ANTLR3_UINT32)strlen((const char *)ptr)); +} + +/** Create a new UTF16 string from the supplied, null terminated, UTF16 string pointer. + * \param[in] factory - Pointer to the string factory that owns strings. + * \param[in] ptr - Pointer to the UTF16 encoded string + * \return Pointer to the newly initialized string + */ +static pANTLR3_STRING +newStrUTF16_UTF16 (pANTLR3_STRING_FACTORY factory, pANTLR3_UINT8 ptr) +{ + pANTLR3_UINT16 in; + ANTLR3_UINT32 count; + + /** First, determine the length of the input string + */ + in = (pANTLR3_UINT16)ptr; + count = 0; + + while (*in++ != '\0') + { + count++; + } + return factory->newPtr(factory, ptr, count); +} + +static void +destroy (pANTLR3_STRING_FACTORY factory, pANTLR3_STRING string) +{ + // Record which string we are deleting + // + ANTLR3_UINT32 strIndex = string->index; + + // Ensure that the string was not factory made, or we would try + // to delete memory that wasn't allocated outside the factory + // block. + // Remove the specific indexed string from the vector + // + factory->strings->del(factory->strings, strIndex); + + // One less string in the vector, so decrement the factory index + // so that the next string allocated is indexed correctly with + // respect to the vector. + // + factory->index--; + + // Now we have to reindex the strings in the vector that followed + // the one we just deleted. We only do this if the one we just deleted + // was not the last one. + // + if (strIndex< factory->index) + { + // We must reindex the strings after the one we just deleted. + // The one that follows the one we just deleted is also out + // of whack, so we start there. + // + ANTLR3_UINT32 i; + + for (i = strIndex; i < factory->index; i++) + { + // Renumber the entry + // + ((pANTLR3_STRING)(factory->strings->elements[i].element))->index = i; + } + } + + // The string has been destroyed and the elements of the factory are reindexed. + // + +} + +static pANTLR3_STRING +printable8(pANTLR3_STRING_FACTORY factory, pANTLR3_STRING instr) +{ + pANTLR3_STRING string; + + /* We don't need to be too efficient here, this is mostly for error messages and so on. + */ + pANTLR3_UINT8 scannedText; + ANTLR3_UINT32 i; + + /* Assume we need as much as twice as much space to parse out the control characters + */ + string = factory->newSize(factory, instr->len *2 + 1); + + /* Scan through and replace unprintable (in terms of this routine) + * characters + */ + scannedText = string->chars; + + for (i = 0; i < instr->len; i++) + { + if (*(instr->chars + i) == '\n') + { + *scannedText++ = '\\'; + *scannedText++ = 'n'; + } + else if (*(instr->chars + i) == '\r') + { + *scannedText++ = '\\'; + *scannedText++ = 'r'; + } + else if (!isprint(*(instr->chars +i))) + { + *scannedText++ = '?'; + } + else + { + *scannedText++ = *(instr->chars + i); + } + } + *scannedText = '\0'; + + string->len = (ANTLR3_UINT32)(scannedText - string->chars); + + return string; +} + +static pANTLR3_STRING +printableUTF16(pANTLR3_STRING_FACTORY factory, pANTLR3_STRING instr) +{ + pANTLR3_STRING string; + + /* We don't need to be too efficient here, this is mostly for error messages and so on. + */ + pANTLR3_UINT16 scannedText; + pANTLR3_UINT16 inText; + ANTLR3_UINT32 i; + ANTLR3_UINT32 outLen; + + /* Assume we need as much as twice as much space to parse out the control characters + */ + string = factory->newSize(factory, instr->len *2 + 1); + + /* Scan through and replace unprintable (in terms of this routine) + * characters + */ + scannedText = (pANTLR3_UINT16)(string->chars); + inText = (pANTLR3_UINT16)(instr->chars); + outLen = 0; + + for (i = 0; i < instr->len; i++) + { + if (*(inText + i) == '\n') + { + *scannedText++ = '\\'; + *scannedText++ = 'n'; + outLen += 2; + } + else if (*(inText + i) == '\r') + { + *scannedText++ = '\\'; + *scannedText++ = 'r'; + outLen += 2; + } + else if (!isprint(*(inText +i))) + { + *scannedText++ = '?'; + outLen++; + } + else + { + *scannedText++ = *(inText + i); + outLen++; + } + } + *scannedText = '\0'; + + string->len = outLen; + + return string; +} + +/** Fascist Capitalist Pig function created + * to oppress the workers comrade. + */ +static void +closeFactory (pANTLR3_STRING_FACTORY factory) +{ + /* Delete the vector we were tracking the strings with, this will + * causes all the allocated strings to be deallocated too + */ + factory->strings->free(factory->strings); + + /* Delete the space for the factory itself + */ + ANTLR3_FREE((void *)factory); +} + +static pANTLR3_UINT8 +append8 (pANTLR3_STRING string, const char * newbit) +{ + ANTLR3_UINT32 len; + + len = (ANTLR3_UINT32)strlen(newbit); + + if (string->size < (string->len + len + 1)) + { + string->chars = (pANTLR3_UINT8) ANTLR3_REALLOC((void *)string->chars, (ANTLR3_UINT32)(string->len + len + 1)); + string->size = string->len + len + 1; + } + + /* Note we copy one more byte than the strlen in order to get the trailing + */ + ANTLR3_MEMMOVE((void *)(string->chars + string->len), newbit, (ANTLR3_UINT32)(len+1)); + string->len += len; + + return string->chars; +} + +static pANTLR3_UINT8 +appendUTF16_8 (pANTLR3_STRING string, const char * newbit) +{ + ANTLR3_UINT32 len; + pANTLR3_UINT16 apPoint; + ANTLR3_UINT32 count; + + len = (ANTLR3_UINT32)strlen(newbit); + + if (string->size < (string->len + len + 1)) + { + string->chars = (pANTLR3_UINT8) ANTLR3_REALLOC((void *)string->chars, (ANTLR3_UINT32)((sizeof(ANTLR3_UINT16)*(string->len + len + 1)))); + string->size = string->len + len + 1; + } + + apPoint = ((pANTLR3_UINT16)string->chars) + string->len; + string->len += len; + + for (count = 0; count < len; count++) + { + *apPoint++ = *(newbit + count); + } + *apPoint = '\0'; + + return string->chars; +} + +static pANTLR3_UINT8 +appendUTF16_UTF16 (pANTLR3_STRING string, const char * newbit) +{ + ANTLR3_UINT32 len; + pANTLR3_UINT16 in; + + /** First, determine the length of the input string + */ + in = (pANTLR3_UINT16)newbit; + len = 0; + + while (*in++ != '\0') + { + len++; + } + + if (string->size < (string->len + len + 1)) + { + string->chars = (pANTLR3_UINT8) ANTLR3_REALLOC((void *)string->chars, (ANTLR3_UINT32)( sizeof(ANTLR3_UINT16) *(string->len + len + 1) )); + string->size = string->len + len + 1; + } + + /* Note we copy one more byte than the strlen in order to get the trailing delimiter + */ + ANTLR3_MEMMOVE((void *)(((pANTLR3_UINT16)string->chars) + string->len), newbit, (ANTLR3_UINT32)(sizeof(ANTLR3_UINT16)*(len+1))); + string->len += len; + + return string->chars; +} + +static pANTLR3_UINT8 +set8 (pANTLR3_STRING string, const char * chars) +{ + ANTLR3_UINT32 len; + + len = (ANTLR3_UINT32)strlen(chars); + if (string->size < len + 1) + { + string->chars = (pANTLR3_UINT8) ANTLR3_REALLOC((void *)string->chars, (ANTLR3_UINT32)(len + 1)); + string->size = len + 1; + } + + /* Note we copy one more byte than the strlen in order to get the trailing '\0' + */ + ANTLR3_MEMMOVE((void *)(string->chars), chars, (ANTLR3_UINT32)(len+1)); + string->len = len; + + return string->chars; + +} + +static pANTLR3_UINT8 +setUTF16_8 (pANTLR3_STRING string, const char * chars) +{ + ANTLR3_UINT32 len; + ANTLR3_UINT32 count; + pANTLR3_UINT16 apPoint; + + len = (ANTLR3_UINT32)strlen(chars); + if (string->size < len + 1) + { + string->chars = (pANTLR3_UINT8) ANTLR3_REALLOC((void *)string->chars, (ANTLR3_UINT32)(sizeof(ANTLR3_UINT16)*(len + 1))); + string->size = len + 1; + } + apPoint = ((pANTLR3_UINT16)string->chars); + string->len = len; + + for (count = 0; count < string->len; count++) + { + *apPoint++ = *(chars + count); + } + *apPoint = '\0'; + + return string->chars; +} + +static pANTLR3_UINT8 +setUTF16_UTF16 (pANTLR3_STRING string, const char * chars) +{ + ANTLR3_UINT32 len; + pANTLR3_UINT16 in; + + /** First, determine the length of the input string + */ + in = (pANTLR3_UINT16)chars; + len = 0; + + while (*in++ != '\0') + { + len++; + } + + if (string->size < len + 1) + { + string->chars = (pANTLR3_UINT8) ANTLR3_REALLOC((void *)string->chars, (ANTLR3_UINT32)(sizeof(ANTLR3_UINT16)*(len + 1))); + string->size = len + 1; + } + + /* Note we copy one more byte than the strlen in order to get the trailing '\0' + */ + ANTLR3_MEMMOVE((void *)(string->chars), chars, (ANTLR3_UINT32)((len+1) * sizeof(ANTLR3_UINT16))); + string->len = len; + + return string->chars; + +} + +static pANTLR3_UINT8 +addc8 (pANTLR3_STRING string, ANTLR3_UINT32 c) +{ + if (string->size < string->len + 2) + { + string->chars = (pANTLR3_UINT8) ANTLR3_REALLOC((void *)string->chars, (ANTLR3_UINT32)(string->len + 2)); + string->size = string->len + 2; + } + *(string->chars + string->len) = (ANTLR3_UINT8)c; + *(string->chars + string->len + 1) = '\0'; + string->len++; + + return string->chars; +} + +static pANTLR3_UINT8 +addcUTF16 (pANTLR3_STRING string, ANTLR3_UINT32 c) +{ + pANTLR3_UINT16 ptr; + + if (string->size < string->len + 2) + { + string->chars = (pANTLR3_UINT8) ANTLR3_REALLOC((void *)string->chars, (ANTLR3_UINT32)(sizeof(ANTLR3_UINT16) * (string->len + 2))); + string->size = string->len + 2; + } + ptr = (pANTLR3_UINT16)(string->chars); + + *(ptr + string->len) = (ANTLR3_UINT16)c; + *(ptr + string->len + 1) = '\0'; + string->len++; + + return string->chars; +} + +static pANTLR3_UINT8 +addi8 (pANTLR3_STRING string, ANTLR3_INT32 i) +{ + ANTLR3_UINT8 newbit[32]; + + sprintf((char *)newbit, "%d", i); + + return string->append8(string, (const char *)newbit); +} +static pANTLR3_UINT8 +addiUTF16 (pANTLR3_STRING string, ANTLR3_INT32 i) +{ + ANTLR3_UINT8 newbit[32]; + + sprintf((char *)newbit, "%d", i); + + return string->append8(string, (const char *)newbit); +} + +static pANTLR3_UINT8 +inserti8 (pANTLR3_STRING string, ANTLR3_UINT32 point, ANTLR3_INT32 i) +{ + ANTLR3_UINT8 newbit[32]; + + sprintf((char *)newbit, "%d", i); + return string->insert8(string, point, (const char *)newbit); +} +static pANTLR3_UINT8 +insertiUTF16 (pANTLR3_STRING string, ANTLR3_UINT32 point, ANTLR3_INT32 i) +{ + ANTLR3_UINT8 newbit[32]; + + sprintf((char *)newbit, "%d", i); + return string->insert8(string, point, (const char *)newbit); +} + +static pANTLR3_UINT8 +insert8 (pANTLR3_STRING string, ANTLR3_UINT32 point, const char * newbit) +{ + ANTLR3_UINT32 len; + + if (point >= string->len) + { + return string->append(string, newbit); + } + + len = (ANTLR3_UINT32)strlen(newbit); + + if (len == 0) + { + return string->chars; + } + + if (string->size < (string->len + len + 1)) + { + string->chars = (pANTLR3_UINT8) ANTLR3_REALLOC((void *)string->chars, (ANTLR3_UINT32)(string->len + len + 1)); + string->size = string->len + len + 1; + } + + /* Move the characters we are inserting before, including the delimiter + */ + ANTLR3_MEMMOVE((void *)(string->chars + point + len), (void *)(string->chars + point), (ANTLR3_UINT32)(string->len - point + 1)); + + /* Note we copy the exact number of bytes + */ + ANTLR3_MEMMOVE((void *)(string->chars + point), newbit, (ANTLR3_UINT32)(len)); + + string->len += len; + + return string->chars; +} + +static pANTLR3_UINT8 +insertUTF16_8 (pANTLR3_STRING string, ANTLR3_UINT32 point, const char * newbit) +{ + ANTLR3_UINT32 len; + ANTLR3_UINT32 count; + pANTLR3_UINT16 inPoint; + + if (point >= string->len) + { + return string->append8(string, newbit); + } + + len = (ANTLR3_UINT32)strlen(newbit); + + if (len == 0) + { + return string->chars; + } + + if (string->size < (string->len + len + 1)) + { + string->chars = (pANTLR3_UINT8) ANTLR3_REALLOC((void *)string->chars, (ANTLR3_UINT32)(sizeof(ANTLR3_UINT16)*(string->len + len + 1))); + string->size = string->len + len + 1; + } + + /* Move the characters we are inserting before, including the delimiter + */ + ANTLR3_MEMMOVE((void *)(((pANTLR3_UINT16)string->chars) + point + len), (void *)(((pANTLR3_UINT16)string->chars) + point), (ANTLR3_UINT32)(sizeof(ANTLR3_UINT16)*(string->len - point + 1))); + + string->len += len; + + inPoint = ((pANTLR3_UINT16)(string->chars))+point; + for (count = 0; countchars; +} + +static pANTLR3_UINT8 +insertUTF16_UTF16 (pANTLR3_STRING string, ANTLR3_UINT32 point, const char * newbit) +{ + ANTLR3_UINT32 len; + pANTLR3_UINT16 in; + + if (point >= string->len) + { + return string->append(string, newbit); + } + + /** First, determine the length of the input string + */ + in = (pANTLR3_UINT16)newbit; + len = 0; + + while (*in++ != '\0') + { + len++; + } + + if (len == 0) + { + return string->chars; + } + + if (string->size < (string->len + len + 1)) + { + string->chars = (pANTLR3_UINT8) ANTLR3_REALLOC((void *)string->chars, (ANTLR3_UINT32)(sizeof(ANTLR3_UINT16)*(string->len + len + 1))); + string->size = string->len + len + 1; + } + + /* Move the characters we are inserting before, including the delimiter + */ + ANTLR3_MEMMOVE((void *)(((pANTLR3_UINT16)string->chars) + point + len), (void *)(((pANTLR3_UINT16)string->chars) + point), (ANTLR3_UINT32)(sizeof(ANTLR3_UINT16)*(string->len - point + 1))); + + + /* Note we copy the exact number of characters + */ + ANTLR3_MEMMOVE((void *)(((pANTLR3_UINT16)string->chars) + point), newbit, (ANTLR3_UINT32)(sizeof(ANTLR3_UINT16)*(len))); + + string->len += len; + + return string->chars; +} + +static pANTLR3_UINT8 setS (pANTLR3_STRING string, pANTLR3_STRING chars) +{ + return string->set(string, (const char *)(chars->chars)); +} + +static pANTLR3_UINT8 appendS (pANTLR3_STRING string, pANTLR3_STRING newbit) +{ + /* We may be passed an empty string, in which case we just return the current pointer + */ + if (newbit == NULL || newbit->len == 0 || newbit->size == 0 || newbit->chars == NULL) + { + return string->chars; + } + else + { + return string->append(string, (const char *)(newbit->chars)); + } +} + +static pANTLR3_UINT8 insertS (pANTLR3_STRING string, ANTLR3_UINT32 point, pANTLR3_STRING newbit) +{ + return string->insert(string, point, (const char *)(newbit->chars)); +} + +/* Function that compares the text of a string to the supplied + * 8 bit character string and returns a result a la strcmp() + */ +static ANTLR3_UINT32 +compare8 (pANTLR3_STRING string, const char * compStr) +{ + return strcmp((const char *)(string->chars), compStr); +} + +/* Function that compares the text of a string with the supplied character string + * (which is assumed to be in the same encoding as the string itself) and returns a result + * a la strcmp() + */ +static ANTLR3_UINT32 +compareUTF16_8 (pANTLR3_STRING string, const char * compStr) +{ + pANTLR3_UINT16 ourString; + ANTLR3_UINT32 charDiff; + + ourString = (pANTLR3_UINT16)(string->chars); + + while (((ANTLR3_UCHAR)(*ourString) != '\0') && ((ANTLR3_UCHAR)(*compStr) != '\0')) + { + charDiff = *ourString - *compStr; + if (charDiff != 0) + { + return charDiff; + } + ourString++; + compStr++; + } + + /* At this point, one of the strings was terminated + */ + return (ANTLR3_UINT32)((ANTLR3_UCHAR)(*ourString) - (ANTLR3_UCHAR)(*compStr)); + +} + +/* Function that compares the text of a string with the supplied character string + * (which is assumed to be in the same encoding as the string itself) and returns a result + * a la strcmp() + */ +static ANTLR3_UINT32 +compareUTF16_UTF16 (pANTLR3_STRING string, const char * compStr8) +{ + pANTLR3_UINT16 ourString; + pANTLR3_UINT16 compStr; + ANTLR3_UINT32 charDiff; + + ourString = (pANTLR3_UINT16)(string->chars); + compStr = (pANTLR3_UINT16)(compStr8); + + while (((ANTLR3_UCHAR)(*ourString) != '\0') && ((ANTLR3_UCHAR)(*((pANTLR3_UINT16)compStr)) != '\0')) + { + charDiff = *ourString - *compStr; + if (charDiff != 0) + { + return charDiff; + } + ourString++; + compStr++; + } + + /* At this point, one of the strings was terminated + */ + return (ANTLR3_UINT32)((ANTLR3_UCHAR)(*ourString) - (ANTLR3_UCHAR)(*compStr)); +} + +/* Function that compares the text of a string with the supplied string + * (which is assumed to be in the same encoding as the string itself) and returns a result + * a la strcmp() + */ +static ANTLR3_UINT32 +compareS (pANTLR3_STRING string, pANTLR3_STRING compStr) +{ + return string->compare(string, (const char *)compStr->chars); +} + + +/* Function that returns the character indexed at the supplied + * offset as a 32 bit character. + */ +static ANTLR3_UCHAR +charAt8 (pANTLR3_STRING string, ANTLR3_UINT32 offset) +{ + if (offset > string->len) + { + return (ANTLR3_UCHAR)'\0'; + } + else + { + return (ANTLR3_UCHAR)(*(string->chars + offset)); + } +} + +/* Function that returns the character indexed at the supplied + * offset as a 32 bit character. + */ +static ANTLR3_UCHAR +charAtUTF16 (pANTLR3_STRING string, ANTLR3_UINT32 offset) +{ + if (offset > string->len) + { + return (ANTLR3_UCHAR)'\0'; + } + else + { + return (ANTLR3_UCHAR)(*((pANTLR3_UINT16)(string->chars) + offset)); + } +} + +/* Function that returns a substring of the supplied string a la .subString(s,e) + * in java runtimes. + */ +static pANTLR3_STRING +subString8 (pANTLR3_STRING string, ANTLR3_UINT32 startIndex, ANTLR3_UINT32 endIndex) +{ + pANTLR3_STRING newStr; + + if (endIndex > string->len) + { + endIndex = string->len + 1; + } + newStr = string->factory->newPtr(string->factory, string->chars + startIndex, endIndex - startIndex); + + return newStr; +} + +/* Returns a substring of the supplied string a la .subString(s,e) + * in java runtimes. + */ +static pANTLR3_STRING +subStringUTF16 (pANTLR3_STRING string, ANTLR3_UINT32 startIndex, ANTLR3_UINT32 endIndex) +{ + pANTLR3_STRING newStr; + + if (endIndex > string->len) + { + endIndex = string->len + 1; + } + newStr = string->factory->newPtr(string->factory, (pANTLR3_UINT8)((pANTLR3_UINT16)(string->chars) + startIndex), endIndex - startIndex); + + return newStr; +} + +/* Function that can convert the characters in the string to an integer + */ +static ANTLR3_INT32 +toInt32_8 (struct ANTLR3_STRING_struct * string) +{ + return atoi((const char *)(string->chars)); +} + +/* Function that can convert the characters in the string to an integer + */ +static ANTLR3_INT32 +toInt32_UTF16 (struct ANTLR3_STRING_struct * string) +{ + pANTLR3_UINT16 input; + ANTLR3_INT32 value; + ANTLR3_BOOLEAN negate; + + value = 0; + input = (pANTLR3_UINT16)(string->chars); + negate = ANTLR3_FALSE; + + if (*input == (ANTLR3_UCHAR)'-') + { + negate = ANTLR3_TRUE; + input++; + } + else if (*input == (ANTLR3_UCHAR)'+') + { + input++; + } + + while (*input != '\0' && isdigit(*input)) + { + value = value * 10; + value += ((ANTLR3_UINT32)(*input) - (ANTLR3_UINT32)'0'); + input++; + } + + return negate ? -value : value; +} + +/* Function that returns a pointer to an 8 bit version of the string, + * which in this case is just the string as this is + * 8 bit encodiing anyway. + */ +static pANTLR3_STRING to8_8 (pANTLR3_STRING string) +{ + return string; +} + +/* Function that returns an 8 bit version of the string, + * which in this case is returning all the UTF16 characters + * narrowed back into 8 bits, with characters that are too large + * replaced with '_' + */ +static pANTLR3_STRING to8_UTF16 (pANTLR3_STRING string) +{ + pANTLR3_STRING newStr; + ANTLR3_UINT32 i; + + /* Create a new 8 bit string + */ + newStr = newRaw8(string->factory); + + if (newStr == NULL) + { + return NULL; + } + + /* Always add one more byte for a terminator + */ + newStr->chars = (pANTLR3_UINT8) ANTLR3_MALLOC((size_t)(string->len + 1)); + newStr->size = string->len + 1; + newStr->len = string->len; + + /* Now copy each UTF16 charActer , making it an 8 bit character of + * some sort. + */ + for (i=0; ilen; i++) + { + ANTLR3_UCHAR c; + + c = *(((pANTLR3_UINT16)(string->chars)) + i); + + *(newStr->chars + i) = (ANTLR3_UINT8)(c > 255 ? '_' : c); + } + + /* Terminate + */ + *(newStr->chars + newStr->len) = '\0'; + + return newStr; +} diff --git a/antlr/libantlr3c-3.4/src/antlr3tokenstream.c b/antlr/libantlr3c-3.4/src/antlr3tokenstream.c new file mode 100644 index 0000000..ec06f15 --- /dev/null +++ b/antlr/libantlr3c-3.4/src/antlr3tokenstream.c @@ -0,0 +1,1091 @@ +/// \file +/// Default implementation of CommonTokenStream +/// + +// [The "BSD licence"] +// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC +// http://www.temporal-wave.com +// http://www.linkedin.com/in/jimidle +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. The name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include + +#ifdef ANTLR3_WINDOWS +#pragma warning( disable : 4100 ) +#endif + +// COMMON_TOKEN_STREAM API +// +static void setTokenTypeChannel (pANTLR3_COMMON_TOKEN_STREAM cts, ANTLR3_UINT32 ttype, ANTLR3_UINT32 channel); +static void discardTokenType (pANTLR3_COMMON_TOKEN_STREAM cts, ANTLR3_INT32 ttype); +static void discardOffChannel (pANTLR3_COMMON_TOKEN_STREAM cts, ANTLR3_BOOLEAN discard); +static pANTLR3_VECTOR getTokens (pANTLR3_COMMON_TOKEN_STREAM cts); +static pANTLR3_LIST getTokenRange (pANTLR3_COMMON_TOKEN_STREAM cts, ANTLR3_UINT32 start, ANTLR3_UINT32 stop); +static pANTLR3_LIST getTokensSet (pANTLR3_COMMON_TOKEN_STREAM cts, ANTLR3_UINT32 start, ANTLR3_UINT32 stop, pANTLR3_BITSET types); +static pANTLR3_LIST getTokensList (pANTLR3_COMMON_TOKEN_STREAM cts, ANTLR3_UINT32 start, ANTLR3_UINT32 stop, pANTLR3_LIST list); +static pANTLR3_LIST getTokensType (pANTLR3_COMMON_TOKEN_STREAM cts, ANTLR3_UINT32 start, ANTLR3_UINT32 stop, ANTLR3_UINT32 type); +static void reset (pANTLR3_COMMON_TOKEN_STREAM cts); + +// TOKEN_STREAM API +// +static pANTLR3_COMMON_TOKEN tokLT (pANTLR3_TOKEN_STREAM ts, ANTLR3_INT32 k); +static pANTLR3_COMMON_TOKEN dbgTokLT (pANTLR3_TOKEN_STREAM ts, ANTLR3_INT32 k); +static pANTLR3_COMMON_TOKEN get (pANTLR3_TOKEN_STREAM ts, ANTLR3_UINT32 i); +static pANTLR3_TOKEN_SOURCE getTokenSource (pANTLR3_TOKEN_STREAM ts); +static void setTokenSource (pANTLR3_TOKEN_STREAM ts, pANTLR3_TOKEN_SOURCE tokenSource); +static pANTLR3_STRING toString (pANTLR3_TOKEN_STREAM ts); +static pANTLR3_STRING toStringSS (pANTLR3_TOKEN_STREAM ts, ANTLR3_UINT32 start, ANTLR3_UINT32 stop); +static pANTLR3_STRING toStringTT (pANTLR3_TOKEN_STREAM ts, pANTLR3_COMMON_TOKEN start, pANTLR3_COMMON_TOKEN stop); +static void setDebugListener (pANTLR3_TOKEN_STREAM ts, pANTLR3_DEBUG_EVENT_LISTENER debugger); + +// INT STREAM API +// +static void consume (pANTLR3_INT_STREAM is); +static void dbgConsume (pANTLR3_INT_STREAM is); +static ANTLR3_UINT32 _LA (pANTLR3_INT_STREAM is, ANTLR3_INT32 i); +static ANTLR3_UINT32 dbgLA (pANTLR3_INT_STREAM is, ANTLR3_INT32 i); +static ANTLR3_MARKER mark (pANTLR3_INT_STREAM is); +static ANTLR3_MARKER dbgMark (pANTLR3_INT_STREAM is); +static void release (pANTLR3_INT_STREAM is, ANTLR3_MARKER mark); +static ANTLR3_UINT32 size (pANTLR3_INT_STREAM is); +static ANTLR3_MARKER tindex (pANTLR3_INT_STREAM is); +static void rewindStream (pANTLR3_INT_STREAM is, ANTLR3_MARKER marker); +static void dbgRewindStream (pANTLR3_INT_STREAM is, ANTLR3_MARKER marker); +static void rewindLast (pANTLR3_INT_STREAM is); +static void dbgRewindLast (pANTLR3_INT_STREAM is); +static void seek (pANTLR3_INT_STREAM is, ANTLR3_MARKER index); +static void dbgSeek (pANTLR3_INT_STREAM is, ANTLR3_MARKER index); +static pANTLR3_STRING getSourceName (pANTLR3_INT_STREAM is); +static void antlr3TokenStreamFree (pANTLR3_TOKEN_STREAM stream); +static void antlr3CTSFree (pANTLR3_COMMON_TOKEN_STREAM stream); + +// Helpers +// +static void fillBuffer (pANTLR3_COMMON_TOKEN_STREAM tokenStream); +static ANTLR3_UINT32 skipOffTokenChannels (pANTLR3_COMMON_TOKEN_STREAM tokenStream, ANTLR3_INT32 i); +static ANTLR3_UINT32 skipOffTokenChannelsReverse (pANTLR3_COMMON_TOKEN_STREAM tokenStream, ANTLR3_INT32 i); +static pANTLR3_COMMON_TOKEN LB (pANTLR3_COMMON_TOKEN_STREAM tokenStream, ANTLR3_INT32 i); + +ANTLR3_API pANTLR3_TOKEN_STREAM +antlr3TokenStreamNew() +{ + pANTLR3_TOKEN_STREAM stream; + + // Memory for the interface structure + // + stream = (pANTLR3_TOKEN_STREAM) ANTLR3_MALLOC(sizeof(ANTLR3_TOKEN_STREAM)); + + if (stream == NULL) + { + return NULL; + } + + // Install basic API + // + stream->free = antlr3TokenStreamFree; + + + return stream; +} + +static void +antlr3TokenStreamFree(pANTLR3_TOKEN_STREAM stream) +{ + ANTLR3_FREE(stream); +} + +static void +antlr3CTSFree (pANTLR3_COMMON_TOKEN_STREAM stream) +{ + // We only free up our subordinate interfaces if they belong + // to us, otherwise we let whoever owns them deal with them. + // + if (stream->tstream->super == stream) + { + if (stream->tstream->istream->super == stream->tstream) + { + stream->tstream->istream->free(stream->tstream->istream); + stream->tstream->istream = NULL; + } + stream->tstream->free(stream->tstream); + } + + // Now we free our own resources + // + if (stream->tokens != NULL) + { + stream->tokens->free(stream->tokens); + stream->tokens = NULL; + } + if (stream->discardSet != NULL) + { + stream->discardSet->free(stream->discardSet); + stream->discardSet = NULL; + } + if (stream->channelOverrides != NULL) + { + stream->channelOverrides->free(stream->channelOverrides); + stream->channelOverrides = NULL; + } + + // Free our memory now + // + ANTLR3_FREE(stream); +} + +// Reset a token stream so it can be used again and can reuse it's +// resources. +// +static void +reset (pANTLR3_COMMON_TOKEN_STREAM cts) +{ + + // Free any resources that ar most like specifc to the + // run we just did. + // + if (cts->discardSet != NULL) + { + cts->discardSet->free(cts->discardSet); + cts->discardSet = NULL; + } + if (cts->channelOverrides != NULL) + { + cts->channelOverrides->free(cts->channelOverrides); + cts->channelOverrides = NULL; + } + + // Now, if there were any existing tokens in the stream, + // then we just reset the vector count so that it starts + // again. We must traverse the entries unfortunately as + // there may be free pointers for custom token types and + // so on. However that is just a quick NULL check on the + // vector entries. + // + if (cts->tokens != NULL) + { + cts->tokens->clear(cts->tokens); + } + else + { + /* Install the token tracking tables + */ + cts->tokens = antlr3VectorNew(0); + } + + // Reset to defaults + // + cts->discardOffChannel = ANTLR3_FALSE; + cts->channel = ANTLR3_TOKEN_DEFAULT_CHANNEL; + cts->p = -1; +} + +ANTLR3_API pANTLR3_COMMON_TOKEN_STREAM +antlr3CommonTokenDebugStreamSourceNew(ANTLR3_UINT32 hint, pANTLR3_TOKEN_SOURCE source, pANTLR3_DEBUG_EVENT_LISTENER debugger) +{ + pANTLR3_COMMON_TOKEN_STREAM stream; + + // Create a standard token stream + // + stream = antlr3CommonTokenStreamSourceNew(hint, source); + + // Install the debugger object + // + stream->tstream->debugger = debugger; + + // Override standard token stream methods with debugging versions + // + stream->tstream->initialStreamState = ANTLR3_FALSE; + + stream->tstream->_LT = dbgTokLT; + + stream->tstream->istream->consume = dbgConsume; + stream->tstream->istream->_LA = dbgLA; + stream->tstream->istream->mark = dbgMark; + stream->tstream->istream->rewind = dbgRewindStream; + stream->tstream->istream->rewindLast = dbgRewindLast; + stream->tstream->istream->seek = dbgSeek; + + return stream; +} + +ANTLR3_API pANTLR3_COMMON_TOKEN_STREAM +antlr3CommonTokenStreamSourceNew(ANTLR3_UINT32 hint, pANTLR3_TOKEN_SOURCE source) +{ + pANTLR3_COMMON_TOKEN_STREAM stream; + + stream = antlr3CommonTokenStreamNew(hint); + + stream->channel = ANTLR3_TOKEN_DEFAULT_CHANNEL; + + stream->channelOverrides = NULL; + stream->discardSet = NULL; + stream->discardOffChannel = ANTLR3_FALSE; + + stream->tstream->setTokenSource(stream->tstream, source); + + stream->free = antlr3CTSFree; + return stream; +} + +ANTLR3_API pANTLR3_COMMON_TOKEN_STREAM +antlr3CommonTokenStreamNew(ANTLR3_UINT32 hint) +{ + pANTLR3_COMMON_TOKEN_STREAM stream; + + /* Memory for the interface structure + */ + stream = (pANTLR3_COMMON_TOKEN_STREAM) ANTLR3_MALLOC(sizeof(ANTLR3_COMMON_TOKEN_STREAM)); + + if (stream == NULL) + { + return NULL; + } + + /* Create space for the token stream interface + */ + stream->tstream = antlr3TokenStreamNew(); + stream->tstream->super = stream; + + /* Create space for the INT_STREAM interfacce + */ + stream->tstream->istream = antlr3IntStreamNew(); + stream->tstream->istream->super = (stream->tstream); + stream->tstream->istream->type = ANTLR3_TOKENSTREAM; + + /* Install the token tracking tables + */ + stream->tokens = antlr3VectorNew(0); + + /* Defaults + */ + stream->p = -1; + + /* Install the common token stream API + */ + stream->setTokenTypeChannel = setTokenTypeChannel; + stream->discardTokenType = discardTokenType; + stream->discardOffChannelToks = discardOffChannel; + stream->getTokens = getTokens; + stream->getTokenRange = getTokenRange; + stream->getTokensSet = getTokensSet; + stream->getTokensList = getTokensList; + stream->getTokensType = getTokensType; + stream->reset = reset; + + /* Install the token stream API + */ + stream->tstream->_LT = tokLT; + stream->tstream->get = get; + stream->tstream->getTokenSource = getTokenSource; + stream->tstream->setTokenSource = setTokenSource; + stream->tstream->toString = toString; + stream->tstream->toStringSS = toStringSS; + stream->tstream->toStringTT = toStringTT; + stream->tstream->setDebugListener = setDebugListener; + + /* Install INT_STREAM interface + */ + stream->tstream->istream->_LA = _LA; + stream->tstream->istream->mark = mark; + stream->tstream->istream->release = release; + stream->tstream->istream->size = size; + stream->tstream->istream->index = tindex; + stream->tstream->istream->rewind = rewindStream; + stream->tstream->istream->rewindLast= rewindLast; + stream->tstream->istream->seek = seek; + stream->tstream->istream->consume = consume; + stream->tstream->istream->getSourceName = getSourceName; + + return stream; +} + +// Install a debug listener adn switch to debug mode methods +// +static void +setDebugListener (pANTLR3_TOKEN_STREAM ts, pANTLR3_DEBUG_EVENT_LISTENER debugger) +{ + // Install the debugger object + // + ts->debugger = debugger; + + // Override standard token stream methods with debugging versions + // + ts->initialStreamState = ANTLR3_FALSE; + + ts->_LT = dbgTokLT; + + ts->istream->consume = dbgConsume; + ts->istream->_LA = dbgLA; + ts->istream->mark = dbgMark; + ts->istream->rewind = dbgRewindStream; + ts->istream->rewindLast = dbgRewindLast; + ts->istream->seek = dbgSeek; +} + +/** Get the ith token from the current position 1..n where k=1 is the +* first symbol of lookahead. +*/ +static pANTLR3_COMMON_TOKEN +tokLT (pANTLR3_TOKEN_STREAM ts, ANTLR3_INT32 k) +{ + ANTLR3_INT32 i; + ANTLR3_INT32 n; + pANTLR3_COMMON_TOKEN_STREAM cts; + + cts = (pANTLR3_COMMON_TOKEN_STREAM)ts->super; + + if (k < 0) + { + return LB(cts, -k); + } + + if (cts->p == -1) + { + fillBuffer(cts); + } + + // Here we used to check for k == 0 and return 0, but this seems + // a superfluous check to me. LT(k=0) is therefore just undefined + // and we won't waste the clock cycles on the check + // + + if ((cts->p + k - 1) >= (ANTLR3_INT32)ts->istream->cachedSize) + { + pANTLR3_COMMON_TOKEN teof = &(ts->tokenSource->eofToken); + + teof->setStartIndex (teof, ts->istream->index (ts->istream)); + teof->setStopIndex (teof, ts->istream->index (ts->istream)); + return teof; + } + + i = cts->p; + n = 1; + + /* Need to find k good tokens, skipping ones that are off channel + */ + while ( n < k) + { + /* Skip off-channel tokens */ + i = skipOffTokenChannels(cts, i+1); /* leave p on valid token */ + n++; + } + if ( (ANTLR3_UINT32) i >= ts->istream->cachedSize) + { + pANTLR3_COMMON_TOKEN teof = &(ts->tokenSource->eofToken); + + teof->setStartIndex (teof, ts->istream->index(ts->istream)); + teof->setStopIndex (teof, ts->istream->index(ts->istream)); + return teof; + } + + // Here the token must be in the input vector. Rather then incur + // function call penalty, we just return the pointer directly + // from the vector + // + return (pANTLR3_COMMON_TOKEN)cts->tokens->elements[i].element; + //return (pANTLR3_COMMON_TOKEN)cts->tokens->get(cts->tokens, i); +} + +/// Debug only method to flag consumption of initial off-channel +/// tokens in the input stream +/// +static void +consumeInitialHiddenTokens(pANTLR3_INT_STREAM is) +{ + ANTLR3_MARKER first; + ANTLR3_INT32 i; + pANTLR3_TOKEN_STREAM ts; + + ts = (pANTLR3_TOKEN_STREAM) is->super; + first = is->index(is); + + for (i=0; idebugger->consumeHiddenToken(ts->debugger, ts->get(ts, i)); + } + + ts->initialStreamState = ANTLR3_FALSE; + +} + +/// As per the normal tokLT but sends information to the debugger +/// +static pANTLR3_COMMON_TOKEN +dbgTokLT (pANTLR3_TOKEN_STREAM ts, ANTLR3_INT32 k) +{ + if (ts->initialStreamState == ANTLR3_TRUE) + { + consumeInitialHiddenTokens(ts->istream); + } + return tokLT(ts, k); +} + +#ifdef ANTLR3_WINDOWS + /* When fully optimized VC7 complains about non reachable code. + * Not yet sure if this is an optimizer bug, or a bug in the flow analysis + */ +#pragma warning( disable : 4702 ) +#endif + +static pANTLR3_COMMON_TOKEN +LB(pANTLR3_COMMON_TOKEN_STREAM cts, ANTLR3_INT32 k) +{ + ANTLR3_INT32 i; + ANTLR3_INT32 n; + + if (cts->p == -1) + { + fillBuffer(cts); + } + if (k == 0) + { + return NULL; + } + if ((cts->p - k) < 0) + { + return NULL; + } + + i = cts->p; + n = 1; + + /* Need to find k good tokens, going backwards, skipping ones that are off channel + */ + while (n <= (ANTLR3_INT32) k) + { + /* Skip off-channel tokens + */ + + i = skipOffTokenChannelsReverse(cts, i - 1); /* leave p on valid token */ + n++; + } + if (i < 0) + { + return NULL; + } + // Here the token must be in the input vector. Rather then incut + // function call penalty, we jsut return the pointer directly + // from the vector + // + return (pANTLR3_COMMON_TOKEN)cts->tokens->elements[i].element; +} + +static pANTLR3_COMMON_TOKEN +get (pANTLR3_TOKEN_STREAM ts, ANTLR3_UINT32 i) +{ + pANTLR3_COMMON_TOKEN_STREAM cts; + + cts = (pANTLR3_COMMON_TOKEN_STREAM)ts->super; + + return (pANTLR3_COMMON_TOKEN)(cts->tokens->get(cts->tokens, i)); /* Token index is zero based but vectors are 1 based */ +} + +static pANTLR3_TOKEN_SOURCE +getTokenSource (pANTLR3_TOKEN_STREAM ts) +{ + return ts->tokenSource; +} + +static void +setTokenSource ( pANTLR3_TOKEN_STREAM ts, + pANTLR3_TOKEN_SOURCE tokenSource) +{ + ts->tokenSource = tokenSource; +} + +static pANTLR3_STRING +toString (pANTLR3_TOKEN_STREAM ts) +{ + pANTLR3_COMMON_TOKEN_STREAM cts; + + cts = (pANTLR3_COMMON_TOKEN_STREAM)ts->super; + + if (cts->p == -1) + { + fillBuffer(cts); + } + + return ts->toStringSS(ts, 0, ts->istream->size(ts->istream)); +} + +static pANTLR3_STRING +toStringSS(pANTLR3_TOKEN_STREAM ts, ANTLR3_UINT32 start, ANTLR3_UINT32 stop) +{ + pANTLR3_STRING string; + pANTLR3_TOKEN_SOURCE tsource; + pANTLR3_COMMON_TOKEN tok; + ANTLR3_UINT32 i; + pANTLR3_COMMON_TOKEN_STREAM cts; + + cts = (pANTLR3_COMMON_TOKEN_STREAM) ts->super; + + if (cts->p == -1) + { + fillBuffer(cts); + } + if (stop >= ts->istream->size(ts->istream)) + { + stop = ts->istream->size(ts->istream) - 1; + } + + /* Who is giving us these tokens? + */ + tsource = ts->getTokenSource(ts); + + if (tsource != NULL && cts->tokens != NULL) + { + /* Finally, let's get a string + */ + string = tsource->strFactory->newRaw(tsource->strFactory); + + for (i = start; i <= stop; i++) + { + tok = ts->get(ts, i); + if (tok != NULL) + { + string->appendS(string, tok->getText(tok)); + } + } + + return string; + } + return NULL; + +} + +static pANTLR3_STRING +toStringTT (pANTLR3_TOKEN_STREAM ts, pANTLR3_COMMON_TOKEN start, pANTLR3_COMMON_TOKEN stop) +{ + if (start != NULL && stop != NULL) + { + return ts->toStringSS(ts, (ANTLR3_UINT32)start->getTokenIndex(start), (ANTLR3_UINT32)stop->getTokenIndex(stop)); + } + else + { + return NULL; + } +} + +/** Move the input pointer to the next incoming token. The stream + * must become active with LT(1) available. consume() simply + * moves the input pointer so that LT(1) points at the next + * input symbol. Consume at least one token. + * + * Walk past any token not on the channel the parser is listening to. + */ +static void +consume (pANTLR3_INT_STREAM is) +{ + pANTLR3_COMMON_TOKEN_STREAM cts; + pANTLR3_TOKEN_STREAM ts; + + ts = (pANTLR3_TOKEN_STREAM) is->super; + cts = (pANTLR3_COMMON_TOKEN_STREAM) ts->super; + + if ((ANTLR3_UINT32)cts->p < cts->tokens->count) + { + cts->p++; + cts->p = skipOffTokenChannels(cts, cts->p); + } +} + + +/// As per ordinary consume but notifies the debugger about hidden +/// tokens and so on. +/// +static void +dbgConsume (pANTLR3_INT_STREAM is) +{ + pANTLR3_TOKEN_STREAM ts; + ANTLR3_MARKER a; + ANTLR3_MARKER b; + pANTLR3_COMMON_TOKEN t; + + ts = (pANTLR3_TOKEN_STREAM) is->super; + + if (ts->initialStreamState == ANTLR3_TRUE) + { + consumeInitialHiddenTokens(is); + } + + a = is->index(is); // Where are we right now? + t = ts->_LT(ts, 1); // Current token from stream + + consume(is); // Standard consumer + + b = is->index(is); // Where are we after consuming 1 on channel token? + + ts->debugger->consumeToken(ts->debugger, t); // Tell the debugger that we consumed the first token + + if (b>a+1) + { + // The standard consume caused the index to advance by more than 1, + // which can only happen if it skipped some off-channel tokens. + // we need to tell the debugger about those tokens. + // + ANTLR3_MARKER i; + + for (i = a+1; idebugger->consumeHiddenToken(ts->debugger, ts->get(ts, (ANTLR3_UINT32)i)); + } + + } +} + +/** A simple filter mechanism whereby you can tell this token stream + * to force all tokens of type ttype to be on channel. For example, + * when interpreting, we cannot execute actions so we need to tell + * the stream to force all WS and NEWLINE to be a different, ignored, + * channel. + */ +static void +setTokenTypeChannel (pANTLR3_COMMON_TOKEN_STREAM tokenStream, ANTLR3_UINT32 ttype, ANTLR3_UINT32 channel) +{ + if (tokenStream->channelOverrides == NULL) + { + tokenStream->channelOverrides = antlr3ListNew(10); + } + + /* We add one to the channel so we can distinguish NULL as being no entry in the + * table for a particular token type. + */ + tokenStream->channelOverrides->put(tokenStream->channelOverrides, ttype, ANTLR3_FUNC_PTR((ANTLR3_UINT32)channel + 1), NULL); +} + +static void +discardTokenType (pANTLR3_COMMON_TOKEN_STREAM tokenStream, ANTLR3_INT32 ttype) +{ + if (tokenStream->discardSet == NULL) + { + tokenStream->discardSet = antlr3ListNew(31); + } + + /* We add one to the channel so we can distinguish NULL as being no entry in the + * table for a particular token type. We could use bitsets for this I suppose too. + */ + tokenStream->discardSet->put(tokenStream->discardSet, ttype, ANTLR3_FUNC_PTR((ANTLR3_UINT32)ttype + 1), NULL); +} + +static void +discardOffChannel (pANTLR3_COMMON_TOKEN_STREAM tokenStream, ANTLR3_BOOLEAN discard) +{ + tokenStream->discardOffChannel = discard; +} + +static pANTLR3_VECTOR +getTokens (pANTLR3_COMMON_TOKEN_STREAM tokenStream) +{ + if (tokenStream->p == -1) + { + fillBuffer(tokenStream); + } + + return tokenStream->tokens; +} + +static pANTLR3_LIST +getTokenRange (pANTLR3_COMMON_TOKEN_STREAM tokenStream, ANTLR3_UINT32 start, ANTLR3_UINT32 stop) +{ + return tokenStream->getTokensSet(tokenStream, start, stop, NULL); +} +/** Given a start and stop index, return a List of all tokens in + * the token type BitSet. Return null if no tokens were found. This + * method looks at both on and off channel tokens. + */ +static pANTLR3_LIST +getTokensSet (pANTLR3_COMMON_TOKEN_STREAM tokenStream, ANTLR3_UINT32 start, ANTLR3_UINT32 stop, pANTLR3_BITSET types) +{ + pANTLR3_LIST filteredList; + ANTLR3_UINT32 i; + ANTLR3_UINT32 n; + pANTLR3_COMMON_TOKEN tok; + + if (tokenStream->p == -1) + { + fillBuffer(tokenStream); + } + if (stop > tokenStream->tstream->istream->size(tokenStream->tstream->istream)) + { + stop = tokenStream->tstream->istream->size(tokenStream->tstream->istream); + } + if (start > stop) + { + return NULL; + } + + /* We have the range set, now we need to iterate through the + * installed tokens and create a new list with just the ones we want + * in it. We are just moving pointers about really. + */ + filteredList = antlr3ListNew((ANTLR3_UINT32)tokenStream->tstream->istream->size(tokenStream->tstream->istream)); + + for (i = start, n = 0; i<= stop; i++) + { + tok = tokenStream->tstream->get(tokenStream->tstream, i); + + if ( types == NULL + || types->isMember(types, tok->getType(tok) == ANTLR3_TRUE) + ) + { + filteredList->put(filteredList, n++, (void *)tok, NULL); + } + } + + /* Did we get any then? + */ + if (filteredList->size(filteredList) == 0) + { + filteredList->free(filteredList); + filteredList = NULL; + } + + return filteredList; +} + +static pANTLR3_LIST +getTokensList (pANTLR3_COMMON_TOKEN_STREAM tokenStream, ANTLR3_UINT32 start, ANTLR3_UINT32 stop, pANTLR3_LIST list) +{ + pANTLR3_BITSET bitSet; + pANTLR3_LIST newlist; + + bitSet = antlr3BitsetList(list->table); + + newlist = tokenStream->getTokensSet(tokenStream, start, stop, bitSet); + + bitSet->free(bitSet); + + return newlist; + +} + +static pANTLR3_LIST +getTokensType (pANTLR3_COMMON_TOKEN_STREAM tokenStream, ANTLR3_UINT32 start, ANTLR3_UINT32 stop, ANTLR3_UINT32 type) +{ + pANTLR3_BITSET bitSet; + pANTLR3_LIST newlist; + + bitSet = antlr3BitsetOf(type, -1); + newlist = tokenStream->getTokensSet(tokenStream, start, stop, bitSet); + + bitSet->free(bitSet); + + return newlist; +} + +static ANTLR3_UINT32 +_LA (pANTLR3_INT_STREAM is, ANTLR3_INT32 i) +{ + pANTLR3_TOKEN_STREAM ts; + pANTLR3_COMMON_TOKEN tok; + + ts = (pANTLR3_TOKEN_STREAM) is->super; + + tok = ts->_LT(ts, i); + + if (tok != NULL) + { + return tok->getType(tok); + } + else + { + return ANTLR3_TOKEN_INVALID; + } +} + +/// As per _LA() but for debug mode. +/// +static ANTLR3_UINT32 +dbgLA (pANTLR3_INT_STREAM is, ANTLR3_INT32 i) +{ + pANTLR3_TOKEN_STREAM ts; + + ts = (pANTLR3_TOKEN_STREAM) is->super; + + if (ts->initialStreamState == ANTLR3_TRUE) + { + consumeInitialHiddenTokens(is); + } + ts->debugger->LT(ts->debugger, i, tokLT(ts, i)); + return _LA(is, i); +} + +static ANTLR3_MARKER +mark (pANTLR3_INT_STREAM is) +{ + is->lastMarker = is->index(is); + return is->lastMarker; +} + +/// As per mark() but with a call to tell the debugger we are doing this +/// +static ANTLR3_MARKER +dbgMark (pANTLR3_INT_STREAM is) +{ + pANTLR3_TOKEN_STREAM ts; + + ts = (pANTLR3_TOKEN_STREAM) is->super; + + is->lastMarker = is->index(is); + ts->debugger->mark(ts->debugger, is->lastMarker); + + return is->lastMarker; +} + +static void +release (pANTLR3_INT_STREAM is, ANTLR3_MARKER mark) +{ + return; +} + +static ANTLR3_UINT32 +size (pANTLR3_INT_STREAM is) +{ + pANTLR3_COMMON_TOKEN_STREAM cts; + pANTLR3_TOKEN_STREAM ts; + + if (is->cachedSize > 0) + { + return is->cachedSize; + } + ts = (pANTLR3_TOKEN_STREAM) is->super; + cts = (pANTLR3_COMMON_TOKEN_STREAM) ts->super; + + is->cachedSize = cts->tokens->count; + return is->cachedSize; +} + +static ANTLR3_MARKER +tindex (pANTLR3_INT_STREAM is) +{ + pANTLR3_COMMON_TOKEN_STREAM cts; + pANTLR3_TOKEN_STREAM ts; + + ts = (pANTLR3_TOKEN_STREAM) is->super; + cts = (pANTLR3_COMMON_TOKEN_STREAM) ts->super; + + return cts->p; +} + +static void +dbgRewindLast (pANTLR3_INT_STREAM is) +{ + pANTLR3_TOKEN_STREAM ts; + + ts = (pANTLR3_TOKEN_STREAM) is->super; + + ts->debugger->rewindLast(ts->debugger); + + is->rewind(is, is->lastMarker); +} +static void +rewindLast (pANTLR3_INT_STREAM is) +{ + is->rewind(is, is->lastMarker); +} +static void +rewindStream (pANTLR3_INT_STREAM is, ANTLR3_MARKER marker) +{ + is->seek(is, (ANTLR3_UINT32)(marker)); +} +static void +dbgRewindStream (pANTLR3_INT_STREAM is, ANTLR3_MARKER marker) +{ + pANTLR3_TOKEN_STREAM ts; + + ts = (pANTLR3_TOKEN_STREAM) is->super; + + ts->debugger->rewind(ts->debugger, marker); + + is->seek(is, (ANTLR3_UINT32)(marker)); +} + +static void +seek (pANTLR3_INT_STREAM is, ANTLR3_MARKER index) +{ + pANTLR3_COMMON_TOKEN_STREAM cts; + pANTLR3_TOKEN_STREAM ts; + + ts = (pANTLR3_TOKEN_STREAM) is->super; + cts = (pANTLR3_COMMON_TOKEN_STREAM) ts->super; + + cts->p = (ANTLR3_UINT32)index; +} +static void +dbgSeek (pANTLR3_INT_STREAM is, ANTLR3_MARKER index) +{ + // TODO: Implement seek in debugger when Ter adds it to Java + // + seek(is, index); +} +ANTLR3_API void +fillBufferExt(pANTLR3_COMMON_TOKEN_STREAM tokenStream) +{ + fillBuffer(tokenStream); +} +static void +fillBuffer(pANTLR3_COMMON_TOKEN_STREAM tokenStream) { + ANTLR3_UINT32 index; + pANTLR3_COMMON_TOKEN tok; + ANTLR3_BOOLEAN discard; + void * channelI; + + /* Start at index 0 of course + */ + index = 0; + + /* Pick out the next token from the token source + * Remember we just get a pointer (reference if you like) here + * and so if we store it anywhere, we don't set any pointers to auto free it. + */ + tok = tokenStream->tstream->tokenSource->nextToken(tokenStream->tstream->tokenSource); + + while (tok != NULL && tok->type != ANTLR3_TOKEN_EOF) + { + discard = ANTLR3_FALSE; /* Assume we are not discarding */ + + /* I employ a bit of a trick, or perhaps hack here. Rather than + * store a pointer to a structure in the override map and discard set + * we store the value + 1 cast to a void *. Hence on systems where NULL = (void *)0 + * we can distinguish "not being there" from "being channel or type 0" + */ + + if (tokenStream->discardSet != NULL + && tokenStream->discardSet->get(tokenStream->discardSet, tok->getType(tok)) != NULL) + { + discard = ANTLR3_TRUE; + } + else if ( tokenStream->discardOffChannel == ANTLR3_TRUE + && tok->getChannel(tok) != tokenStream->channel + ) + { + discard = ANTLR3_TRUE; + } + else if (tokenStream->channelOverrides != NULL) + { + /* See if this type is in the override map + */ + channelI = tokenStream->channelOverrides->get(tokenStream->channelOverrides, tok->getType(tok) + 1); + + if (channelI != NULL) + { + /* Override found + */ + tok->setChannel(tok, ANTLR3_UINT32_CAST(channelI) - 1); + } + } + + /* If not discarding it, add it to the list at the current index + */ + if (discard == ANTLR3_FALSE) + { + /* Add it, indicating that we will delete it and the table should not + */ + tok->setTokenIndex(tok, index); + tokenStream->p++; + tokenStream->tokens->add(tokenStream->tokens, (void *) tok, NULL); + index++; + } + + tok = tokenStream->tstream->tokenSource->nextToken(tokenStream->tstream->tokenSource); + } + + /* Cache the size so we don't keep doing indirect method calls. We do this as + * early as possible so that anything after this may utilize the cached value. + */ + tokenStream->tstream->istream->cachedSize = tokenStream->tokens->count; + + /* Set the consume pointer to the first token that is on our channel + */ + tokenStream->p = 0; + tokenStream->p = skipOffTokenChannels(tokenStream, tokenStream->p); + +} + +/// Given a starting index, return the index of the first on-channel +/// token. +/// +static ANTLR3_UINT32 +skipOffTokenChannels(pANTLR3_COMMON_TOKEN_STREAM tokenStream, ANTLR3_INT32 i) { + ANTLR3_INT32 n; + pANTLR3_COMMON_TOKEN tok; + + n = tokenStream->tstream->istream->cachedSize; + + while (i < n) + { + tok = (pANTLR3_COMMON_TOKEN)tokenStream->tokens->elements[i].element; + + if (tok->channel!= tokenStream->channel) + { + i++; + } + else + { + return i; + } + } + return i; +} + +static ANTLR3_UINT32 +skipOffTokenChannelsReverse(pANTLR3_COMMON_TOKEN_STREAM tokenStream, ANTLR3_INT32 x) +{ + pANTLR3_COMMON_TOKEN tok; + + while (x >= 0) + { + tok = (pANTLR3_COMMON_TOKEN)tokenStream->tokens->elements[x].element; + + if ((tok->channel != tokenStream->channel)) + { + x--; + } + else + { + return x; + } + } + return x; +} + +/// Return a string that represents the name assoicated with the input source +/// +/// /param[in] is The ANTLR3_INT_STREAM interface that is representing this token stream. +/// +/// /returns +/// /implements ANTLR3_INT_STREAM_struct::getSourceName() +/// +static pANTLR3_STRING +getSourceName (pANTLR3_INT_STREAM is) +{ + // Slightly convoluted as we must trace back to the lexer's input source + // via the token source. The streamName that is here is not initialized + // because this is a token stream, not a file or string stream, which are the + // only things that have a context for a source name. + // + return ((pANTLR3_TOKEN_STREAM)(is->super))->tokenSource->fileName; +} diff --git a/antlr/libantlr3c-3.4/src/antlr3treeparser.c b/antlr/libantlr3c-3.4/src/antlr3treeparser.c new file mode 100644 index 0000000..b7e035a --- /dev/null +++ b/antlr/libantlr3c-3.4/src/antlr3treeparser.c @@ -0,0 +1,255 @@ +/** \file + * Implementation of the tree parser and overrides for the base recognizer + */ + +// [The "BSD licence"] +// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC +// http://www.temporal-wave.com +// http://www.linkedin.com/in/jimidle +// +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions +// are met: +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// 3. The name of the author may not be used to endorse or promote products +// derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +#include + +/* BASE Recognizer overrides + */ +static void mismatch (pANTLR3_BASE_RECOGNIZER recognizer, ANTLR3_UINT32 ttype, pANTLR3_BITSET_LIST follow); + +/* Tree parser API + */ +static void setTreeNodeStream (pANTLR3_TREE_PARSER parser, pANTLR3_COMMON_TREE_NODE_STREAM input); +static pANTLR3_COMMON_TREE_NODE_STREAM + getTreeNodeStream (pANTLR3_TREE_PARSER parser); +static void freeParser (pANTLR3_TREE_PARSER parser); +static void * getCurrentInputSymbol (pANTLR3_BASE_RECOGNIZER recognizer, pANTLR3_INT_STREAM istream); +static void * getMissingSymbol (pANTLR3_BASE_RECOGNIZER recognizer, pANTLR3_INT_STREAM istream, pANTLR3_EXCEPTION e, + ANTLR3_UINT32 expectedTokenType, pANTLR3_BITSET_LIST follow); + + +ANTLR3_API pANTLR3_TREE_PARSER +antlr3TreeParserNewStream(ANTLR3_UINT32 sizeHint, pANTLR3_COMMON_TREE_NODE_STREAM ctnstream, pANTLR3_RECOGNIZER_SHARED_STATE state) +{ + pANTLR3_TREE_PARSER parser; + + /** Allocate tree parser memory + */ + parser =(pANTLR3_TREE_PARSER) ANTLR3_MALLOC(sizeof(ANTLR3_TREE_PARSER)); + + if (parser == NULL) + { + return NULL; + } + + /* Create and install a base recognizer which does most of the work for us + */ + parser->rec = antlr3BaseRecognizerNew(ANTLR3_TYPE_PARSER, sizeHint, state); + + if (parser->rec == NULL) + { + parser->free(parser); + return NULL; + } + + /* Ensure we can track back to the tree parser super structure + * from the base recognizer structure + */ + parser->rec->super = parser; + parser->rec->type = ANTLR3_TYPE_TREE_PARSER; + + /* Install our base recognizer overrides + */ + parser->rec->mismatch = mismatch; + parser->rec->exConstruct = antlr3MTNExceptionNew; + parser->rec->getCurrentInputSymbol = getCurrentInputSymbol; + parser->rec->getMissingSymbol = getMissingSymbol; + + /* Install tree parser API + */ + parser->getTreeNodeStream = getTreeNodeStream; + parser->setTreeNodeStream = setTreeNodeStream; + parser->free = freeParser; + + /* Install the tree node stream + */ + parser->setTreeNodeStream(parser, ctnstream); + + return parser; +} + +/** + * \brief + * Creates a new Mismatched Tree Nde Exception and inserts in the recognizer + * exception stack. + * + * \param recognizer + * Context pointer for this recognizer + * + */ +ANTLR3_API void +antlr3MTNExceptionNew(pANTLR3_BASE_RECOGNIZER recognizer) +{ + /* Create a basic recognition exception structure + */ + antlr3RecognitionExceptionNew(recognizer); + + /* Now update it to indicate this is a Mismatched token exception + */ + recognizer->state->exception->name = ANTLR3_MISMATCHED_TREE_NODE_NAME; + recognizer->state->exception->type = ANTLR3_MISMATCHED_TREE_NODE_EXCEPTION; + + return; +} + + +static void +freeParser (pANTLR3_TREE_PARSER parser) +{ + if (parser->rec != NULL) + { + // This may have ben a delegate or delegator parser, in which case the + // state may already have been freed (and set to NULL therefore) + // so we ignore the state if we don't have it. + // + if (parser->rec->state != NULL) + { + if (parser->rec->state->following != NULL) + { + parser->rec->state->following->free(parser->rec->state->following); + parser->rec->state->following = NULL; + } + } + parser->rec->free(parser->rec); + parser->rec = NULL; + } + + ANTLR3_FREE(parser); +} + +/** Set the input stream and reset the parser + */ +static void +setTreeNodeStream (pANTLR3_TREE_PARSER parser, pANTLR3_COMMON_TREE_NODE_STREAM input) +{ + parser->ctnstream = input; + parser->rec->reset (parser->rec); + parser->ctnstream->reset (parser->ctnstream); +} + +/** Return a pointer to the input stream + */ +static pANTLR3_COMMON_TREE_NODE_STREAM +getTreeNodeStream (pANTLR3_TREE_PARSER parser) +{ + return parser->ctnstream; +} + + +/** Override for standard base recognizer mismatch function + * as we have DOWN/UP nodes in the stream that have no line info, + * plus we want to alter the exception type. + */ +static void +mismatch (pANTLR3_BASE_RECOGNIZER recognizer, ANTLR3_UINT32 ttype, pANTLR3_BITSET_LIST follow) +{ + recognizer->exConstruct(recognizer); + recognizer->recoverFromMismatchedToken(recognizer, ttype, follow); +} + +#ifdef ANTLR3_WINDOWS +#pragma warning (push) +#pragma warning (disable : 4100) +#endif + +// Default implementation is for parser and assumes a token stream as supplied by the runtime. +// You MAY need override this function if the standard TOKEN_STREAM is not what you are using. +// +static void * +getCurrentInputSymbol (pANTLR3_BASE_RECOGNIZER recognizer, pANTLR3_INT_STREAM istream) +{ + pANTLR3_TREE_NODE_STREAM tns; + pANTLR3_COMMON_TREE_NODE_STREAM ctns; + + tns = (pANTLR3_TREE_NODE_STREAM)(istream->super); + ctns = tns->ctns; + return tns->_LT(tns, 1); +} + + +// Default implementation is for parser and assumes a token stream as supplied by the runtime. +// You MAY need override this function if the standard BASE_TREE is not what you are using. +// +static void * +getMissingSymbol (pANTLR3_BASE_RECOGNIZER recognizer, pANTLR3_INT_STREAM istream, pANTLR3_EXCEPTION e, + ANTLR3_UINT32 expectedTokenType, pANTLR3_BITSET_LIST follow) +{ + pANTLR3_TREE_NODE_STREAM tns; + pANTLR3_COMMON_TREE_NODE_STREAM ctns; + pANTLR3_BASE_TREE node; + pANTLR3_BASE_TREE current; + pANTLR3_COMMON_TOKEN token; + pANTLR3_STRING text; + ANTLR3_INT32 i; + + // Dereference the standard pointers + // + tns = (pANTLR3_TREE_NODE_STREAM)(istream->super); + ctns = tns->ctns; + + // Create a new empty node, by stealing the current one, or the previous one if the current one is EOF + // + current = tns->_LT(tns, 1); + i = -1; + + if (current == &ctns->EOF_NODE.baseTree) + { + current = tns->_LT(tns, -1); + i--; + } + while (((pANTLR3_COMMON_TREE)(current->super))->factory == NULL) + { + current = tns->_LT(tns, i--); + } + + node = current->dupNode(current); + + // Find the newly dupicated token + // + token = node->getToken(node); + + // Create the token text that shows it has been inserted + // + token->setText8 (token, (pANTLR3_UINT8)"getText (token); + text->append8 (text, (const char *)recognizer->state->tokenNames[expectedTokenType]); + text->append8 (text, (const char *)">"); + + // Finally return the pointer to our new node + // + return node; +} +#ifdef ANTLR3_WINDOWS +#pragma warning (pop) +#endif + diff --git a/antlr/libantlr3c-3.4/stamp-h1 b/antlr/libantlr3c-3.4/stamp-h1 new file mode 100644 index 0000000..d9e70fd --- /dev/null +++ b/antlr/libantlr3c-3.4/stamp-h1 @@ -0,0 +1 @@ +timestamp for antlr3config.h diff --git a/antlr/libantlr3c-3.4/vsrulefiles/antlr3lexer.rules b/antlr/libantlr3c-3.4/vsrulefiles/antlr3lexer.rules new file mode 100644 index 0000000..d80fefa --- /dev/null +++ b/antlr/libantlr3c-3.4/vsrulefiles/antlr3lexer.rules @@ -0,0 +1,199 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/antlr/libantlr3c-3.4/vsrulefiles/antlr3lexerandparser.rules b/antlr/libantlr3c-3.4/vsrulefiles/antlr3lexerandparser.rules new file mode 100644 index 0000000..12d100a --- /dev/null +++ b/antlr/libantlr3c-3.4/vsrulefiles/antlr3lexerandparser.rules @@ -0,0 +1,201 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/antlr/libantlr3c-3.4/vsrulefiles/antlr3parser.rules b/antlr/libantlr3c-3.4/vsrulefiles/antlr3parser.rules new file mode 100644 index 0000000..6332946 --- /dev/null +++ b/antlr/libantlr3c-3.4/vsrulefiles/antlr3parser.rules @@ -0,0 +1,201 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/antlr/libantlr3c-3.4/vsrulefiles/antlr3treeparser.rules b/antlr/libantlr3c-3.4/vsrulefiles/antlr3treeparser.rules new file mode 100644 index 0000000..1f60f77 --- /dev/null +++ b/antlr/libantlr3c-3.4/vsrulefiles/antlr3treeparser.rules @@ -0,0 +1,201 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/antlr/test-file b/antlr/test-file new file mode 100644 index 0000000..0e7f8f0 --- /dev/null +++ b/antlr/test-file @@ -0,0 +1,2 @@ +y = min(1, z) +z = y+1 diff --git a/antlr/test-system b/antlr/test-system new file mode 100644 index 0000000..68f8d4c --- /dev/null +++ b/antlr/test-system @@ -0,0 +1,100 @@ +x0 = max(0) +x1 = x0 +x2 = x1 +x3 = x2 +x4 = x3 +x5 = x4 +x6 = x5 +x7 = x6 +x8 = x7 +x9 = x8 +x10 = x9 +x11 = x10 +x12 = x11 +x13 = x12 +x14 = x13 +x15 = x14 +x16 = x15 +x17 = x16 +x18 = x17 +x19 = x18 +x20 = x19 +x21 = x20 +x22 = x21 +x23 = x22 +x24 = x23 +x25 = x24 +x26 = x25 +x27 = x26 +x28 = x27 +x29 = x28 +x30 = x29 +x31 = x30 +x32 = x31 +x33 = x32 +x34 = x33 +x35 = x34 +x36 = x35 +x37 = x36 +x38 = x37 +x39 = x38 +x40 = x39 +x41 = x40 +x42 = x41 +x43 = x42 +x44 = x43 +x45 = x44 +x46 = x45 +x47 = x46 +x48 = x47 +x49 = x48 +x50 = x49 +x51 = x50 +x52 = x51 +x53 = x52 +x54 = x53 +x55 = x54 +x56 = x55 +x57 = x56 +x58 = x57 +x59 = x58 +x60 = x59 +x61 = x60 +x62 = x61 +x63 = x62 +x64 = x63 +x65 = x64 +x66 = x65 +x67 = x66 +x68 = x67 +x69 = x68 +x70 = x69 +x71 = x70 +x72 = x71 +x73 = x72 +x74 = x73 +x75 = x74 +x76 = x75 +x77 = x76 +x78 = x77 +x79 = x78 +x80 = x79 +x81 = x80 +x82 = x81 +x83 = x82 +x84 = x83 +x85 = x84 +x86 = x85 +x87 = x86 +x88 = x87 +x89 = x88 +x90 = x89 +x91 = x90 +x92 = x91 +x93 = x92 +x94 = x93 +x95 = x94 +x96 = x95 +x97 = x96 +x98 = x97 +x99 = x98 diff --git a/impl/Makefile b/impl/Makefile index 4a3b558..f056d1f 100644 --- a/impl/Makefile +++ b/impl/Makefile @@ -19,13 +19,16 @@ fastest-main: build-dir grammar $(CPP) main.cpp *.o -o $(BUILD)/main $(OPTIMISED_FLAGS) grammar: build-dir - java -jar antlr/antlr-3.4-complete.jar EquationSystem.g + java -jar ../antlr/antlr-3.4-complete.jar EquationSystem.g $(CC) *.c -c -lantrl3c build-dir: mkdir -p $(BUILD) +test: main + bash ./test/run ./build/main + clean: rm -rf $(BUILD) rm -rf *.o *.c *.h *.tokens - # antlr o, c, h and tokens files +# antlr o, c, h and tokens files diff --git a/impl/antlr/antlr-3.4-complete.jar b/impl/antlr/antlr-3.4-complete.jar deleted file mode 100644 index 9c985c7..0000000 Binary files a/impl/antlr/antlr-3.4-complete.jar and /dev/null differ diff --git a/impl/antlr/libantlr3c-3.4/.deps/antlr3baserecognizer.Plo b/impl/antlr/libantlr3c-3.4/.deps/antlr3baserecognizer.Plo deleted file mode 100644 index 1c74dc3..0000000 --- a/impl/antlr/libantlr3c-3.4/.deps/antlr3baserecognizer.Plo +++ /dev/null @@ -1,274 +0,0 @@ -antlr3baserecognizer.lo: src/antlr3baserecognizer.c \ - include/antlr3baserecognizer.h include/antlr3defs.h \ - include/antlr3errors.h antlr3config.h /usr/include/stdio.h \ - /usr/include/features.h /usr/include/i386-linux-gnu/bits/predefs.h \ - /usr/include/i386-linux-gnu/sys/cdefs.h \ - /usr/include/i386-linux-gnu/bits/wordsize.h \ - /usr/include/i386-linux-gnu/gnu/stubs.h \ - /usr/include/i386-linux-gnu/gnu/stubs-32.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include/stddef.h \ - /usr/include/i386-linux-gnu/bits/types.h \ - /usr/include/i386-linux-gnu/bits/typesizes.h /usr/include/libio.h \ - /usr/include/_G_config.h /usr/include/wchar.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include/stdarg.h \ - /usr/include/i386-linux-gnu/bits/stdio_lim.h \ - /usr/include/i386-linux-gnu/bits/sys_errlist.h \ - /usr/include/i386-linux-gnu/bits/stdio.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include/stdint.h /usr/include/stdint.h \ - /usr/include/i386-linux-gnu/bits/wchar.h \ - /usr/include/i386-linux-gnu/sys/types.h /usr/include/time.h \ - /usr/include/endian.h /usr/include/i386-linux-gnu/bits/endian.h \ - /usr/include/i386-linux-gnu/bits/byteswap.h \ - /usr/include/i386-linux-gnu/sys/select.h \ - /usr/include/i386-linux-gnu/bits/select.h \ - /usr/include/i386-linux-gnu/bits/sigset.h \ - /usr/include/i386-linux-gnu/bits/time.h \ - /usr/include/i386-linux-gnu/sys/sysmacros.h \ - /usr/include/i386-linux-gnu/bits/pthreadtypes.h \ - /usr/include/i386-linux-gnu/sys/stat.h \ - /usr/include/i386-linux-gnu/bits/stat.h /usr/include/stdlib.h \ - /usr/include/i386-linux-gnu/bits/waitflags.h \ - /usr/include/i386-linux-gnu/bits/waitstatus.h /usr/include/alloca.h \ - /usr/include/string.h /usr/include/xlocale.h \ - /usr/include/i386-linux-gnu/bits/string.h \ - /usr/include/i386-linux-gnu/bits/string2.h /usr/include/strings.h \ - /usr/include/inttypes.h /usr/include/unistd.h \ - /usr/include/i386-linux-gnu/bits/posix_opt.h \ - /usr/include/i386-linux-gnu/bits/environments.h \ - /usr/include/i386-linux-gnu/bits/confname.h /usr/include/getopt.h \ - /usr/include/netinet/in.h /usr/include/i386-linux-gnu/sys/socket.h \ - /usr/include/i386-linux-gnu/sys/uio.h \ - /usr/include/i386-linux-gnu/bits/uio.h \ - /usr/include/i386-linux-gnu/bits/socket.h \ - /usr/include/i386-linux-gnu/bits/sockaddr.h \ - /usr/include/i386-linux-gnu/asm/socket.h \ - /usr/include/asm-generic/socket.h \ - /usr/include/i386-linux-gnu/asm/sockios.h \ - /usr/include/asm-generic/sockios.h /usr/include/i386-linux-gnu/bits/in.h \ - /usr/include/netinet/tcp.h /usr/include/arpa/nameser.h \ - /usr/include/i386-linux-gnu/sys/param.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/limits.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/syslimits.h \ - /usr/include/limits.h /usr/include/i386-linux-gnu/bits/posix1_lim.h \ - /usr/include/i386-linux-gnu/bits/local_lim.h /usr/include/linux/limits.h \ - /usr/include/i386-linux-gnu/bits/posix2_lim.h /usr/include/linux/param.h \ - /usr/include/i386-linux-gnu/asm/param.h /usr/include/asm-generic/param.h \ - /usr/include/i386-linux-gnu/sys/bitypes.h \ - /usr/include/arpa/nameser_compat.h /usr/include/netdb.h \ - /usr/include/rpc/netdb.h /usr/include/i386-linux-gnu/bits/netdb.h \ - /usr/include/malloc.h /usr/include/ctype.h include/antlr3interfaces.h \ - include/antlr3convertutf.h include/antlr3exception.h \ - include/antlr3input.h include/antlr3string.h include/antlr3collections.h \ - include/antlr3bitset.h include/antlr3commontoken.h \ - include/antlr3intstream.h include/antlr3tokenstream.h \ - include/antlr3debugeventlistener.h include/antlr3basetree.h \ - include/antlr3commontreenodestream.h include/antlr3commontreeadaptor.h \ - include/antlr3basetreeadaptor.h include/antlr3commontree.h \ - include/antlr3recognizersharedstate.h include/antlr3lexer.h \ - include/antlr3parser.h include/antlr3treeparser.h - -include/antlr3baserecognizer.h: - -include/antlr3defs.h: - -include/antlr3errors.h: - -antlr3config.h: - -/usr/include/stdio.h: - -/usr/include/features.h: - -/usr/include/i386-linux-gnu/bits/predefs.h: - -/usr/include/i386-linux-gnu/sys/cdefs.h: - -/usr/include/i386-linux-gnu/bits/wordsize.h: - -/usr/include/i386-linux-gnu/gnu/stubs.h: - -/usr/include/i386-linux-gnu/gnu/stubs-32.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include/stddef.h: - -/usr/include/i386-linux-gnu/bits/types.h: - -/usr/include/i386-linux-gnu/bits/typesizes.h: - -/usr/include/libio.h: - -/usr/include/_G_config.h: - -/usr/include/wchar.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include/stdarg.h: - -/usr/include/i386-linux-gnu/bits/stdio_lim.h: - -/usr/include/i386-linux-gnu/bits/sys_errlist.h: - -/usr/include/i386-linux-gnu/bits/stdio.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include/stdint.h: - -/usr/include/stdint.h: - -/usr/include/i386-linux-gnu/bits/wchar.h: - -/usr/include/i386-linux-gnu/sys/types.h: - -/usr/include/time.h: - -/usr/include/endian.h: - -/usr/include/i386-linux-gnu/bits/endian.h: - -/usr/include/i386-linux-gnu/bits/byteswap.h: - -/usr/include/i386-linux-gnu/sys/select.h: - -/usr/include/i386-linux-gnu/bits/select.h: - -/usr/include/i386-linux-gnu/bits/sigset.h: - -/usr/include/i386-linux-gnu/bits/time.h: - -/usr/include/i386-linux-gnu/sys/sysmacros.h: - -/usr/include/i386-linux-gnu/bits/pthreadtypes.h: - -/usr/include/i386-linux-gnu/sys/stat.h: - -/usr/include/i386-linux-gnu/bits/stat.h: - -/usr/include/stdlib.h: - -/usr/include/i386-linux-gnu/bits/waitflags.h: - -/usr/include/i386-linux-gnu/bits/waitstatus.h: - -/usr/include/alloca.h: - -/usr/include/string.h: - -/usr/include/xlocale.h: - -/usr/include/i386-linux-gnu/bits/string.h: - -/usr/include/i386-linux-gnu/bits/string2.h: - -/usr/include/strings.h: - -/usr/include/inttypes.h: - -/usr/include/unistd.h: - -/usr/include/i386-linux-gnu/bits/posix_opt.h: - -/usr/include/i386-linux-gnu/bits/environments.h: - -/usr/include/i386-linux-gnu/bits/confname.h: - -/usr/include/getopt.h: - -/usr/include/netinet/in.h: - -/usr/include/i386-linux-gnu/sys/socket.h: - -/usr/include/i386-linux-gnu/sys/uio.h: - -/usr/include/i386-linux-gnu/bits/uio.h: - -/usr/include/i386-linux-gnu/bits/socket.h: - -/usr/include/i386-linux-gnu/bits/sockaddr.h: - -/usr/include/i386-linux-gnu/asm/socket.h: - -/usr/include/asm-generic/socket.h: - -/usr/include/i386-linux-gnu/asm/sockios.h: - -/usr/include/asm-generic/sockios.h: - -/usr/include/i386-linux-gnu/bits/in.h: - -/usr/include/netinet/tcp.h: - -/usr/include/arpa/nameser.h: - -/usr/include/i386-linux-gnu/sys/param.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/limits.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/syslimits.h: - -/usr/include/limits.h: - -/usr/include/i386-linux-gnu/bits/posix1_lim.h: - -/usr/include/i386-linux-gnu/bits/local_lim.h: - -/usr/include/linux/limits.h: - -/usr/include/i386-linux-gnu/bits/posix2_lim.h: - -/usr/include/linux/param.h: - -/usr/include/i386-linux-gnu/asm/param.h: - -/usr/include/asm-generic/param.h: - -/usr/include/i386-linux-gnu/sys/bitypes.h: - -/usr/include/arpa/nameser_compat.h: - -/usr/include/netdb.h: - -/usr/include/rpc/netdb.h: - -/usr/include/i386-linux-gnu/bits/netdb.h: - -/usr/include/malloc.h: - -/usr/include/ctype.h: - -include/antlr3interfaces.h: - -include/antlr3convertutf.h: - -include/antlr3exception.h: - -include/antlr3input.h: - -include/antlr3string.h: - -include/antlr3collections.h: - -include/antlr3bitset.h: - -include/antlr3commontoken.h: - -include/antlr3intstream.h: - -include/antlr3tokenstream.h: - -include/antlr3debugeventlistener.h: - -include/antlr3basetree.h: - -include/antlr3commontreenodestream.h: - -include/antlr3commontreeadaptor.h: - -include/antlr3basetreeadaptor.h: - -include/antlr3commontree.h: - -include/antlr3recognizersharedstate.h: - -include/antlr3lexer.h: - -include/antlr3parser.h: - -include/antlr3treeparser.h: diff --git a/impl/antlr/libantlr3c-3.4/.deps/antlr3basetree.Plo b/impl/antlr/libantlr3c-3.4/.deps/antlr3basetree.Plo deleted file mode 100644 index b95ef6a..0000000 --- a/impl/antlr/libantlr3c-3.4/.deps/antlr3basetree.Plo +++ /dev/null @@ -1,237 +0,0 @@ -antlr3basetree.lo: src/antlr3basetree.c include/antlr3basetree.h \ - include/antlr3defs.h include/antlr3errors.h antlr3config.h \ - /usr/include/stdio.h /usr/include/features.h \ - /usr/include/i386-linux-gnu/bits/predefs.h \ - /usr/include/i386-linux-gnu/sys/cdefs.h \ - /usr/include/i386-linux-gnu/bits/wordsize.h \ - /usr/include/i386-linux-gnu/gnu/stubs.h \ - /usr/include/i386-linux-gnu/gnu/stubs-32.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include/stddef.h \ - /usr/include/i386-linux-gnu/bits/types.h \ - /usr/include/i386-linux-gnu/bits/typesizes.h /usr/include/libio.h \ - /usr/include/_G_config.h /usr/include/wchar.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include/stdarg.h \ - /usr/include/i386-linux-gnu/bits/stdio_lim.h \ - /usr/include/i386-linux-gnu/bits/sys_errlist.h \ - /usr/include/i386-linux-gnu/bits/stdio.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include/stdint.h /usr/include/stdint.h \ - /usr/include/i386-linux-gnu/bits/wchar.h \ - /usr/include/i386-linux-gnu/sys/types.h /usr/include/time.h \ - /usr/include/endian.h /usr/include/i386-linux-gnu/bits/endian.h \ - /usr/include/i386-linux-gnu/bits/byteswap.h \ - /usr/include/i386-linux-gnu/sys/select.h \ - /usr/include/i386-linux-gnu/bits/select.h \ - /usr/include/i386-linux-gnu/bits/sigset.h \ - /usr/include/i386-linux-gnu/bits/time.h \ - /usr/include/i386-linux-gnu/sys/sysmacros.h \ - /usr/include/i386-linux-gnu/bits/pthreadtypes.h \ - /usr/include/i386-linux-gnu/sys/stat.h \ - /usr/include/i386-linux-gnu/bits/stat.h /usr/include/stdlib.h \ - /usr/include/i386-linux-gnu/bits/waitflags.h \ - /usr/include/i386-linux-gnu/bits/waitstatus.h /usr/include/alloca.h \ - /usr/include/string.h /usr/include/xlocale.h \ - /usr/include/i386-linux-gnu/bits/string.h \ - /usr/include/i386-linux-gnu/bits/string2.h /usr/include/strings.h \ - /usr/include/inttypes.h /usr/include/unistd.h \ - /usr/include/i386-linux-gnu/bits/posix_opt.h \ - /usr/include/i386-linux-gnu/bits/environments.h \ - /usr/include/i386-linux-gnu/bits/confname.h /usr/include/getopt.h \ - /usr/include/netinet/in.h /usr/include/i386-linux-gnu/sys/socket.h \ - /usr/include/i386-linux-gnu/sys/uio.h \ - /usr/include/i386-linux-gnu/bits/uio.h \ - /usr/include/i386-linux-gnu/bits/socket.h \ - /usr/include/i386-linux-gnu/bits/sockaddr.h \ - /usr/include/i386-linux-gnu/asm/socket.h \ - /usr/include/asm-generic/socket.h \ - /usr/include/i386-linux-gnu/asm/sockios.h \ - /usr/include/asm-generic/sockios.h /usr/include/i386-linux-gnu/bits/in.h \ - /usr/include/netinet/tcp.h /usr/include/arpa/nameser.h \ - /usr/include/i386-linux-gnu/sys/param.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/limits.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/syslimits.h \ - /usr/include/limits.h /usr/include/i386-linux-gnu/bits/posix1_lim.h \ - /usr/include/i386-linux-gnu/bits/local_lim.h /usr/include/linux/limits.h \ - /usr/include/i386-linux-gnu/bits/posix2_lim.h /usr/include/linux/param.h \ - /usr/include/i386-linux-gnu/asm/param.h /usr/include/asm-generic/param.h \ - /usr/include/i386-linux-gnu/sys/bitypes.h \ - /usr/include/arpa/nameser_compat.h /usr/include/netdb.h \ - /usr/include/rpc/netdb.h /usr/include/i386-linux-gnu/bits/netdb.h \ - /usr/include/malloc.h /usr/include/ctype.h include/antlr3interfaces.h \ - include/antlr3convertutf.h include/antlr3collections.h \ - include/antlr3bitset.h include/antlr3string.h - -include/antlr3basetree.h: - -include/antlr3defs.h: - -include/antlr3errors.h: - -antlr3config.h: - -/usr/include/stdio.h: - -/usr/include/features.h: - -/usr/include/i386-linux-gnu/bits/predefs.h: - -/usr/include/i386-linux-gnu/sys/cdefs.h: - -/usr/include/i386-linux-gnu/bits/wordsize.h: - -/usr/include/i386-linux-gnu/gnu/stubs.h: - -/usr/include/i386-linux-gnu/gnu/stubs-32.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include/stddef.h: - -/usr/include/i386-linux-gnu/bits/types.h: - -/usr/include/i386-linux-gnu/bits/typesizes.h: - -/usr/include/libio.h: - -/usr/include/_G_config.h: - -/usr/include/wchar.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include/stdarg.h: - -/usr/include/i386-linux-gnu/bits/stdio_lim.h: - -/usr/include/i386-linux-gnu/bits/sys_errlist.h: - -/usr/include/i386-linux-gnu/bits/stdio.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include/stdint.h: - -/usr/include/stdint.h: - -/usr/include/i386-linux-gnu/bits/wchar.h: - -/usr/include/i386-linux-gnu/sys/types.h: - -/usr/include/time.h: - -/usr/include/endian.h: - -/usr/include/i386-linux-gnu/bits/endian.h: - -/usr/include/i386-linux-gnu/bits/byteswap.h: - -/usr/include/i386-linux-gnu/sys/select.h: - -/usr/include/i386-linux-gnu/bits/select.h: - -/usr/include/i386-linux-gnu/bits/sigset.h: - -/usr/include/i386-linux-gnu/bits/time.h: - -/usr/include/i386-linux-gnu/sys/sysmacros.h: - -/usr/include/i386-linux-gnu/bits/pthreadtypes.h: - -/usr/include/i386-linux-gnu/sys/stat.h: - -/usr/include/i386-linux-gnu/bits/stat.h: - -/usr/include/stdlib.h: - -/usr/include/i386-linux-gnu/bits/waitflags.h: - -/usr/include/i386-linux-gnu/bits/waitstatus.h: - -/usr/include/alloca.h: - -/usr/include/string.h: - -/usr/include/xlocale.h: - -/usr/include/i386-linux-gnu/bits/string.h: - -/usr/include/i386-linux-gnu/bits/string2.h: - -/usr/include/strings.h: - -/usr/include/inttypes.h: - -/usr/include/unistd.h: - -/usr/include/i386-linux-gnu/bits/posix_opt.h: - -/usr/include/i386-linux-gnu/bits/environments.h: - -/usr/include/i386-linux-gnu/bits/confname.h: - -/usr/include/getopt.h: - -/usr/include/netinet/in.h: - -/usr/include/i386-linux-gnu/sys/socket.h: - -/usr/include/i386-linux-gnu/sys/uio.h: - -/usr/include/i386-linux-gnu/bits/uio.h: - -/usr/include/i386-linux-gnu/bits/socket.h: - -/usr/include/i386-linux-gnu/bits/sockaddr.h: - -/usr/include/i386-linux-gnu/asm/socket.h: - -/usr/include/asm-generic/socket.h: - -/usr/include/i386-linux-gnu/asm/sockios.h: - -/usr/include/asm-generic/sockios.h: - -/usr/include/i386-linux-gnu/bits/in.h: - -/usr/include/netinet/tcp.h: - -/usr/include/arpa/nameser.h: - -/usr/include/i386-linux-gnu/sys/param.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/limits.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/syslimits.h: - -/usr/include/limits.h: - -/usr/include/i386-linux-gnu/bits/posix1_lim.h: - -/usr/include/i386-linux-gnu/bits/local_lim.h: - -/usr/include/linux/limits.h: - -/usr/include/i386-linux-gnu/bits/posix2_lim.h: - -/usr/include/linux/param.h: - -/usr/include/i386-linux-gnu/asm/param.h: - -/usr/include/asm-generic/param.h: - -/usr/include/i386-linux-gnu/sys/bitypes.h: - -/usr/include/arpa/nameser_compat.h: - -/usr/include/netdb.h: - -/usr/include/rpc/netdb.h: - -/usr/include/i386-linux-gnu/bits/netdb.h: - -/usr/include/malloc.h: - -/usr/include/ctype.h: - -include/antlr3interfaces.h: - -include/antlr3convertutf.h: - -include/antlr3collections.h: - -include/antlr3bitset.h: - -include/antlr3string.h: diff --git a/impl/antlr/libantlr3c-3.4/.deps/antlr3basetreeadaptor.Plo b/impl/antlr/libantlr3c-3.4/.deps/antlr3basetreeadaptor.Plo deleted file mode 100644 index f420b67..0000000 --- a/impl/antlr/libantlr3c-3.4/.deps/antlr3basetreeadaptor.Plo +++ /dev/null @@ -1,244 +0,0 @@ -antlr3basetreeadaptor.lo: src/antlr3basetreeadaptor.c \ - include/antlr3basetreeadaptor.h include/antlr3defs.h \ - include/antlr3errors.h antlr3config.h /usr/include/stdio.h \ - /usr/include/features.h /usr/include/i386-linux-gnu/bits/predefs.h \ - /usr/include/i386-linux-gnu/sys/cdefs.h \ - /usr/include/i386-linux-gnu/bits/wordsize.h \ - /usr/include/i386-linux-gnu/gnu/stubs.h \ - /usr/include/i386-linux-gnu/gnu/stubs-32.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include/stddef.h \ - /usr/include/i386-linux-gnu/bits/types.h \ - /usr/include/i386-linux-gnu/bits/typesizes.h /usr/include/libio.h \ - /usr/include/_G_config.h /usr/include/wchar.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include/stdarg.h \ - /usr/include/i386-linux-gnu/bits/stdio_lim.h \ - /usr/include/i386-linux-gnu/bits/sys_errlist.h \ - /usr/include/i386-linux-gnu/bits/stdio.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include/stdint.h /usr/include/stdint.h \ - /usr/include/i386-linux-gnu/bits/wchar.h \ - /usr/include/i386-linux-gnu/sys/types.h /usr/include/time.h \ - /usr/include/endian.h /usr/include/i386-linux-gnu/bits/endian.h \ - /usr/include/i386-linux-gnu/bits/byteswap.h \ - /usr/include/i386-linux-gnu/sys/select.h \ - /usr/include/i386-linux-gnu/bits/select.h \ - /usr/include/i386-linux-gnu/bits/sigset.h \ - /usr/include/i386-linux-gnu/bits/time.h \ - /usr/include/i386-linux-gnu/sys/sysmacros.h \ - /usr/include/i386-linux-gnu/bits/pthreadtypes.h \ - /usr/include/i386-linux-gnu/sys/stat.h \ - /usr/include/i386-linux-gnu/bits/stat.h /usr/include/stdlib.h \ - /usr/include/i386-linux-gnu/bits/waitflags.h \ - /usr/include/i386-linux-gnu/bits/waitstatus.h /usr/include/alloca.h \ - /usr/include/string.h /usr/include/xlocale.h \ - /usr/include/i386-linux-gnu/bits/string.h \ - /usr/include/i386-linux-gnu/bits/string2.h /usr/include/strings.h \ - /usr/include/inttypes.h /usr/include/unistd.h \ - /usr/include/i386-linux-gnu/bits/posix_opt.h \ - /usr/include/i386-linux-gnu/bits/environments.h \ - /usr/include/i386-linux-gnu/bits/confname.h /usr/include/getopt.h \ - /usr/include/netinet/in.h /usr/include/i386-linux-gnu/sys/socket.h \ - /usr/include/i386-linux-gnu/sys/uio.h \ - /usr/include/i386-linux-gnu/bits/uio.h \ - /usr/include/i386-linux-gnu/bits/socket.h \ - /usr/include/i386-linux-gnu/bits/sockaddr.h \ - /usr/include/i386-linux-gnu/asm/socket.h \ - /usr/include/asm-generic/socket.h \ - /usr/include/i386-linux-gnu/asm/sockios.h \ - /usr/include/asm-generic/sockios.h /usr/include/i386-linux-gnu/bits/in.h \ - /usr/include/netinet/tcp.h /usr/include/arpa/nameser.h \ - /usr/include/i386-linux-gnu/sys/param.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/limits.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/syslimits.h \ - /usr/include/limits.h /usr/include/i386-linux-gnu/bits/posix1_lim.h \ - /usr/include/i386-linux-gnu/bits/local_lim.h /usr/include/linux/limits.h \ - /usr/include/i386-linux-gnu/bits/posix2_lim.h /usr/include/linux/param.h \ - /usr/include/i386-linux-gnu/asm/param.h /usr/include/asm-generic/param.h \ - /usr/include/i386-linux-gnu/sys/bitypes.h \ - /usr/include/arpa/nameser_compat.h /usr/include/netdb.h \ - /usr/include/rpc/netdb.h /usr/include/i386-linux-gnu/bits/netdb.h \ - /usr/include/malloc.h /usr/include/ctype.h include/antlr3interfaces.h \ - include/antlr3convertutf.h include/antlr3collections.h \ - include/antlr3bitset.h include/antlr3string.h include/antlr3basetree.h \ - include/antlr3commontoken.h include/antlr3debugeventlistener.h - -include/antlr3basetreeadaptor.h: - -include/antlr3defs.h: - -include/antlr3errors.h: - -antlr3config.h: - -/usr/include/stdio.h: - -/usr/include/features.h: - -/usr/include/i386-linux-gnu/bits/predefs.h: - -/usr/include/i386-linux-gnu/sys/cdefs.h: - -/usr/include/i386-linux-gnu/bits/wordsize.h: - -/usr/include/i386-linux-gnu/gnu/stubs.h: - -/usr/include/i386-linux-gnu/gnu/stubs-32.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include/stddef.h: - -/usr/include/i386-linux-gnu/bits/types.h: - -/usr/include/i386-linux-gnu/bits/typesizes.h: - -/usr/include/libio.h: - -/usr/include/_G_config.h: - -/usr/include/wchar.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include/stdarg.h: - -/usr/include/i386-linux-gnu/bits/stdio_lim.h: - -/usr/include/i386-linux-gnu/bits/sys_errlist.h: - -/usr/include/i386-linux-gnu/bits/stdio.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include/stdint.h: - -/usr/include/stdint.h: - -/usr/include/i386-linux-gnu/bits/wchar.h: - -/usr/include/i386-linux-gnu/sys/types.h: - -/usr/include/time.h: - -/usr/include/endian.h: - -/usr/include/i386-linux-gnu/bits/endian.h: - -/usr/include/i386-linux-gnu/bits/byteswap.h: - -/usr/include/i386-linux-gnu/sys/select.h: - -/usr/include/i386-linux-gnu/bits/select.h: - -/usr/include/i386-linux-gnu/bits/sigset.h: - -/usr/include/i386-linux-gnu/bits/time.h: - -/usr/include/i386-linux-gnu/sys/sysmacros.h: - -/usr/include/i386-linux-gnu/bits/pthreadtypes.h: - -/usr/include/i386-linux-gnu/sys/stat.h: - -/usr/include/i386-linux-gnu/bits/stat.h: - -/usr/include/stdlib.h: - -/usr/include/i386-linux-gnu/bits/waitflags.h: - -/usr/include/i386-linux-gnu/bits/waitstatus.h: - -/usr/include/alloca.h: - -/usr/include/string.h: - -/usr/include/xlocale.h: - -/usr/include/i386-linux-gnu/bits/string.h: - -/usr/include/i386-linux-gnu/bits/string2.h: - -/usr/include/strings.h: - -/usr/include/inttypes.h: - -/usr/include/unistd.h: - -/usr/include/i386-linux-gnu/bits/posix_opt.h: - -/usr/include/i386-linux-gnu/bits/environments.h: - -/usr/include/i386-linux-gnu/bits/confname.h: - -/usr/include/getopt.h: - -/usr/include/netinet/in.h: - -/usr/include/i386-linux-gnu/sys/socket.h: - -/usr/include/i386-linux-gnu/sys/uio.h: - -/usr/include/i386-linux-gnu/bits/uio.h: - -/usr/include/i386-linux-gnu/bits/socket.h: - -/usr/include/i386-linux-gnu/bits/sockaddr.h: - -/usr/include/i386-linux-gnu/asm/socket.h: - -/usr/include/asm-generic/socket.h: - -/usr/include/i386-linux-gnu/asm/sockios.h: - -/usr/include/asm-generic/sockios.h: - -/usr/include/i386-linux-gnu/bits/in.h: - -/usr/include/netinet/tcp.h: - -/usr/include/arpa/nameser.h: - -/usr/include/i386-linux-gnu/sys/param.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/limits.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/syslimits.h: - -/usr/include/limits.h: - -/usr/include/i386-linux-gnu/bits/posix1_lim.h: - -/usr/include/i386-linux-gnu/bits/local_lim.h: - -/usr/include/linux/limits.h: - -/usr/include/i386-linux-gnu/bits/posix2_lim.h: - -/usr/include/linux/param.h: - -/usr/include/i386-linux-gnu/asm/param.h: - -/usr/include/asm-generic/param.h: - -/usr/include/i386-linux-gnu/sys/bitypes.h: - -/usr/include/arpa/nameser_compat.h: - -/usr/include/netdb.h: - -/usr/include/rpc/netdb.h: - -/usr/include/i386-linux-gnu/bits/netdb.h: - -/usr/include/malloc.h: - -/usr/include/ctype.h: - -include/antlr3interfaces.h: - -include/antlr3convertutf.h: - -include/antlr3collections.h: - -include/antlr3bitset.h: - -include/antlr3string.h: - -include/antlr3basetree.h: - -include/antlr3commontoken.h: - -include/antlr3debugeventlistener.h: diff --git a/impl/antlr/libantlr3c-3.4/.deps/antlr3bitset.Plo b/impl/antlr/libantlr3c-3.4/.deps/antlr3bitset.Plo deleted file mode 100644 index 1d657ed..0000000 --- a/impl/antlr/libantlr3c-3.4/.deps/antlr3bitset.Plo +++ /dev/null @@ -1,232 +0,0 @@ -antlr3bitset.lo: src/antlr3bitset.c include/antlr3bitset.h \ - include/antlr3defs.h include/antlr3errors.h antlr3config.h \ - /usr/include/stdio.h /usr/include/features.h \ - /usr/include/i386-linux-gnu/bits/predefs.h \ - /usr/include/i386-linux-gnu/sys/cdefs.h \ - /usr/include/i386-linux-gnu/bits/wordsize.h \ - /usr/include/i386-linux-gnu/gnu/stubs.h \ - /usr/include/i386-linux-gnu/gnu/stubs-32.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include/stddef.h \ - /usr/include/i386-linux-gnu/bits/types.h \ - /usr/include/i386-linux-gnu/bits/typesizes.h /usr/include/libio.h \ - /usr/include/_G_config.h /usr/include/wchar.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include/stdarg.h \ - /usr/include/i386-linux-gnu/bits/stdio_lim.h \ - /usr/include/i386-linux-gnu/bits/sys_errlist.h \ - /usr/include/i386-linux-gnu/bits/stdio.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include/stdint.h /usr/include/stdint.h \ - /usr/include/i386-linux-gnu/bits/wchar.h \ - /usr/include/i386-linux-gnu/sys/types.h /usr/include/time.h \ - /usr/include/endian.h /usr/include/i386-linux-gnu/bits/endian.h \ - /usr/include/i386-linux-gnu/bits/byteswap.h \ - /usr/include/i386-linux-gnu/sys/select.h \ - /usr/include/i386-linux-gnu/bits/select.h \ - /usr/include/i386-linux-gnu/bits/sigset.h \ - /usr/include/i386-linux-gnu/bits/time.h \ - /usr/include/i386-linux-gnu/sys/sysmacros.h \ - /usr/include/i386-linux-gnu/bits/pthreadtypes.h \ - /usr/include/i386-linux-gnu/sys/stat.h \ - /usr/include/i386-linux-gnu/bits/stat.h /usr/include/stdlib.h \ - /usr/include/i386-linux-gnu/bits/waitflags.h \ - /usr/include/i386-linux-gnu/bits/waitstatus.h /usr/include/alloca.h \ - /usr/include/string.h /usr/include/xlocale.h \ - /usr/include/i386-linux-gnu/bits/string.h \ - /usr/include/i386-linux-gnu/bits/string2.h /usr/include/strings.h \ - /usr/include/inttypes.h /usr/include/unistd.h \ - /usr/include/i386-linux-gnu/bits/posix_opt.h \ - /usr/include/i386-linux-gnu/bits/environments.h \ - /usr/include/i386-linux-gnu/bits/confname.h /usr/include/getopt.h \ - /usr/include/netinet/in.h /usr/include/i386-linux-gnu/sys/socket.h \ - /usr/include/i386-linux-gnu/sys/uio.h \ - /usr/include/i386-linux-gnu/bits/uio.h \ - /usr/include/i386-linux-gnu/bits/socket.h \ - /usr/include/i386-linux-gnu/bits/sockaddr.h \ - /usr/include/i386-linux-gnu/asm/socket.h \ - /usr/include/asm-generic/socket.h \ - /usr/include/i386-linux-gnu/asm/sockios.h \ - /usr/include/asm-generic/sockios.h /usr/include/i386-linux-gnu/bits/in.h \ - /usr/include/netinet/tcp.h /usr/include/arpa/nameser.h \ - /usr/include/i386-linux-gnu/sys/param.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/limits.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/syslimits.h \ - /usr/include/limits.h /usr/include/i386-linux-gnu/bits/posix1_lim.h \ - /usr/include/i386-linux-gnu/bits/local_lim.h /usr/include/linux/limits.h \ - /usr/include/i386-linux-gnu/bits/posix2_lim.h /usr/include/linux/param.h \ - /usr/include/i386-linux-gnu/asm/param.h /usr/include/asm-generic/param.h \ - /usr/include/i386-linux-gnu/sys/bitypes.h \ - /usr/include/arpa/nameser_compat.h /usr/include/netdb.h \ - /usr/include/rpc/netdb.h /usr/include/i386-linux-gnu/bits/netdb.h \ - /usr/include/malloc.h /usr/include/ctype.h include/antlr3interfaces.h \ - include/antlr3convertutf.h include/antlr3collections.h - -include/antlr3bitset.h: - -include/antlr3defs.h: - -include/antlr3errors.h: - -antlr3config.h: - -/usr/include/stdio.h: - -/usr/include/features.h: - -/usr/include/i386-linux-gnu/bits/predefs.h: - -/usr/include/i386-linux-gnu/sys/cdefs.h: - -/usr/include/i386-linux-gnu/bits/wordsize.h: - -/usr/include/i386-linux-gnu/gnu/stubs.h: - -/usr/include/i386-linux-gnu/gnu/stubs-32.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include/stddef.h: - -/usr/include/i386-linux-gnu/bits/types.h: - -/usr/include/i386-linux-gnu/bits/typesizes.h: - -/usr/include/libio.h: - -/usr/include/_G_config.h: - -/usr/include/wchar.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include/stdarg.h: - -/usr/include/i386-linux-gnu/bits/stdio_lim.h: - -/usr/include/i386-linux-gnu/bits/sys_errlist.h: - -/usr/include/i386-linux-gnu/bits/stdio.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include/stdint.h: - -/usr/include/stdint.h: - -/usr/include/i386-linux-gnu/bits/wchar.h: - -/usr/include/i386-linux-gnu/sys/types.h: - -/usr/include/time.h: - -/usr/include/endian.h: - -/usr/include/i386-linux-gnu/bits/endian.h: - -/usr/include/i386-linux-gnu/bits/byteswap.h: - -/usr/include/i386-linux-gnu/sys/select.h: - -/usr/include/i386-linux-gnu/bits/select.h: - -/usr/include/i386-linux-gnu/bits/sigset.h: - -/usr/include/i386-linux-gnu/bits/time.h: - -/usr/include/i386-linux-gnu/sys/sysmacros.h: - -/usr/include/i386-linux-gnu/bits/pthreadtypes.h: - -/usr/include/i386-linux-gnu/sys/stat.h: - -/usr/include/i386-linux-gnu/bits/stat.h: - -/usr/include/stdlib.h: - -/usr/include/i386-linux-gnu/bits/waitflags.h: - -/usr/include/i386-linux-gnu/bits/waitstatus.h: - -/usr/include/alloca.h: - -/usr/include/string.h: - -/usr/include/xlocale.h: - -/usr/include/i386-linux-gnu/bits/string.h: - -/usr/include/i386-linux-gnu/bits/string2.h: - -/usr/include/strings.h: - -/usr/include/inttypes.h: - -/usr/include/unistd.h: - -/usr/include/i386-linux-gnu/bits/posix_opt.h: - -/usr/include/i386-linux-gnu/bits/environments.h: - -/usr/include/i386-linux-gnu/bits/confname.h: - -/usr/include/getopt.h: - -/usr/include/netinet/in.h: - -/usr/include/i386-linux-gnu/sys/socket.h: - -/usr/include/i386-linux-gnu/sys/uio.h: - -/usr/include/i386-linux-gnu/bits/uio.h: - -/usr/include/i386-linux-gnu/bits/socket.h: - -/usr/include/i386-linux-gnu/bits/sockaddr.h: - -/usr/include/i386-linux-gnu/asm/socket.h: - -/usr/include/asm-generic/socket.h: - -/usr/include/i386-linux-gnu/asm/sockios.h: - -/usr/include/asm-generic/sockios.h: - -/usr/include/i386-linux-gnu/bits/in.h: - -/usr/include/netinet/tcp.h: - -/usr/include/arpa/nameser.h: - -/usr/include/i386-linux-gnu/sys/param.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/limits.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/syslimits.h: - -/usr/include/limits.h: - -/usr/include/i386-linux-gnu/bits/posix1_lim.h: - -/usr/include/i386-linux-gnu/bits/local_lim.h: - -/usr/include/linux/limits.h: - -/usr/include/i386-linux-gnu/bits/posix2_lim.h: - -/usr/include/linux/param.h: - -/usr/include/i386-linux-gnu/asm/param.h: - -/usr/include/asm-generic/param.h: - -/usr/include/i386-linux-gnu/sys/bitypes.h: - -/usr/include/arpa/nameser_compat.h: - -/usr/include/netdb.h: - -/usr/include/rpc/netdb.h: - -/usr/include/i386-linux-gnu/bits/netdb.h: - -/usr/include/malloc.h: - -/usr/include/ctype.h: - -include/antlr3interfaces.h: - -include/antlr3convertutf.h: - -include/antlr3collections.h: diff --git a/impl/antlr/libantlr3c-3.4/.deps/antlr3collections.Plo b/impl/antlr/libantlr3c-3.4/.deps/antlr3collections.Plo deleted file mode 100644 index a209893..0000000 --- a/impl/antlr/libantlr3c-3.4/.deps/antlr3collections.Plo +++ /dev/null @@ -1,286 +0,0 @@ -antlr3collections.lo: src/antlr3collections.c include/antlr3.h \ - include/antlr3defs.h include/antlr3errors.h antlr3config.h \ - /usr/include/stdio.h /usr/include/features.h \ - /usr/include/i386-linux-gnu/bits/predefs.h \ - /usr/include/i386-linux-gnu/sys/cdefs.h \ - /usr/include/i386-linux-gnu/bits/wordsize.h \ - /usr/include/i386-linux-gnu/gnu/stubs.h \ - /usr/include/i386-linux-gnu/gnu/stubs-32.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include/stddef.h \ - /usr/include/i386-linux-gnu/bits/types.h \ - /usr/include/i386-linux-gnu/bits/typesizes.h /usr/include/libio.h \ - /usr/include/_G_config.h /usr/include/wchar.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include/stdarg.h \ - /usr/include/i386-linux-gnu/bits/stdio_lim.h \ - /usr/include/i386-linux-gnu/bits/sys_errlist.h \ - /usr/include/i386-linux-gnu/bits/stdio.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include/stdint.h /usr/include/stdint.h \ - /usr/include/i386-linux-gnu/bits/wchar.h \ - /usr/include/i386-linux-gnu/sys/types.h /usr/include/time.h \ - /usr/include/endian.h /usr/include/i386-linux-gnu/bits/endian.h \ - /usr/include/i386-linux-gnu/bits/byteswap.h \ - /usr/include/i386-linux-gnu/sys/select.h \ - /usr/include/i386-linux-gnu/bits/select.h \ - /usr/include/i386-linux-gnu/bits/sigset.h \ - /usr/include/i386-linux-gnu/bits/time.h \ - /usr/include/i386-linux-gnu/sys/sysmacros.h \ - /usr/include/i386-linux-gnu/bits/pthreadtypes.h \ - /usr/include/i386-linux-gnu/sys/stat.h \ - /usr/include/i386-linux-gnu/bits/stat.h /usr/include/stdlib.h \ - /usr/include/i386-linux-gnu/bits/waitflags.h \ - /usr/include/i386-linux-gnu/bits/waitstatus.h /usr/include/alloca.h \ - /usr/include/string.h /usr/include/xlocale.h \ - /usr/include/i386-linux-gnu/bits/string.h \ - /usr/include/i386-linux-gnu/bits/string2.h /usr/include/strings.h \ - /usr/include/inttypes.h /usr/include/unistd.h \ - /usr/include/i386-linux-gnu/bits/posix_opt.h \ - /usr/include/i386-linux-gnu/bits/environments.h \ - /usr/include/i386-linux-gnu/bits/confname.h /usr/include/getopt.h \ - /usr/include/netinet/in.h /usr/include/i386-linux-gnu/sys/socket.h \ - /usr/include/i386-linux-gnu/sys/uio.h \ - /usr/include/i386-linux-gnu/bits/uio.h \ - /usr/include/i386-linux-gnu/bits/socket.h \ - /usr/include/i386-linux-gnu/bits/sockaddr.h \ - /usr/include/i386-linux-gnu/asm/socket.h \ - /usr/include/asm-generic/socket.h \ - /usr/include/i386-linux-gnu/asm/sockios.h \ - /usr/include/asm-generic/sockios.h /usr/include/i386-linux-gnu/bits/in.h \ - /usr/include/netinet/tcp.h /usr/include/arpa/nameser.h \ - /usr/include/i386-linux-gnu/sys/param.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/limits.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/syslimits.h \ - /usr/include/limits.h /usr/include/i386-linux-gnu/bits/posix1_lim.h \ - /usr/include/i386-linux-gnu/bits/local_lim.h /usr/include/linux/limits.h \ - /usr/include/i386-linux-gnu/bits/posix2_lim.h /usr/include/linux/param.h \ - /usr/include/i386-linux-gnu/asm/param.h /usr/include/asm-generic/param.h \ - /usr/include/i386-linux-gnu/sys/bitypes.h \ - /usr/include/arpa/nameser_compat.h /usr/include/netdb.h \ - /usr/include/rpc/netdb.h /usr/include/i386-linux-gnu/bits/netdb.h \ - /usr/include/malloc.h /usr/include/ctype.h include/antlr3interfaces.h \ - include/antlr3convertutf.h include/antlr3exception.h \ - include/antlr3encodings.h include/antlr3string.h \ - include/antlr3collections.h include/antlr3bitset.h include/antlr3input.h \ - include/antlr3commontoken.h include/antlr3intstream.h \ - include/antlr3cyclicdfa.h include/antlr3baserecognizer.h \ - include/antlr3tokenstream.h include/antlr3debugeventlistener.h \ - include/antlr3basetree.h include/antlr3commontreenodestream.h \ - include/antlr3commontreeadaptor.h include/antlr3basetreeadaptor.h \ - include/antlr3commontree.h include/antlr3recognizersharedstate.h \ - include/antlr3lexer.h include/antlr3parser.h include/antlr3treeparser.h \ - include/antlr3filestream.h include/antlr3rewritestreams.h - -include/antlr3.h: - -include/antlr3defs.h: - -include/antlr3errors.h: - -antlr3config.h: - -/usr/include/stdio.h: - -/usr/include/features.h: - -/usr/include/i386-linux-gnu/bits/predefs.h: - -/usr/include/i386-linux-gnu/sys/cdefs.h: - -/usr/include/i386-linux-gnu/bits/wordsize.h: - -/usr/include/i386-linux-gnu/gnu/stubs.h: - -/usr/include/i386-linux-gnu/gnu/stubs-32.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include/stddef.h: - -/usr/include/i386-linux-gnu/bits/types.h: - -/usr/include/i386-linux-gnu/bits/typesizes.h: - -/usr/include/libio.h: - -/usr/include/_G_config.h: - -/usr/include/wchar.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include/stdarg.h: - -/usr/include/i386-linux-gnu/bits/stdio_lim.h: - -/usr/include/i386-linux-gnu/bits/sys_errlist.h: - -/usr/include/i386-linux-gnu/bits/stdio.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include/stdint.h: - -/usr/include/stdint.h: - -/usr/include/i386-linux-gnu/bits/wchar.h: - -/usr/include/i386-linux-gnu/sys/types.h: - -/usr/include/time.h: - -/usr/include/endian.h: - -/usr/include/i386-linux-gnu/bits/endian.h: - -/usr/include/i386-linux-gnu/bits/byteswap.h: - -/usr/include/i386-linux-gnu/sys/select.h: - -/usr/include/i386-linux-gnu/bits/select.h: - -/usr/include/i386-linux-gnu/bits/sigset.h: - -/usr/include/i386-linux-gnu/bits/time.h: - -/usr/include/i386-linux-gnu/sys/sysmacros.h: - -/usr/include/i386-linux-gnu/bits/pthreadtypes.h: - -/usr/include/i386-linux-gnu/sys/stat.h: - -/usr/include/i386-linux-gnu/bits/stat.h: - -/usr/include/stdlib.h: - -/usr/include/i386-linux-gnu/bits/waitflags.h: - -/usr/include/i386-linux-gnu/bits/waitstatus.h: - -/usr/include/alloca.h: - -/usr/include/string.h: - -/usr/include/xlocale.h: - -/usr/include/i386-linux-gnu/bits/string.h: - -/usr/include/i386-linux-gnu/bits/string2.h: - -/usr/include/strings.h: - -/usr/include/inttypes.h: - -/usr/include/unistd.h: - -/usr/include/i386-linux-gnu/bits/posix_opt.h: - -/usr/include/i386-linux-gnu/bits/environments.h: - -/usr/include/i386-linux-gnu/bits/confname.h: - -/usr/include/getopt.h: - -/usr/include/netinet/in.h: - -/usr/include/i386-linux-gnu/sys/socket.h: - -/usr/include/i386-linux-gnu/sys/uio.h: - -/usr/include/i386-linux-gnu/bits/uio.h: - -/usr/include/i386-linux-gnu/bits/socket.h: - -/usr/include/i386-linux-gnu/bits/sockaddr.h: - -/usr/include/i386-linux-gnu/asm/socket.h: - -/usr/include/asm-generic/socket.h: - -/usr/include/i386-linux-gnu/asm/sockios.h: - -/usr/include/asm-generic/sockios.h: - -/usr/include/i386-linux-gnu/bits/in.h: - -/usr/include/netinet/tcp.h: - -/usr/include/arpa/nameser.h: - -/usr/include/i386-linux-gnu/sys/param.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/limits.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/syslimits.h: - -/usr/include/limits.h: - -/usr/include/i386-linux-gnu/bits/posix1_lim.h: - -/usr/include/i386-linux-gnu/bits/local_lim.h: - -/usr/include/linux/limits.h: - -/usr/include/i386-linux-gnu/bits/posix2_lim.h: - -/usr/include/linux/param.h: - -/usr/include/i386-linux-gnu/asm/param.h: - -/usr/include/asm-generic/param.h: - -/usr/include/i386-linux-gnu/sys/bitypes.h: - -/usr/include/arpa/nameser_compat.h: - -/usr/include/netdb.h: - -/usr/include/rpc/netdb.h: - -/usr/include/i386-linux-gnu/bits/netdb.h: - -/usr/include/malloc.h: - -/usr/include/ctype.h: - -include/antlr3interfaces.h: - -include/antlr3convertutf.h: - -include/antlr3exception.h: - -include/antlr3encodings.h: - -include/antlr3string.h: - -include/antlr3collections.h: - -include/antlr3bitset.h: - -include/antlr3input.h: - -include/antlr3commontoken.h: - -include/antlr3intstream.h: - -include/antlr3cyclicdfa.h: - -include/antlr3baserecognizer.h: - -include/antlr3tokenstream.h: - -include/antlr3debugeventlistener.h: - -include/antlr3basetree.h: - -include/antlr3commontreenodestream.h: - -include/antlr3commontreeadaptor.h: - -include/antlr3basetreeadaptor.h: - -include/antlr3commontree.h: - -include/antlr3recognizersharedstate.h: - -include/antlr3lexer.h: - -include/antlr3parser.h: - -include/antlr3treeparser.h: - -include/antlr3filestream.h: - -include/antlr3rewritestreams.h: diff --git a/impl/antlr/libantlr3c-3.4/.deps/antlr3commontoken.Plo b/impl/antlr/libantlr3c-3.4/.deps/antlr3commontoken.Plo deleted file mode 100644 index d52c37f..0000000 --- a/impl/antlr/libantlr3c-3.4/.deps/antlr3commontoken.Plo +++ /dev/null @@ -1,286 +0,0 @@ -antlr3commontoken.lo: src/antlr3commontoken.c include/antlr3.h \ - include/antlr3defs.h include/antlr3errors.h antlr3config.h \ - /usr/include/stdio.h /usr/include/features.h \ - /usr/include/i386-linux-gnu/bits/predefs.h \ - /usr/include/i386-linux-gnu/sys/cdefs.h \ - /usr/include/i386-linux-gnu/bits/wordsize.h \ - /usr/include/i386-linux-gnu/gnu/stubs.h \ - /usr/include/i386-linux-gnu/gnu/stubs-32.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include/stddef.h \ - /usr/include/i386-linux-gnu/bits/types.h \ - /usr/include/i386-linux-gnu/bits/typesizes.h /usr/include/libio.h \ - /usr/include/_G_config.h /usr/include/wchar.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include/stdarg.h \ - /usr/include/i386-linux-gnu/bits/stdio_lim.h \ - /usr/include/i386-linux-gnu/bits/sys_errlist.h \ - /usr/include/i386-linux-gnu/bits/stdio.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include/stdint.h /usr/include/stdint.h \ - /usr/include/i386-linux-gnu/bits/wchar.h \ - /usr/include/i386-linux-gnu/sys/types.h /usr/include/time.h \ - /usr/include/endian.h /usr/include/i386-linux-gnu/bits/endian.h \ - /usr/include/i386-linux-gnu/bits/byteswap.h \ - /usr/include/i386-linux-gnu/sys/select.h \ - /usr/include/i386-linux-gnu/bits/select.h \ - /usr/include/i386-linux-gnu/bits/sigset.h \ - /usr/include/i386-linux-gnu/bits/time.h \ - /usr/include/i386-linux-gnu/sys/sysmacros.h \ - /usr/include/i386-linux-gnu/bits/pthreadtypes.h \ - /usr/include/i386-linux-gnu/sys/stat.h \ - /usr/include/i386-linux-gnu/bits/stat.h /usr/include/stdlib.h \ - /usr/include/i386-linux-gnu/bits/waitflags.h \ - /usr/include/i386-linux-gnu/bits/waitstatus.h /usr/include/alloca.h \ - /usr/include/string.h /usr/include/xlocale.h \ - /usr/include/i386-linux-gnu/bits/string.h \ - /usr/include/i386-linux-gnu/bits/string2.h /usr/include/strings.h \ - /usr/include/inttypes.h /usr/include/unistd.h \ - /usr/include/i386-linux-gnu/bits/posix_opt.h \ - /usr/include/i386-linux-gnu/bits/environments.h \ - /usr/include/i386-linux-gnu/bits/confname.h /usr/include/getopt.h \ - /usr/include/netinet/in.h /usr/include/i386-linux-gnu/sys/socket.h \ - /usr/include/i386-linux-gnu/sys/uio.h \ - /usr/include/i386-linux-gnu/bits/uio.h \ - /usr/include/i386-linux-gnu/bits/socket.h \ - /usr/include/i386-linux-gnu/bits/sockaddr.h \ - /usr/include/i386-linux-gnu/asm/socket.h \ - /usr/include/asm-generic/socket.h \ - /usr/include/i386-linux-gnu/asm/sockios.h \ - /usr/include/asm-generic/sockios.h /usr/include/i386-linux-gnu/bits/in.h \ - /usr/include/netinet/tcp.h /usr/include/arpa/nameser.h \ - /usr/include/i386-linux-gnu/sys/param.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/limits.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/syslimits.h \ - /usr/include/limits.h /usr/include/i386-linux-gnu/bits/posix1_lim.h \ - /usr/include/i386-linux-gnu/bits/local_lim.h /usr/include/linux/limits.h \ - /usr/include/i386-linux-gnu/bits/posix2_lim.h /usr/include/linux/param.h \ - /usr/include/i386-linux-gnu/asm/param.h /usr/include/asm-generic/param.h \ - /usr/include/i386-linux-gnu/sys/bitypes.h \ - /usr/include/arpa/nameser_compat.h /usr/include/netdb.h \ - /usr/include/rpc/netdb.h /usr/include/i386-linux-gnu/bits/netdb.h \ - /usr/include/malloc.h /usr/include/ctype.h include/antlr3interfaces.h \ - include/antlr3convertutf.h include/antlr3exception.h \ - include/antlr3encodings.h include/antlr3string.h \ - include/antlr3collections.h include/antlr3bitset.h include/antlr3input.h \ - include/antlr3commontoken.h include/antlr3intstream.h \ - include/antlr3cyclicdfa.h include/antlr3baserecognizer.h \ - include/antlr3tokenstream.h include/antlr3debugeventlistener.h \ - include/antlr3basetree.h include/antlr3commontreenodestream.h \ - include/antlr3commontreeadaptor.h include/antlr3basetreeadaptor.h \ - include/antlr3commontree.h include/antlr3recognizersharedstate.h \ - include/antlr3lexer.h include/antlr3parser.h include/antlr3treeparser.h \ - include/antlr3filestream.h include/antlr3rewritestreams.h - -include/antlr3.h: - -include/antlr3defs.h: - -include/antlr3errors.h: - -antlr3config.h: - -/usr/include/stdio.h: - -/usr/include/features.h: - -/usr/include/i386-linux-gnu/bits/predefs.h: - -/usr/include/i386-linux-gnu/sys/cdefs.h: - -/usr/include/i386-linux-gnu/bits/wordsize.h: - -/usr/include/i386-linux-gnu/gnu/stubs.h: - -/usr/include/i386-linux-gnu/gnu/stubs-32.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include/stddef.h: - -/usr/include/i386-linux-gnu/bits/types.h: - -/usr/include/i386-linux-gnu/bits/typesizes.h: - -/usr/include/libio.h: - -/usr/include/_G_config.h: - -/usr/include/wchar.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include/stdarg.h: - -/usr/include/i386-linux-gnu/bits/stdio_lim.h: - -/usr/include/i386-linux-gnu/bits/sys_errlist.h: - -/usr/include/i386-linux-gnu/bits/stdio.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include/stdint.h: - -/usr/include/stdint.h: - -/usr/include/i386-linux-gnu/bits/wchar.h: - -/usr/include/i386-linux-gnu/sys/types.h: - -/usr/include/time.h: - -/usr/include/endian.h: - -/usr/include/i386-linux-gnu/bits/endian.h: - -/usr/include/i386-linux-gnu/bits/byteswap.h: - -/usr/include/i386-linux-gnu/sys/select.h: - -/usr/include/i386-linux-gnu/bits/select.h: - -/usr/include/i386-linux-gnu/bits/sigset.h: - -/usr/include/i386-linux-gnu/bits/time.h: - -/usr/include/i386-linux-gnu/sys/sysmacros.h: - -/usr/include/i386-linux-gnu/bits/pthreadtypes.h: - -/usr/include/i386-linux-gnu/sys/stat.h: - -/usr/include/i386-linux-gnu/bits/stat.h: - -/usr/include/stdlib.h: - -/usr/include/i386-linux-gnu/bits/waitflags.h: - -/usr/include/i386-linux-gnu/bits/waitstatus.h: - -/usr/include/alloca.h: - -/usr/include/string.h: - -/usr/include/xlocale.h: - -/usr/include/i386-linux-gnu/bits/string.h: - -/usr/include/i386-linux-gnu/bits/string2.h: - -/usr/include/strings.h: - -/usr/include/inttypes.h: - -/usr/include/unistd.h: - -/usr/include/i386-linux-gnu/bits/posix_opt.h: - -/usr/include/i386-linux-gnu/bits/environments.h: - -/usr/include/i386-linux-gnu/bits/confname.h: - -/usr/include/getopt.h: - -/usr/include/netinet/in.h: - -/usr/include/i386-linux-gnu/sys/socket.h: - -/usr/include/i386-linux-gnu/sys/uio.h: - -/usr/include/i386-linux-gnu/bits/uio.h: - -/usr/include/i386-linux-gnu/bits/socket.h: - -/usr/include/i386-linux-gnu/bits/sockaddr.h: - -/usr/include/i386-linux-gnu/asm/socket.h: - -/usr/include/asm-generic/socket.h: - -/usr/include/i386-linux-gnu/asm/sockios.h: - -/usr/include/asm-generic/sockios.h: - -/usr/include/i386-linux-gnu/bits/in.h: - -/usr/include/netinet/tcp.h: - -/usr/include/arpa/nameser.h: - -/usr/include/i386-linux-gnu/sys/param.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/limits.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/syslimits.h: - -/usr/include/limits.h: - -/usr/include/i386-linux-gnu/bits/posix1_lim.h: - -/usr/include/i386-linux-gnu/bits/local_lim.h: - -/usr/include/linux/limits.h: - -/usr/include/i386-linux-gnu/bits/posix2_lim.h: - -/usr/include/linux/param.h: - -/usr/include/i386-linux-gnu/asm/param.h: - -/usr/include/asm-generic/param.h: - -/usr/include/i386-linux-gnu/sys/bitypes.h: - -/usr/include/arpa/nameser_compat.h: - -/usr/include/netdb.h: - -/usr/include/rpc/netdb.h: - -/usr/include/i386-linux-gnu/bits/netdb.h: - -/usr/include/malloc.h: - -/usr/include/ctype.h: - -include/antlr3interfaces.h: - -include/antlr3convertutf.h: - -include/antlr3exception.h: - -include/antlr3encodings.h: - -include/antlr3string.h: - -include/antlr3collections.h: - -include/antlr3bitset.h: - -include/antlr3input.h: - -include/antlr3commontoken.h: - -include/antlr3intstream.h: - -include/antlr3cyclicdfa.h: - -include/antlr3baserecognizer.h: - -include/antlr3tokenstream.h: - -include/antlr3debugeventlistener.h: - -include/antlr3basetree.h: - -include/antlr3commontreenodestream.h: - -include/antlr3commontreeadaptor.h: - -include/antlr3basetreeadaptor.h: - -include/antlr3commontree.h: - -include/antlr3recognizersharedstate.h: - -include/antlr3lexer.h: - -include/antlr3parser.h: - -include/antlr3treeparser.h: - -include/antlr3filestream.h: - -include/antlr3rewritestreams.h: diff --git a/impl/antlr/libantlr3c-3.4/.deps/antlr3commontree.Plo b/impl/antlr/libantlr3c-3.4/.deps/antlr3commontree.Plo deleted file mode 100644 index eb8ff1b..0000000 --- a/impl/antlr/libantlr3c-3.4/.deps/antlr3commontree.Plo +++ /dev/null @@ -1,242 +0,0 @@ -antlr3commontree.lo: src/antlr3commontree.c include/antlr3commontree.h \ - include/antlr3defs.h include/antlr3errors.h antlr3config.h \ - /usr/include/stdio.h /usr/include/features.h \ - /usr/include/i386-linux-gnu/bits/predefs.h \ - /usr/include/i386-linux-gnu/sys/cdefs.h \ - /usr/include/i386-linux-gnu/bits/wordsize.h \ - /usr/include/i386-linux-gnu/gnu/stubs.h \ - /usr/include/i386-linux-gnu/gnu/stubs-32.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include/stddef.h \ - /usr/include/i386-linux-gnu/bits/types.h \ - /usr/include/i386-linux-gnu/bits/typesizes.h /usr/include/libio.h \ - /usr/include/_G_config.h /usr/include/wchar.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include/stdarg.h \ - /usr/include/i386-linux-gnu/bits/stdio_lim.h \ - /usr/include/i386-linux-gnu/bits/sys_errlist.h \ - /usr/include/i386-linux-gnu/bits/stdio.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include/stdint.h /usr/include/stdint.h \ - /usr/include/i386-linux-gnu/bits/wchar.h \ - /usr/include/i386-linux-gnu/sys/types.h /usr/include/time.h \ - /usr/include/endian.h /usr/include/i386-linux-gnu/bits/endian.h \ - /usr/include/i386-linux-gnu/bits/byteswap.h \ - /usr/include/i386-linux-gnu/sys/select.h \ - /usr/include/i386-linux-gnu/bits/select.h \ - /usr/include/i386-linux-gnu/bits/sigset.h \ - /usr/include/i386-linux-gnu/bits/time.h \ - /usr/include/i386-linux-gnu/sys/sysmacros.h \ - /usr/include/i386-linux-gnu/bits/pthreadtypes.h \ - /usr/include/i386-linux-gnu/sys/stat.h \ - /usr/include/i386-linux-gnu/bits/stat.h /usr/include/stdlib.h \ - /usr/include/i386-linux-gnu/bits/waitflags.h \ - /usr/include/i386-linux-gnu/bits/waitstatus.h /usr/include/alloca.h \ - /usr/include/string.h /usr/include/xlocale.h \ - /usr/include/i386-linux-gnu/bits/string.h \ - /usr/include/i386-linux-gnu/bits/string2.h /usr/include/strings.h \ - /usr/include/inttypes.h /usr/include/unistd.h \ - /usr/include/i386-linux-gnu/bits/posix_opt.h \ - /usr/include/i386-linux-gnu/bits/environments.h \ - /usr/include/i386-linux-gnu/bits/confname.h /usr/include/getopt.h \ - /usr/include/netinet/in.h /usr/include/i386-linux-gnu/sys/socket.h \ - /usr/include/i386-linux-gnu/sys/uio.h \ - /usr/include/i386-linux-gnu/bits/uio.h \ - /usr/include/i386-linux-gnu/bits/socket.h \ - /usr/include/i386-linux-gnu/bits/sockaddr.h \ - /usr/include/i386-linux-gnu/asm/socket.h \ - /usr/include/asm-generic/socket.h \ - /usr/include/i386-linux-gnu/asm/sockios.h \ - /usr/include/asm-generic/sockios.h /usr/include/i386-linux-gnu/bits/in.h \ - /usr/include/netinet/tcp.h /usr/include/arpa/nameser.h \ - /usr/include/i386-linux-gnu/sys/param.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/limits.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/syslimits.h \ - /usr/include/limits.h /usr/include/i386-linux-gnu/bits/posix1_lim.h \ - /usr/include/i386-linux-gnu/bits/local_lim.h /usr/include/linux/limits.h \ - /usr/include/i386-linux-gnu/bits/posix2_lim.h /usr/include/linux/param.h \ - /usr/include/i386-linux-gnu/asm/param.h /usr/include/asm-generic/param.h \ - /usr/include/i386-linux-gnu/sys/bitypes.h \ - /usr/include/arpa/nameser_compat.h /usr/include/netdb.h \ - /usr/include/rpc/netdb.h /usr/include/i386-linux-gnu/bits/netdb.h \ - /usr/include/malloc.h /usr/include/ctype.h include/antlr3interfaces.h \ - include/antlr3convertutf.h include/antlr3basetree.h \ - include/antlr3collections.h include/antlr3bitset.h \ - include/antlr3string.h include/antlr3commontoken.h - -include/antlr3commontree.h: - -include/antlr3defs.h: - -include/antlr3errors.h: - -antlr3config.h: - -/usr/include/stdio.h: - -/usr/include/features.h: - -/usr/include/i386-linux-gnu/bits/predefs.h: - -/usr/include/i386-linux-gnu/sys/cdefs.h: - -/usr/include/i386-linux-gnu/bits/wordsize.h: - -/usr/include/i386-linux-gnu/gnu/stubs.h: - -/usr/include/i386-linux-gnu/gnu/stubs-32.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include/stddef.h: - -/usr/include/i386-linux-gnu/bits/types.h: - -/usr/include/i386-linux-gnu/bits/typesizes.h: - -/usr/include/libio.h: - -/usr/include/_G_config.h: - -/usr/include/wchar.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include/stdarg.h: - -/usr/include/i386-linux-gnu/bits/stdio_lim.h: - -/usr/include/i386-linux-gnu/bits/sys_errlist.h: - -/usr/include/i386-linux-gnu/bits/stdio.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include/stdint.h: - -/usr/include/stdint.h: - -/usr/include/i386-linux-gnu/bits/wchar.h: - -/usr/include/i386-linux-gnu/sys/types.h: - -/usr/include/time.h: - -/usr/include/endian.h: - -/usr/include/i386-linux-gnu/bits/endian.h: - -/usr/include/i386-linux-gnu/bits/byteswap.h: - -/usr/include/i386-linux-gnu/sys/select.h: - -/usr/include/i386-linux-gnu/bits/select.h: - -/usr/include/i386-linux-gnu/bits/sigset.h: - -/usr/include/i386-linux-gnu/bits/time.h: - -/usr/include/i386-linux-gnu/sys/sysmacros.h: - -/usr/include/i386-linux-gnu/bits/pthreadtypes.h: - -/usr/include/i386-linux-gnu/sys/stat.h: - -/usr/include/i386-linux-gnu/bits/stat.h: - -/usr/include/stdlib.h: - -/usr/include/i386-linux-gnu/bits/waitflags.h: - -/usr/include/i386-linux-gnu/bits/waitstatus.h: - -/usr/include/alloca.h: - -/usr/include/string.h: - -/usr/include/xlocale.h: - -/usr/include/i386-linux-gnu/bits/string.h: - -/usr/include/i386-linux-gnu/bits/string2.h: - -/usr/include/strings.h: - -/usr/include/inttypes.h: - -/usr/include/unistd.h: - -/usr/include/i386-linux-gnu/bits/posix_opt.h: - -/usr/include/i386-linux-gnu/bits/environments.h: - -/usr/include/i386-linux-gnu/bits/confname.h: - -/usr/include/getopt.h: - -/usr/include/netinet/in.h: - -/usr/include/i386-linux-gnu/sys/socket.h: - -/usr/include/i386-linux-gnu/sys/uio.h: - -/usr/include/i386-linux-gnu/bits/uio.h: - -/usr/include/i386-linux-gnu/bits/socket.h: - -/usr/include/i386-linux-gnu/bits/sockaddr.h: - -/usr/include/i386-linux-gnu/asm/socket.h: - -/usr/include/asm-generic/socket.h: - -/usr/include/i386-linux-gnu/asm/sockios.h: - -/usr/include/asm-generic/sockios.h: - -/usr/include/i386-linux-gnu/bits/in.h: - -/usr/include/netinet/tcp.h: - -/usr/include/arpa/nameser.h: - -/usr/include/i386-linux-gnu/sys/param.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/limits.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/syslimits.h: - -/usr/include/limits.h: - -/usr/include/i386-linux-gnu/bits/posix1_lim.h: - -/usr/include/i386-linux-gnu/bits/local_lim.h: - -/usr/include/linux/limits.h: - -/usr/include/i386-linux-gnu/bits/posix2_lim.h: - -/usr/include/linux/param.h: - -/usr/include/i386-linux-gnu/asm/param.h: - -/usr/include/asm-generic/param.h: - -/usr/include/i386-linux-gnu/sys/bitypes.h: - -/usr/include/arpa/nameser_compat.h: - -/usr/include/netdb.h: - -/usr/include/rpc/netdb.h: - -/usr/include/i386-linux-gnu/bits/netdb.h: - -/usr/include/malloc.h: - -/usr/include/ctype.h: - -include/antlr3interfaces.h: - -include/antlr3convertutf.h: - -include/antlr3basetree.h: - -include/antlr3collections.h: - -include/antlr3bitset.h: - -include/antlr3string.h: - -include/antlr3commontoken.h: diff --git a/impl/antlr/libantlr3c-3.4/.deps/antlr3commontreeadaptor.Plo b/impl/antlr/libantlr3c-3.4/.deps/antlr3commontreeadaptor.Plo deleted file mode 100644 index a3defd0..0000000 --- a/impl/antlr/libantlr3c-3.4/.deps/antlr3commontreeadaptor.Plo +++ /dev/null @@ -1,250 +0,0 @@ -antlr3commontreeadaptor.lo: src/antlr3commontreeadaptor.c \ - include/antlr3commontreeadaptor.h include/antlr3defs.h \ - include/antlr3errors.h antlr3config.h /usr/include/stdio.h \ - /usr/include/features.h /usr/include/i386-linux-gnu/bits/predefs.h \ - /usr/include/i386-linux-gnu/sys/cdefs.h \ - /usr/include/i386-linux-gnu/bits/wordsize.h \ - /usr/include/i386-linux-gnu/gnu/stubs.h \ - /usr/include/i386-linux-gnu/gnu/stubs-32.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include/stddef.h \ - /usr/include/i386-linux-gnu/bits/types.h \ - /usr/include/i386-linux-gnu/bits/typesizes.h /usr/include/libio.h \ - /usr/include/_G_config.h /usr/include/wchar.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include/stdarg.h \ - /usr/include/i386-linux-gnu/bits/stdio_lim.h \ - /usr/include/i386-linux-gnu/bits/sys_errlist.h \ - /usr/include/i386-linux-gnu/bits/stdio.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include/stdint.h /usr/include/stdint.h \ - /usr/include/i386-linux-gnu/bits/wchar.h \ - /usr/include/i386-linux-gnu/sys/types.h /usr/include/time.h \ - /usr/include/endian.h /usr/include/i386-linux-gnu/bits/endian.h \ - /usr/include/i386-linux-gnu/bits/byteswap.h \ - /usr/include/i386-linux-gnu/sys/select.h \ - /usr/include/i386-linux-gnu/bits/select.h \ - /usr/include/i386-linux-gnu/bits/sigset.h \ - /usr/include/i386-linux-gnu/bits/time.h \ - /usr/include/i386-linux-gnu/sys/sysmacros.h \ - /usr/include/i386-linux-gnu/bits/pthreadtypes.h \ - /usr/include/i386-linux-gnu/sys/stat.h \ - /usr/include/i386-linux-gnu/bits/stat.h /usr/include/stdlib.h \ - /usr/include/i386-linux-gnu/bits/waitflags.h \ - /usr/include/i386-linux-gnu/bits/waitstatus.h /usr/include/alloca.h \ - /usr/include/string.h /usr/include/xlocale.h \ - /usr/include/i386-linux-gnu/bits/string.h \ - /usr/include/i386-linux-gnu/bits/string2.h /usr/include/strings.h \ - /usr/include/inttypes.h /usr/include/unistd.h \ - /usr/include/i386-linux-gnu/bits/posix_opt.h \ - /usr/include/i386-linux-gnu/bits/environments.h \ - /usr/include/i386-linux-gnu/bits/confname.h /usr/include/getopt.h \ - /usr/include/netinet/in.h /usr/include/i386-linux-gnu/sys/socket.h \ - /usr/include/i386-linux-gnu/sys/uio.h \ - /usr/include/i386-linux-gnu/bits/uio.h \ - /usr/include/i386-linux-gnu/bits/socket.h \ - /usr/include/i386-linux-gnu/bits/sockaddr.h \ - /usr/include/i386-linux-gnu/asm/socket.h \ - /usr/include/asm-generic/socket.h \ - /usr/include/i386-linux-gnu/asm/sockios.h \ - /usr/include/asm-generic/sockios.h /usr/include/i386-linux-gnu/bits/in.h \ - /usr/include/netinet/tcp.h /usr/include/arpa/nameser.h \ - /usr/include/i386-linux-gnu/sys/param.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/limits.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/syslimits.h \ - /usr/include/limits.h /usr/include/i386-linux-gnu/bits/posix1_lim.h \ - /usr/include/i386-linux-gnu/bits/local_lim.h /usr/include/linux/limits.h \ - /usr/include/i386-linux-gnu/bits/posix2_lim.h /usr/include/linux/param.h \ - /usr/include/i386-linux-gnu/asm/param.h /usr/include/asm-generic/param.h \ - /usr/include/i386-linux-gnu/sys/bitypes.h \ - /usr/include/arpa/nameser_compat.h /usr/include/netdb.h \ - /usr/include/rpc/netdb.h /usr/include/i386-linux-gnu/bits/netdb.h \ - /usr/include/malloc.h /usr/include/ctype.h include/antlr3interfaces.h \ - include/antlr3convertutf.h include/antlr3collections.h \ - include/antlr3bitset.h include/antlr3string.h \ - include/antlr3basetreeadaptor.h include/antlr3basetree.h \ - include/antlr3commontoken.h include/antlr3debugeventlistener.h \ - include/antlr3commontree.h - -include/antlr3commontreeadaptor.h: - -include/antlr3defs.h: - -include/antlr3errors.h: - -antlr3config.h: - -/usr/include/stdio.h: - -/usr/include/features.h: - -/usr/include/i386-linux-gnu/bits/predefs.h: - -/usr/include/i386-linux-gnu/sys/cdefs.h: - -/usr/include/i386-linux-gnu/bits/wordsize.h: - -/usr/include/i386-linux-gnu/gnu/stubs.h: - -/usr/include/i386-linux-gnu/gnu/stubs-32.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include/stddef.h: - -/usr/include/i386-linux-gnu/bits/types.h: - -/usr/include/i386-linux-gnu/bits/typesizes.h: - -/usr/include/libio.h: - -/usr/include/_G_config.h: - -/usr/include/wchar.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include/stdarg.h: - -/usr/include/i386-linux-gnu/bits/stdio_lim.h: - -/usr/include/i386-linux-gnu/bits/sys_errlist.h: - -/usr/include/i386-linux-gnu/bits/stdio.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include/stdint.h: - -/usr/include/stdint.h: - -/usr/include/i386-linux-gnu/bits/wchar.h: - -/usr/include/i386-linux-gnu/sys/types.h: - -/usr/include/time.h: - -/usr/include/endian.h: - -/usr/include/i386-linux-gnu/bits/endian.h: - -/usr/include/i386-linux-gnu/bits/byteswap.h: - -/usr/include/i386-linux-gnu/sys/select.h: - -/usr/include/i386-linux-gnu/bits/select.h: - -/usr/include/i386-linux-gnu/bits/sigset.h: - -/usr/include/i386-linux-gnu/bits/time.h: - -/usr/include/i386-linux-gnu/sys/sysmacros.h: - -/usr/include/i386-linux-gnu/bits/pthreadtypes.h: - -/usr/include/i386-linux-gnu/sys/stat.h: - -/usr/include/i386-linux-gnu/bits/stat.h: - -/usr/include/stdlib.h: - -/usr/include/i386-linux-gnu/bits/waitflags.h: - -/usr/include/i386-linux-gnu/bits/waitstatus.h: - -/usr/include/alloca.h: - -/usr/include/string.h: - -/usr/include/xlocale.h: - -/usr/include/i386-linux-gnu/bits/string.h: - -/usr/include/i386-linux-gnu/bits/string2.h: - -/usr/include/strings.h: - -/usr/include/inttypes.h: - -/usr/include/unistd.h: - -/usr/include/i386-linux-gnu/bits/posix_opt.h: - -/usr/include/i386-linux-gnu/bits/environments.h: - -/usr/include/i386-linux-gnu/bits/confname.h: - -/usr/include/getopt.h: - -/usr/include/netinet/in.h: - -/usr/include/i386-linux-gnu/sys/socket.h: - -/usr/include/i386-linux-gnu/sys/uio.h: - -/usr/include/i386-linux-gnu/bits/uio.h: - -/usr/include/i386-linux-gnu/bits/socket.h: - -/usr/include/i386-linux-gnu/bits/sockaddr.h: - -/usr/include/i386-linux-gnu/asm/socket.h: - -/usr/include/asm-generic/socket.h: - -/usr/include/i386-linux-gnu/asm/sockios.h: - -/usr/include/asm-generic/sockios.h: - -/usr/include/i386-linux-gnu/bits/in.h: - -/usr/include/netinet/tcp.h: - -/usr/include/arpa/nameser.h: - -/usr/include/i386-linux-gnu/sys/param.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/limits.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/syslimits.h: - -/usr/include/limits.h: - -/usr/include/i386-linux-gnu/bits/posix1_lim.h: - -/usr/include/i386-linux-gnu/bits/local_lim.h: - -/usr/include/linux/limits.h: - -/usr/include/i386-linux-gnu/bits/posix2_lim.h: - -/usr/include/linux/param.h: - -/usr/include/i386-linux-gnu/asm/param.h: - -/usr/include/asm-generic/param.h: - -/usr/include/i386-linux-gnu/sys/bitypes.h: - -/usr/include/arpa/nameser_compat.h: - -/usr/include/netdb.h: - -/usr/include/rpc/netdb.h: - -/usr/include/i386-linux-gnu/bits/netdb.h: - -/usr/include/malloc.h: - -/usr/include/ctype.h: - -include/antlr3interfaces.h: - -include/antlr3convertutf.h: - -include/antlr3collections.h: - -include/antlr3bitset.h: - -include/antlr3string.h: - -include/antlr3basetreeadaptor.h: - -include/antlr3basetree.h: - -include/antlr3commontoken.h: - -include/antlr3debugeventlistener.h: - -include/antlr3commontree.h: diff --git a/impl/antlr/libantlr3c-3.4/.deps/antlr3commontreenodestream.Plo b/impl/antlr/libantlr3c-3.4/.deps/antlr3commontreenodestream.Plo deleted file mode 100644 index 52ee66b..0000000 --- a/impl/antlr/libantlr3c-3.4/.deps/antlr3commontreenodestream.Plo +++ /dev/null @@ -1,255 +0,0 @@ -antlr3commontreenodestream.lo: src/antlr3commontreenodestream.c \ - include/antlr3commontreenodestream.h include/antlr3defs.h \ - include/antlr3errors.h antlr3config.h /usr/include/stdio.h \ - /usr/include/features.h /usr/include/i386-linux-gnu/bits/predefs.h \ - /usr/include/i386-linux-gnu/sys/cdefs.h \ - /usr/include/i386-linux-gnu/bits/wordsize.h \ - /usr/include/i386-linux-gnu/gnu/stubs.h \ - /usr/include/i386-linux-gnu/gnu/stubs-32.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include/stddef.h \ - /usr/include/i386-linux-gnu/bits/types.h \ - /usr/include/i386-linux-gnu/bits/typesizes.h /usr/include/libio.h \ - /usr/include/_G_config.h /usr/include/wchar.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include/stdarg.h \ - /usr/include/i386-linux-gnu/bits/stdio_lim.h \ - /usr/include/i386-linux-gnu/bits/sys_errlist.h \ - /usr/include/i386-linux-gnu/bits/stdio.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include/stdint.h /usr/include/stdint.h \ - /usr/include/i386-linux-gnu/bits/wchar.h \ - /usr/include/i386-linux-gnu/sys/types.h /usr/include/time.h \ - /usr/include/endian.h /usr/include/i386-linux-gnu/bits/endian.h \ - /usr/include/i386-linux-gnu/bits/byteswap.h \ - /usr/include/i386-linux-gnu/sys/select.h \ - /usr/include/i386-linux-gnu/bits/select.h \ - /usr/include/i386-linux-gnu/bits/sigset.h \ - /usr/include/i386-linux-gnu/bits/time.h \ - /usr/include/i386-linux-gnu/sys/sysmacros.h \ - /usr/include/i386-linux-gnu/bits/pthreadtypes.h \ - /usr/include/i386-linux-gnu/sys/stat.h \ - /usr/include/i386-linux-gnu/bits/stat.h /usr/include/stdlib.h \ - /usr/include/i386-linux-gnu/bits/waitflags.h \ - /usr/include/i386-linux-gnu/bits/waitstatus.h /usr/include/alloca.h \ - /usr/include/string.h /usr/include/xlocale.h \ - /usr/include/i386-linux-gnu/bits/string.h \ - /usr/include/i386-linux-gnu/bits/string2.h /usr/include/strings.h \ - /usr/include/inttypes.h /usr/include/unistd.h \ - /usr/include/i386-linux-gnu/bits/posix_opt.h \ - /usr/include/i386-linux-gnu/bits/environments.h \ - /usr/include/i386-linux-gnu/bits/confname.h /usr/include/getopt.h \ - /usr/include/netinet/in.h /usr/include/i386-linux-gnu/sys/socket.h \ - /usr/include/i386-linux-gnu/sys/uio.h \ - /usr/include/i386-linux-gnu/bits/uio.h \ - /usr/include/i386-linux-gnu/bits/socket.h \ - /usr/include/i386-linux-gnu/bits/sockaddr.h \ - /usr/include/i386-linux-gnu/asm/socket.h \ - /usr/include/asm-generic/socket.h \ - /usr/include/i386-linux-gnu/asm/sockios.h \ - /usr/include/asm-generic/sockios.h /usr/include/i386-linux-gnu/bits/in.h \ - /usr/include/netinet/tcp.h /usr/include/arpa/nameser.h \ - /usr/include/i386-linux-gnu/sys/param.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/limits.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/syslimits.h \ - /usr/include/limits.h /usr/include/i386-linux-gnu/bits/posix1_lim.h \ - /usr/include/i386-linux-gnu/bits/local_lim.h /usr/include/linux/limits.h \ - /usr/include/i386-linux-gnu/bits/posix2_lim.h /usr/include/linux/param.h \ - /usr/include/i386-linux-gnu/asm/param.h /usr/include/asm-generic/param.h \ - /usr/include/i386-linux-gnu/sys/bitypes.h \ - /usr/include/arpa/nameser_compat.h /usr/include/netdb.h \ - /usr/include/rpc/netdb.h /usr/include/i386-linux-gnu/bits/netdb.h \ - /usr/include/malloc.h /usr/include/ctype.h include/antlr3interfaces.h \ - include/antlr3convertutf.h include/antlr3commontreeadaptor.h \ - include/antlr3collections.h include/antlr3bitset.h \ - include/antlr3string.h include/antlr3basetreeadaptor.h \ - include/antlr3basetree.h include/antlr3commontoken.h \ - include/antlr3debugeventlistener.h include/antlr3commontree.h \ - include/antlr3intstream.h - -include/antlr3commontreenodestream.h: - -include/antlr3defs.h: - -include/antlr3errors.h: - -antlr3config.h: - -/usr/include/stdio.h: - -/usr/include/features.h: - -/usr/include/i386-linux-gnu/bits/predefs.h: - -/usr/include/i386-linux-gnu/sys/cdefs.h: - -/usr/include/i386-linux-gnu/bits/wordsize.h: - -/usr/include/i386-linux-gnu/gnu/stubs.h: - -/usr/include/i386-linux-gnu/gnu/stubs-32.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include/stddef.h: - -/usr/include/i386-linux-gnu/bits/types.h: - -/usr/include/i386-linux-gnu/bits/typesizes.h: - -/usr/include/libio.h: - -/usr/include/_G_config.h: - -/usr/include/wchar.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include/stdarg.h: - -/usr/include/i386-linux-gnu/bits/stdio_lim.h: - -/usr/include/i386-linux-gnu/bits/sys_errlist.h: - -/usr/include/i386-linux-gnu/bits/stdio.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include/stdint.h: - -/usr/include/stdint.h: - -/usr/include/i386-linux-gnu/bits/wchar.h: - -/usr/include/i386-linux-gnu/sys/types.h: - -/usr/include/time.h: - -/usr/include/endian.h: - -/usr/include/i386-linux-gnu/bits/endian.h: - -/usr/include/i386-linux-gnu/bits/byteswap.h: - -/usr/include/i386-linux-gnu/sys/select.h: - -/usr/include/i386-linux-gnu/bits/select.h: - -/usr/include/i386-linux-gnu/bits/sigset.h: - -/usr/include/i386-linux-gnu/bits/time.h: - -/usr/include/i386-linux-gnu/sys/sysmacros.h: - -/usr/include/i386-linux-gnu/bits/pthreadtypes.h: - -/usr/include/i386-linux-gnu/sys/stat.h: - -/usr/include/i386-linux-gnu/bits/stat.h: - -/usr/include/stdlib.h: - -/usr/include/i386-linux-gnu/bits/waitflags.h: - -/usr/include/i386-linux-gnu/bits/waitstatus.h: - -/usr/include/alloca.h: - -/usr/include/string.h: - -/usr/include/xlocale.h: - -/usr/include/i386-linux-gnu/bits/string.h: - -/usr/include/i386-linux-gnu/bits/string2.h: - -/usr/include/strings.h: - -/usr/include/inttypes.h: - -/usr/include/unistd.h: - -/usr/include/i386-linux-gnu/bits/posix_opt.h: - -/usr/include/i386-linux-gnu/bits/environments.h: - -/usr/include/i386-linux-gnu/bits/confname.h: - -/usr/include/getopt.h: - -/usr/include/netinet/in.h: - -/usr/include/i386-linux-gnu/sys/socket.h: - -/usr/include/i386-linux-gnu/sys/uio.h: - -/usr/include/i386-linux-gnu/bits/uio.h: - -/usr/include/i386-linux-gnu/bits/socket.h: - -/usr/include/i386-linux-gnu/bits/sockaddr.h: - -/usr/include/i386-linux-gnu/asm/socket.h: - -/usr/include/asm-generic/socket.h: - -/usr/include/i386-linux-gnu/asm/sockios.h: - -/usr/include/asm-generic/sockios.h: - -/usr/include/i386-linux-gnu/bits/in.h: - -/usr/include/netinet/tcp.h: - -/usr/include/arpa/nameser.h: - -/usr/include/i386-linux-gnu/sys/param.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/limits.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/syslimits.h: - -/usr/include/limits.h: - -/usr/include/i386-linux-gnu/bits/posix1_lim.h: - -/usr/include/i386-linux-gnu/bits/local_lim.h: - -/usr/include/linux/limits.h: - -/usr/include/i386-linux-gnu/bits/posix2_lim.h: - -/usr/include/linux/param.h: - -/usr/include/i386-linux-gnu/asm/param.h: - -/usr/include/asm-generic/param.h: - -/usr/include/i386-linux-gnu/sys/bitypes.h: - -/usr/include/arpa/nameser_compat.h: - -/usr/include/netdb.h: - -/usr/include/rpc/netdb.h: - -/usr/include/i386-linux-gnu/bits/netdb.h: - -/usr/include/malloc.h: - -/usr/include/ctype.h: - -include/antlr3interfaces.h: - -include/antlr3convertutf.h: - -include/antlr3commontreeadaptor.h: - -include/antlr3collections.h: - -include/antlr3bitset.h: - -include/antlr3string.h: - -include/antlr3basetreeadaptor.h: - -include/antlr3basetree.h: - -include/antlr3commontoken.h: - -include/antlr3debugeventlistener.h: - -include/antlr3commontree.h: - -include/antlr3intstream.h: diff --git a/impl/antlr/libantlr3c-3.4/.deps/antlr3convertutf.Plo b/impl/antlr/libantlr3c-3.4/.deps/antlr3convertutf.Plo deleted file mode 100644 index e04a0b5..0000000 --- a/impl/antlr/libantlr3c-3.4/.deps/antlr3convertutf.Plo +++ /dev/null @@ -1,227 +0,0 @@ -antlr3convertutf.lo: src/antlr3convertutf.c include/antlr3convertutf.h \ - include/antlr3defs.h include/antlr3errors.h antlr3config.h \ - /usr/include/stdio.h /usr/include/features.h \ - /usr/include/i386-linux-gnu/bits/predefs.h \ - /usr/include/i386-linux-gnu/sys/cdefs.h \ - /usr/include/i386-linux-gnu/bits/wordsize.h \ - /usr/include/i386-linux-gnu/gnu/stubs.h \ - /usr/include/i386-linux-gnu/gnu/stubs-32.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include/stddef.h \ - /usr/include/i386-linux-gnu/bits/types.h \ - /usr/include/i386-linux-gnu/bits/typesizes.h /usr/include/libio.h \ - /usr/include/_G_config.h /usr/include/wchar.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include/stdarg.h \ - /usr/include/i386-linux-gnu/bits/stdio_lim.h \ - /usr/include/i386-linux-gnu/bits/sys_errlist.h \ - /usr/include/i386-linux-gnu/bits/stdio.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include/stdint.h /usr/include/stdint.h \ - /usr/include/i386-linux-gnu/bits/wchar.h \ - /usr/include/i386-linux-gnu/sys/types.h /usr/include/time.h \ - /usr/include/endian.h /usr/include/i386-linux-gnu/bits/endian.h \ - /usr/include/i386-linux-gnu/bits/byteswap.h \ - /usr/include/i386-linux-gnu/sys/select.h \ - /usr/include/i386-linux-gnu/bits/select.h \ - /usr/include/i386-linux-gnu/bits/sigset.h \ - /usr/include/i386-linux-gnu/bits/time.h \ - /usr/include/i386-linux-gnu/sys/sysmacros.h \ - /usr/include/i386-linux-gnu/bits/pthreadtypes.h \ - /usr/include/i386-linux-gnu/sys/stat.h \ - /usr/include/i386-linux-gnu/bits/stat.h /usr/include/stdlib.h \ - /usr/include/i386-linux-gnu/bits/waitflags.h \ - /usr/include/i386-linux-gnu/bits/waitstatus.h /usr/include/alloca.h \ - /usr/include/string.h /usr/include/xlocale.h \ - /usr/include/i386-linux-gnu/bits/string.h \ - /usr/include/i386-linux-gnu/bits/string2.h /usr/include/strings.h \ - /usr/include/inttypes.h /usr/include/unistd.h \ - /usr/include/i386-linux-gnu/bits/posix_opt.h \ - /usr/include/i386-linux-gnu/bits/environments.h \ - /usr/include/i386-linux-gnu/bits/confname.h /usr/include/getopt.h \ - /usr/include/netinet/in.h /usr/include/i386-linux-gnu/sys/socket.h \ - /usr/include/i386-linux-gnu/sys/uio.h \ - /usr/include/i386-linux-gnu/bits/uio.h \ - /usr/include/i386-linux-gnu/bits/socket.h \ - /usr/include/i386-linux-gnu/bits/sockaddr.h \ - /usr/include/i386-linux-gnu/asm/socket.h \ - /usr/include/asm-generic/socket.h \ - /usr/include/i386-linux-gnu/asm/sockios.h \ - /usr/include/asm-generic/sockios.h /usr/include/i386-linux-gnu/bits/in.h \ - /usr/include/netinet/tcp.h /usr/include/arpa/nameser.h \ - /usr/include/i386-linux-gnu/sys/param.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/limits.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/syslimits.h \ - /usr/include/limits.h /usr/include/i386-linux-gnu/bits/posix1_lim.h \ - /usr/include/i386-linux-gnu/bits/local_lim.h /usr/include/linux/limits.h \ - /usr/include/i386-linux-gnu/bits/posix2_lim.h /usr/include/linux/param.h \ - /usr/include/i386-linux-gnu/asm/param.h /usr/include/asm-generic/param.h \ - /usr/include/i386-linux-gnu/sys/bitypes.h \ - /usr/include/arpa/nameser_compat.h /usr/include/netdb.h \ - /usr/include/rpc/netdb.h /usr/include/i386-linux-gnu/bits/netdb.h \ - /usr/include/malloc.h /usr/include/ctype.h include/antlr3interfaces.h - -include/antlr3convertutf.h: - -include/antlr3defs.h: - -include/antlr3errors.h: - -antlr3config.h: - -/usr/include/stdio.h: - -/usr/include/features.h: - -/usr/include/i386-linux-gnu/bits/predefs.h: - -/usr/include/i386-linux-gnu/sys/cdefs.h: - -/usr/include/i386-linux-gnu/bits/wordsize.h: - -/usr/include/i386-linux-gnu/gnu/stubs.h: - -/usr/include/i386-linux-gnu/gnu/stubs-32.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include/stddef.h: - -/usr/include/i386-linux-gnu/bits/types.h: - -/usr/include/i386-linux-gnu/bits/typesizes.h: - -/usr/include/libio.h: - -/usr/include/_G_config.h: - -/usr/include/wchar.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include/stdarg.h: - -/usr/include/i386-linux-gnu/bits/stdio_lim.h: - -/usr/include/i386-linux-gnu/bits/sys_errlist.h: - -/usr/include/i386-linux-gnu/bits/stdio.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include/stdint.h: - -/usr/include/stdint.h: - -/usr/include/i386-linux-gnu/bits/wchar.h: - -/usr/include/i386-linux-gnu/sys/types.h: - -/usr/include/time.h: - -/usr/include/endian.h: - -/usr/include/i386-linux-gnu/bits/endian.h: - -/usr/include/i386-linux-gnu/bits/byteswap.h: - -/usr/include/i386-linux-gnu/sys/select.h: - -/usr/include/i386-linux-gnu/bits/select.h: - -/usr/include/i386-linux-gnu/bits/sigset.h: - -/usr/include/i386-linux-gnu/bits/time.h: - -/usr/include/i386-linux-gnu/sys/sysmacros.h: - -/usr/include/i386-linux-gnu/bits/pthreadtypes.h: - -/usr/include/i386-linux-gnu/sys/stat.h: - -/usr/include/i386-linux-gnu/bits/stat.h: - -/usr/include/stdlib.h: - -/usr/include/i386-linux-gnu/bits/waitflags.h: - -/usr/include/i386-linux-gnu/bits/waitstatus.h: - -/usr/include/alloca.h: - -/usr/include/string.h: - -/usr/include/xlocale.h: - -/usr/include/i386-linux-gnu/bits/string.h: - -/usr/include/i386-linux-gnu/bits/string2.h: - -/usr/include/strings.h: - -/usr/include/inttypes.h: - -/usr/include/unistd.h: - -/usr/include/i386-linux-gnu/bits/posix_opt.h: - -/usr/include/i386-linux-gnu/bits/environments.h: - -/usr/include/i386-linux-gnu/bits/confname.h: - -/usr/include/getopt.h: - -/usr/include/netinet/in.h: - -/usr/include/i386-linux-gnu/sys/socket.h: - -/usr/include/i386-linux-gnu/sys/uio.h: - -/usr/include/i386-linux-gnu/bits/uio.h: - -/usr/include/i386-linux-gnu/bits/socket.h: - -/usr/include/i386-linux-gnu/bits/sockaddr.h: - -/usr/include/i386-linux-gnu/asm/socket.h: - -/usr/include/asm-generic/socket.h: - -/usr/include/i386-linux-gnu/asm/sockios.h: - -/usr/include/asm-generic/sockios.h: - -/usr/include/i386-linux-gnu/bits/in.h: - -/usr/include/netinet/tcp.h: - -/usr/include/arpa/nameser.h: - -/usr/include/i386-linux-gnu/sys/param.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/limits.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/syslimits.h: - -/usr/include/limits.h: - -/usr/include/i386-linux-gnu/bits/posix1_lim.h: - -/usr/include/i386-linux-gnu/bits/local_lim.h: - -/usr/include/linux/limits.h: - -/usr/include/i386-linux-gnu/bits/posix2_lim.h: - -/usr/include/linux/param.h: - -/usr/include/i386-linux-gnu/asm/param.h: - -/usr/include/asm-generic/param.h: - -/usr/include/i386-linux-gnu/sys/bitypes.h: - -/usr/include/arpa/nameser_compat.h: - -/usr/include/netdb.h: - -/usr/include/rpc/netdb.h: - -/usr/include/i386-linux-gnu/bits/netdb.h: - -/usr/include/malloc.h: - -/usr/include/ctype.h: - -include/antlr3interfaces.h: diff --git a/impl/antlr/libantlr3c-3.4/.deps/antlr3cyclicdfa.Plo b/impl/antlr/libantlr3c-3.4/.deps/antlr3cyclicdfa.Plo deleted file mode 100644 index 4e7be8d..0000000 --- a/impl/antlr/libantlr3c-3.4/.deps/antlr3cyclicdfa.Plo +++ /dev/null @@ -1,276 +0,0 @@ -antlr3cyclicdfa.lo: src/antlr3cyclicdfa.c include/antlr3defs.h \ - include/antlr3errors.h antlr3config.h /usr/include/stdio.h \ - /usr/include/features.h /usr/include/i386-linux-gnu/bits/predefs.h \ - /usr/include/i386-linux-gnu/sys/cdefs.h \ - /usr/include/i386-linux-gnu/bits/wordsize.h \ - /usr/include/i386-linux-gnu/gnu/stubs.h \ - /usr/include/i386-linux-gnu/gnu/stubs-32.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include/stddef.h \ - /usr/include/i386-linux-gnu/bits/types.h \ - /usr/include/i386-linux-gnu/bits/typesizes.h /usr/include/libio.h \ - /usr/include/_G_config.h /usr/include/wchar.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include/stdarg.h \ - /usr/include/i386-linux-gnu/bits/stdio_lim.h \ - /usr/include/i386-linux-gnu/bits/sys_errlist.h \ - /usr/include/i386-linux-gnu/bits/stdio.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include/stdint.h /usr/include/stdint.h \ - /usr/include/i386-linux-gnu/bits/wchar.h \ - /usr/include/i386-linux-gnu/sys/types.h /usr/include/time.h \ - /usr/include/endian.h /usr/include/i386-linux-gnu/bits/endian.h \ - /usr/include/i386-linux-gnu/bits/byteswap.h \ - /usr/include/i386-linux-gnu/sys/select.h \ - /usr/include/i386-linux-gnu/bits/select.h \ - /usr/include/i386-linux-gnu/bits/sigset.h \ - /usr/include/i386-linux-gnu/bits/time.h \ - /usr/include/i386-linux-gnu/sys/sysmacros.h \ - /usr/include/i386-linux-gnu/bits/pthreadtypes.h \ - /usr/include/i386-linux-gnu/sys/stat.h \ - /usr/include/i386-linux-gnu/bits/stat.h /usr/include/stdlib.h \ - /usr/include/i386-linux-gnu/bits/waitflags.h \ - /usr/include/i386-linux-gnu/bits/waitstatus.h /usr/include/alloca.h \ - /usr/include/string.h /usr/include/xlocale.h \ - /usr/include/i386-linux-gnu/bits/string.h \ - /usr/include/i386-linux-gnu/bits/string2.h /usr/include/strings.h \ - /usr/include/inttypes.h /usr/include/unistd.h \ - /usr/include/i386-linux-gnu/bits/posix_opt.h \ - /usr/include/i386-linux-gnu/bits/environments.h \ - /usr/include/i386-linux-gnu/bits/confname.h /usr/include/getopt.h \ - /usr/include/netinet/in.h /usr/include/i386-linux-gnu/sys/socket.h \ - /usr/include/i386-linux-gnu/sys/uio.h \ - /usr/include/i386-linux-gnu/bits/uio.h \ - /usr/include/i386-linux-gnu/bits/socket.h \ - /usr/include/i386-linux-gnu/bits/sockaddr.h \ - /usr/include/i386-linux-gnu/asm/socket.h \ - /usr/include/asm-generic/socket.h \ - /usr/include/i386-linux-gnu/asm/sockios.h \ - /usr/include/asm-generic/sockios.h /usr/include/i386-linux-gnu/bits/in.h \ - /usr/include/netinet/tcp.h /usr/include/arpa/nameser.h \ - /usr/include/i386-linux-gnu/sys/param.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/limits.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/syslimits.h \ - /usr/include/limits.h /usr/include/i386-linux-gnu/bits/posix1_lim.h \ - /usr/include/i386-linux-gnu/bits/local_lim.h /usr/include/linux/limits.h \ - /usr/include/i386-linux-gnu/bits/posix2_lim.h /usr/include/linux/param.h \ - /usr/include/i386-linux-gnu/asm/param.h /usr/include/asm-generic/param.h \ - /usr/include/i386-linux-gnu/sys/bitypes.h \ - /usr/include/arpa/nameser_compat.h /usr/include/netdb.h \ - /usr/include/rpc/netdb.h /usr/include/i386-linux-gnu/bits/netdb.h \ - /usr/include/malloc.h /usr/include/ctype.h include/antlr3interfaces.h \ - include/antlr3convertutf.h include/antlr3cyclicdfa.h \ - include/antlr3baserecognizer.h include/antlr3exception.h \ - include/antlr3input.h include/antlr3string.h include/antlr3collections.h \ - include/antlr3bitset.h include/antlr3commontoken.h \ - include/antlr3intstream.h include/antlr3tokenstream.h \ - include/antlr3debugeventlistener.h include/antlr3basetree.h \ - include/antlr3commontreenodestream.h include/antlr3commontreeadaptor.h \ - include/antlr3basetreeadaptor.h include/antlr3commontree.h \ - include/antlr3recognizersharedstate.h include/antlr3lexer.h \ - include/antlr3parser.h include/antlr3treeparser.h - -include/antlr3defs.h: - -include/antlr3errors.h: - -antlr3config.h: - -/usr/include/stdio.h: - -/usr/include/features.h: - -/usr/include/i386-linux-gnu/bits/predefs.h: - -/usr/include/i386-linux-gnu/sys/cdefs.h: - -/usr/include/i386-linux-gnu/bits/wordsize.h: - -/usr/include/i386-linux-gnu/gnu/stubs.h: - -/usr/include/i386-linux-gnu/gnu/stubs-32.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include/stddef.h: - -/usr/include/i386-linux-gnu/bits/types.h: - -/usr/include/i386-linux-gnu/bits/typesizes.h: - -/usr/include/libio.h: - -/usr/include/_G_config.h: - -/usr/include/wchar.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include/stdarg.h: - -/usr/include/i386-linux-gnu/bits/stdio_lim.h: - -/usr/include/i386-linux-gnu/bits/sys_errlist.h: - -/usr/include/i386-linux-gnu/bits/stdio.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include/stdint.h: - -/usr/include/stdint.h: - -/usr/include/i386-linux-gnu/bits/wchar.h: - -/usr/include/i386-linux-gnu/sys/types.h: - -/usr/include/time.h: - -/usr/include/endian.h: - -/usr/include/i386-linux-gnu/bits/endian.h: - -/usr/include/i386-linux-gnu/bits/byteswap.h: - -/usr/include/i386-linux-gnu/sys/select.h: - -/usr/include/i386-linux-gnu/bits/select.h: - -/usr/include/i386-linux-gnu/bits/sigset.h: - -/usr/include/i386-linux-gnu/bits/time.h: - -/usr/include/i386-linux-gnu/sys/sysmacros.h: - -/usr/include/i386-linux-gnu/bits/pthreadtypes.h: - -/usr/include/i386-linux-gnu/sys/stat.h: - -/usr/include/i386-linux-gnu/bits/stat.h: - -/usr/include/stdlib.h: - -/usr/include/i386-linux-gnu/bits/waitflags.h: - -/usr/include/i386-linux-gnu/bits/waitstatus.h: - -/usr/include/alloca.h: - -/usr/include/string.h: - -/usr/include/xlocale.h: - -/usr/include/i386-linux-gnu/bits/string.h: - -/usr/include/i386-linux-gnu/bits/string2.h: - -/usr/include/strings.h: - -/usr/include/inttypes.h: - -/usr/include/unistd.h: - -/usr/include/i386-linux-gnu/bits/posix_opt.h: - -/usr/include/i386-linux-gnu/bits/environments.h: - -/usr/include/i386-linux-gnu/bits/confname.h: - -/usr/include/getopt.h: - -/usr/include/netinet/in.h: - -/usr/include/i386-linux-gnu/sys/socket.h: - -/usr/include/i386-linux-gnu/sys/uio.h: - -/usr/include/i386-linux-gnu/bits/uio.h: - -/usr/include/i386-linux-gnu/bits/socket.h: - -/usr/include/i386-linux-gnu/bits/sockaddr.h: - -/usr/include/i386-linux-gnu/asm/socket.h: - -/usr/include/asm-generic/socket.h: - -/usr/include/i386-linux-gnu/asm/sockios.h: - -/usr/include/asm-generic/sockios.h: - -/usr/include/i386-linux-gnu/bits/in.h: - -/usr/include/netinet/tcp.h: - -/usr/include/arpa/nameser.h: - -/usr/include/i386-linux-gnu/sys/param.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/limits.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/syslimits.h: - -/usr/include/limits.h: - -/usr/include/i386-linux-gnu/bits/posix1_lim.h: - -/usr/include/i386-linux-gnu/bits/local_lim.h: - -/usr/include/linux/limits.h: - -/usr/include/i386-linux-gnu/bits/posix2_lim.h: - -/usr/include/linux/param.h: - -/usr/include/i386-linux-gnu/asm/param.h: - -/usr/include/asm-generic/param.h: - -/usr/include/i386-linux-gnu/sys/bitypes.h: - -/usr/include/arpa/nameser_compat.h: - -/usr/include/netdb.h: - -/usr/include/rpc/netdb.h: - -/usr/include/i386-linux-gnu/bits/netdb.h: - -/usr/include/malloc.h: - -/usr/include/ctype.h: - -include/antlr3interfaces.h: - -include/antlr3convertutf.h: - -include/antlr3cyclicdfa.h: - -include/antlr3baserecognizer.h: - -include/antlr3exception.h: - -include/antlr3input.h: - -include/antlr3string.h: - -include/antlr3collections.h: - -include/antlr3bitset.h: - -include/antlr3commontoken.h: - -include/antlr3intstream.h: - -include/antlr3tokenstream.h: - -include/antlr3debugeventlistener.h: - -include/antlr3basetree.h: - -include/antlr3commontreenodestream.h: - -include/antlr3commontreeadaptor.h: - -include/antlr3basetreeadaptor.h: - -include/antlr3commontree.h: - -include/antlr3recognizersharedstate.h: - -include/antlr3lexer.h: - -include/antlr3parser.h: - -include/antlr3treeparser.h: diff --git a/impl/antlr/libantlr3c-3.4/.deps/antlr3debughandlers.Plo b/impl/antlr/libantlr3c-3.4/.deps/antlr3debughandlers.Plo deleted file mode 100644 index 6568abc..0000000 --- a/impl/antlr/libantlr3c-3.4/.deps/antlr3debughandlers.Plo +++ /dev/null @@ -1,286 +0,0 @@ -antlr3debughandlers.lo: src/antlr3debughandlers.c include/antlr3.h \ - include/antlr3defs.h include/antlr3errors.h antlr3config.h \ - /usr/include/stdio.h /usr/include/features.h \ - /usr/include/i386-linux-gnu/bits/predefs.h \ - /usr/include/i386-linux-gnu/sys/cdefs.h \ - /usr/include/i386-linux-gnu/bits/wordsize.h \ - /usr/include/i386-linux-gnu/gnu/stubs.h \ - /usr/include/i386-linux-gnu/gnu/stubs-32.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include/stddef.h \ - /usr/include/i386-linux-gnu/bits/types.h \ - /usr/include/i386-linux-gnu/bits/typesizes.h /usr/include/libio.h \ - /usr/include/_G_config.h /usr/include/wchar.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include/stdarg.h \ - /usr/include/i386-linux-gnu/bits/stdio_lim.h \ - /usr/include/i386-linux-gnu/bits/sys_errlist.h \ - /usr/include/i386-linux-gnu/bits/stdio.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include/stdint.h /usr/include/stdint.h \ - /usr/include/i386-linux-gnu/bits/wchar.h \ - /usr/include/i386-linux-gnu/sys/types.h /usr/include/time.h \ - /usr/include/endian.h /usr/include/i386-linux-gnu/bits/endian.h \ - /usr/include/i386-linux-gnu/bits/byteswap.h \ - /usr/include/i386-linux-gnu/sys/select.h \ - /usr/include/i386-linux-gnu/bits/select.h \ - /usr/include/i386-linux-gnu/bits/sigset.h \ - /usr/include/i386-linux-gnu/bits/time.h \ - /usr/include/i386-linux-gnu/sys/sysmacros.h \ - /usr/include/i386-linux-gnu/bits/pthreadtypes.h \ - /usr/include/i386-linux-gnu/sys/stat.h \ - /usr/include/i386-linux-gnu/bits/stat.h /usr/include/stdlib.h \ - /usr/include/i386-linux-gnu/bits/waitflags.h \ - /usr/include/i386-linux-gnu/bits/waitstatus.h /usr/include/alloca.h \ - /usr/include/string.h /usr/include/xlocale.h \ - /usr/include/i386-linux-gnu/bits/string.h \ - /usr/include/i386-linux-gnu/bits/string2.h /usr/include/strings.h \ - /usr/include/inttypes.h /usr/include/unistd.h \ - /usr/include/i386-linux-gnu/bits/posix_opt.h \ - /usr/include/i386-linux-gnu/bits/environments.h \ - /usr/include/i386-linux-gnu/bits/confname.h /usr/include/getopt.h \ - /usr/include/netinet/in.h /usr/include/i386-linux-gnu/sys/socket.h \ - /usr/include/i386-linux-gnu/sys/uio.h \ - /usr/include/i386-linux-gnu/bits/uio.h \ - /usr/include/i386-linux-gnu/bits/socket.h \ - /usr/include/i386-linux-gnu/bits/sockaddr.h \ - /usr/include/i386-linux-gnu/asm/socket.h \ - /usr/include/asm-generic/socket.h \ - /usr/include/i386-linux-gnu/asm/sockios.h \ - /usr/include/asm-generic/sockios.h /usr/include/i386-linux-gnu/bits/in.h \ - /usr/include/netinet/tcp.h /usr/include/arpa/nameser.h \ - /usr/include/i386-linux-gnu/sys/param.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/limits.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/syslimits.h \ - /usr/include/limits.h /usr/include/i386-linux-gnu/bits/posix1_lim.h \ - /usr/include/i386-linux-gnu/bits/local_lim.h /usr/include/linux/limits.h \ - /usr/include/i386-linux-gnu/bits/posix2_lim.h /usr/include/linux/param.h \ - /usr/include/i386-linux-gnu/asm/param.h /usr/include/asm-generic/param.h \ - /usr/include/i386-linux-gnu/sys/bitypes.h \ - /usr/include/arpa/nameser_compat.h /usr/include/netdb.h \ - /usr/include/rpc/netdb.h /usr/include/i386-linux-gnu/bits/netdb.h \ - /usr/include/malloc.h /usr/include/ctype.h include/antlr3interfaces.h \ - include/antlr3convertutf.h include/antlr3exception.h \ - include/antlr3encodings.h include/antlr3string.h \ - include/antlr3collections.h include/antlr3bitset.h include/antlr3input.h \ - include/antlr3commontoken.h include/antlr3intstream.h \ - include/antlr3cyclicdfa.h include/antlr3baserecognizer.h \ - include/antlr3tokenstream.h include/antlr3debugeventlistener.h \ - include/antlr3basetree.h include/antlr3commontreenodestream.h \ - include/antlr3commontreeadaptor.h include/antlr3basetreeadaptor.h \ - include/antlr3commontree.h include/antlr3recognizersharedstate.h \ - include/antlr3lexer.h include/antlr3parser.h include/antlr3treeparser.h \ - include/antlr3filestream.h include/antlr3rewritestreams.h - -include/antlr3.h: - -include/antlr3defs.h: - -include/antlr3errors.h: - -antlr3config.h: - -/usr/include/stdio.h: - -/usr/include/features.h: - -/usr/include/i386-linux-gnu/bits/predefs.h: - -/usr/include/i386-linux-gnu/sys/cdefs.h: - -/usr/include/i386-linux-gnu/bits/wordsize.h: - -/usr/include/i386-linux-gnu/gnu/stubs.h: - -/usr/include/i386-linux-gnu/gnu/stubs-32.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include/stddef.h: - -/usr/include/i386-linux-gnu/bits/types.h: - -/usr/include/i386-linux-gnu/bits/typesizes.h: - -/usr/include/libio.h: - -/usr/include/_G_config.h: - -/usr/include/wchar.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include/stdarg.h: - -/usr/include/i386-linux-gnu/bits/stdio_lim.h: - -/usr/include/i386-linux-gnu/bits/sys_errlist.h: - -/usr/include/i386-linux-gnu/bits/stdio.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include/stdint.h: - -/usr/include/stdint.h: - -/usr/include/i386-linux-gnu/bits/wchar.h: - -/usr/include/i386-linux-gnu/sys/types.h: - -/usr/include/time.h: - -/usr/include/endian.h: - -/usr/include/i386-linux-gnu/bits/endian.h: - -/usr/include/i386-linux-gnu/bits/byteswap.h: - -/usr/include/i386-linux-gnu/sys/select.h: - -/usr/include/i386-linux-gnu/bits/select.h: - -/usr/include/i386-linux-gnu/bits/sigset.h: - -/usr/include/i386-linux-gnu/bits/time.h: - -/usr/include/i386-linux-gnu/sys/sysmacros.h: - -/usr/include/i386-linux-gnu/bits/pthreadtypes.h: - -/usr/include/i386-linux-gnu/sys/stat.h: - -/usr/include/i386-linux-gnu/bits/stat.h: - -/usr/include/stdlib.h: - -/usr/include/i386-linux-gnu/bits/waitflags.h: - -/usr/include/i386-linux-gnu/bits/waitstatus.h: - -/usr/include/alloca.h: - -/usr/include/string.h: - -/usr/include/xlocale.h: - -/usr/include/i386-linux-gnu/bits/string.h: - -/usr/include/i386-linux-gnu/bits/string2.h: - -/usr/include/strings.h: - -/usr/include/inttypes.h: - -/usr/include/unistd.h: - -/usr/include/i386-linux-gnu/bits/posix_opt.h: - -/usr/include/i386-linux-gnu/bits/environments.h: - -/usr/include/i386-linux-gnu/bits/confname.h: - -/usr/include/getopt.h: - -/usr/include/netinet/in.h: - -/usr/include/i386-linux-gnu/sys/socket.h: - -/usr/include/i386-linux-gnu/sys/uio.h: - -/usr/include/i386-linux-gnu/bits/uio.h: - -/usr/include/i386-linux-gnu/bits/socket.h: - -/usr/include/i386-linux-gnu/bits/sockaddr.h: - -/usr/include/i386-linux-gnu/asm/socket.h: - -/usr/include/asm-generic/socket.h: - -/usr/include/i386-linux-gnu/asm/sockios.h: - -/usr/include/asm-generic/sockios.h: - -/usr/include/i386-linux-gnu/bits/in.h: - -/usr/include/netinet/tcp.h: - -/usr/include/arpa/nameser.h: - -/usr/include/i386-linux-gnu/sys/param.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/limits.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/syslimits.h: - -/usr/include/limits.h: - -/usr/include/i386-linux-gnu/bits/posix1_lim.h: - -/usr/include/i386-linux-gnu/bits/local_lim.h: - -/usr/include/linux/limits.h: - -/usr/include/i386-linux-gnu/bits/posix2_lim.h: - -/usr/include/linux/param.h: - -/usr/include/i386-linux-gnu/asm/param.h: - -/usr/include/asm-generic/param.h: - -/usr/include/i386-linux-gnu/sys/bitypes.h: - -/usr/include/arpa/nameser_compat.h: - -/usr/include/netdb.h: - -/usr/include/rpc/netdb.h: - -/usr/include/i386-linux-gnu/bits/netdb.h: - -/usr/include/malloc.h: - -/usr/include/ctype.h: - -include/antlr3interfaces.h: - -include/antlr3convertutf.h: - -include/antlr3exception.h: - -include/antlr3encodings.h: - -include/antlr3string.h: - -include/antlr3collections.h: - -include/antlr3bitset.h: - -include/antlr3input.h: - -include/antlr3commontoken.h: - -include/antlr3intstream.h: - -include/antlr3cyclicdfa.h: - -include/antlr3baserecognizer.h: - -include/antlr3tokenstream.h: - -include/antlr3debugeventlistener.h: - -include/antlr3basetree.h: - -include/antlr3commontreenodestream.h: - -include/antlr3commontreeadaptor.h: - -include/antlr3basetreeadaptor.h: - -include/antlr3commontree.h: - -include/antlr3recognizersharedstate.h: - -include/antlr3lexer.h: - -include/antlr3parser.h: - -include/antlr3treeparser.h: - -include/antlr3filestream.h: - -include/antlr3rewritestreams.h: diff --git a/impl/antlr/libantlr3c-3.4/.deps/antlr3encodings.Plo b/impl/antlr/libantlr3c-3.4/.deps/antlr3encodings.Plo deleted file mode 100644 index 7261a24..0000000 --- a/impl/antlr/libantlr3c-3.4/.deps/antlr3encodings.Plo +++ /dev/null @@ -1,286 +0,0 @@ -antlr3encodings.lo: src/antlr3encodings.c include/antlr3.h \ - include/antlr3defs.h include/antlr3errors.h antlr3config.h \ - /usr/include/stdio.h /usr/include/features.h \ - /usr/include/i386-linux-gnu/bits/predefs.h \ - /usr/include/i386-linux-gnu/sys/cdefs.h \ - /usr/include/i386-linux-gnu/bits/wordsize.h \ - /usr/include/i386-linux-gnu/gnu/stubs.h \ - /usr/include/i386-linux-gnu/gnu/stubs-32.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include/stddef.h \ - /usr/include/i386-linux-gnu/bits/types.h \ - /usr/include/i386-linux-gnu/bits/typesizes.h /usr/include/libio.h \ - /usr/include/_G_config.h /usr/include/wchar.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include/stdarg.h \ - /usr/include/i386-linux-gnu/bits/stdio_lim.h \ - /usr/include/i386-linux-gnu/bits/sys_errlist.h \ - /usr/include/i386-linux-gnu/bits/stdio.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include/stdint.h /usr/include/stdint.h \ - /usr/include/i386-linux-gnu/bits/wchar.h \ - /usr/include/i386-linux-gnu/sys/types.h /usr/include/time.h \ - /usr/include/endian.h /usr/include/i386-linux-gnu/bits/endian.h \ - /usr/include/i386-linux-gnu/bits/byteswap.h \ - /usr/include/i386-linux-gnu/sys/select.h \ - /usr/include/i386-linux-gnu/bits/select.h \ - /usr/include/i386-linux-gnu/bits/sigset.h \ - /usr/include/i386-linux-gnu/bits/time.h \ - /usr/include/i386-linux-gnu/sys/sysmacros.h \ - /usr/include/i386-linux-gnu/bits/pthreadtypes.h \ - /usr/include/i386-linux-gnu/sys/stat.h \ - /usr/include/i386-linux-gnu/bits/stat.h /usr/include/stdlib.h \ - /usr/include/i386-linux-gnu/bits/waitflags.h \ - /usr/include/i386-linux-gnu/bits/waitstatus.h /usr/include/alloca.h \ - /usr/include/string.h /usr/include/xlocale.h \ - /usr/include/i386-linux-gnu/bits/string.h \ - /usr/include/i386-linux-gnu/bits/string2.h /usr/include/strings.h \ - /usr/include/inttypes.h /usr/include/unistd.h \ - /usr/include/i386-linux-gnu/bits/posix_opt.h \ - /usr/include/i386-linux-gnu/bits/environments.h \ - /usr/include/i386-linux-gnu/bits/confname.h /usr/include/getopt.h \ - /usr/include/netinet/in.h /usr/include/i386-linux-gnu/sys/socket.h \ - /usr/include/i386-linux-gnu/sys/uio.h \ - /usr/include/i386-linux-gnu/bits/uio.h \ - /usr/include/i386-linux-gnu/bits/socket.h \ - /usr/include/i386-linux-gnu/bits/sockaddr.h \ - /usr/include/i386-linux-gnu/asm/socket.h \ - /usr/include/asm-generic/socket.h \ - /usr/include/i386-linux-gnu/asm/sockios.h \ - /usr/include/asm-generic/sockios.h /usr/include/i386-linux-gnu/bits/in.h \ - /usr/include/netinet/tcp.h /usr/include/arpa/nameser.h \ - /usr/include/i386-linux-gnu/sys/param.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/limits.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/syslimits.h \ - /usr/include/limits.h /usr/include/i386-linux-gnu/bits/posix1_lim.h \ - /usr/include/i386-linux-gnu/bits/local_lim.h /usr/include/linux/limits.h \ - /usr/include/i386-linux-gnu/bits/posix2_lim.h /usr/include/linux/param.h \ - /usr/include/i386-linux-gnu/asm/param.h /usr/include/asm-generic/param.h \ - /usr/include/i386-linux-gnu/sys/bitypes.h \ - /usr/include/arpa/nameser_compat.h /usr/include/netdb.h \ - /usr/include/rpc/netdb.h /usr/include/i386-linux-gnu/bits/netdb.h \ - /usr/include/malloc.h /usr/include/ctype.h include/antlr3interfaces.h \ - include/antlr3convertutf.h include/antlr3exception.h \ - include/antlr3encodings.h include/antlr3string.h \ - include/antlr3collections.h include/antlr3bitset.h include/antlr3input.h \ - include/antlr3commontoken.h include/antlr3intstream.h \ - include/antlr3cyclicdfa.h include/antlr3baserecognizer.h \ - include/antlr3tokenstream.h include/antlr3debugeventlistener.h \ - include/antlr3basetree.h include/antlr3commontreenodestream.h \ - include/antlr3commontreeadaptor.h include/antlr3basetreeadaptor.h \ - include/antlr3commontree.h include/antlr3recognizersharedstate.h \ - include/antlr3lexer.h include/antlr3parser.h include/antlr3treeparser.h \ - include/antlr3filestream.h include/antlr3rewritestreams.h - -include/antlr3.h: - -include/antlr3defs.h: - -include/antlr3errors.h: - -antlr3config.h: - -/usr/include/stdio.h: - -/usr/include/features.h: - -/usr/include/i386-linux-gnu/bits/predefs.h: - -/usr/include/i386-linux-gnu/sys/cdefs.h: - -/usr/include/i386-linux-gnu/bits/wordsize.h: - -/usr/include/i386-linux-gnu/gnu/stubs.h: - -/usr/include/i386-linux-gnu/gnu/stubs-32.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include/stddef.h: - -/usr/include/i386-linux-gnu/bits/types.h: - -/usr/include/i386-linux-gnu/bits/typesizes.h: - -/usr/include/libio.h: - -/usr/include/_G_config.h: - -/usr/include/wchar.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include/stdarg.h: - -/usr/include/i386-linux-gnu/bits/stdio_lim.h: - -/usr/include/i386-linux-gnu/bits/sys_errlist.h: - -/usr/include/i386-linux-gnu/bits/stdio.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include/stdint.h: - -/usr/include/stdint.h: - -/usr/include/i386-linux-gnu/bits/wchar.h: - -/usr/include/i386-linux-gnu/sys/types.h: - -/usr/include/time.h: - -/usr/include/endian.h: - -/usr/include/i386-linux-gnu/bits/endian.h: - -/usr/include/i386-linux-gnu/bits/byteswap.h: - -/usr/include/i386-linux-gnu/sys/select.h: - -/usr/include/i386-linux-gnu/bits/select.h: - -/usr/include/i386-linux-gnu/bits/sigset.h: - -/usr/include/i386-linux-gnu/bits/time.h: - -/usr/include/i386-linux-gnu/sys/sysmacros.h: - -/usr/include/i386-linux-gnu/bits/pthreadtypes.h: - -/usr/include/i386-linux-gnu/sys/stat.h: - -/usr/include/i386-linux-gnu/bits/stat.h: - -/usr/include/stdlib.h: - -/usr/include/i386-linux-gnu/bits/waitflags.h: - -/usr/include/i386-linux-gnu/bits/waitstatus.h: - -/usr/include/alloca.h: - -/usr/include/string.h: - -/usr/include/xlocale.h: - -/usr/include/i386-linux-gnu/bits/string.h: - -/usr/include/i386-linux-gnu/bits/string2.h: - -/usr/include/strings.h: - -/usr/include/inttypes.h: - -/usr/include/unistd.h: - -/usr/include/i386-linux-gnu/bits/posix_opt.h: - -/usr/include/i386-linux-gnu/bits/environments.h: - -/usr/include/i386-linux-gnu/bits/confname.h: - -/usr/include/getopt.h: - -/usr/include/netinet/in.h: - -/usr/include/i386-linux-gnu/sys/socket.h: - -/usr/include/i386-linux-gnu/sys/uio.h: - -/usr/include/i386-linux-gnu/bits/uio.h: - -/usr/include/i386-linux-gnu/bits/socket.h: - -/usr/include/i386-linux-gnu/bits/sockaddr.h: - -/usr/include/i386-linux-gnu/asm/socket.h: - -/usr/include/asm-generic/socket.h: - -/usr/include/i386-linux-gnu/asm/sockios.h: - -/usr/include/asm-generic/sockios.h: - -/usr/include/i386-linux-gnu/bits/in.h: - -/usr/include/netinet/tcp.h: - -/usr/include/arpa/nameser.h: - -/usr/include/i386-linux-gnu/sys/param.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/limits.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/syslimits.h: - -/usr/include/limits.h: - -/usr/include/i386-linux-gnu/bits/posix1_lim.h: - -/usr/include/i386-linux-gnu/bits/local_lim.h: - -/usr/include/linux/limits.h: - -/usr/include/i386-linux-gnu/bits/posix2_lim.h: - -/usr/include/linux/param.h: - -/usr/include/i386-linux-gnu/asm/param.h: - -/usr/include/asm-generic/param.h: - -/usr/include/i386-linux-gnu/sys/bitypes.h: - -/usr/include/arpa/nameser_compat.h: - -/usr/include/netdb.h: - -/usr/include/rpc/netdb.h: - -/usr/include/i386-linux-gnu/bits/netdb.h: - -/usr/include/malloc.h: - -/usr/include/ctype.h: - -include/antlr3interfaces.h: - -include/antlr3convertutf.h: - -include/antlr3exception.h: - -include/antlr3encodings.h: - -include/antlr3string.h: - -include/antlr3collections.h: - -include/antlr3bitset.h: - -include/antlr3input.h: - -include/antlr3commontoken.h: - -include/antlr3intstream.h: - -include/antlr3cyclicdfa.h: - -include/antlr3baserecognizer.h: - -include/antlr3tokenstream.h: - -include/antlr3debugeventlistener.h: - -include/antlr3basetree.h: - -include/antlr3commontreenodestream.h: - -include/antlr3commontreeadaptor.h: - -include/antlr3basetreeadaptor.h: - -include/antlr3commontree.h: - -include/antlr3recognizersharedstate.h: - -include/antlr3lexer.h: - -include/antlr3parser.h: - -include/antlr3treeparser.h: - -include/antlr3filestream.h: - -include/antlr3rewritestreams.h: diff --git a/impl/antlr/libantlr3c-3.4/.deps/antlr3exception.Plo b/impl/antlr/libantlr3c-3.4/.deps/antlr3exception.Plo deleted file mode 100644 index 2b768a8..0000000 --- a/impl/antlr/libantlr3c-3.4/.deps/antlr3exception.Plo +++ /dev/null @@ -1,230 +0,0 @@ -antlr3exception.lo: src/antlr3exception.c include/antlr3exception.h \ - include/antlr3defs.h include/antlr3errors.h antlr3config.h \ - /usr/include/stdio.h /usr/include/features.h \ - /usr/include/i386-linux-gnu/bits/predefs.h \ - /usr/include/i386-linux-gnu/sys/cdefs.h \ - /usr/include/i386-linux-gnu/bits/wordsize.h \ - /usr/include/i386-linux-gnu/gnu/stubs.h \ - /usr/include/i386-linux-gnu/gnu/stubs-32.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include/stddef.h \ - /usr/include/i386-linux-gnu/bits/types.h \ - /usr/include/i386-linux-gnu/bits/typesizes.h /usr/include/libio.h \ - /usr/include/_G_config.h /usr/include/wchar.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include/stdarg.h \ - /usr/include/i386-linux-gnu/bits/stdio_lim.h \ - /usr/include/i386-linux-gnu/bits/sys_errlist.h \ - /usr/include/i386-linux-gnu/bits/stdio.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include/stdint.h /usr/include/stdint.h \ - /usr/include/i386-linux-gnu/bits/wchar.h \ - /usr/include/i386-linux-gnu/sys/types.h /usr/include/time.h \ - /usr/include/endian.h /usr/include/i386-linux-gnu/bits/endian.h \ - /usr/include/i386-linux-gnu/bits/byteswap.h \ - /usr/include/i386-linux-gnu/sys/select.h \ - /usr/include/i386-linux-gnu/bits/select.h \ - /usr/include/i386-linux-gnu/bits/sigset.h \ - /usr/include/i386-linux-gnu/bits/time.h \ - /usr/include/i386-linux-gnu/sys/sysmacros.h \ - /usr/include/i386-linux-gnu/bits/pthreadtypes.h \ - /usr/include/i386-linux-gnu/sys/stat.h \ - /usr/include/i386-linux-gnu/bits/stat.h /usr/include/stdlib.h \ - /usr/include/i386-linux-gnu/bits/waitflags.h \ - /usr/include/i386-linux-gnu/bits/waitstatus.h /usr/include/alloca.h \ - /usr/include/string.h /usr/include/xlocale.h \ - /usr/include/i386-linux-gnu/bits/string.h \ - /usr/include/i386-linux-gnu/bits/string2.h /usr/include/strings.h \ - /usr/include/inttypes.h /usr/include/unistd.h \ - /usr/include/i386-linux-gnu/bits/posix_opt.h \ - /usr/include/i386-linux-gnu/bits/environments.h \ - /usr/include/i386-linux-gnu/bits/confname.h /usr/include/getopt.h \ - /usr/include/netinet/in.h /usr/include/i386-linux-gnu/sys/socket.h \ - /usr/include/i386-linux-gnu/sys/uio.h \ - /usr/include/i386-linux-gnu/bits/uio.h \ - /usr/include/i386-linux-gnu/bits/socket.h \ - /usr/include/i386-linux-gnu/bits/sockaddr.h \ - /usr/include/i386-linux-gnu/asm/socket.h \ - /usr/include/asm-generic/socket.h \ - /usr/include/i386-linux-gnu/asm/sockios.h \ - /usr/include/asm-generic/sockios.h /usr/include/i386-linux-gnu/bits/in.h \ - /usr/include/netinet/tcp.h /usr/include/arpa/nameser.h \ - /usr/include/i386-linux-gnu/sys/param.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/limits.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/syslimits.h \ - /usr/include/limits.h /usr/include/i386-linux-gnu/bits/posix1_lim.h \ - /usr/include/i386-linux-gnu/bits/local_lim.h /usr/include/linux/limits.h \ - /usr/include/i386-linux-gnu/bits/posix2_lim.h /usr/include/linux/param.h \ - /usr/include/i386-linux-gnu/asm/param.h /usr/include/asm-generic/param.h \ - /usr/include/i386-linux-gnu/sys/bitypes.h \ - /usr/include/arpa/nameser_compat.h /usr/include/netdb.h \ - /usr/include/rpc/netdb.h /usr/include/i386-linux-gnu/bits/netdb.h \ - /usr/include/malloc.h /usr/include/ctype.h include/antlr3interfaces.h \ - include/antlr3convertutf.h - -include/antlr3exception.h: - -include/antlr3defs.h: - -include/antlr3errors.h: - -antlr3config.h: - -/usr/include/stdio.h: - -/usr/include/features.h: - -/usr/include/i386-linux-gnu/bits/predefs.h: - -/usr/include/i386-linux-gnu/sys/cdefs.h: - -/usr/include/i386-linux-gnu/bits/wordsize.h: - -/usr/include/i386-linux-gnu/gnu/stubs.h: - -/usr/include/i386-linux-gnu/gnu/stubs-32.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include/stddef.h: - -/usr/include/i386-linux-gnu/bits/types.h: - -/usr/include/i386-linux-gnu/bits/typesizes.h: - -/usr/include/libio.h: - -/usr/include/_G_config.h: - -/usr/include/wchar.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include/stdarg.h: - -/usr/include/i386-linux-gnu/bits/stdio_lim.h: - -/usr/include/i386-linux-gnu/bits/sys_errlist.h: - -/usr/include/i386-linux-gnu/bits/stdio.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include/stdint.h: - -/usr/include/stdint.h: - -/usr/include/i386-linux-gnu/bits/wchar.h: - -/usr/include/i386-linux-gnu/sys/types.h: - -/usr/include/time.h: - -/usr/include/endian.h: - -/usr/include/i386-linux-gnu/bits/endian.h: - -/usr/include/i386-linux-gnu/bits/byteswap.h: - -/usr/include/i386-linux-gnu/sys/select.h: - -/usr/include/i386-linux-gnu/bits/select.h: - -/usr/include/i386-linux-gnu/bits/sigset.h: - -/usr/include/i386-linux-gnu/bits/time.h: - -/usr/include/i386-linux-gnu/sys/sysmacros.h: - -/usr/include/i386-linux-gnu/bits/pthreadtypes.h: - -/usr/include/i386-linux-gnu/sys/stat.h: - -/usr/include/i386-linux-gnu/bits/stat.h: - -/usr/include/stdlib.h: - -/usr/include/i386-linux-gnu/bits/waitflags.h: - -/usr/include/i386-linux-gnu/bits/waitstatus.h: - -/usr/include/alloca.h: - -/usr/include/string.h: - -/usr/include/xlocale.h: - -/usr/include/i386-linux-gnu/bits/string.h: - -/usr/include/i386-linux-gnu/bits/string2.h: - -/usr/include/strings.h: - -/usr/include/inttypes.h: - -/usr/include/unistd.h: - -/usr/include/i386-linux-gnu/bits/posix_opt.h: - -/usr/include/i386-linux-gnu/bits/environments.h: - -/usr/include/i386-linux-gnu/bits/confname.h: - -/usr/include/getopt.h: - -/usr/include/netinet/in.h: - -/usr/include/i386-linux-gnu/sys/socket.h: - -/usr/include/i386-linux-gnu/sys/uio.h: - -/usr/include/i386-linux-gnu/bits/uio.h: - -/usr/include/i386-linux-gnu/bits/socket.h: - -/usr/include/i386-linux-gnu/bits/sockaddr.h: - -/usr/include/i386-linux-gnu/asm/socket.h: - -/usr/include/asm-generic/socket.h: - -/usr/include/i386-linux-gnu/asm/sockios.h: - -/usr/include/asm-generic/sockios.h: - -/usr/include/i386-linux-gnu/bits/in.h: - -/usr/include/netinet/tcp.h: - -/usr/include/arpa/nameser.h: - -/usr/include/i386-linux-gnu/sys/param.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/limits.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/syslimits.h: - -/usr/include/limits.h: - -/usr/include/i386-linux-gnu/bits/posix1_lim.h: - -/usr/include/i386-linux-gnu/bits/local_lim.h: - -/usr/include/linux/limits.h: - -/usr/include/i386-linux-gnu/bits/posix2_lim.h: - -/usr/include/linux/param.h: - -/usr/include/i386-linux-gnu/asm/param.h: - -/usr/include/asm-generic/param.h: - -/usr/include/i386-linux-gnu/sys/bitypes.h: - -/usr/include/arpa/nameser_compat.h: - -/usr/include/netdb.h: - -/usr/include/rpc/netdb.h: - -/usr/include/i386-linux-gnu/bits/netdb.h: - -/usr/include/malloc.h: - -/usr/include/ctype.h: - -include/antlr3interfaces.h: - -include/antlr3convertutf.h: diff --git a/impl/antlr/libantlr3c-3.4/.deps/antlr3filestream.Plo b/impl/antlr/libantlr3c-3.4/.deps/antlr3filestream.Plo deleted file mode 100644 index 61a223c..0000000 --- a/impl/antlr/libantlr3c-3.4/.deps/antlr3filestream.Plo +++ /dev/null @@ -1,286 +0,0 @@ -antlr3filestream.lo: src/antlr3filestream.c include/antlr3.h \ - include/antlr3defs.h include/antlr3errors.h antlr3config.h \ - /usr/include/stdio.h /usr/include/features.h \ - /usr/include/i386-linux-gnu/bits/predefs.h \ - /usr/include/i386-linux-gnu/sys/cdefs.h \ - /usr/include/i386-linux-gnu/bits/wordsize.h \ - /usr/include/i386-linux-gnu/gnu/stubs.h \ - /usr/include/i386-linux-gnu/gnu/stubs-32.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include/stddef.h \ - /usr/include/i386-linux-gnu/bits/types.h \ - /usr/include/i386-linux-gnu/bits/typesizes.h /usr/include/libio.h \ - /usr/include/_G_config.h /usr/include/wchar.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include/stdarg.h \ - /usr/include/i386-linux-gnu/bits/stdio_lim.h \ - /usr/include/i386-linux-gnu/bits/sys_errlist.h \ - /usr/include/i386-linux-gnu/bits/stdio.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include/stdint.h /usr/include/stdint.h \ - /usr/include/i386-linux-gnu/bits/wchar.h \ - /usr/include/i386-linux-gnu/sys/types.h /usr/include/time.h \ - /usr/include/endian.h /usr/include/i386-linux-gnu/bits/endian.h \ - /usr/include/i386-linux-gnu/bits/byteswap.h \ - /usr/include/i386-linux-gnu/sys/select.h \ - /usr/include/i386-linux-gnu/bits/select.h \ - /usr/include/i386-linux-gnu/bits/sigset.h \ - /usr/include/i386-linux-gnu/bits/time.h \ - /usr/include/i386-linux-gnu/sys/sysmacros.h \ - /usr/include/i386-linux-gnu/bits/pthreadtypes.h \ - /usr/include/i386-linux-gnu/sys/stat.h \ - /usr/include/i386-linux-gnu/bits/stat.h /usr/include/stdlib.h \ - /usr/include/i386-linux-gnu/bits/waitflags.h \ - /usr/include/i386-linux-gnu/bits/waitstatus.h /usr/include/alloca.h \ - /usr/include/string.h /usr/include/xlocale.h \ - /usr/include/i386-linux-gnu/bits/string.h \ - /usr/include/i386-linux-gnu/bits/string2.h /usr/include/strings.h \ - /usr/include/inttypes.h /usr/include/unistd.h \ - /usr/include/i386-linux-gnu/bits/posix_opt.h \ - /usr/include/i386-linux-gnu/bits/environments.h \ - /usr/include/i386-linux-gnu/bits/confname.h /usr/include/getopt.h \ - /usr/include/netinet/in.h /usr/include/i386-linux-gnu/sys/socket.h \ - /usr/include/i386-linux-gnu/sys/uio.h \ - /usr/include/i386-linux-gnu/bits/uio.h \ - /usr/include/i386-linux-gnu/bits/socket.h \ - /usr/include/i386-linux-gnu/bits/sockaddr.h \ - /usr/include/i386-linux-gnu/asm/socket.h \ - /usr/include/asm-generic/socket.h \ - /usr/include/i386-linux-gnu/asm/sockios.h \ - /usr/include/asm-generic/sockios.h /usr/include/i386-linux-gnu/bits/in.h \ - /usr/include/netinet/tcp.h /usr/include/arpa/nameser.h \ - /usr/include/i386-linux-gnu/sys/param.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/limits.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/syslimits.h \ - /usr/include/limits.h /usr/include/i386-linux-gnu/bits/posix1_lim.h \ - /usr/include/i386-linux-gnu/bits/local_lim.h /usr/include/linux/limits.h \ - /usr/include/i386-linux-gnu/bits/posix2_lim.h /usr/include/linux/param.h \ - /usr/include/i386-linux-gnu/asm/param.h /usr/include/asm-generic/param.h \ - /usr/include/i386-linux-gnu/sys/bitypes.h \ - /usr/include/arpa/nameser_compat.h /usr/include/netdb.h \ - /usr/include/rpc/netdb.h /usr/include/i386-linux-gnu/bits/netdb.h \ - /usr/include/malloc.h /usr/include/ctype.h include/antlr3interfaces.h \ - include/antlr3convertutf.h include/antlr3exception.h \ - include/antlr3encodings.h include/antlr3string.h \ - include/antlr3collections.h include/antlr3bitset.h include/antlr3input.h \ - include/antlr3commontoken.h include/antlr3intstream.h \ - include/antlr3cyclicdfa.h include/antlr3baserecognizer.h \ - include/antlr3tokenstream.h include/antlr3debugeventlistener.h \ - include/antlr3basetree.h include/antlr3commontreenodestream.h \ - include/antlr3commontreeadaptor.h include/antlr3basetreeadaptor.h \ - include/antlr3commontree.h include/antlr3recognizersharedstate.h \ - include/antlr3lexer.h include/antlr3parser.h include/antlr3treeparser.h \ - include/antlr3filestream.h include/antlr3rewritestreams.h - -include/antlr3.h: - -include/antlr3defs.h: - -include/antlr3errors.h: - -antlr3config.h: - -/usr/include/stdio.h: - -/usr/include/features.h: - -/usr/include/i386-linux-gnu/bits/predefs.h: - -/usr/include/i386-linux-gnu/sys/cdefs.h: - -/usr/include/i386-linux-gnu/bits/wordsize.h: - -/usr/include/i386-linux-gnu/gnu/stubs.h: - -/usr/include/i386-linux-gnu/gnu/stubs-32.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include/stddef.h: - -/usr/include/i386-linux-gnu/bits/types.h: - -/usr/include/i386-linux-gnu/bits/typesizes.h: - -/usr/include/libio.h: - -/usr/include/_G_config.h: - -/usr/include/wchar.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include/stdarg.h: - -/usr/include/i386-linux-gnu/bits/stdio_lim.h: - -/usr/include/i386-linux-gnu/bits/sys_errlist.h: - -/usr/include/i386-linux-gnu/bits/stdio.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include/stdint.h: - -/usr/include/stdint.h: - -/usr/include/i386-linux-gnu/bits/wchar.h: - -/usr/include/i386-linux-gnu/sys/types.h: - -/usr/include/time.h: - -/usr/include/endian.h: - -/usr/include/i386-linux-gnu/bits/endian.h: - -/usr/include/i386-linux-gnu/bits/byteswap.h: - -/usr/include/i386-linux-gnu/sys/select.h: - -/usr/include/i386-linux-gnu/bits/select.h: - -/usr/include/i386-linux-gnu/bits/sigset.h: - -/usr/include/i386-linux-gnu/bits/time.h: - -/usr/include/i386-linux-gnu/sys/sysmacros.h: - -/usr/include/i386-linux-gnu/bits/pthreadtypes.h: - -/usr/include/i386-linux-gnu/sys/stat.h: - -/usr/include/i386-linux-gnu/bits/stat.h: - -/usr/include/stdlib.h: - -/usr/include/i386-linux-gnu/bits/waitflags.h: - -/usr/include/i386-linux-gnu/bits/waitstatus.h: - -/usr/include/alloca.h: - -/usr/include/string.h: - -/usr/include/xlocale.h: - -/usr/include/i386-linux-gnu/bits/string.h: - -/usr/include/i386-linux-gnu/bits/string2.h: - -/usr/include/strings.h: - -/usr/include/inttypes.h: - -/usr/include/unistd.h: - -/usr/include/i386-linux-gnu/bits/posix_opt.h: - -/usr/include/i386-linux-gnu/bits/environments.h: - -/usr/include/i386-linux-gnu/bits/confname.h: - -/usr/include/getopt.h: - -/usr/include/netinet/in.h: - -/usr/include/i386-linux-gnu/sys/socket.h: - -/usr/include/i386-linux-gnu/sys/uio.h: - -/usr/include/i386-linux-gnu/bits/uio.h: - -/usr/include/i386-linux-gnu/bits/socket.h: - -/usr/include/i386-linux-gnu/bits/sockaddr.h: - -/usr/include/i386-linux-gnu/asm/socket.h: - -/usr/include/asm-generic/socket.h: - -/usr/include/i386-linux-gnu/asm/sockios.h: - -/usr/include/asm-generic/sockios.h: - -/usr/include/i386-linux-gnu/bits/in.h: - -/usr/include/netinet/tcp.h: - -/usr/include/arpa/nameser.h: - -/usr/include/i386-linux-gnu/sys/param.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/limits.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/syslimits.h: - -/usr/include/limits.h: - -/usr/include/i386-linux-gnu/bits/posix1_lim.h: - -/usr/include/i386-linux-gnu/bits/local_lim.h: - -/usr/include/linux/limits.h: - -/usr/include/i386-linux-gnu/bits/posix2_lim.h: - -/usr/include/linux/param.h: - -/usr/include/i386-linux-gnu/asm/param.h: - -/usr/include/asm-generic/param.h: - -/usr/include/i386-linux-gnu/sys/bitypes.h: - -/usr/include/arpa/nameser_compat.h: - -/usr/include/netdb.h: - -/usr/include/rpc/netdb.h: - -/usr/include/i386-linux-gnu/bits/netdb.h: - -/usr/include/malloc.h: - -/usr/include/ctype.h: - -include/antlr3interfaces.h: - -include/antlr3convertutf.h: - -include/antlr3exception.h: - -include/antlr3encodings.h: - -include/antlr3string.h: - -include/antlr3collections.h: - -include/antlr3bitset.h: - -include/antlr3input.h: - -include/antlr3commontoken.h: - -include/antlr3intstream.h: - -include/antlr3cyclicdfa.h: - -include/antlr3baserecognizer.h: - -include/antlr3tokenstream.h: - -include/antlr3debugeventlistener.h: - -include/antlr3basetree.h: - -include/antlr3commontreenodestream.h: - -include/antlr3commontreeadaptor.h: - -include/antlr3basetreeadaptor.h: - -include/antlr3commontree.h: - -include/antlr3recognizersharedstate.h: - -include/antlr3lexer.h: - -include/antlr3parser.h: - -include/antlr3treeparser.h: - -include/antlr3filestream.h: - -include/antlr3rewritestreams.h: diff --git a/impl/antlr/libantlr3c-3.4/.deps/antlr3inputstream.Plo b/impl/antlr/libantlr3c-3.4/.deps/antlr3inputstream.Plo deleted file mode 100644 index cbe47f8..0000000 --- a/impl/antlr/libantlr3c-3.4/.deps/antlr3inputstream.Plo +++ /dev/null @@ -1,242 +0,0 @@ -antlr3inputstream.lo: src/antlr3inputstream.c include/antlr3input.h \ - include/antlr3defs.h include/antlr3errors.h antlr3config.h \ - /usr/include/stdio.h /usr/include/features.h \ - /usr/include/i386-linux-gnu/bits/predefs.h \ - /usr/include/i386-linux-gnu/sys/cdefs.h \ - /usr/include/i386-linux-gnu/bits/wordsize.h \ - /usr/include/i386-linux-gnu/gnu/stubs.h \ - /usr/include/i386-linux-gnu/gnu/stubs-32.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include/stddef.h \ - /usr/include/i386-linux-gnu/bits/types.h \ - /usr/include/i386-linux-gnu/bits/typesizes.h /usr/include/libio.h \ - /usr/include/_G_config.h /usr/include/wchar.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include/stdarg.h \ - /usr/include/i386-linux-gnu/bits/stdio_lim.h \ - /usr/include/i386-linux-gnu/bits/sys_errlist.h \ - /usr/include/i386-linux-gnu/bits/stdio.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include/stdint.h /usr/include/stdint.h \ - /usr/include/i386-linux-gnu/bits/wchar.h \ - /usr/include/i386-linux-gnu/sys/types.h /usr/include/time.h \ - /usr/include/endian.h /usr/include/i386-linux-gnu/bits/endian.h \ - /usr/include/i386-linux-gnu/bits/byteswap.h \ - /usr/include/i386-linux-gnu/sys/select.h \ - /usr/include/i386-linux-gnu/bits/select.h \ - /usr/include/i386-linux-gnu/bits/sigset.h \ - /usr/include/i386-linux-gnu/bits/time.h \ - /usr/include/i386-linux-gnu/sys/sysmacros.h \ - /usr/include/i386-linux-gnu/bits/pthreadtypes.h \ - /usr/include/i386-linux-gnu/sys/stat.h \ - /usr/include/i386-linux-gnu/bits/stat.h /usr/include/stdlib.h \ - /usr/include/i386-linux-gnu/bits/waitflags.h \ - /usr/include/i386-linux-gnu/bits/waitstatus.h /usr/include/alloca.h \ - /usr/include/string.h /usr/include/xlocale.h \ - /usr/include/i386-linux-gnu/bits/string.h \ - /usr/include/i386-linux-gnu/bits/string2.h /usr/include/strings.h \ - /usr/include/inttypes.h /usr/include/unistd.h \ - /usr/include/i386-linux-gnu/bits/posix_opt.h \ - /usr/include/i386-linux-gnu/bits/environments.h \ - /usr/include/i386-linux-gnu/bits/confname.h /usr/include/getopt.h \ - /usr/include/netinet/in.h /usr/include/i386-linux-gnu/sys/socket.h \ - /usr/include/i386-linux-gnu/sys/uio.h \ - /usr/include/i386-linux-gnu/bits/uio.h \ - /usr/include/i386-linux-gnu/bits/socket.h \ - /usr/include/i386-linux-gnu/bits/sockaddr.h \ - /usr/include/i386-linux-gnu/asm/socket.h \ - /usr/include/asm-generic/socket.h \ - /usr/include/i386-linux-gnu/asm/sockios.h \ - /usr/include/asm-generic/sockios.h /usr/include/i386-linux-gnu/bits/in.h \ - /usr/include/netinet/tcp.h /usr/include/arpa/nameser.h \ - /usr/include/i386-linux-gnu/sys/param.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/limits.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/syslimits.h \ - /usr/include/limits.h /usr/include/i386-linux-gnu/bits/posix1_lim.h \ - /usr/include/i386-linux-gnu/bits/local_lim.h /usr/include/linux/limits.h \ - /usr/include/i386-linux-gnu/bits/posix2_lim.h /usr/include/linux/param.h \ - /usr/include/i386-linux-gnu/asm/param.h /usr/include/asm-generic/param.h \ - /usr/include/i386-linux-gnu/sys/bitypes.h \ - /usr/include/arpa/nameser_compat.h /usr/include/netdb.h \ - /usr/include/rpc/netdb.h /usr/include/i386-linux-gnu/bits/netdb.h \ - /usr/include/malloc.h /usr/include/ctype.h include/antlr3interfaces.h \ - include/antlr3convertutf.h include/antlr3string.h \ - include/antlr3collections.h include/antlr3bitset.h \ - include/antlr3commontoken.h include/antlr3intstream.h - -include/antlr3input.h: - -include/antlr3defs.h: - -include/antlr3errors.h: - -antlr3config.h: - -/usr/include/stdio.h: - -/usr/include/features.h: - -/usr/include/i386-linux-gnu/bits/predefs.h: - -/usr/include/i386-linux-gnu/sys/cdefs.h: - -/usr/include/i386-linux-gnu/bits/wordsize.h: - -/usr/include/i386-linux-gnu/gnu/stubs.h: - -/usr/include/i386-linux-gnu/gnu/stubs-32.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include/stddef.h: - -/usr/include/i386-linux-gnu/bits/types.h: - -/usr/include/i386-linux-gnu/bits/typesizes.h: - -/usr/include/libio.h: - -/usr/include/_G_config.h: - -/usr/include/wchar.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include/stdarg.h: - -/usr/include/i386-linux-gnu/bits/stdio_lim.h: - -/usr/include/i386-linux-gnu/bits/sys_errlist.h: - -/usr/include/i386-linux-gnu/bits/stdio.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include/stdint.h: - -/usr/include/stdint.h: - -/usr/include/i386-linux-gnu/bits/wchar.h: - -/usr/include/i386-linux-gnu/sys/types.h: - -/usr/include/time.h: - -/usr/include/endian.h: - -/usr/include/i386-linux-gnu/bits/endian.h: - -/usr/include/i386-linux-gnu/bits/byteswap.h: - -/usr/include/i386-linux-gnu/sys/select.h: - -/usr/include/i386-linux-gnu/bits/select.h: - -/usr/include/i386-linux-gnu/bits/sigset.h: - -/usr/include/i386-linux-gnu/bits/time.h: - -/usr/include/i386-linux-gnu/sys/sysmacros.h: - -/usr/include/i386-linux-gnu/bits/pthreadtypes.h: - -/usr/include/i386-linux-gnu/sys/stat.h: - -/usr/include/i386-linux-gnu/bits/stat.h: - -/usr/include/stdlib.h: - -/usr/include/i386-linux-gnu/bits/waitflags.h: - -/usr/include/i386-linux-gnu/bits/waitstatus.h: - -/usr/include/alloca.h: - -/usr/include/string.h: - -/usr/include/xlocale.h: - -/usr/include/i386-linux-gnu/bits/string.h: - -/usr/include/i386-linux-gnu/bits/string2.h: - -/usr/include/strings.h: - -/usr/include/inttypes.h: - -/usr/include/unistd.h: - -/usr/include/i386-linux-gnu/bits/posix_opt.h: - -/usr/include/i386-linux-gnu/bits/environments.h: - -/usr/include/i386-linux-gnu/bits/confname.h: - -/usr/include/getopt.h: - -/usr/include/netinet/in.h: - -/usr/include/i386-linux-gnu/sys/socket.h: - -/usr/include/i386-linux-gnu/sys/uio.h: - -/usr/include/i386-linux-gnu/bits/uio.h: - -/usr/include/i386-linux-gnu/bits/socket.h: - -/usr/include/i386-linux-gnu/bits/sockaddr.h: - -/usr/include/i386-linux-gnu/asm/socket.h: - -/usr/include/asm-generic/socket.h: - -/usr/include/i386-linux-gnu/asm/sockios.h: - -/usr/include/asm-generic/sockios.h: - -/usr/include/i386-linux-gnu/bits/in.h: - -/usr/include/netinet/tcp.h: - -/usr/include/arpa/nameser.h: - -/usr/include/i386-linux-gnu/sys/param.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/limits.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/syslimits.h: - -/usr/include/limits.h: - -/usr/include/i386-linux-gnu/bits/posix1_lim.h: - -/usr/include/i386-linux-gnu/bits/local_lim.h: - -/usr/include/linux/limits.h: - -/usr/include/i386-linux-gnu/bits/posix2_lim.h: - -/usr/include/linux/param.h: - -/usr/include/i386-linux-gnu/asm/param.h: - -/usr/include/asm-generic/param.h: - -/usr/include/i386-linux-gnu/sys/bitypes.h: - -/usr/include/arpa/nameser_compat.h: - -/usr/include/netdb.h: - -/usr/include/rpc/netdb.h: - -/usr/include/i386-linux-gnu/bits/netdb.h: - -/usr/include/malloc.h: - -/usr/include/ctype.h: - -include/antlr3interfaces.h: - -include/antlr3convertutf.h: - -include/antlr3string.h: - -include/antlr3collections.h: - -include/antlr3bitset.h: - -include/antlr3commontoken.h: - -include/antlr3intstream.h: diff --git a/impl/antlr/libantlr3c-3.4/.deps/antlr3intstream.Plo b/impl/antlr/libantlr3c-3.4/.deps/antlr3intstream.Plo deleted file mode 100644 index 3d39d20..0000000 --- a/impl/antlr/libantlr3c-3.4/.deps/antlr3intstream.Plo +++ /dev/null @@ -1,232 +0,0 @@ -antlr3intstream.lo: src/antlr3intstream.c include/antlr3intstream.h \ - include/antlr3defs.h include/antlr3errors.h antlr3config.h \ - /usr/include/stdio.h /usr/include/features.h \ - /usr/include/i386-linux-gnu/bits/predefs.h \ - /usr/include/i386-linux-gnu/sys/cdefs.h \ - /usr/include/i386-linux-gnu/bits/wordsize.h \ - /usr/include/i386-linux-gnu/gnu/stubs.h \ - /usr/include/i386-linux-gnu/gnu/stubs-32.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include/stddef.h \ - /usr/include/i386-linux-gnu/bits/types.h \ - /usr/include/i386-linux-gnu/bits/typesizes.h /usr/include/libio.h \ - /usr/include/_G_config.h /usr/include/wchar.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include/stdarg.h \ - /usr/include/i386-linux-gnu/bits/stdio_lim.h \ - /usr/include/i386-linux-gnu/bits/sys_errlist.h \ - /usr/include/i386-linux-gnu/bits/stdio.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include/stdint.h /usr/include/stdint.h \ - /usr/include/i386-linux-gnu/bits/wchar.h \ - /usr/include/i386-linux-gnu/sys/types.h /usr/include/time.h \ - /usr/include/endian.h /usr/include/i386-linux-gnu/bits/endian.h \ - /usr/include/i386-linux-gnu/bits/byteswap.h \ - /usr/include/i386-linux-gnu/sys/select.h \ - /usr/include/i386-linux-gnu/bits/select.h \ - /usr/include/i386-linux-gnu/bits/sigset.h \ - /usr/include/i386-linux-gnu/bits/time.h \ - /usr/include/i386-linux-gnu/sys/sysmacros.h \ - /usr/include/i386-linux-gnu/bits/pthreadtypes.h \ - /usr/include/i386-linux-gnu/sys/stat.h \ - /usr/include/i386-linux-gnu/bits/stat.h /usr/include/stdlib.h \ - /usr/include/i386-linux-gnu/bits/waitflags.h \ - /usr/include/i386-linux-gnu/bits/waitstatus.h /usr/include/alloca.h \ - /usr/include/string.h /usr/include/xlocale.h \ - /usr/include/i386-linux-gnu/bits/string.h \ - /usr/include/i386-linux-gnu/bits/string2.h /usr/include/strings.h \ - /usr/include/inttypes.h /usr/include/unistd.h \ - /usr/include/i386-linux-gnu/bits/posix_opt.h \ - /usr/include/i386-linux-gnu/bits/environments.h \ - /usr/include/i386-linux-gnu/bits/confname.h /usr/include/getopt.h \ - /usr/include/netinet/in.h /usr/include/i386-linux-gnu/sys/socket.h \ - /usr/include/i386-linux-gnu/sys/uio.h \ - /usr/include/i386-linux-gnu/bits/uio.h \ - /usr/include/i386-linux-gnu/bits/socket.h \ - /usr/include/i386-linux-gnu/bits/sockaddr.h \ - /usr/include/i386-linux-gnu/asm/socket.h \ - /usr/include/asm-generic/socket.h \ - /usr/include/i386-linux-gnu/asm/sockios.h \ - /usr/include/asm-generic/sockios.h /usr/include/i386-linux-gnu/bits/in.h \ - /usr/include/netinet/tcp.h /usr/include/arpa/nameser.h \ - /usr/include/i386-linux-gnu/sys/param.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/limits.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/syslimits.h \ - /usr/include/limits.h /usr/include/i386-linux-gnu/bits/posix1_lim.h \ - /usr/include/i386-linux-gnu/bits/local_lim.h /usr/include/linux/limits.h \ - /usr/include/i386-linux-gnu/bits/posix2_lim.h /usr/include/linux/param.h \ - /usr/include/i386-linux-gnu/asm/param.h /usr/include/asm-generic/param.h \ - /usr/include/i386-linux-gnu/sys/bitypes.h \ - /usr/include/arpa/nameser_compat.h /usr/include/netdb.h \ - /usr/include/rpc/netdb.h /usr/include/i386-linux-gnu/bits/netdb.h \ - /usr/include/malloc.h /usr/include/ctype.h include/antlr3interfaces.h \ - include/antlr3convertutf.h include/antlr3commontoken.h - -include/antlr3intstream.h: - -include/antlr3defs.h: - -include/antlr3errors.h: - -antlr3config.h: - -/usr/include/stdio.h: - -/usr/include/features.h: - -/usr/include/i386-linux-gnu/bits/predefs.h: - -/usr/include/i386-linux-gnu/sys/cdefs.h: - -/usr/include/i386-linux-gnu/bits/wordsize.h: - -/usr/include/i386-linux-gnu/gnu/stubs.h: - -/usr/include/i386-linux-gnu/gnu/stubs-32.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include/stddef.h: - -/usr/include/i386-linux-gnu/bits/types.h: - -/usr/include/i386-linux-gnu/bits/typesizes.h: - -/usr/include/libio.h: - -/usr/include/_G_config.h: - -/usr/include/wchar.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include/stdarg.h: - -/usr/include/i386-linux-gnu/bits/stdio_lim.h: - -/usr/include/i386-linux-gnu/bits/sys_errlist.h: - -/usr/include/i386-linux-gnu/bits/stdio.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include/stdint.h: - -/usr/include/stdint.h: - -/usr/include/i386-linux-gnu/bits/wchar.h: - -/usr/include/i386-linux-gnu/sys/types.h: - -/usr/include/time.h: - -/usr/include/endian.h: - -/usr/include/i386-linux-gnu/bits/endian.h: - -/usr/include/i386-linux-gnu/bits/byteswap.h: - -/usr/include/i386-linux-gnu/sys/select.h: - -/usr/include/i386-linux-gnu/bits/select.h: - -/usr/include/i386-linux-gnu/bits/sigset.h: - -/usr/include/i386-linux-gnu/bits/time.h: - -/usr/include/i386-linux-gnu/sys/sysmacros.h: - -/usr/include/i386-linux-gnu/bits/pthreadtypes.h: - -/usr/include/i386-linux-gnu/sys/stat.h: - -/usr/include/i386-linux-gnu/bits/stat.h: - -/usr/include/stdlib.h: - -/usr/include/i386-linux-gnu/bits/waitflags.h: - -/usr/include/i386-linux-gnu/bits/waitstatus.h: - -/usr/include/alloca.h: - -/usr/include/string.h: - -/usr/include/xlocale.h: - -/usr/include/i386-linux-gnu/bits/string.h: - -/usr/include/i386-linux-gnu/bits/string2.h: - -/usr/include/strings.h: - -/usr/include/inttypes.h: - -/usr/include/unistd.h: - -/usr/include/i386-linux-gnu/bits/posix_opt.h: - -/usr/include/i386-linux-gnu/bits/environments.h: - -/usr/include/i386-linux-gnu/bits/confname.h: - -/usr/include/getopt.h: - -/usr/include/netinet/in.h: - -/usr/include/i386-linux-gnu/sys/socket.h: - -/usr/include/i386-linux-gnu/sys/uio.h: - -/usr/include/i386-linux-gnu/bits/uio.h: - -/usr/include/i386-linux-gnu/bits/socket.h: - -/usr/include/i386-linux-gnu/bits/sockaddr.h: - -/usr/include/i386-linux-gnu/asm/socket.h: - -/usr/include/asm-generic/socket.h: - -/usr/include/i386-linux-gnu/asm/sockios.h: - -/usr/include/asm-generic/sockios.h: - -/usr/include/i386-linux-gnu/bits/in.h: - -/usr/include/netinet/tcp.h: - -/usr/include/arpa/nameser.h: - -/usr/include/i386-linux-gnu/sys/param.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/limits.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/syslimits.h: - -/usr/include/limits.h: - -/usr/include/i386-linux-gnu/bits/posix1_lim.h: - -/usr/include/i386-linux-gnu/bits/local_lim.h: - -/usr/include/linux/limits.h: - -/usr/include/i386-linux-gnu/bits/posix2_lim.h: - -/usr/include/linux/param.h: - -/usr/include/i386-linux-gnu/asm/param.h: - -/usr/include/asm-generic/param.h: - -/usr/include/i386-linux-gnu/sys/bitypes.h: - -/usr/include/arpa/nameser_compat.h: - -/usr/include/netdb.h: - -/usr/include/rpc/netdb.h: - -/usr/include/i386-linux-gnu/bits/netdb.h: - -/usr/include/malloc.h: - -/usr/include/ctype.h: - -include/antlr3interfaces.h: - -include/antlr3convertutf.h: - -include/antlr3commontoken.h: diff --git a/impl/antlr/libantlr3c-3.4/.deps/antlr3lexer.Plo b/impl/antlr/libantlr3c-3.4/.deps/antlr3lexer.Plo deleted file mode 100644 index 6ae4d9f..0000000 --- a/impl/antlr/libantlr3c-3.4/.deps/antlr3lexer.Plo +++ /dev/null @@ -1,274 +0,0 @@ -antlr3lexer.lo: src/antlr3lexer.c include/antlr3lexer.h \ - include/antlr3defs.h include/antlr3errors.h antlr3config.h \ - /usr/include/stdio.h /usr/include/features.h \ - /usr/include/i386-linux-gnu/bits/predefs.h \ - /usr/include/i386-linux-gnu/sys/cdefs.h \ - /usr/include/i386-linux-gnu/bits/wordsize.h \ - /usr/include/i386-linux-gnu/gnu/stubs.h \ - /usr/include/i386-linux-gnu/gnu/stubs-32.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include/stddef.h \ - /usr/include/i386-linux-gnu/bits/types.h \ - /usr/include/i386-linux-gnu/bits/typesizes.h /usr/include/libio.h \ - /usr/include/_G_config.h /usr/include/wchar.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include/stdarg.h \ - /usr/include/i386-linux-gnu/bits/stdio_lim.h \ - /usr/include/i386-linux-gnu/bits/sys_errlist.h \ - /usr/include/i386-linux-gnu/bits/stdio.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include/stdint.h /usr/include/stdint.h \ - /usr/include/i386-linux-gnu/bits/wchar.h \ - /usr/include/i386-linux-gnu/sys/types.h /usr/include/time.h \ - /usr/include/endian.h /usr/include/i386-linux-gnu/bits/endian.h \ - /usr/include/i386-linux-gnu/bits/byteswap.h \ - /usr/include/i386-linux-gnu/sys/select.h \ - /usr/include/i386-linux-gnu/bits/select.h \ - /usr/include/i386-linux-gnu/bits/sigset.h \ - /usr/include/i386-linux-gnu/bits/time.h \ - /usr/include/i386-linux-gnu/sys/sysmacros.h \ - /usr/include/i386-linux-gnu/bits/pthreadtypes.h \ - /usr/include/i386-linux-gnu/sys/stat.h \ - /usr/include/i386-linux-gnu/bits/stat.h /usr/include/stdlib.h \ - /usr/include/i386-linux-gnu/bits/waitflags.h \ - /usr/include/i386-linux-gnu/bits/waitstatus.h /usr/include/alloca.h \ - /usr/include/string.h /usr/include/xlocale.h \ - /usr/include/i386-linux-gnu/bits/string.h \ - /usr/include/i386-linux-gnu/bits/string2.h /usr/include/strings.h \ - /usr/include/inttypes.h /usr/include/unistd.h \ - /usr/include/i386-linux-gnu/bits/posix_opt.h \ - /usr/include/i386-linux-gnu/bits/environments.h \ - /usr/include/i386-linux-gnu/bits/confname.h /usr/include/getopt.h \ - /usr/include/netinet/in.h /usr/include/i386-linux-gnu/sys/socket.h \ - /usr/include/i386-linux-gnu/sys/uio.h \ - /usr/include/i386-linux-gnu/bits/uio.h \ - /usr/include/i386-linux-gnu/bits/socket.h \ - /usr/include/i386-linux-gnu/bits/sockaddr.h \ - /usr/include/i386-linux-gnu/asm/socket.h \ - /usr/include/asm-generic/socket.h \ - /usr/include/i386-linux-gnu/asm/sockios.h \ - /usr/include/asm-generic/sockios.h /usr/include/i386-linux-gnu/bits/in.h \ - /usr/include/netinet/tcp.h /usr/include/arpa/nameser.h \ - /usr/include/i386-linux-gnu/sys/param.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/limits.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/syslimits.h \ - /usr/include/limits.h /usr/include/i386-linux-gnu/bits/posix1_lim.h \ - /usr/include/i386-linux-gnu/bits/local_lim.h /usr/include/linux/limits.h \ - /usr/include/i386-linux-gnu/bits/posix2_lim.h /usr/include/linux/param.h \ - /usr/include/i386-linux-gnu/asm/param.h /usr/include/asm-generic/param.h \ - /usr/include/i386-linux-gnu/sys/bitypes.h \ - /usr/include/arpa/nameser_compat.h /usr/include/netdb.h \ - /usr/include/rpc/netdb.h /usr/include/i386-linux-gnu/bits/netdb.h \ - /usr/include/malloc.h /usr/include/ctype.h include/antlr3interfaces.h \ - include/antlr3convertutf.h include/antlr3input.h include/antlr3string.h \ - include/antlr3collections.h include/antlr3bitset.h \ - include/antlr3commontoken.h include/antlr3intstream.h \ - include/antlr3tokenstream.h include/antlr3debugeventlistener.h \ - include/antlr3basetree.h include/antlr3baserecognizer.h \ - include/antlr3exception.h include/antlr3commontreenodestream.h \ - include/antlr3commontreeadaptor.h include/antlr3basetreeadaptor.h \ - include/antlr3commontree.h include/antlr3recognizersharedstate.h \ - include/antlr3parser.h include/antlr3treeparser.h - -include/antlr3lexer.h: - -include/antlr3defs.h: - -include/antlr3errors.h: - -antlr3config.h: - -/usr/include/stdio.h: - -/usr/include/features.h: - -/usr/include/i386-linux-gnu/bits/predefs.h: - -/usr/include/i386-linux-gnu/sys/cdefs.h: - -/usr/include/i386-linux-gnu/bits/wordsize.h: - -/usr/include/i386-linux-gnu/gnu/stubs.h: - -/usr/include/i386-linux-gnu/gnu/stubs-32.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include/stddef.h: - -/usr/include/i386-linux-gnu/bits/types.h: - -/usr/include/i386-linux-gnu/bits/typesizes.h: - -/usr/include/libio.h: - -/usr/include/_G_config.h: - -/usr/include/wchar.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include/stdarg.h: - -/usr/include/i386-linux-gnu/bits/stdio_lim.h: - -/usr/include/i386-linux-gnu/bits/sys_errlist.h: - -/usr/include/i386-linux-gnu/bits/stdio.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include/stdint.h: - -/usr/include/stdint.h: - -/usr/include/i386-linux-gnu/bits/wchar.h: - -/usr/include/i386-linux-gnu/sys/types.h: - -/usr/include/time.h: - -/usr/include/endian.h: - -/usr/include/i386-linux-gnu/bits/endian.h: - -/usr/include/i386-linux-gnu/bits/byteswap.h: - -/usr/include/i386-linux-gnu/sys/select.h: - -/usr/include/i386-linux-gnu/bits/select.h: - -/usr/include/i386-linux-gnu/bits/sigset.h: - -/usr/include/i386-linux-gnu/bits/time.h: - -/usr/include/i386-linux-gnu/sys/sysmacros.h: - -/usr/include/i386-linux-gnu/bits/pthreadtypes.h: - -/usr/include/i386-linux-gnu/sys/stat.h: - -/usr/include/i386-linux-gnu/bits/stat.h: - -/usr/include/stdlib.h: - -/usr/include/i386-linux-gnu/bits/waitflags.h: - -/usr/include/i386-linux-gnu/bits/waitstatus.h: - -/usr/include/alloca.h: - -/usr/include/string.h: - -/usr/include/xlocale.h: - -/usr/include/i386-linux-gnu/bits/string.h: - -/usr/include/i386-linux-gnu/bits/string2.h: - -/usr/include/strings.h: - -/usr/include/inttypes.h: - -/usr/include/unistd.h: - -/usr/include/i386-linux-gnu/bits/posix_opt.h: - -/usr/include/i386-linux-gnu/bits/environments.h: - -/usr/include/i386-linux-gnu/bits/confname.h: - -/usr/include/getopt.h: - -/usr/include/netinet/in.h: - -/usr/include/i386-linux-gnu/sys/socket.h: - -/usr/include/i386-linux-gnu/sys/uio.h: - -/usr/include/i386-linux-gnu/bits/uio.h: - -/usr/include/i386-linux-gnu/bits/socket.h: - -/usr/include/i386-linux-gnu/bits/sockaddr.h: - -/usr/include/i386-linux-gnu/asm/socket.h: - -/usr/include/asm-generic/socket.h: - -/usr/include/i386-linux-gnu/asm/sockios.h: - -/usr/include/asm-generic/sockios.h: - -/usr/include/i386-linux-gnu/bits/in.h: - -/usr/include/netinet/tcp.h: - -/usr/include/arpa/nameser.h: - -/usr/include/i386-linux-gnu/sys/param.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/limits.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/syslimits.h: - -/usr/include/limits.h: - -/usr/include/i386-linux-gnu/bits/posix1_lim.h: - -/usr/include/i386-linux-gnu/bits/local_lim.h: - -/usr/include/linux/limits.h: - -/usr/include/i386-linux-gnu/bits/posix2_lim.h: - -/usr/include/linux/param.h: - -/usr/include/i386-linux-gnu/asm/param.h: - -/usr/include/asm-generic/param.h: - -/usr/include/i386-linux-gnu/sys/bitypes.h: - -/usr/include/arpa/nameser_compat.h: - -/usr/include/netdb.h: - -/usr/include/rpc/netdb.h: - -/usr/include/i386-linux-gnu/bits/netdb.h: - -/usr/include/malloc.h: - -/usr/include/ctype.h: - -include/antlr3interfaces.h: - -include/antlr3convertutf.h: - -include/antlr3input.h: - -include/antlr3string.h: - -include/antlr3collections.h: - -include/antlr3bitset.h: - -include/antlr3commontoken.h: - -include/antlr3intstream.h: - -include/antlr3tokenstream.h: - -include/antlr3debugeventlistener.h: - -include/antlr3basetree.h: - -include/antlr3baserecognizer.h: - -include/antlr3exception.h: - -include/antlr3commontreenodestream.h: - -include/antlr3commontreeadaptor.h: - -include/antlr3basetreeadaptor.h: - -include/antlr3commontree.h: - -include/antlr3recognizersharedstate.h: - -include/antlr3parser.h: - -include/antlr3treeparser.h: diff --git a/impl/antlr/libantlr3c-3.4/.deps/antlr3parser.Plo b/impl/antlr/libantlr3c-3.4/.deps/antlr3parser.Plo deleted file mode 100644 index 9700032..0000000 --- a/impl/antlr/libantlr3c-3.4/.deps/antlr3parser.Plo +++ /dev/null @@ -1,274 +0,0 @@ -antlr3parser.lo: src/antlr3parser.c include/antlr3parser.h \ - include/antlr3defs.h include/antlr3errors.h antlr3config.h \ - /usr/include/stdio.h /usr/include/features.h \ - /usr/include/i386-linux-gnu/bits/predefs.h \ - /usr/include/i386-linux-gnu/sys/cdefs.h \ - /usr/include/i386-linux-gnu/bits/wordsize.h \ - /usr/include/i386-linux-gnu/gnu/stubs.h \ - /usr/include/i386-linux-gnu/gnu/stubs-32.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include/stddef.h \ - /usr/include/i386-linux-gnu/bits/types.h \ - /usr/include/i386-linux-gnu/bits/typesizes.h /usr/include/libio.h \ - /usr/include/_G_config.h /usr/include/wchar.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include/stdarg.h \ - /usr/include/i386-linux-gnu/bits/stdio_lim.h \ - /usr/include/i386-linux-gnu/bits/sys_errlist.h \ - /usr/include/i386-linux-gnu/bits/stdio.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include/stdint.h /usr/include/stdint.h \ - /usr/include/i386-linux-gnu/bits/wchar.h \ - /usr/include/i386-linux-gnu/sys/types.h /usr/include/time.h \ - /usr/include/endian.h /usr/include/i386-linux-gnu/bits/endian.h \ - /usr/include/i386-linux-gnu/bits/byteswap.h \ - /usr/include/i386-linux-gnu/sys/select.h \ - /usr/include/i386-linux-gnu/bits/select.h \ - /usr/include/i386-linux-gnu/bits/sigset.h \ - /usr/include/i386-linux-gnu/bits/time.h \ - /usr/include/i386-linux-gnu/sys/sysmacros.h \ - /usr/include/i386-linux-gnu/bits/pthreadtypes.h \ - /usr/include/i386-linux-gnu/sys/stat.h \ - /usr/include/i386-linux-gnu/bits/stat.h /usr/include/stdlib.h \ - /usr/include/i386-linux-gnu/bits/waitflags.h \ - /usr/include/i386-linux-gnu/bits/waitstatus.h /usr/include/alloca.h \ - /usr/include/string.h /usr/include/xlocale.h \ - /usr/include/i386-linux-gnu/bits/string.h \ - /usr/include/i386-linux-gnu/bits/string2.h /usr/include/strings.h \ - /usr/include/inttypes.h /usr/include/unistd.h \ - /usr/include/i386-linux-gnu/bits/posix_opt.h \ - /usr/include/i386-linux-gnu/bits/environments.h \ - /usr/include/i386-linux-gnu/bits/confname.h /usr/include/getopt.h \ - /usr/include/netinet/in.h /usr/include/i386-linux-gnu/sys/socket.h \ - /usr/include/i386-linux-gnu/sys/uio.h \ - /usr/include/i386-linux-gnu/bits/uio.h \ - /usr/include/i386-linux-gnu/bits/socket.h \ - /usr/include/i386-linux-gnu/bits/sockaddr.h \ - /usr/include/i386-linux-gnu/asm/socket.h \ - /usr/include/asm-generic/socket.h \ - /usr/include/i386-linux-gnu/asm/sockios.h \ - /usr/include/asm-generic/sockios.h /usr/include/i386-linux-gnu/bits/in.h \ - /usr/include/netinet/tcp.h /usr/include/arpa/nameser.h \ - /usr/include/i386-linux-gnu/sys/param.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/limits.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/syslimits.h \ - /usr/include/limits.h /usr/include/i386-linux-gnu/bits/posix1_lim.h \ - /usr/include/i386-linux-gnu/bits/local_lim.h /usr/include/linux/limits.h \ - /usr/include/i386-linux-gnu/bits/posix2_lim.h /usr/include/linux/param.h \ - /usr/include/i386-linux-gnu/asm/param.h /usr/include/asm-generic/param.h \ - /usr/include/i386-linux-gnu/sys/bitypes.h \ - /usr/include/arpa/nameser_compat.h /usr/include/netdb.h \ - /usr/include/rpc/netdb.h /usr/include/i386-linux-gnu/bits/netdb.h \ - /usr/include/malloc.h /usr/include/ctype.h include/antlr3interfaces.h \ - include/antlr3convertutf.h include/antlr3baserecognizer.h \ - include/antlr3exception.h include/antlr3input.h include/antlr3string.h \ - include/antlr3collections.h include/antlr3bitset.h \ - include/antlr3commontoken.h include/antlr3intstream.h \ - include/antlr3tokenstream.h include/antlr3debugeventlistener.h \ - include/antlr3basetree.h include/antlr3commontreenodestream.h \ - include/antlr3commontreeadaptor.h include/antlr3basetreeadaptor.h \ - include/antlr3commontree.h include/antlr3recognizersharedstate.h \ - include/antlr3lexer.h include/antlr3treeparser.h - -include/antlr3parser.h: - -include/antlr3defs.h: - -include/antlr3errors.h: - -antlr3config.h: - -/usr/include/stdio.h: - -/usr/include/features.h: - -/usr/include/i386-linux-gnu/bits/predefs.h: - -/usr/include/i386-linux-gnu/sys/cdefs.h: - -/usr/include/i386-linux-gnu/bits/wordsize.h: - -/usr/include/i386-linux-gnu/gnu/stubs.h: - -/usr/include/i386-linux-gnu/gnu/stubs-32.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include/stddef.h: - -/usr/include/i386-linux-gnu/bits/types.h: - -/usr/include/i386-linux-gnu/bits/typesizes.h: - -/usr/include/libio.h: - -/usr/include/_G_config.h: - -/usr/include/wchar.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include/stdarg.h: - -/usr/include/i386-linux-gnu/bits/stdio_lim.h: - -/usr/include/i386-linux-gnu/bits/sys_errlist.h: - -/usr/include/i386-linux-gnu/bits/stdio.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include/stdint.h: - -/usr/include/stdint.h: - -/usr/include/i386-linux-gnu/bits/wchar.h: - -/usr/include/i386-linux-gnu/sys/types.h: - -/usr/include/time.h: - -/usr/include/endian.h: - -/usr/include/i386-linux-gnu/bits/endian.h: - -/usr/include/i386-linux-gnu/bits/byteswap.h: - -/usr/include/i386-linux-gnu/sys/select.h: - -/usr/include/i386-linux-gnu/bits/select.h: - -/usr/include/i386-linux-gnu/bits/sigset.h: - -/usr/include/i386-linux-gnu/bits/time.h: - -/usr/include/i386-linux-gnu/sys/sysmacros.h: - -/usr/include/i386-linux-gnu/bits/pthreadtypes.h: - -/usr/include/i386-linux-gnu/sys/stat.h: - -/usr/include/i386-linux-gnu/bits/stat.h: - -/usr/include/stdlib.h: - -/usr/include/i386-linux-gnu/bits/waitflags.h: - -/usr/include/i386-linux-gnu/bits/waitstatus.h: - -/usr/include/alloca.h: - -/usr/include/string.h: - -/usr/include/xlocale.h: - -/usr/include/i386-linux-gnu/bits/string.h: - -/usr/include/i386-linux-gnu/bits/string2.h: - -/usr/include/strings.h: - -/usr/include/inttypes.h: - -/usr/include/unistd.h: - -/usr/include/i386-linux-gnu/bits/posix_opt.h: - -/usr/include/i386-linux-gnu/bits/environments.h: - -/usr/include/i386-linux-gnu/bits/confname.h: - -/usr/include/getopt.h: - -/usr/include/netinet/in.h: - -/usr/include/i386-linux-gnu/sys/socket.h: - -/usr/include/i386-linux-gnu/sys/uio.h: - -/usr/include/i386-linux-gnu/bits/uio.h: - -/usr/include/i386-linux-gnu/bits/socket.h: - -/usr/include/i386-linux-gnu/bits/sockaddr.h: - -/usr/include/i386-linux-gnu/asm/socket.h: - -/usr/include/asm-generic/socket.h: - -/usr/include/i386-linux-gnu/asm/sockios.h: - -/usr/include/asm-generic/sockios.h: - -/usr/include/i386-linux-gnu/bits/in.h: - -/usr/include/netinet/tcp.h: - -/usr/include/arpa/nameser.h: - -/usr/include/i386-linux-gnu/sys/param.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/limits.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/syslimits.h: - -/usr/include/limits.h: - -/usr/include/i386-linux-gnu/bits/posix1_lim.h: - -/usr/include/i386-linux-gnu/bits/local_lim.h: - -/usr/include/linux/limits.h: - -/usr/include/i386-linux-gnu/bits/posix2_lim.h: - -/usr/include/linux/param.h: - -/usr/include/i386-linux-gnu/asm/param.h: - -/usr/include/asm-generic/param.h: - -/usr/include/i386-linux-gnu/sys/bitypes.h: - -/usr/include/arpa/nameser_compat.h: - -/usr/include/netdb.h: - -/usr/include/rpc/netdb.h: - -/usr/include/i386-linux-gnu/bits/netdb.h: - -/usr/include/malloc.h: - -/usr/include/ctype.h: - -include/antlr3interfaces.h: - -include/antlr3convertutf.h: - -include/antlr3baserecognizer.h: - -include/antlr3exception.h: - -include/antlr3input.h: - -include/antlr3string.h: - -include/antlr3collections.h: - -include/antlr3bitset.h: - -include/antlr3commontoken.h: - -include/antlr3intstream.h: - -include/antlr3tokenstream.h: - -include/antlr3debugeventlistener.h: - -include/antlr3basetree.h: - -include/antlr3commontreenodestream.h: - -include/antlr3commontreeadaptor.h: - -include/antlr3basetreeadaptor.h: - -include/antlr3commontree.h: - -include/antlr3recognizersharedstate.h: - -include/antlr3lexer.h: - -include/antlr3treeparser.h: diff --git a/impl/antlr/libantlr3c-3.4/.deps/antlr3rewritestreams.Plo b/impl/antlr/libantlr3c-3.4/.deps/antlr3rewritestreams.Plo deleted file mode 100644 index 879dd91..0000000 --- a/impl/antlr/libantlr3c-3.4/.deps/antlr3rewritestreams.Plo +++ /dev/null @@ -1,277 +0,0 @@ -antlr3rewritestreams.lo: src/antlr3rewritestreams.c \ - include/antlr3rewritestreams.h include/antlr3defs.h \ - include/antlr3errors.h antlr3config.h /usr/include/stdio.h \ - /usr/include/features.h /usr/include/i386-linux-gnu/bits/predefs.h \ - /usr/include/i386-linux-gnu/sys/cdefs.h \ - /usr/include/i386-linux-gnu/bits/wordsize.h \ - /usr/include/i386-linux-gnu/gnu/stubs.h \ - /usr/include/i386-linux-gnu/gnu/stubs-32.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include/stddef.h \ - /usr/include/i386-linux-gnu/bits/types.h \ - /usr/include/i386-linux-gnu/bits/typesizes.h /usr/include/libio.h \ - /usr/include/_G_config.h /usr/include/wchar.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include/stdarg.h \ - /usr/include/i386-linux-gnu/bits/stdio_lim.h \ - /usr/include/i386-linux-gnu/bits/sys_errlist.h \ - /usr/include/i386-linux-gnu/bits/stdio.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include/stdint.h /usr/include/stdint.h \ - /usr/include/i386-linux-gnu/bits/wchar.h \ - /usr/include/i386-linux-gnu/sys/types.h /usr/include/time.h \ - /usr/include/endian.h /usr/include/i386-linux-gnu/bits/endian.h \ - /usr/include/i386-linux-gnu/bits/byteswap.h \ - /usr/include/i386-linux-gnu/sys/select.h \ - /usr/include/i386-linux-gnu/bits/select.h \ - /usr/include/i386-linux-gnu/bits/sigset.h \ - /usr/include/i386-linux-gnu/bits/time.h \ - /usr/include/i386-linux-gnu/sys/sysmacros.h \ - /usr/include/i386-linux-gnu/bits/pthreadtypes.h \ - /usr/include/i386-linux-gnu/sys/stat.h \ - /usr/include/i386-linux-gnu/bits/stat.h /usr/include/stdlib.h \ - /usr/include/i386-linux-gnu/bits/waitflags.h \ - /usr/include/i386-linux-gnu/bits/waitstatus.h /usr/include/alloca.h \ - /usr/include/string.h /usr/include/xlocale.h \ - /usr/include/i386-linux-gnu/bits/string.h \ - /usr/include/i386-linux-gnu/bits/string2.h /usr/include/strings.h \ - /usr/include/inttypes.h /usr/include/unistd.h \ - /usr/include/i386-linux-gnu/bits/posix_opt.h \ - /usr/include/i386-linux-gnu/bits/environments.h \ - /usr/include/i386-linux-gnu/bits/confname.h /usr/include/getopt.h \ - /usr/include/netinet/in.h /usr/include/i386-linux-gnu/sys/socket.h \ - /usr/include/i386-linux-gnu/sys/uio.h \ - /usr/include/i386-linux-gnu/bits/uio.h \ - /usr/include/i386-linux-gnu/bits/socket.h \ - /usr/include/i386-linux-gnu/bits/sockaddr.h \ - /usr/include/i386-linux-gnu/asm/socket.h \ - /usr/include/asm-generic/socket.h \ - /usr/include/i386-linux-gnu/asm/sockios.h \ - /usr/include/asm-generic/sockios.h /usr/include/i386-linux-gnu/bits/in.h \ - /usr/include/netinet/tcp.h /usr/include/arpa/nameser.h \ - /usr/include/i386-linux-gnu/sys/param.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/limits.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/syslimits.h \ - /usr/include/limits.h /usr/include/i386-linux-gnu/bits/posix1_lim.h \ - /usr/include/i386-linux-gnu/bits/local_lim.h /usr/include/linux/limits.h \ - /usr/include/i386-linux-gnu/bits/posix2_lim.h /usr/include/linux/param.h \ - /usr/include/i386-linux-gnu/asm/param.h /usr/include/asm-generic/param.h \ - /usr/include/i386-linux-gnu/sys/bitypes.h \ - /usr/include/arpa/nameser_compat.h /usr/include/netdb.h \ - /usr/include/rpc/netdb.h /usr/include/i386-linux-gnu/bits/netdb.h \ - /usr/include/malloc.h /usr/include/ctype.h include/antlr3interfaces.h \ - include/antlr3convertutf.h include/antlr3collections.h \ - include/antlr3bitset.h include/antlr3commontreeadaptor.h \ - include/antlr3string.h include/antlr3basetreeadaptor.h \ - include/antlr3basetree.h include/antlr3commontoken.h \ - include/antlr3debugeventlistener.h include/antlr3commontree.h \ - include/antlr3baserecognizer.h include/antlr3exception.h \ - include/antlr3input.h include/antlr3intstream.h \ - include/antlr3tokenstream.h include/antlr3commontreenodestream.h \ - include/antlr3recognizersharedstate.h include/antlr3lexer.h \ - include/antlr3parser.h include/antlr3treeparser.h - -include/antlr3rewritestreams.h: - -include/antlr3defs.h: - -include/antlr3errors.h: - -antlr3config.h: - -/usr/include/stdio.h: - -/usr/include/features.h: - -/usr/include/i386-linux-gnu/bits/predefs.h: - -/usr/include/i386-linux-gnu/sys/cdefs.h: - -/usr/include/i386-linux-gnu/bits/wordsize.h: - -/usr/include/i386-linux-gnu/gnu/stubs.h: - -/usr/include/i386-linux-gnu/gnu/stubs-32.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include/stddef.h: - -/usr/include/i386-linux-gnu/bits/types.h: - -/usr/include/i386-linux-gnu/bits/typesizes.h: - -/usr/include/libio.h: - -/usr/include/_G_config.h: - -/usr/include/wchar.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include/stdarg.h: - -/usr/include/i386-linux-gnu/bits/stdio_lim.h: - -/usr/include/i386-linux-gnu/bits/sys_errlist.h: - -/usr/include/i386-linux-gnu/bits/stdio.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include/stdint.h: - -/usr/include/stdint.h: - -/usr/include/i386-linux-gnu/bits/wchar.h: - -/usr/include/i386-linux-gnu/sys/types.h: - -/usr/include/time.h: - -/usr/include/endian.h: - -/usr/include/i386-linux-gnu/bits/endian.h: - -/usr/include/i386-linux-gnu/bits/byteswap.h: - -/usr/include/i386-linux-gnu/sys/select.h: - -/usr/include/i386-linux-gnu/bits/select.h: - -/usr/include/i386-linux-gnu/bits/sigset.h: - -/usr/include/i386-linux-gnu/bits/time.h: - -/usr/include/i386-linux-gnu/sys/sysmacros.h: - -/usr/include/i386-linux-gnu/bits/pthreadtypes.h: - -/usr/include/i386-linux-gnu/sys/stat.h: - -/usr/include/i386-linux-gnu/bits/stat.h: - -/usr/include/stdlib.h: - -/usr/include/i386-linux-gnu/bits/waitflags.h: - -/usr/include/i386-linux-gnu/bits/waitstatus.h: - -/usr/include/alloca.h: - -/usr/include/string.h: - -/usr/include/xlocale.h: - -/usr/include/i386-linux-gnu/bits/string.h: - -/usr/include/i386-linux-gnu/bits/string2.h: - -/usr/include/strings.h: - -/usr/include/inttypes.h: - -/usr/include/unistd.h: - -/usr/include/i386-linux-gnu/bits/posix_opt.h: - -/usr/include/i386-linux-gnu/bits/environments.h: - -/usr/include/i386-linux-gnu/bits/confname.h: - -/usr/include/getopt.h: - -/usr/include/netinet/in.h: - -/usr/include/i386-linux-gnu/sys/socket.h: - -/usr/include/i386-linux-gnu/sys/uio.h: - -/usr/include/i386-linux-gnu/bits/uio.h: - -/usr/include/i386-linux-gnu/bits/socket.h: - -/usr/include/i386-linux-gnu/bits/sockaddr.h: - -/usr/include/i386-linux-gnu/asm/socket.h: - -/usr/include/asm-generic/socket.h: - -/usr/include/i386-linux-gnu/asm/sockios.h: - -/usr/include/asm-generic/sockios.h: - -/usr/include/i386-linux-gnu/bits/in.h: - -/usr/include/netinet/tcp.h: - -/usr/include/arpa/nameser.h: - -/usr/include/i386-linux-gnu/sys/param.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/limits.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/syslimits.h: - -/usr/include/limits.h: - -/usr/include/i386-linux-gnu/bits/posix1_lim.h: - -/usr/include/i386-linux-gnu/bits/local_lim.h: - -/usr/include/linux/limits.h: - -/usr/include/i386-linux-gnu/bits/posix2_lim.h: - -/usr/include/linux/param.h: - -/usr/include/i386-linux-gnu/asm/param.h: - -/usr/include/asm-generic/param.h: - -/usr/include/i386-linux-gnu/sys/bitypes.h: - -/usr/include/arpa/nameser_compat.h: - -/usr/include/netdb.h: - -/usr/include/rpc/netdb.h: - -/usr/include/i386-linux-gnu/bits/netdb.h: - -/usr/include/malloc.h: - -/usr/include/ctype.h: - -include/antlr3interfaces.h: - -include/antlr3convertutf.h: - -include/antlr3collections.h: - -include/antlr3bitset.h: - -include/antlr3commontreeadaptor.h: - -include/antlr3string.h: - -include/antlr3basetreeadaptor.h: - -include/antlr3basetree.h: - -include/antlr3commontoken.h: - -include/antlr3debugeventlistener.h: - -include/antlr3commontree.h: - -include/antlr3baserecognizer.h: - -include/antlr3exception.h: - -include/antlr3input.h: - -include/antlr3intstream.h: - -include/antlr3tokenstream.h: - -include/antlr3commontreenodestream.h: - -include/antlr3recognizersharedstate.h: - -include/antlr3lexer.h: - -include/antlr3parser.h: - -include/antlr3treeparser.h: diff --git a/impl/antlr/libantlr3c-3.4/.deps/antlr3string.Plo b/impl/antlr/libantlr3c-3.4/.deps/antlr3string.Plo deleted file mode 100644 index 15b3d1c..0000000 --- a/impl/antlr/libantlr3c-3.4/.deps/antlr3string.Plo +++ /dev/null @@ -1,235 +0,0 @@ -antlr3string.lo: src/antlr3string.c include/antlr3string.h \ - include/antlr3defs.h include/antlr3errors.h antlr3config.h \ - /usr/include/stdio.h /usr/include/features.h \ - /usr/include/i386-linux-gnu/bits/predefs.h \ - /usr/include/i386-linux-gnu/sys/cdefs.h \ - /usr/include/i386-linux-gnu/bits/wordsize.h \ - /usr/include/i386-linux-gnu/gnu/stubs.h \ - /usr/include/i386-linux-gnu/gnu/stubs-32.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include/stddef.h \ - /usr/include/i386-linux-gnu/bits/types.h \ - /usr/include/i386-linux-gnu/bits/typesizes.h /usr/include/libio.h \ - /usr/include/_G_config.h /usr/include/wchar.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include/stdarg.h \ - /usr/include/i386-linux-gnu/bits/stdio_lim.h \ - /usr/include/i386-linux-gnu/bits/sys_errlist.h \ - /usr/include/i386-linux-gnu/bits/stdio.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include/stdint.h /usr/include/stdint.h \ - /usr/include/i386-linux-gnu/bits/wchar.h \ - /usr/include/i386-linux-gnu/sys/types.h /usr/include/time.h \ - /usr/include/endian.h /usr/include/i386-linux-gnu/bits/endian.h \ - /usr/include/i386-linux-gnu/bits/byteswap.h \ - /usr/include/i386-linux-gnu/sys/select.h \ - /usr/include/i386-linux-gnu/bits/select.h \ - /usr/include/i386-linux-gnu/bits/sigset.h \ - /usr/include/i386-linux-gnu/bits/time.h \ - /usr/include/i386-linux-gnu/sys/sysmacros.h \ - /usr/include/i386-linux-gnu/bits/pthreadtypes.h \ - /usr/include/i386-linux-gnu/sys/stat.h \ - /usr/include/i386-linux-gnu/bits/stat.h /usr/include/stdlib.h \ - /usr/include/i386-linux-gnu/bits/waitflags.h \ - /usr/include/i386-linux-gnu/bits/waitstatus.h /usr/include/alloca.h \ - /usr/include/string.h /usr/include/xlocale.h \ - /usr/include/i386-linux-gnu/bits/string.h \ - /usr/include/i386-linux-gnu/bits/string2.h /usr/include/strings.h \ - /usr/include/inttypes.h /usr/include/unistd.h \ - /usr/include/i386-linux-gnu/bits/posix_opt.h \ - /usr/include/i386-linux-gnu/bits/environments.h \ - /usr/include/i386-linux-gnu/bits/confname.h /usr/include/getopt.h \ - /usr/include/netinet/in.h /usr/include/i386-linux-gnu/sys/socket.h \ - /usr/include/i386-linux-gnu/sys/uio.h \ - /usr/include/i386-linux-gnu/bits/uio.h \ - /usr/include/i386-linux-gnu/bits/socket.h \ - /usr/include/i386-linux-gnu/bits/sockaddr.h \ - /usr/include/i386-linux-gnu/asm/socket.h \ - /usr/include/asm-generic/socket.h \ - /usr/include/i386-linux-gnu/asm/sockios.h \ - /usr/include/asm-generic/sockios.h /usr/include/i386-linux-gnu/bits/in.h \ - /usr/include/netinet/tcp.h /usr/include/arpa/nameser.h \ - /usr/include/i386-linux-gnu/sys/param.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/limits.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/syslimits.h \ - /usr/include/limits.h /usr/include/i386-linux-gnu/bits/posix1_lim.h \ - /usr/include/i386-linux-gnu/bits/local_lim.h /usr/include/linux/limits.h \ - /usr/include/i386-linux-gnu/bits/posix2_lim.h /usr/include/linux/param.h \ - /usr/include/i386-linux-gnu/asm/param.h /usr/include/asm-generic/param.h \ - /usr/include/i386-linux-gnu/sys/bitypes.h \ - /usr/include/arpa/nameser_compat.h /usr/include/netdb.h \ - /usr/include/rpc/netdb.h /usr/include/i386-linux-gnu/bits/netdb.h \ - /usr/include/malloc.h /usr/include/ctype.h include/antlr3interfaces.h \ - include/antlr3convertutf.h include/antlr3collections.h \ - include/antlr3bitset.h - -include/antlr3string.h: - -include/antlr3defs.h: - -include/antlr3errors.h: - -antlr3config.h: - -/usr/include/stdio.h: - -/usr/include/features.h: - -/usr/include/i386-linux-gnu/bits/predefs.h: - -/usr/include/i386-linux-gnu/sys/cdefs.h: - -/usr/include/i386-linux-gnu/bits/wordsize.h: - -/usr/include/i386-linux-gnu/gnu/stubs.h: - -/usr/include/i386-linux-gnu/gnu/stubs-32.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include/stddef.h: - -/usr/include/i386-linux-gnu/bits/types.h: - -/usr/include/i386-linux-gnu/bits/typesizes.h: - -/usr/include/libio.h: - -/usr/include/_G_config.h: - -/usr/include/wchar.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include/stdarg.h: - -/usr/include/i386-linux-gnu/bits/stdio_lim.h: - -/usr/include/i386-linux-gnu/bits/sys_errlist.h: - -/usr/include/i386-linux-gnu/bits/stdio.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include/stdint.h: - -/usr/include/stdint.h: - -/usr/include/i386-linux-gnu/bits/wchar.h: - -/usr/include/i386-linux-gnu/sys/types.h: - -/usr/include/time.h: - -/usr/include/endian.h: - -/usr/include/i386-linux-gnu/bits/endian.h: - -/usr/include/i386-linux-gnu/bits/byteswap.h: - -/usr/include/i386-linux-gnu/sys/select.h: - -/usr/include/i386-linux-gnu/bits/select.h: - -/usr/include/i386-linux-gnu/bits/sigset.h: - -/usr/include/i386-linux-gnu/bits/time.h: - -/usr/include/i386-linux-gnu/sys/sysmacros.h: - -/usr/include/i386-linux-gnu/bits/pthreadtypes.h: - -/usr/include/i386-linux-gnu/sys/stat.h: - -/usr/include/i386-linux-gnu/bits/stat.h: - -/usr/include/stdlib.h: - -/usr/include/i386-linux-gnu/bits/waitflags.h: - -/usr/include/i386-linux-gnu/bits/waitstatus.h: - -/usr/include/alloca.h: - -/usr/include/string.h: - -/usr/include/xlocale.h: - -/usr/include/i386-linux-gnu/bits/string.h: - -/usr/include/i386-linux-gnu/bits/string2.h: - -/usr/include/strings.h: - -/usr/include/inttypes.h: - -/usr/include/unistd.h: - -/usr/include/i386-linux-gnu/bits/posix_opt.h: - -/usr/include/i386-linux-gnu/bits/environments.h: - -/usr/include/i386-linux-gnu/bits/confname.h: - -/usr/include/getopt.h: - -/usr/include/netinet/in.h: - -/usr/include/i386-linux-gnu/sys/socket.h: - -/usr/include/i386-linux-gnu/sys/uio.h: - -/usr/include/i386-linux-gnu/bits/uio.h: - -/usr/include/i386-linux-gnu/bits/socket.h: - -/usr/include/i386-linux-gnu/bits/sockaddr.h: - -/usr/include/i386-linux-gnu/asm/socket.h: - -/usr/include/asm-generic/socket.h: - -/usr/include/i386-linux-gnu/asm/sockios.h: - -/usr/include/asm-generic/sockios.h: - -/usr/include/i386-linux-gnu/bits/in.h: - -/usr/include/netinet/tcp.h: - -/usr/include/arpa/nameser.h: - -/usr/include/i386-linux-gnu/sys/param.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/limits.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/syslimits.h: - -/usr/include/limits.h: - -/usr/include/i386-linux-gnu/bits/posix1_lim.h: - -/usr/include/i386-linux-gnu/bits/local_lim.h: - -/usr/include/linux/limits.h: - -/usr/include/i386-linux-gnu/bits/posix2_lim.h: - -/usr/include/linux/param.h: - -/usr/include/i386-linux-gnu/asm/param.h: - -/usr/include/asm-generic/param.h: - -/usr/include/i386-linux-gnu/sys/bitypes.h: - -/usr/include/arpa/nameser_compat.h: - -/usr/include/netdb.h: - -/usr/include/rpc/netdb.h: - -/usr/include/i386-linux-gnu/bits/netdb.h: - -/usr/include/malloc.h: - -/usr/include/ctype.h: - -include/antlr3interfaces.h: - -include/antlr3convertutf.h: - -include/antlr3collections.h: - -include/antlr3bitset.h: diff --git a/impl/antlr/libantlr3c-3.4/.deps/antlr3tokenstream.Plo b/impl/antlr/libantlr3c-3.4/.deps/antlr3tokenstream.Plo deleted file mode 100644 index d97c475..0000000 --- a/impl/antlr/libantlr3c-3.4/.deps/antlr3tokenstream.Plo +++ /dev/null @@ -1,249 +0,0 @@ -antlr3tokenstream.lo: src/antlr3tokenstream.c include/antlr3tokenstream.h \ - include/antlr3defs.h include/antlr3errors.h antlr3config.h \ - /usr/include/stdio.h /usr/include/features.h \ - /usr/include/i386-linux-gnu/bits/predefs.h \ - /usr/include/i386-linux-gnu/sys/cdefs.h \ - /usr/include/i386-linux-gnu/bits/wordsize.h \ - /usr/include/i386-linux-gnu/gnu/stubs.h \ - /usr/include/i386-linux-gnu/gnu/stubs-32.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include/stddef.h \ - /usr/include/i386-linux-gnu/bits/types.h \ - /usr/include/i386-linux-gnu/bits/typesizes.h /usr/include/libio.h \ - /usr/include/_G_config.h /usr/include/wchar.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include/stdarg.h \ - /usr/include/i386-linux-gnu/bits/stdio_lim.h \ - /usr/include/i386-linux-gnu/bits/sys_errlist.h \ - /usr/include/i386-linux-gnu/bits/stdio.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include/stdint.h /usr/include/stdint.h \ - /usr/include/i386-linux-gnu/bits/wchar.h \ - /usr/include/i386-linux-gnu/sys/types.h /usr/include/time.h \ - /usr/include/endian.h /usr/include/i386-linux-gnu/bits/endian.h \ - /usr/include/i386-linux-gnu/bits/byteswap.h \ - /usr/include/i386-linux-gnu/sys/select.h \ - /usr/include/i386-linux-gnu/bits/select.h \ - /usr/include/i386-linux-gnu/bits/sigset.h \ - /usr/include/i386-linux-gnu/bits/time.h \ - /usr/include/i386-linux-gnu/sys/sysmacros.h \ - /usr/include/i386-linux-gnu/bits/pthreadtypes.h \ - /usr/include/i386-linux-gnu/sys/stat.h \ - /usr/include/i386-linux-gnu/bits/stat.h /usr/include/stdlib.h \ - /usr/include/i386-linux-gnu/bits/waitflags.h \ - /usr/include/i386-linux-gnu/bits/waitstatus.h /usr/include/alloca.h \ - /usr/include/string.h /usr/include/xlocale.h \ - /usr/include/i386-linux-gnu/bits/string.h \ - /usr/include/i386-linux-gnu/bits/string2.h /usr/include/strings.h \ - /usr/include/inttypes.h /usr/include/unistd.h \ - /usr/include/i386-linux-gnu/bits/posix_opt.h \ - /usr/include/i386-linux-gnu/bits/environments.h \ - /usr/include/i386-linux-gnu/bits/confname.h /usr/include/getopt.h \ - /usr/include/netinet/in.h /usr/include/i386-linux-gnu/sys/socket.h \ - /usr/include/i386-linux-gnu/sys/uio.h \ - /usr/include/i386-linux-gnu/bits/uio.h \ - /usr/include/i386-linux-gnu/bits/socket.h \ - /usr/include/i386-linux-gnu/bits/sockaddr.h \ - /usr/include/i386-linux-gnu/asm/socket.h \ - /usr/include/asm-generic/socket.h \ - /usr/include/i386-linux-gnu/asm/sockios.h \ - /usr/include/asm-generic/sockios.h /usr/include/i386-linux-gnu/bits/in.h \ - /usr/include/netinet/tcp.h /usr/include/arpa/nameser.h \ - /usr/include/i386-linux-gnu/sys/param.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/limits.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/syslimits.h \ - /usr/include/limits.h /usr/include/i386-linux-gnu/bits/posix1_lim.h \ - /usr/include/i386-linux-gnu/bits/local_lim.h /usr/include/linux/limits.h \ - /usr/include/i386-linux-gnu/bits/posix2_lim.h /usr/include/linux/param.h \ - /usr/include/i386-linux-gnu/asm/param.h /usr/include/asm-generic/param.h \ - /usr/include/i386-linux-gnu/sys/bitypes.h \ - /usr/include/arpa/nameser_compat.h /usr/include/netdb.h \ - /usr/include/rpc/netdb.h /usr/include/i386-linux-gnu/bits/netdb.h \ - /usr/include/malloc.h /usr/include/ctype.h include/antlr3interfaces.h \ - include/antlr3convertutf.h include/antlr3string.h \ - include/antlr3collections.h include/antlr3bitset.h include/antlr3input.h \ - include/antlr3commontoken.h include/antlr3intstream.h \ - include/antlr3debugeventlistener.h include/antlr3basetree.h - -include/antlr3tokenstream.h: - -include/antlr3defs.h: - -include/antlr3errors.h: - -antlr3config.h: - -/usr/include/stdio.h: - -/usr/include/features.h: - -/usr/include/i386-linux-gnu/bits/predefs.h: - -/usr/include/i386-linux-gnu/sys/cdefs.h: - -/usr/include/i386-linux-gnu/bits/wordsize.h: - -/usr/include/i386-linux-gnu/gnu/stubs.h: - -/usr/include/i386-linux-gnu/gnu/stubs-32.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include/stddef.h: - -/usr/include/i386-linux-gnu/bits/types.h: - -/usr/include/i386-linux-gnu/bits/typesizes.h: - -/usr/include/libio.h: - -/usr/include/_G_config.h: - -/usr/include/wchar.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include/stdarg.h: - -/usr/include/i386-linux-gnu/bits/stdio_lim.h: - -/usr/include/i386-linux-gnu/bits/sys_errlist.h: - -/usr/include/i386-linux-gnu/bits/stdio.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include/stdint.h: - -/usr/include/stdint.h: - -/usr/include/i386-linux-gnu/bits/wchar.h: - -/usr/include/i386-linux-gnu/sys/types.h: - -/usr/include/time.h: - -/usr/include/endian.h: - -/usr/include/i386-linux-gnu/bits/endian.h: - -/usr/include/i386-linux-gnu/bits/byteswap.h: - -/usr/include/i386-linux-gnu/sys/select.h: - -/usr/include/i386-linux-gnu/bits/select.h: - -/usr/include/i386-linux-gnu/bits/sigset.h: - -/usr/include/i386-linux-gnu/bits/time.h: - -/usr/include/i386-linux-gnu/sys/sysmacros.h: - -/usr/include/i386-linux-gnu/bits/pthreadtypes.h: - -/usr/include/i386-linux-gnu/sys/stat.h: - -/usr/include/i386-linux-gnu/bits/stat.h: - -/usr/include/stdlib.h: - -/usr/include/i386-linux-gnu/bits/waitflags.h: - -/usr/include/i386-linux-gnu/bits/waitstatus.h: - -/usr/include/alloca.h: - -/usr/include/string.h: - -/usr/include/xlocale.h: - -/usr/include/i386-linux-gnu/bits/string.h: - -/usr/include/i386-linux-gnu/bits/string2.h: - -/usr/include/strings.h: - -/usr/include/inttypes.h: - -/usr/include/unistd.h: - -/usr/include/i386-linux-gnu/bits/posix_opt.h: - -/usr/include/i386-linux-gnu/bits/environments.h: - -/usr/include/i386-linux-gnu/bits/confname.h: - -/usr/include/getopt.h: - -/usr/include/netinet/in.h: - -/usr/include/i386-linux-gnu/sys/socket.h: - -/usr/include/i386-linux-gnu/sys/uio.h: - -/usr/include/i386-linux-gnu/bits/uio.h: - -/usr/include/i386-linux-gnu/bits/socket.h: - -/usr/include/i386-linux-gnu/bits/sockaddr.h: - -/usr/include/i386-linux-gnu/asm/socket.h: - -/usr/include/asm-generic/socket.h: - -/usr/include/i386-linux-gnu/asm/sockios.h: - -/usr/include/asm-generic/sockios.h: - -/usr/include/i386-linux-gnu/bits/in.h: - -/usr/include/netinet/tcp.h: - -/usr/include/arpa/nameser.h: - -/usr/include/i386-linux-gnu/sys/param.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/limits.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/syslimits.h: - -/usr/include/limits.h: - -/usr/include/i386-linux-gnu/bits/posix1_lim.h: - -/usr/include/i386-linux-gnu/bits/local_lim.h: - -/usr/include/linux/limits.h: - -/usr/include/i386-linux-gnu/bits/posix2_lim.h: - -/usr/include/linux/param.h: - -/usr/include/i386-linux-gnu/asm/param.h: - -/usr/include/asm-generic/param.h: - -/usr/include/i386-linux-gnu/sys/bitypes.h: - -/usr/include/arpa/nameser_compat.h: - -/usr/include/netdb.h: - -/usr/include/rpc/netdb.h: - -/usr/include/i386-linux-gnu/bits/netdb.h: - -/usr/include/malloc.h: - -/usr/include/ctype.h: - -include/antlr3interfaces.h: - -include/antlr3convertutf.h: - -include/antlr3string.h: - -include/antlr3collections.h: - -include/antlr3bitset.h: - -include/antlr3input.h: - -include/antlr3commontoken.h: - -include/antlr3intstream.h: - -include/antlr3debugeventlistener.h: - -include/antlr3basetree.h: diff --git a/impl/antlr/libantlr3c-3.4/.deps/antlr3treeparser.Plo b/impl/antlr/libantlr3c-3.4/.deps/antlr3treeparser.Plo deleted file mode 100644 index 4b4a2e8..0000000 --- a/impl/antlr/libantlr3c-3.4/.deps/antlr3treeparser.Plo +++ /dev/null @@ -1,274 +0,0 @@ -antlr3treeparser.lo: src/antlr3treeparser.c include/antlr3treeparser.h \ - include/antlr3defs.h include/antlr3errors.h antlr3config.h \ - /usr/include/stdio.h /usr/include/features.h \ - /usr/include/i386-linux-gnu/bits/predefs.h \ - /usr/include/i386-linux-gnu/sys/cdefs.h \ - /usr/include/i386-linux-gnu/bits/wordsize.h \ - /usr/include/i386-linux-gnu/gnu/stubs.h \ - /usr/include/i386-linux-gnu/gnu/stubs-32.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include/stddef.h \ - /usr/include/i386-linux-gnu/bits/types.h \ - /usr/include/i386-linux-gnu/bits/typesizes.h /usr/include/libio.h \ - /usr/include/_G_config.h /usr/include/wchar.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include/stdarg.h \ - /usr/include/i386-linux-gnu/bits/stdio_lim.h \ - /usr/include/i386-linux-gnu/bits/sys_errlist.h \ - /usr/include/i386-linux-gnu/bits/stdio.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include/stdint.h /usr/include/stdint.h \ - /usr/include/i386-linux-gnu/bits/wchar.h \ - /usr/include/i386-linux-gnu/sys/types.h /usr/include/time.h \ - /usr/include/endian.h /usr/include/i386-linux-gnu/bits/endian.h \ - /usr/include/i386-linux-gnu/bits/byteswap.h \ - /usr/include/i386-linux-gnu/sys/select.h \ - /usr/include/i386-linux-gnu/bits/select.h \ - /usr/include/i386-linux-gnu/bits/sigset.h \ - /usr/include/i386-linux-gnu/bits/time.h \ - /usr/include/i386-linux-gnu/sys/sysmacros.h \ - /usr/include/i386-linux-gnu/bits/pthreadtypes.h \ - /usr/include/i386-linux-gnu/sys/stat.h \ - /usr/include/i386-linux-gnu/bits/stat.h /usr/include/stdlib.h \ - /usr/include/i386-linux-gnu/bits/waitflags.h \ - /usr/include/i386-linux-gnu/bits/waitstatus.h /usr/include/alloca.h \ - /usr/include/string.h /usr/include/xlocale.h \ - /usr/include/i386-linux-gnu/bits/string.h \ - /usr/include/i386-linux-gnu/bits/string2.h /usr/include/strings.h \ - /usr/include/inttypes.h /usr/include/unistd.h \ - /usr/include/i386-linux-gnu/bits/posix_opt.h \ - /usr/include/i386-linux-gnu/bits/environments.h \ - /usr/include/i386-linux-gnu/bits/confname.h /usr/include/getopt.h \ - /usr/include/netinet/in.h /usr/include/i386-linux-gnu/sys/socket.h \ - /usr/include/i386-linux-gnu/sys/uio.h \ - /usr/include/i386-linux-gnu/bits/uio.h \ - /usr/include/i386-linux-gnu/bits/socket.h \ - /usr/include/i386-linux-gnu/bits/sockaddr.h \ - /usr/include/i386-linux-gnu/asm/socket.h \ - /usr/include/asm-generic/socket.h \ - /usr/include/i386-linux-gnu/asm/sockios.h \ - /usr/include/asm-generic/sockios.h /usr/include/i386-linux-gnu/bits/in.h \ - /usr/include/netinet/tcp.h /usr/include/arpa/nameser.h \ - /usr/include/i386-linux-gnu/sys/param.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/limits.h \ - /usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/syslimits.h \ - /usr/include/limits.h /usr/include/i386-linux-gnu/bits/posix1_lim.h \ - /usr/include/i386-linux-gnu/bits/local_lim.h /usr/include/linux/limits.h \ - /usr/include/i386-linux-gnu/bits/posix2_lim.h /usr/include/linux/param.h \ - /usr/include/i386-linux-gnu/asm/param.h /usr/include/asm-generic/param.h \ - /usr/include/i386-linux-gnu/sys/bitypes.h \ - /usr/include/arpa/nameser_compat.h /usr/include/netdb.h \ - /usr/include/rpc/netdb.h /usr/include/i386-linux-gnu/bits/netdb.h \ - /usr/include/malloc.h /usr/include/ctype.h include/antlr3interfaces.h \ - include/antlr3convertutf.h include/antlr3baserecognizer.h \ - include/antlr3exception.h include/antlr3input.h include/antlr3string.h \ - include/antlr3collections.h include/antlr3bitset.h \ - include/antlr3commontoken.h include/antlr3intstream.h \ - include/antlr3tokenstream.h include/antlr3debugeventlistener.h \ - include/antlr3basetree.h include/antlr3commontreenodestream.h \ - include/antlr3commontreeadaptor.h include/antlr3basetreeadaptor.h \ - include/antlr3commontree.h include/antlr3recognizersharedstate.h \ - include/antlr3lexer.h include/antlr3parser.h - -include/antlr3treeparser.h: - -include/antlr3defs.h: - -include/antlr3errors.h: - -antlr3config.h: - -/usr/include/stdio.h: - -/usr/include/features.h: - -/usr/include/i386-linux-gnu/bits/predefs.h: - -/usr/include/i386-linux-gnu/sys/cdefs.h: - -/usr/include/i386-linux-gnu/bits/wordsize.h: - -/usr/include/i386-linux-gnu/gnu/stubs.h: - -/usr/include/i386-linux-gnu/gnu/stubs-32.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include/stddef.h: - -/usr/include/i386-linux-gnu/bits/types.h: - -/usr/include/i386-linux-gnu/bits/typesizes.h: - -/usr/include/libio.h: - -/usr/include/_G_config.h: - -/usr/include/wchar.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include/stdarg.h: - -/usr/include/i386-linux-gnu/bits/stdio_lim.h: - -/usr/include/i386-linux-gnu/bits/sys_errlist.h: - -/usr/include/i386-linux-gnu/bits/stdio.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include/stdint.h: - -/usr/include/stdint.h: - -/usr/include/i386-linux-gnu/bits/wchar.h: - -/usr/include/i386-linux-gnu/sys/types.h: - -/usr/include/time.h: - -/usr/include/endian.h: - -/usr/include/i386-linux-gnu/bits/endian.h: - -/usr/include/i386-linux-gnu/bits/byteswap.h: - -/usr/include/i386-linux-gnu/sys/select.h: - -/usr/include/i386-linux-gnu/bits/select.h: - -/usr/include/i386-linux-gnu/bits/sigset.h: - -/usr/include/i386-linux-gnu/bits/time.h: - -/usr/include/i386-linux-gnu/sys/sysmacros.h: - -/usr/include/i386-linux-gnu/bits/pthreadtypes.h: - -/usr/include/i386-linux-gnu/sys/stat.h: - -/usr/include/i386-linux-gnu/bits/stat.h: - -/usr/include/stdlib.h: - -/usr/include/i386-linux-gnu/bits/waitflags.h: - -/usr/include/i386-linux-gnu/bits/waitstatus.h: - -/usr/include/alloca.h: - -/usr/include/string.h: - -/usr/include/xlocale.h: - -/usr/include/i386-linux-gnu/bits/string.h: - -/usr/include/i386-linux-gnu/bits/string2.h: - -/usr/include/strings.h: - -/usr/include/inttypes.h: - -/usr/include/unistd.h: - -/usr/include/i386-linux-gnu/bits/posix_opt.h: - -/usr/include/i386-linux-gnu/bits/environments.h: - -/usr/include/i386-linux-gnu/bits/confname.h: - -/usr/include/getopt.h: - -/usr/include/netinet/in.h: - -/usr/include/i386-linux-gnu/sys/socket.h: - -/usr/include/i386-linux-gnu/sys/uio.h: - -/usr/include/i386-linux-gnu/bits/uio.h: - -/usr/include/i386-linux-gnu/bits/socket.h: - -/usr/include/i386-linux-gnu/bits/sockaddr.h: - -/usr/include/i386-linux-gnu/asm/socket.h: - -/usr/include/asm-generic/socket.h: - -/usr/include/i386-linux-gnu/asm/sockios.h: - -/usr/include/asm-generic/sockios.h: - -/usr/include/i386-linux-gnu/bits/in.h: - -/usr/include/netinet/tcp.h: - -/usr/include/arpa/nameser.h: - -/usr/include/i386-linux-gnu/sys/param.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/limits.h: - -/usr/lib/gcc/i486-linux-gnu/4.6/include-fixed/syslimits.h: - -/usr/include/limits.h: - -/usr/include/i386-linux-gnu/bits/posix1_lim.h: - -/usr/include/i386-linux-gnu/bits/local_lim.h: - -/usr/include/linux/limits.h: - -/usr/include/i386-linux-gnu/bits/posix2_lim.h: - -/usr/include/linux/param.h: - -/usr/include/i386-linux-gnu/asm/param.h: - -/usr/include/asm-generic/param.h: - -/usr/include/i386-linux-gnu/sys/bitypes.h: - -/usr/include/arpa/nameser_compat.h: - -/usr/include/netdb.h: - -/usr/include/rpc/netdb.h: - -/usr/include/i386-linux-gnu/bits/netdb.h: - -/usr/include/malloc.h: - -/usr/include/ctype.h: - -include/antlr3interfaces.h: - -include/antlr3convertutf.h: - -include/antlr3baserecognizer.h: - -include/antlr3exception.h: - -include/antlr3input.h: - -include/antlr3string.h: - -include/antlr3collections.h: - -include/antlr3bitset.h: - -include/antlr3commontoken.h: - -include/antlr3intstream.h: - -include/antlr3tokenstream.h: - -include/antlr3debugeventlistener.h: - -include/antlr3basetree.h: - -include/antlr3commontreenodestream.h: - -include/antlr3commontreeadaptor.h: - -include/antlr3basetreeadaptor.h: - -include/antlr3commontree.h: - -include/antlr3recognizersharedstate.h: - -include/antlr3lexer.h: - -include/antlr3parser.h: diff --git a/impl/antlr/libantlr3c-3.4/AUTHORS b/impl/antlr/libantlr3c-3.4/AUTHORS deleted file mode 100644 index 9195a9d..0000000 --- a/impl/antlr/libantlr3c-3.4/AUTHORS +++ /dev/null @@ -1,41 +0,0 @@ -The ANTLR recognizer generator tool was written by (with many contributions) - - Prof. Terence Parr at USF - -The C runtime and related C code generation elements were written by - - Jim Idle (jimi idle ws s/ /./g) with no contributions at all because - nobody else was crazy enough to do it. - -The C runtime and the ANLTR tool itself are distributed under the BSD license -which basically gives the right to so anythign with it, so long as you -recognize the authors. See here: - - [The "BSD licence"] - Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC - http://www.temporal-wave.com - http://www.linkedin.com/in/jimidle - - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - 3. The name of the author may not be used to endorse or promote products - derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/impl/antlr/libantlr3c-3.4/C.sln b/impl/antlr/libantlr3c-3.4/C.sln deleted file mode 100644 index f841177..0000000 --- a/impl/antlr/libantlr3c-3.4/C.sln +++ /dev/null @@ -1,53 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 10.00 -# Visual Studio 2008 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "C", "C.vcproj", "{0F0FE03A-78F3-4B34-9DCE-0CDFF1FB5C40}" -EndProject -Global - GlobalSection(SourceCodeControl) = preSolution - SccNumberOfProjects = 2 - SccProjectName0 = Perforce\u0020Project - SccLocalPath0 = ..\\.. - SccProvider0 = MSSCCI:Perforce\u0020SCM - SccProjectFilePathRelativizedFromConnection0 = runtime\\C\\ - SccProjectUniqueName1 = C.vcproj - SccLocalPath1 = ..\\.. - SccProjectFilePathRelativizedFromConnection1 = runtime\\C\\ - EndGlobalSection - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Debug|x64 = Debug|x64 - DebugDLL|Win32 = DebugDLL|Win32 - DebugDLL|x64 = DebugDLL|x64 - Deployment|Win32 = Deployment|Win32 - Deployment|x64 = Deployment|x64 - Release|Win32 = Release|Win32 - Release|x64 = Release|x64 - ReleaseDLL|Win32 = ReleaseDLL|Win32 - ReleaseDLL|x64 = ReleaseDLL|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {0F0FE03A-78F3-4B34-9DCE-0CDFF1FB5C40}.Debug|Win32.ActiveCfg = Debug|Win32 - {0F0FE03A-78F3-4B34-9DCE-0CDFF1FB5C40}.Debug|Win32.Build.0 = Debug|Win32 - {0F0FE03A-78F3-4B34-9DCE-0CDFF1FB5C40}.Debug|x64.ActiveCfg = Debug|x64 - {0F0FE03A-78F3-4B34-9DCE-0CDFF1FB5C40}.Debug|x64.Build.0 = Debug|x64 - {0F0FE03A-78F3-4B34-9DCE-0CDFF1FB5C40}.DebugDLL|Win32.ActiveCfg = DebugDLL|Win32 - {0F0FE03A-78F3-4B34-9DCE-0CDFF1FB5C40}.DebugDLL|Win32.Build.0 = DebugDLL|Win32 - {0F0FE03A-78F3-4B34-9DCE-0CDFF1FB5C40}.DebugDLL|x64.ActiveCfg = DebugDLL|x64 - {0F0FE03A-78F3-4B34-9DCE-0CDFF1FB5C40}.DebugDLL|x64.Build.0 = DebugDLL|x64 - {0F0FE03A-78F3-4B34-9DCE-0CDFF1FB5C40}.Deployment|Win32.ActiveCfg = DebugDLL|Win32 - {0F0FE03A-78F3-4B34-9DCE-0CDFF1FB5C40}.Deployment|Win32.Build.0 = DebugDLL|Win32 - {0F0FE03A-78F3-4B34-9DCE-0CDFF1FB5C40}.Deployment|x64.ActiveCfg = DebugDLL|x64 - {0F0FE03A-78F3-4B34-9DCE-0CDFF1FB5C40}.Deployment|x64.Build.0 = DebugDLL|x64 - {0F0FE03A-78F3-4B34-9DCE-0CDFF1FB5C40}.Release|Win32.ActiveCfg = Release|Win32 - {0F0FE03A-78F3-4B34-9DCE-0CDFF1FB5C40}.Release|Win32.Build.0 = Release|Win32 - {0F0FE03A-78F3-4B34-9DCE-0CDFF1FB5C40}.Release|x64.ActiveCfg = Release|x64 - {0F0FE03A-78F3-4B34-9DCE-0CDFF1FB5C40}.Release|x64.Build.0 = Release|x64 - {0F0FE03A-78F3-4B34-9DCE-0CDFF1FB5C40}.ReleaseDLL|Win32.ActiveCfg = ReleaseDLL|Win32 - {0F0FE03A-78F3-4B34-9DCE-0CDFF1FB5C40}.ReleaseDLL|Win32.Build.0 = ReleaseDLL|Win32 - {0F0FE03A-78F3-4B34-9DCE-0CDFF1FB5C40}.ReleaseDLL|x64.ActiveCfg = ReleaseDLL|x64 - {0F0FE03A-78F3-4B34-9DCE-0CDFF1FB5C40}.ReleaseDLL|x64.Build.0 = ReleaseDLL|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/impl/antlr/libantlr3c-3.4/C.vcproj b/impl/antlr/libantlr3c-3.4/C.vcproj deleted file mode 100644 index 16d9c2b..0000000 --- a/impl/antlr/libantlr3c-3.4/C.vcproj +++ /dev/null @@ -1,1043 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/impl/antlr/libantlr3c-3.4/C.vcproj.vspscc b/impl/antlr/libantlr3c-3.4/C.vcproj.vspscc deleted file mode 100644 index 953a1b9..0000000 --- a/impl/antlr/libantlr3c-3.4/C.vcproj.vspscc +++ /dev/null @@ -1,14 +0,0 @@ -"" -{ -"FILE_VERSION" = "9237" -"ENLISTMENT_CHOICE" = "NEVER" -"PROJECT_FILE_RELATIVE_PATH" = "" -"NUMBER_OF_EXCLUDED_FILES" = "4" -"EXCLUDED_FILE0" = "debugdll\\antlr3cd_dll.lib" -"EXCLUDED_FILE1" = "releasedll\\antlr3c_dll.lib" -"EXCLUDED_FILE2" = "debugdll\\antlr3cd_dll.exp" -"EXCLUDED_FILE3" = "releasedll\\antlr3c_dll.exp" -"ORIGINAL_PROJECT_FILE_PATH" = "" -"NUMBER_OF_NESTED_PROJECTS" = "0" -"SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER" -} diff --git a/impl/antlr/libantlr3c-3.4/C.vssscc b/impl/antlr/libantlr3c-3.4/C.vssscc deleted file mode 100644 index 6cb031b..0000000 --- a/impl/antlr/libantlr3c-3.4/C.vssscc +++ /dev/null @@ -1,10 +0,0 @@ -"" -{ -"FILE_VERSION" = "9237" -"ENLISTMENT_CHOICE" = "NEVER" -"PROJECT_FILE_RELATIVE_PATH" = "" -"NUMBER_OF_EXCLUDED_FILES" = "0" -"ORIGINAL_PROJECT_FILE_PATH" = "" -"NUMBER_OF_NESTED_PROJECTS" = "0" -"SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROJECT" -} diff --git a/impl/antlr/libantlr3c-3.4/COPYING b/impl/antlr/libantlr3c-3.4/COPYING deleted file mode 100644 index f62f896..0000000 --- a/impl/antlr/libantlr3c-3.4/COPYING +++ /dev/null @@ -1,29 +0,0 @@ -// [The "BSD licence"] -// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC -// http://www.temporal-wave.com -// http://www.linkedin.com/in/jimidle -// -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions -// are met: -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// 3. The name of the author may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - diff --git a/impl/antlr/libantlr3c-3.4/ChangeLog b/impl/antlr/libantlr3c-3.4/ChangeLog deleted file mode 100644 index c5540d9..0000000 --- a/impl/antlr/libantlr3c-3.4/ChangeLog +++ /dev/null @@ -1,550 +0,0 @@ -The following changes (change numbers refer to perforce) were -made from version 3.1.1 to 3.1.2 - -Runtime -------- - -Change 5641 on 2009/02/20 by jimi@jimi.jimi.antlr3 - - Release version 3.1.2 of the ANTLR C runtime. - - Updated documents and release notes will have to follow later. - -Change 5639 on 2009/02/20 by jimi@jimi.jimi.antlr3 - - Fixed: ANTLR-356 - - Ensure that code generation for C++ does not require casts - -Change 5577 on 2009/02/12 by jimi@jimi.jimi.antlr3 - - C Runtime - Bug fixes. - - o Having moved to use an extract directly from a vector for returning - tokens, it exposed a - bug whereby the EOF boudary calculation in tokLT was incorrectly - checking > rather than >=. - o Changing to API initialization of tokens rather than memcmp() - incorrectly forgot to set teh input stream pointer for the - manufactured tokens in the token factory; - o Rewrite streams for rewriting tree parsers did not check whether the - rewrite stream was ever assigned before trying to free it, it is now - in line with the ordinary parser code. - -Change 5576 on 2009/02/11 by jimi@jimi.jimi.antlr3 - - C Runtime: Ensure that when we manufacture a new token for a missing - token, that the user suplied custom information (if any) is copied - from the current token. - -Change 5575 on 2009/02/08 by jimi@jimi.jimi.antlr3 - - C Runtime - Vastly improve the reuse of allocated memory for nodes in - tree rewriting. - - A problem for all targets at the moment si that the rewrite logic - generated by ANTLR makes no attempt - to reuse any resources, it merely gurantees that the tree shape at the - end is correct. To some extent this is mitigated by the garbage - collection systems of Java and .Net, even thoguh it is still an overhead to - keep creating so many modes. - - This change implements the first of two C runtime changes that make - best efforst to track when a node has become orphaned and will never - be reused, based on inherent knowledge of the rewrite logic (which in - the long term is not a great soloution). - - Much of the rewrite logic consists of creating a niilnode into which - child nodes are appended. At: rulePost processing time; when a rewrite - stream is closed; and when becomeRoot is called, there are many situations - where the root of the tree that will be manipulted, or is finished with - (in the case of rewrtie streams), where the nilNode was just a temporary - creation for the sake of the rewrite itself. - - In these cases we can see that the nilNode would just be left ot rot in - the node factory that tracks all the tree nodes. - Rather than leave these in the factory to rot, we now keep a resuse - stck and always reuse any node on this - stack before claimin a new node from the factory pool. - - This single change alone reduces memory usage in the test case (20,604 - line C program and a GNU C parser) - from nearly a GB, to 276MB. This is still way more memory than we - shoudl need to do this operation, even on such a large input file, - but the reduction results in a huge performance increase and greatly - reduced system time spent on allocations. - - After this optimizatoin, comparison with gcc yeilds: - - time gcc -S a.c - a.c:1026: warning: conflicting types for built-in function ‘vsprintf’ - a.c:1030: warning: conflicting types for built-in function ‘vsnprintf’ - a.c:1041: warning: conflicting types for built-in function ‘vsscanf’ - 0.21user 0.01system 0:00.22elapsed 97%CPU (0avgtext+0avgdata 0maxresident)k - 0inputs+240outputs (0major+8345minor)pagefaults 0swaps - - and - - time ./jimi - Reading a.c - 0.28user 0.11system 0:00.39elapsed 98%CPU (0avgtext+0avgdata 0maxresident)k - 0inputs+0outputs (0major+66609minor)pagefaults 0swaps - - And we can now interpolate the fact that the only major differnce is - now the huge disparity in memory allocations. A - future optimization of vector pooling, to sepate node resue from vector - reuse, currently looks promising for further reuse of memory. - - Finally, a static analysis of the rewrte code, plus a realtime analysis - of the heap at runtime, may well give us a reasonable memory usage - pattern. In reality though, it is the generated rewrite logic - that must becom optional at not continuously rewriting things that it - need not, as it ascends the rule chain. - -Change 5563 on 2009/01/28 by jimi@jimi.jimi.antlr3 - - Allow rewrite streams to use the base adaptors vector factory and not - try to malloc new vectors themselves. - -Change 5562 on 2009/01/28 by jimi@jimi.jimi.antlr3 - - Don't use CALLOC to allocate tree pools, use malloc as there is no need - for calloc. - -Change 5561 on 2009/01/28 by jimi@jimi.jimi.antlr3 - - Prevent warnigsn about retval.stop not being initialized when a rule - returns eraly because it is in backtracking mode - -Change 5558 on 2009/01/28 by jimi@jimi.jimi.antlr3 - - Lots of optimizations (though the next one to be checked in is the huge - win) for AST building and vector factories. - - A large part of tree rewriting was the creation of vectors to hold AST - nodes. Although I had created a vector factory, for some reason I never got - around to creating a proper one, that pre-allocated the vectors in chunks and - so on. I guess I just forgot to. Hence a big win here is prevention of calling - malloc lots and lots of times to create vectors. - - A second inprovement was to change teh vector definition such that it - holds a certain number of elements wihtin the vector structure itself, rather - than malloc and freeing these. Currently this is set to 8, but may increase. - For AST construction, this is generally a big win because AST nodes don't often - have many individual children unless there has not been any shaping going on in - the parser. But if you are not shaping, then you don't really need a tree. - - Other perforamnce inprovements here include not calling functions - indirectly within token stream and common token stream. Hence tokens are - claimed directly from the vectors. Users can override these funcitons of course - and all this means is that if you override tokenstreams then you pretty much - have to provide all the mehtods, but then I think you woudl have to anyway (and - I don't know of anyone that has wanted to do this as you can carry your own - structure around with the tokens anyway and that is much easier). - -Change 5555 on 2009/01/26 by jimi@jimi.jimi.antlr3 - - Fixed: ANTLR-288 - Correct the interpretation of the skip token such that channel, start - index, char pos in lie, start line and text are correctly reset to the start of - the new token when the one that we just traversed was marked as being skipped. - - This correctly excludes the text that was matched as part of the - SKIP()ed token from the next token in the token stream and so has the side - effect that asking for $text of a rule no longer includes the text that shuodl - be skipped, but DOES include the text of tokens that were merely placed off the - default channel. - -Change 5551 on 2009/01/25 by jimi@jimi.jimi.antlr3 - - Fixed: ANTLR-287 - Most of the source files did not include the BSD license. THis might - not be that big a deal given that I don't care what people do with it - other than take my name off it, but having the license reproduced - everywhere - at least makes things perfectly clear. Hence this mass change of - sources and templates - to include the license. - -Change 5550 on 2009/01/25 by jimi@jimi.jimi.antlr3 - - Fixed: ANTLR-365 - Ensure that as soon as we known about an input stream on the lexer that - we borrow its string factroy adn use it in our EOF token in case - anyone tries to make it a string, such as in error messages for - instance. - -Change 5548 on 2009/01/25 by jimi@jimi.jimi.antlr3 - - Fixed: ANTLR-363 - At some point the Java runtime default changed from discarding offchannel - tokens to preserving them. The fix is to make the C runtime also - default to preserving off-channel tokens. - -Change 5544 on 2009/01/24 by jimi@jimi.jimi.antlr3 - - Fixed: ANTLR-360 - Ensure that the fillBuffer funtiion does not call any methods - that require the cached buffer size to be recorded before we - have actually recorded it. - -Change 5543 on 2009/01/24 by jimi@jimi.jimi.antlr3 - - Fixed: ANTLR-362 - Some users have started using string factories themselves and - exposed a flaw in the destroy method, that is intended to remove - a strng htat was created by the factory and is no longer needed. - The string was correctly removed from the vector that tracks them - but after the first one, all the remaining strings are then numbered - incorrectly. Hence the destroy method has been recoded to reindex - the strings in the factory after one is removed and everythig is once - more hunky dory. - User suggested fix rejected. - -Change 5542 on 2009/01/24 by jimi@jimi.jimi.antlr3 - - Fixed ANTLR-366 - The recognizer state now ensures that all fields are set to NULL upon -creation - and the reset does not overwrite the tokenname array - -Change 5527 on 2009/01/15 by jimi@jimi.jimi.antlr3 - - Add the C runtime for 3.1.2 beta2 to perforce - -Change 5526 on 2009/01/15 by jimi@jimi.jimivista.antlr3 - - Correctly define the MEMMOVE macro which was inadvertently left to be - memcpy. - -Change 5503 on 2008/12/12 by jimi@jimi.jimi.antlr3 - - Change C runtime release number to 3.1.2 beta - -Change 5473 on 2008/12/01 by jimi@jimi.jimivista.antlr3 - - Fixed: ANTLR-350 - C runtime use of memcpy - Prior change to use memcpy instead of memmove in all cases missed the - fact that the string factory can be in a situation where overlaps occur. We now - have ANTLR3_MEMCPY and ANTLR3_MEMMOVE and use the two appropriately. - -Change 5471 on 2008/12/01 by jimi@jimi.jimivista.antlr3 - - Fixed ANTLR-361 - - Ensure that ANTLR3_BOOLEAN is typedef'ed correctly when building for - MingW - -Templates ---------- - -Change 5637 on 2009/02/20 by jimi@jimi.jimi.antlr3 - - C rtunime - make sure that ADAPTOR results are cast to the tree type on - a rewrite - -Change 5620 on 2009/02/18 by jimi@jimi.jimi.antlr3 - - Rename/Move: - From: //depot/code/antlr/main/src/org/antlr/codegen/templates/... - To: //depot/code/antlr/main/src/main/resources/org/antlr/codegen/templates/... - - Relocate the code generating templates to exist in the directory set - that maven expects. - - When checking in your templates, you may find it easiest to make a copy - of what you have, revert the change in perforce, then just check out the - template in the new location, and copy the changes back over. Nobody has oore - than two files open at the moment. - -Change 5578 on 2009/02/12 by jimi@jimi.jimi.antlr3 - - Correct the string template escape sequences for generating scope - code in the C templates. - -Change 5577 on 2009/02/12 by jimi@jimi.jimi.antlr3 - - C Runtime - Bug fixes. - - o Having moved to use an extract directly from a vector for returning - tokens, it exposed a - bug whereby the EOF boudary calculation in tokLT was incorrectly - checking > rather than - >=. - o Changing to API initialization of tokens rather than memcmp() - incorrectly forgot to - set teh input stream pointer for the manufactured tokens in the - token factory; - o Rewrite streams for rewriting tree parsers did not check whether the - rewrite stream - was ever assigned before trying to free it, it is now in line with - the ordinary parser code. - -Change 5567 on 2009/01/29 by jimi@jimi.jimi.antlr3 - - C Runtime - Further Optimizations - - Within grammars that used scopes and were intended to parse large - inputs with many rule nests, - the creation anf deletion of the scopes themselves became significant. - Careful analysis shows that - for most grammars, while a parse could create and delete 20,000 scopes, - the maxium depth of - any scope was only 8. - - This change therefore changes the scope implementation so that it does - not free scope memory when - it is popped but just tracks it in a C runtime stack, eventually - freeing it when the stack is freed. This change - caused the allocation of only 12 scope structures instead of 20,000 for - the extreme example case. - - This change means that scope users must be carefule (as ever in C) to - initializae their scope elements - correctly as: - - 1) If not you may inherit values from a prior use of the scope - structure; - 2) SCope structure are now allocated with malloc and not calloc; - - Also, when using a custom free function to clean a scope when it is - popped, it is probably a good idea - to set any free'd pointers to NULL (this is generally good C programmig - practice in any case) - -Change 5566 on 2009/01/29 by jimi@jimi.jimi.antlr3 - - Remove redundant BACKTRACK checking so that MSVC9 does not get confused - about possibly uninitialized variables - -Change 5565 on 2009/01/28 by jimi@jimi.jimi.antlr3 - - Use malloc rather than calloc to allocate memory for new scopes. Note - that this means users will have to be careful to initialize any values in their - scopes that they expect to be 0 or NULL and I must document this. - -Change 5564 on 2009/01/28 by jimi@jimi.jimi.antlr3 - - Use malloc rather than calloc for copying list lable tokens for - rewrites. - -Change 5561 on 2009/01/28 by jimi@jimi.jimi.antlr3 - - Prevent warnigsn about retval.stop not being initialized when a rule - returns eraly because it is in backtracking mode - -Change 5560 on 2009/01/28 by jimi@jimi.jimi.antlr3 - - Add a NULL check before freeing rewrite streams used in AST rewrites - rather than auto-rewrites. - - While the NULL check is redundant as the free cannot be called unless - it is assigned, Visual Studio C 2008 - gets it wrong and thinks that there is a PATH than can arrive at the - free wihtout it being assigned and that is too annoying to ignore. - -Change 5559 on 2009/01/28 by jimi@jimi.jimi.antlr3 - - C target Tree rewrite optimization - - There is only one optimization in this change, but it is a huge one. - - The code generation templates were set up so that at the start of a rule, - any rewrite streams mentioned in the rule wer pre-created. However, this - is a massive overhead for rules where only one or two of the streams are - actually used, as we create them then free them without ever using them. - This was copied from the Java templates basically. - This caused literally millions of extra calls and vector allocations - in the case of the GNU C parser given to me for testing with a 20,000 - line program. - - After this change, the following comparison is avaiable against the gcc - compiler: - - Before (different machines here so use the relative difference for - comparison): - - gcc: - - real 0m0.425s - user 0m0.384s - sys 0m0.036s - - ANTLR C - real 0m1.958s - user 0m1.284s - sys 0m0.656s - - After the previous optimizations for vector pooling via a factory, - plus this huge win in removing redundant code, we have the following - (different machine to the one above): - - gcc: - 0.21user 0.01system 0:00.23elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k - 0inputs+328outputs (0major+9922minor)pagefaults 0swaps - - ANTLR C: - - 0.37user 0.26system 0:00.64elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k - 0inputs+0outputs (0major+130944minor)pagefaults 0swaps - - The extra system time coming from the fact that although the tree - rewriting is now optimal in terms of not allocating things it does - not need, there is still a lot more overhead in a parser that is generated - for generic use, including much more use of structures for tokens and extra - copying and so on. I will - continue to work on improviing things where I can, but the next big - improvement will come from Ter's optimization of the actual code structures we - generate including not doing things with rewrite streams that we do not need to - do at all. - - The second machine I used is about twice as fast CPU wise as the system - that was used originally by the user that asked about this performance. - -Change 5558 on 2009/01/28 by jimi@jimi.jimi.antlr3 - - Lots of optimizations (though the next one to be checked in is the huge - win) for AST building and vector factories. - - A large part of tree rewriting was the creation of vectors to hold AST - nodes. Although I had created a vector factory, for some reason I never got - around to creating a proper one, that pre-allocated the vectors in chunks and - so on. I guess I just forgot to. Hence a big win here is prevention of calling - malloc lots and lots of times to create vectors. - - A second inprovement was to change teh vector definition such that it - holds a certain number of elements wihtin the vector structure itself, rather - than malloc and freeing these. Currently this is set to 8, but may increase. - For AST construction, this is generally a big win because AST nodes don't often - have many individual children unless there has not been any shaping going on in - the parser. But if you are not shaping, then you don't really need a tree. - - Other perforamnce inprovements here include not calling functions - indirectly within token stream and common token stream. Hence tokens are - claimed directly from the vectors. Users can override these funcitons of course - and all this means is that if you override tokenstreams then you pretty much - have to provide all the mehtods, but then I think you woudl have to anyway (and - I don't know of anyone that has wanted to do this as you can carry your own - structure around with the tokens anyway and that is much easier). - -Change 5554 on 2009/01/26 by jimi@jimi.jimi.antlr3 - - Fixed: ANTLR-379 - For some reason in the past, the ruleMemozation() template had required - that the name parameter be set to the rule name. This does not seem to be a - requirement any more. The name=xxx override when invoking the template was - causing all the scope names derived when cleaning up in memoization to be - called after the rule name, which was not correct. Howver, this only affected - the output when in output=AST mode. - - This template invocation is now corrected. - -Change 5553 on 2009/01/26 by jimi@jimi.jimi.antlr3 - - Fixed: ANTLR-330 - Managed to get the one rule that could not see the ASTLabelType to call - back in to the super template C.stg and ask it to construct hte name. I am not - 100% sure that this fixes all cases, but I cannot find any that fail. PLease - let me know if you find any exampoles of being unable to default the - ASTLabelType option in the C target. - -Change 5552 on 2009/01/25 by jimi@jimi.jimi.antlr3 - - Progress: ANTLR-327 - Fix debug code generation templates when output=AST such that code - can at least be generated and I can debug the output code correctly. - Note that this checkin does not implement the debugging requirements - for tree generating parsers. - -Change 5551 on 2009/01/25 by jimi@jimi.jimi.antlr3 - - Fixed: ANTLR-287 - Most of the source files did not include the BSD license. THis might - not be that big a deal given that I don't care what people do with it - other than take my name off it, but having the license reproduced - everywhere at least makes things perfectly clear. Hence this mass change of - sources and templates to include the license. - -Change 5549 on 2009/01/25 by jimi@jimi.jimi.antlr3 - - Fixed: ANTLR-354 - Using 0.0D as the default initialize value for a double caused - VS 2003 C compiler to bomb out. There seesm to be no reason other - than force of habit to set this to 0.0D so I have dropped the D so - that older compilers do not complain. - -Change 5547 on 2009/01/25 by jimi@jimi.jimi.antlr3 - - Fixed: ANTLR-282 - All references are now unadorned with any type of NULL check for the - following reasons: - - 1) A NULL reference means that there is a problem with the - grammar and we need the program to fail immediately so - that the programmer can work out where the problem occured; - 2) Most of the time, the only sensible value that can be - returned is NULL or 0 which - obviates the NULL check in the first place; - 3) If we replace a NULL reference with some value such as 0, - then the program may blithely continue but just do something - logically wrong, which will be very difficult for the - grammar programmer to detect and correct. - -Change 5545 on 2009/01/24 by jimi@jimi.jimi.antlr3 - - Fixed: ANTLR-357 - The bug report was correct in that the types of references to things - like $start were being incorrectly cast as they wer not changed from - Java style casts (and the casts are unneccessary). this is now fixed - and references are referencing the correct, uncast, types. - However, the bug report was wrong in that the reference in the bok to - $start.pos will only work for Java and really, it is incorrect in the - book because it shoudl not access the .pos member directly but shudl - be using $start.getCharPositionInLine(). - Because there is no access qualification in C, one could use - $start.charPosition, however - really this should be $start->getCharPositionInLine($start); - -Change 5541 on 2009/01/24 by jimi@jimi.jimi.antlr3 - - Fixed - ANTLR-367 - The code generation for the free method of a recognizer was not - distinguishing tree parsers from parsers when it came to calling delegate free - functions. - This is now corrected. - -Change 5540 on 2009/01/24 by jimi@jimi.jimi.antlr3 - - Fixed ANTLR-355 - Ensure that we do not attempt to free any memory that we did not - actually allocate because the parser rule was being executed in - backtracking mode. - -Change 5539 on 2009/01/24 by jimi@jimi.jimivista.antlr3 - - Fixed: ANTLR-355 - When a C targetted parser is producing in backtracking mode, then the - creation of new stream rewrite structures shoudl not happen if the rule is - currently backtracking - -Change 5502 on 2008/12/11 by jimi@jimi.jimi.antlr3 - - Fixed: ANTLR-349 Ensure that all marker labels in the lexer are 64 bit - compatible - -Change 5473 on 2008/12/01 by jimi@jimi.jimivista.antlr3 - - Fixed: ANTLR-350 - C runtime use of memcpy - Prior change to use memcpy instead of memmove in all cases missed the - fact that the string factory can be in a situation where overlaps occur. We now - have ANTLR3_MEMCPY and ANTLR3_MEMMOVE and use the two appropriately. - -Change 5387 on 2008/11/05 by parrt@parrt.spork - - Fixed x+=. issue with tree grammars; added unit test - -Change 5325 on 2008/10/23 by parrt@parrt.spork - - We were all ref'ing backtracking==0 hardcoded instead checking the - @synpredgate action. - - diff --git a/impl/antlr/libantlr3c-3.4/INSTALL b/impl/antlr/libantlr3c-3.4/INSTALL deleted file mode 100644 index 7d1c323..0000000 --- a/impl/antlr/libantlr3c-3.4/INSTALL +++ /dev/null @@ -1,365 +0,0 @@ -Installation Instructions -************************* - -Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005, -2006, 2007, 2008, 2009 Free Software Foundation, Inc. - - Copying and distribution of this file, with or without modification, -are permitted in any medium without royalty provided the copyright -notice and this notice are preserved. This file is offered as-is, -without warranty of any kind. - -Basic Installation -================== - - Briefly, the shell commands `./configure; make; make install' should -configure, build, and install this package. The following -more-detailed instructions are generic; see the `README' file for -instructions specific to this package. Some packages provide this -`INSTALL' file but do not implement all of the features documented -below. The lack of an optional feature in a given package is not -necessarily a bug. More recommendations for GNU packages can be found -in *note Makefile Conventions: (standards)Makefile Conventions. - - The `configure' shell script attempts to guess correct values for -various system-dependent variables used during compilation. It uses -those values to create a `Makefile' in each directory of the package. -It may also create one or more `.h' files containing system-dependent -definitions. Finally, it creates a shell script `config.status' that -you can run in the future to recreate the current configuration, and a -file `config.log' containing compiler output (useful mainly for -debugging `configure'). - - It can also use an optional file (typically called `config.cache' -and enabled with `--cache-file=config.cache' or simply `-C') that saves -the results of its tests to speed up reconfiguring. Caching is -disabled by default to prevent problems with accidental use of stale -cache files. - - If you need to do unusual things to compile the package, please try -to figure out how `configure' could check whether to do them, and mail -diffs or instructions to the address given in the `README' so they can -be considered for the next release. If you are using the cache, and at -some point `config.cache' contains results you don't want to keep, you -may remove or edit it. - - The file `configure.ac' (or `configure.in') is used to create -`configure' by a program called `autoconf'. You need `configure.ac' if -you want to change it or regenerate `configure' using a newer version -of `autoconf'. - - The simplest way to compile this package is: - - 1. `cd' to the directory containing the package's source code and type - `./configure' to configure the package for your system. - - Running `configure' might take a while. While running, it prints - some messages telling which features it is checking for. - - 2. Type `make' to compile the package. - - 3. Optionally, type `make check' to run any self-tests that come with - the package, generally using the just-built uninstalled binaries. - - 4. Type `make install' to install the programs and any data files and - documentation. When installing into a prefix owned by root, it is - recommended that the package be configured and built as a regular - user, and only the `make install' phase executed with root - privileges. - - 5. Optionally, type `make installcheck' to repeat any self-tests, but - this time using the binaries in their final installed location. - This target does not install anything. Running this target as a - regular user, particularly if the prior `make install' required - root privileges, verifies that the installation completed - correctly. - - 6. 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. - - 7. Often, you can also type `make uninstall' to remove the installed - files again. In practice, not all packages have tested that - uninstallation works correctly, even though it is required by the - GNU Coding Standards. - - 8. Some packages, particularly those that use Automake, provide `make - distcheck', which can by used by developers to test that all other - targets like `make install' and `make uninstall' work correctly. - This target is generally not run by end users. - -Compilers and Options -===================== - - Some systems require unusual options for compilation or linking that -the `configure' script does not know about. Run `./configure --help' -for details on some of the pertinent environment variables. - - You can give `configure' initial values for configuration parameters -by setting variables in the command line or in the environment. Here -is an example: - - ./configure CC=c99 CFLAGS=-g LIBS=-lposix - - *Note Defining Variables::, for more details. - -Compiling For Multiple Architectures -==================================== - - You can compile the package for more than one kind of computer at the -same time, by placing the object files for each architecture in their -own directory. To do this, you can use GNU `make'. `cd' to the -directory where you want the object files and executables to go and run -the `configure' script. `configure' automatically checks for the -source code in the directory that `configure' is in and in `..'. This -is known as a "VPATH" build. - - With a non-GNU `make', it is safer to compile the package for one -architecture at a time in the source code directory. After you have -installed the package for one architecture, use `make distclean' before -reconfiguring for another architecture. - - On MacOS X 10.5 and later systems, you can create libraries and -executables that work on multiple system types--known as "fat" or -"universal" binaries--by specifying multiple `-arch' options to the -compiler but only a single `-arch' option to the preprocessor. Like -this: - - ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ - CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \ - CPP="gcc -E" CXXCPP="g++ -E" - - This is not guaranteed to produce working output in all cases, you -may have to build one architecture at a time and combine the results -using the `lipo' tool if you have problems. - -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', where PREFIX must be an -absolute file name. - - 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. In general, the -default for these options is expressed in terms of `${prefix}', so that -specifying just `--prefix' will affect all of the other directory -specifications that were not explicitly provided. - - The most portable way to affect installation locations is to pass the -correct locations to `configure'; however, many packages provide one or -both of the following shortcuts of passing variable assignments to the -`make install' command line to change installation locations without -having to reconfigure or recompile. - - The first method involves providing an override variable for each -affected directory. For example, `make install -prefix=/alternate/directory' will choose an alternate location for all -directory configuration variables that were expressed in terms of -`${prefix}'. Any directories that were specified during `configure', -but not in terms of `${prefix}', must each be overridden at install -time for the entire installation to be relocated. The approach of -makefile variable overrides for each directory variable is required by -the GNU Coding Standards, and ideally causes no recompilation. -However, some platforms have known limitations with the semantics of -shared libraries that end up requiring recompilation when using this -method, particularly noticeable in packages that use GNU Libtool. - - The second method involves providing the `DESTDIR' variable. For -example, `make install DESTDIR=/alternate/directory' will prepend -`/alternate/directory' before all installation names. The approach of -`DESTDIR' overrides is not required by the GNU Coding Standards, and -does not work on platforms that have drive letters. On the other hand, -it does better at avoiding recompilation issues, and works well even -when some directory options were not specified in terms of `${prefix}' -at `configure' time. - -Optional Features -================= - - 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'. - - 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. - - Some packages offer the ability to configure how verbose the -execution of `make' will be. For these packages, running `./configure ---enable-silent-rules' sets the default to minimal output, which can be -overridden with `make V=1'; while running `./configure ---disable-silent-rules' sets the default to verbose, which can be -overridden with `make V=0'. - -Particular systems -================== - - On HP-UX, the default C compiler is not ANSI C compatible. If GNU -CC is not installed, it is recommended to use the following options in -order to use an ANSI C compiler: - - ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" - -and if that doesn't work, install pre-built binaries of GCC for HP-UX. - - On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot -parse its `' header file. The option `-nodtk' can be used as -a workaround. If GNU CC is not installed, it is therefore recommended -to try - - ./configure CC="cc" - -and if that doesn't work, try - - ./configure CC="cc -nodtk" - - On Solaris, don't put `/usr/ucb' early in your `PATH'. This -directory contains several dysfunctional programs; working variants of -these programs are available in `/usr/bin'. So, if you need `/usr/ucb' -in your `PATH', put it _after_ `/usr/bin'. - - On Haiku, software installed for all users goes in `/boot/common', -not `/usr/local'. It is recommended to use the following options: - - ./configure --prefix=/boot/common - -Specifying the System Type -========================== - - There may be some features `configure' cannot figure out -automatically, but needs to determine by the type of machine the package -will run on. Usually, assuming the package is built to be run on the -_same_ architectures, `configure' can figure that out, but if it prints -a message saying it cannot guess the machine type, give it the -`--build=TYPE' option. TYPE can either be a short name for the system -type, such as `sun4', or a canonical name which has the form: - - CPU-COMPANY-SYSTEM - -where SYSTEM can have one of these forms: - - OS - KERNEL-OS - - See the file `config.sub' for the possible values of each field. If -`config.sub' isn't included in this package, then this package doesn't -need to know the machine type. - - If you are _building_ compiler tools for cross-compiling, you should -use the option `--target=TYPE' to select the type of system they will -produce code for. - - If you want to _use_ a cross compiler, that generates code for a -platform different from the build platform, you should specify the -"host" platform (i.e., that on which the generated programs will -eventually be run) with `--host=TYPE'. - -Sharing Defaults -================ - - If you want to set default values for `configure' scripts to share, -you can create a site shell script called `config.site' that gives -default values for variables like `CC', `cache_file', and `prefix'. -`configure' looks for `PREFIX/share/config.site' if it exists, then -`PREFIX/etc/config.site' if it exists. Or, you can set the -`CONFIG_SITE' environment variable to the location of the site script. -A warning: not all `configure' scripts look for a site script. - -Defining Variables -================== - - Variables not defined in a site shell script can be set in the -environment passed to `configure'. However, some packages may run -configure again during the build, and the customized values of these -variables may be lost. In order to avoid this problem, you should set -them in the `configure' command line, using `VAR=value'. For example: - - ./configure CC=/usr/local2/bin/gcc - -causes the specified `gcc' to be used as the C compiler (unless it is -overridden in the site shell script). - -Unfortunately, this technique does not work for `CONFIG_SHELL' due to -an Autoconf bug. Until the bug is fixed you can use this workaround: - - CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash - -`configure' Invocation -====================== - - `configure' recognizes the following options to control how it -operates. - -`--help' -`-h' - Print a summary of all of the options to `configure', and exit. - -`--help=short' -`--help=recursive' - Print a summary of the options unique to this package's - `configure', and exit. The `short' variant lists options used - only in the top level, while the `recursive' variant lists options - also present in any nested packages. - -`--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. - -`--prefix=DIR' - Use DIR as the installation prefix. *note Installation Names:: - for more details, including other options available for fine-tuning - the installation locations. - -`--no-create' -`-n' - Run the configure checks, but stop before creating any output - files. - -`configure' also accepts some other, not widely useful, options. Run -`configure --help' for more details. - diff --git a/impl/antlr/libantlr3c-3.4/Makefile b/impl/antlr/libantlr3c-3.4/Makefile deleted file mode 100644 index 1f6a077..0000000 --- a/impl/antlr/libantlr3c-3.4/Makefile +++ /dev/null @@ -1,968 +0,0 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. -# Makefile. Generated from Makefile.in by configure. - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 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. - - - - - -pkgdatadir = $(datadir)/libantlr3c -pkgincludedir = $(includedir)/libantlr3c -pkglibdir = $(libdir)/libantlr3c -pkglibexecdir = $(libexecdir)/libantlr3c -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = x86_64-unknown-linux-gnu -host_triplet = x86_64-unknown-linux-gnu -subdir = . -DIST_COMMON = README $(am__configure_deps) $(include_HEADERS) \ - $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ - $(srcdir)/antlr3config.h.in $(top_srcdir)/configure AUTHORS \ - COPYING ChangeLog INSTALL NEWS config.guess config.sub depcomp \ - install-sh ltmain.sh missing -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(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 = antlr3config.h -CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; -am__install_max = 40 -am__nobase_strip_setup = \ - srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` -am__nobase_strip = \ - for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" -am__nobase_list = $(am__nobase_strip_setup); \ - for p in $$list; do echo "$$p $$p"; done | \ - sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ - $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ - if (++n[$$2] == $(am__install_max)) \ - { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ - END { for (dir in files) print dir, files[dir] }' -am__base_list = \ - sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ - sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)" -LTLIBRARIES = $(lib_LTLIBRARIES) -libantlr3c_la_LIBADD = -am__objects_1 = antlr3baserecognizer.lo antlr3basetree.lo \ - antlr3basetreeadaptor.lo antlr3bitset.lo antlr3collections.lo \ - antlr3commontoken.lo antlr3commontree.lo \ - antlr3commontreeadaptor.lo antlr3commontreenodestream.lo \ - antlr3convertutf.lo antlr3cyclicdfa.lo antlr3debughandlers.lo \ - antlr3encodings.lo antlr3exception.lo antlr3filestream.lo \ - antlr3inputstream.lo antlr3intstream.lo antlr3lexer.lo \ - antlr3parser.lo antlr3rewritestreams.lo antlr3string.lo \ - antlr3tokenstream.lo antlr3treeparser.lo -am_libantlr3c_la_OBJECTS = $(am__objects_1) -libantlr3c_la_OBJECTS = $(am_libantlr3c_la_OBJECTS) -libantlr3c_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(libantlr3c_la_LDFLAGS) $(LDFLAGS) -o $@ -DEFAULT_INCLUDES = -I. -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -am__mv = mv -f -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ - $(LDFLAGS) -o $@ -SOURCES = $(libantlr3c_la_SOURCES) -DIST_SOURCES = $(libantlr3c_la_SOURCES) -HEADERS = $(include_HEADERS) -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 -GZIP_ENV = --best -distuninstallcheck_listfiles = find . -type f -print -distcleancheck_listfiles = find . -type f -print -ACLOCAL = ${SHELL} /home/carlo/laptop-repository/impl/antlr/libantlr3c-3.4/missing --run aclocal-1.11 -AMTAR = ${SHELL} /home/carlo/laptop-repository/impl/antlr/libantlr3c-3.4/missing --run tar -AR = ar -AUTOCONF = ${SHELL} /home/carlo/laptop-repository/impl/antlr/libantlr3c-3.4/missing --run autoconf -AUTOHEADER = ${SHELL} /home/carlo/laptop-repository/impl/antlr/libantlr3c-3.4/missing --run autoheader -AUTOMAKE = ${SHELL} /home/carlo/laptop-repository/impl/antlr/libantlr3c-3.4/missing --run automake-1.11 -AWK = mawk -CC = gcc -CCDEPMODE = depmode=gcc3 -CFLAGS = -m32 -O2 -Wall -CPP = gcc -E -CPPFLAGS = -CYGPATH_W = echo -DEFS = -DHAVE_CONFIG_H -DEPDIR = .deps -DSYMUTIL = -DUMPBIN = -ECHO_C = -ECHO_N = -n -ECHO_T = -EGREP = /bin/grep -E -EXEEXT = -FGREP = /bin/grep -F -GREP = /bin/grep -INSTALL = /usr/bin/install -c -INSTALL_DATA = ${INSTALL} -m 644 -INSTALL_PROGRAM = ${INSTALL} -INSTALL_SCRIPT = ${INSTALL} -INSTALL_STRIP_PROGRAM = $(install_sh) -c -s -LD = /usr/bin/ld -m elf_x86_64 -LDFLAGS = -LIBOBJS = -LIBS = -LIBTOOL = $(SHELL) $(top_builddir)/libtool -LIPO = -LN_S = ln -s -LTLIBOBJS = -MAINT = # -MAKEINFO = ${SHELL} /home/carlo/laptop-repository/impl/antlr/libantlr3c-3.4/missing --run makeinfo -MKDIR_P = /bin/mkdir -p -NM = /usr/bin/nm -B -NMEDIT = -OBJDUMP = objdump -OBJECT_MODE = -OBJEXT = o -OTOOL = -OTOOL64 = -PACKAGE = libantlr3c -PACKAGE_BUGREPORT = jimi@temporal-wave.com -PACKAGE_NAME = libantlr3c -PACKAGE_STRING = libantlr3c 3.4 -PACKAGE_TARNAME = libantlr3c -PACKAGE_URL = -PACKAGE_VERSION = 3.4 -PATH_SEPARATOR = : -RANLIB = ranlib -SED = /bin/sed -SET_MAKE = -SHELL = /bin/bash -STRIP = strip -VERSION = 3.4 -abs_builddir = /home/carlo/laptop-repository/impl/antlr/libantlr3c-3.4 -abs_srcdir = /home/carlo/laptop-repository/impl/antlr/libantlr3c-3.4 -abs_top_builddir = /home/carlo/laptop-repository/impl/antlr/libantlr3c-3.4 -abs_top_srcdir = /home/carlo/laptop-repository/impl/antlr/libantlr3c-3.4 -ac_ct_CC = gcc -ac_ct_DUMPBIN = -am__include = include -am__leading_dot = . -am__quote = -am__tar = ${AMTAR} chof - "$$tardir" -am__untar = ${AMTAR} xf - -bindir = ${exec_prefix}/bin -build = x86_64-unknown-linux-gnu -build_alias = -build_cpu = x86_64 -build_os = linux-gnu -build_vendor = unknown -builddir = . -datadir = ${datarootdir} -datarootdir = ${prefix}/share -docdir = ${datarootdir}/doc/${PACKAGE_TARNAME} -dvidir = ${docdir} -exec_prefix = ${prefix} -host = x86_64-unknown-linux-gnu -host_alias = -host_cpu = x86_64 -host_os = linux-gnu -host_vendor = unknown -htmldir = ${docdir} -includedir = ${prefix}/include -infodir = ${datarootdir}/info -install_sh = ${SHELL} /home/carlo/laptop-repository/impl/antlr/libantlr3c-3.4/install-sh -libdir = ${exec_prefix}/lib -libexecdir = ${exec_prefix}/libexec -localedir = ${datarootdir}/locale -localstatedir = ${prefix}/var -mandir = ${datarootdir}/man -mkdir_p = /bin/mkdir -p -oldincludedir = /usr/include -pdfdir = ${docdir} -prefix = /usr/local -program_transform_name = s,x,x, -psdir = ${docdir} -sbindir = ${exec_prefix}/sbin -sharedstatedir = ${prefix}/com -srcdir = . -sysconfdir = ${prefix}/etc -target_alias = -top_build_prefix = -top_builddir = . -top_srcdir = . -AUTOMAKE_OPTIONS = gnu -AM_LIBTOOLFLAGS = -ACLOCAL_AMFLAGS = -I m4 -lib_LTLIBRARIES = libantlr3c.la -LIBSOURCES = src/antlr3baserecognizer.c \ - src/antlr3basetree.c \ - src/antlr3basetreeadaptor.c \ - src/antlr3bitset.c \ - src/antlr3collections.c \ - src/antlr3commontoken.c \ - src/antlr3commontree.c \ - src/antlr3commontreeadaptor.c \ - src/antlr3commontreenodestream.c \ - src/antlr3convertutf.c \ - src/antlr3cyclicdfa.c \ - src/antlr3debughandlers.c \ - src/antlr3encodings.c \ - src/antlr3exception.c \ - src/antlr3filestream.c \ - src/antlr3inputstream.c \ - src/antlr3intstream.c \ - src/antlr3lexer.c \ - src/antlr3parser.c \ - src/antlr3rewritestreams.c \ - src/antlr3string.c \ - src/antlr3tokenstream.c \ - src/antlr3treeparser.c - -libantlr3c_la_SOURCES = $(LIBSOURCES) -include_HEADERS = include/antlr3.h \ - include/antlr3baserecognizer.h \ - include/antlr3basetree.h \ - include/antlr3basetreeadaptor.h \ - include/antlr3bitset.h \ - include/antlr3collections.h \ - include/antlr3commontoken.h \ - include/antlr3commontree.h \ - include/antlr3commontreeadaptor.h \ - include/antlr3commontreenodestream.h \ - include/antlr3convertutf.h \ - include/antlr3cyclicdfa.h \ - include/antlr3debugeventlistener.h \ - include/antlr3defs.h \ - include/antlr3encodings.h \ - include/antlr3errors.h \ - include/antlr3exception.h \ - include/antlr3filestream.h \ - include/antlr3input.h \ - include/antlr3interfaces.h \ - include/antlr3intstream.h \ - include/antlr3lexer.h \ - include/antlr3memory.h \ - include/antlr3parser.h \ - include/antlr3parsetree.h \ - include/antlr3recognizersharedstate.h \ - include/antlr3rewritestreams.h \ - include/antlr3string.h \ - include/antlr3tokenstream.h \ - include/antlr3treeparser.h \ - antlr3config.h - -libantlr3c_la_LDFLAGS = -avoid-version -INCLUDES = -Iinclude -EXTRA_DIST = \ - vsrulefiles/antlr3lexerandparser.rules \ - vsrulefiles/antlr3lexer.rules \ - vsrulefiles/antlr3parser.rules \ - vsrulefiles/antlr3treeparser.rules \ - C.sln C.vcproj C.vcproj.vspscc \ - C.vssscc doxyfile doxygen - -all: antlr3config.h - $(MAKE) $(AM_MAKEFLAGS) all-am - -.SUFFIXES: -.SUFFIXES: .c .lo .o .obj -am--refresh: - @: -$(srcdir)/Makefile.in: # $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \ - $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \ - && exit 0; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ - $(am__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: # $(am__configure_deps) - $(am__cd) $(srcdir) && $(AUTOCONF) -$(ACLOCAL_M4): # $(am__aclocal_m4_deps) - $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) -$(am__aclocal_m4_deps): - -antlr3config.h: stamp-h1 - @if test ! -f $@; then \ - rm -f stamp-h1; \ - $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \ - else :; fi - -stamp-h1: $(srcdir)/antlr3config.h.in $(top_builddir)/config.status - @rm -f stamp-h1 - cd $(top_builddir) && $(SHELL) ./config.status antlr3config.h -$(srcdir)/antlr3config.h.in: # $(am__configure_deps) - ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) - rm -f stamp-h1 - touch $@ - -distclean-hdr: - -rm -f antlr3config.h stamp-h1 -install-libLTLIBRARIES: $(lib_LTLIBRARIES) - @$(NORMAL_INSTALL) - test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" - @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ - list2=; for p in $$list; do \ - if test -f $$p; then \ - list2="$$list2 $$p"; \ - else :; fi; \ - done; \ - test -z "$$list2" || { \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ - } - -uninstall-libLTLIBRARIES: - @$(NORMAL_UNINSTALL) - @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ - for p in $$list; do \ - $(am__strip_dir) \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ - 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 -libantlr3c.la: $(libantlr3c_la_OBJECTS) $(libantlr3c_la_DEPENDENCIES) - $(libantlr3c_la_LINK) -rpath $(libdir) $(libantlr3c_la_OBJECTS) $(libantlr3c_la_LIBADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -include ./$(DEPDIR)/antlr3baserecognizer.Plo -include ./$(DEPDIR)/antlr3basetree.Plo -include ./$(DEPDIR)/antlr3basetreeadaptor.Plo -include ./$(DEPDIR)/antlr3bitset.Plo -include ./$(DEPDIR)/antlr3collections.Plo -include ./$(DEPDIR)/antlr3commontoken.Plo -include ./$(DEPDIR)/antlr3commontree.Plo -include ./$(DEPDIR)/antlr3commontreeadaptor.Plo -include ./$(DEPDIR)/antlr3commontreenodestream.Plo -include ./$(DEPDIR)/antlr3convertutf.Plo -include ./$(DEPDIR)/antlr3cyclicdfa.Plo -include ./$(DEPDIR)/antlr3debughandlers.Plo -include ./$(DEPDIR)/antlr3encodings.Plo -include ./$(DEPDIR)/antlr3exception.Plo -include ./$(DEPDIR)/antlr3filestream.Plo -include ./$(DEPDIR)/antlr3inputstream.Plo -include ./$(DEPDIR)/antlr3intstream.Plo -include ./$(DEPDIR)/antlr3lexer.Plo -include ./$(DEPDIR)/antlr3parser.Plo -include ./$(DEPDIR)/antlr3rewritestreams.Plo -include ./$(DEPDIR)/antlr3string.Plo -include ./$(DEPDIR)/antlr3tokenstream.Plo -include ./$(DEPDIR)/antlr3treeparser.Plo - -.c.o: - $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< - $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -# source='$<' object='$@' libtool=no \ -# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ -# $(COMPILE) -c $< - -.c.obj: - $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` - $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -# source='$<' object='$@' libtool=no \ -# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ -# $(COMPILE) -c `$(CYGPATH_W) '$<'` - -.c.lo: - $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< - $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -# source='$<' object='$@' libtool=yes \ -# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ -# $(LTCOMPILE) -c -o $@ $< - -antlr3baserecognizer.lo: src/antlr3baserecognizer.c - $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT antlr3baserecognizer.lo -MD -MP -MF $(DEPDIR)/antlr3baserecognizer.Tpo -c -o antlr3baserecognizer.lo `test -f 'src/antlr3baserecognizer.c' || echo '$(srcdir)/'`src/antlr3baserecognizer.c - $(am__mv) $(DEPDIR)/antlr3baserecognizer.Tpo $(DEPDIR)/antlr3baserecognizer.Plo -# source='src/antlr3baserecognizer.c' object='antlr3baserecognizer.lo' libtool=yes \ -# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ -# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o antlr3baserecognizer.lo `test -f 'src/antlr3baserecognizer.c' || echo '$(srcdir)/'`src/antlr3baserecognizer.c - -antlr3basetree.lo: src/antlr3basetree.c - $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT antlr3basetree.lo -MD -MP -MF $(DEPDIR)/antlr3basetree.Tpo -c -o antlr3basetree.lo `test -f 'src/antlr3basetree.c' || echo '$(srcdir)/'`src/antlr3basetree.c - $(am__mv) $(DEPDIR)/antlr3basetree.Tpo $(DEPDIR)/antlr3basetree.Plo -# source='src/antlr3basetree.c' object='antlr3basetree.lo' libtool=yes \ -# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ -# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o antlr3basetree.lo `test -f 'src/antlr3basetree.c' || echo '$(srcdir)/'`src/antlr3basetree.c - -antlr3basetreeadaptor.lo: src/antlr3basetreeadaptor.c - $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT antlr3basetreeadaptor.lo -MD -MP -MF $(DEPDIR)/antlr3basetreeadaptor.Tpo -c -o antlr3basetreeadaptor.lo `test -f 'src/antlr3basetreeadaptor.c' || echo '$(srcdir)/'`src/antlr3basetreeadaptor.c - $(am__mv) $(DEPDIR)/antlr3basetreeadaptor.Tpo $(DEPDIR)/antlr3basetreeadaptor.Plo -# source='src/antlr3basetreeadaptor.c' object='antlr3basetreeadaptor.lo' libtool=yes \ -# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ -# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o antlr3basetreeadaptor.lo `test -f 'src/antlr3basetreeadaptor.c' || echo '$(srcdir)/'`src/antlr3basetreeadaptor.c - -antlr3bitset.lo: src/antlr3bitset.c - $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT antlr3bitset.lo -MD -MP -MF $(DEPDIR)/antlr3bitset.Tpo -c -o antlr3bitset.lo `test -f 'src/antlr3bitset.c' || echo '$(srcdir)/'`src/antlr3bitset.c - $(am__mv) $(DEPDIR)/antlr3bitset.Tpo $(DEPDIR)/antlr3bitset.Plo -# source='src/antlr3bitset.c' object='antlr3bitset.lo' libtool=yes \ -# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ -# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o antlr3bitset.lo `test -f 'src/antlr3bitset.c' || echo '$(srcdir)/'`src/antlr3bitset.c - -antlr3collections.lo: src/antlr3collections.c - $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT antlr3collections.lo -MD -MP -MF $(DEPDIR)/antlr3collections.Tpo -c -o antlr3collections.lo `test -f 'src/antlr3collections.c' || echo '$(srcdir)/'`src/antlr3collections.c - $(am__mv) $(DEPDIR)/antlr3collections.Tpo $(DEPDIR)/antlr3collections.Plo -# source='src/antlr3collections.c' object='antlr3collections.lo' libtool=yes \ -# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ -# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o antlr3collections.lo `test -f 'src/antlr3collections.c' || echo '$(srcdir)/'`src/antlr3collections.c - -antlr3commontoken.lo: src/antlr3commontoken.c - $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT antlr3commontoken.lo -MD -MP -MF $(DEPDIR)/antlr3commontoken.Tpo -c -o antlr3commontoken.lo `test -f 'src/antlr3commontoken.c' || echo '$(srcdir)/'`src/antlr3commontoken.c - $(am__mv) $(DEPDIR)/antlr3commontoken.Tpo $(DEPDIR)/antlr3commontoken.Plo -# source='src/antlr3commontoken.c' object='antlr3commontoken.lo' libtool=yes \ -# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ -# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o antlr3commontoken.lo `test -f 'src/antlr3commontoken.c' || echo '$(srcdir)/'`src/antlr3commontoken.c - -antlr3commontree.lo: src/antlr3commontree.c - $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT antlr3commontree.lo -MD -MP -MF $(DEPDIR)/antlr3commontree.Tpo -c -o antlr3commontree.lo `test -f 'src/antlr3commontree.c' || echo '$(srcdir)/'`src/antlr3commontree.c - $(am__mv) $(DEPDIR)/antlr3commontree.Tpo $(DEPDIR)/antlr3commontree.Plo -# source='src/antlr3commontree.c' object='antlr3commontree.lo' libtool=yes \ -# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ -# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o antlr3commontree.lo `test -f 'src/antlr3commontree.c' || echo '$(srcdir)/'`src/antlr3commontree.c - -antlr3commontreeadaptor.lo: src/antlr3commontreeadaptor.c - $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT antlr3commontreeadaptor.lo -MD -MP -MF $(DEPDIR)/antlr3commontreeadaptor.Tpo -c -o antlr3commontreeadaptor.lo `test -f 'src/antlr3commontreeadaptor.c' || echo '$(srcdir)/'`src/antlr3commontreeadaptor.c - $(am__mv) $(DEPDIR)/antlr3commontreeadaptor.Tpo $(DEPDIR)/antlr3commontreeadaptor.Plo -# source='src/antlr3commontreeadaptor.c' object='antlr3commontreeadaptor.lo' libtool=yes \ -# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ -# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o antlr3commontreeadaptor.lo `test -f 'src/antlr3commontreeadaptor.c' || echo '$(srcdir)/'`src/antlr3commontreeadaptor.c - -antlr3commontreenodestream.lo: src/antlr3commontreenodestream.c - $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT antlr3commontreenodestream.lo -MD -MP -MF $(DEPDIR)/antlr3commontreenodestream.Tpo -c -o antlr3commontreenodestream.lo `test -f 'src/antlr3commontreenodestream.c' || echo '$(srcdir)/'`src/antlr3commontreenodestream.c - $(am__mv) $(DEPDIR)/antlr3commontreenodestream.Tpo $(DEPDIR)/antlr3commontreenodestream.Plo -# source='src/antlr3commontreenodestream.c' object='antlr3commontreenodestream.lo' libtool=yes \ -# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ -# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o antlr3commontreenodestream.lo `test -f 'src/antlr3commontreenodestream.c' || echo '$(srcdir)/'`src/antlr3commontreenodestream.c - -antlr3convertutf.lo: src/antlr3convertutf.c - $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT antlr3convertutf.lo -MD -MP -MF $(DEPDIR)/antlr3convertutf.Tpo -c -o antlr3convertutf.lo `test -f 'src/antlr3convertutf.c' || echo '$(srcdir)/'`src/antlr3convertutf.c - $(am__mv) $(DEPDIR)/antlr3convertutf.Tpo $(DEPDIR)/antlr3convertutf.Plo -# source='src/antlr3convertutf.c' object='antlr3convertutf.lo' libtool=yes \ -# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ -# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o antlr3convertutf.lo `test -f 'src/antlr3convertutf.c' || echo '$(srcdir)/'`src/antlr3convertutf.c - -antlr3cyclicdfa.lo: src/antlr3cyclicdfa.c - $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT antlr3cyclicdfa.lo -MD -MP -MF $(DEPDIR)/antlr3cyclicdfa.Tpo -c -o antlr3cyclicdfa.lo `test -f 'src/antlr3cyclicdfa.c' || echo '$(srcdir)/'`src/antlr3cyclicdfa.c - $(am__mv) $(DEPDIR)/antlr3cyclicdfa.Tpo $(DEPDIR)/antlr3cyclicdfa.Plo -# source='src/antlr3cyclicdfa.c' object='antlr3cyclicdfa.lo' libtool=yes \ -# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ -# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o antlr3cyclicdfa.lo `test -f 'src/antlr3cyclicdfa.c' || echo '$(srcdir)/'`src/antlr3cyclicdfa.c - -antlr3debughandlers.lo: src/antlr3debughandlers.c - $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT antlr3debughandlers.lo -MD -MP -MF $(DEPDIR)/antlr3debughandlers.Tpo -c -o antlr3debughandlers.lo `test -f 'src/antlr3debughandlers.c' || echo '$(srcdir)/'`src/antlr3debughandlers.c - $(am__mv) $(DEPDIR)/antlr3debughandlers.Tpo $(DEPDIR)/antlr3debughandlers.Plo -# source='src/antlr3debughandlers.c' object='antlr3debughandlers.lo' libtool=yes \ -# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ -# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o antlr3debughandlers.lo `test -f 'src/antlr3debughandlers.c' || echo '$(srcdir)/'`src/antlr3debughandlers.c - -antlr3encodings.lo: src/antlr3encodings.c - $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT antlr3encodings.lo -MD -MP -MF $(DEPDIR)/antlr3encodings.Tpo -c -o antlr3encodings.lo `test -f 'src/antlr3encodings.c' || echo '$(srcdir)/'`src/antlr3encodings.c - $(am__mv) $(DEPDIR)/antlr3encodings.Tpo $(DEPDIR)/antlr3encodings.Plo -# source='src/antlr3encodings.c' object='antlr3encodings.lo' libtool=yes \ -# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ -# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o antlr3encodings.lo `test -f 'src/antlr3encodings.c' || echo '$(srcdir)/'`src/antlr3encodings.c - -antlr3exception.lo: src/antlr3exception.c - $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT antlr3exception.lo -MD -MP -MF $(DEPDIR)/antlr3exception.Tpo -c -o antlr3exception.lo `test -f 'src/antlr3exception.c' || echo '$(srcdir)/'`src/antlr3exception.c - $(am__mv) $(DEPDIR)/antlr3exception.Tpo $(DEPDIR)/antlr3exception.Plo -# source='src/antlr3exception.c' object='antlr3exception.lo' libtool=yes \ -# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ -# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o antlr3exception.lo `test -f 'src/antlr3exception.c' || echo '$(srcdir)/'`src/antlr3exception.c - -antlr3filestream.lo: src/antlr3filestream.c - $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT antlr3filestream.lo -MD -MP -MF $(DEPDIR)/antlr3filestream.Tpo -c -o antlr3filestream.lo `test -f 'src/antlr3filestream.c' || echo '$(srcdir)/'`src/antlr3filestream.c - $(am__mv) $(DEPDIR)/antlr3filestream.Tpo $(DEPDIR)/antlr3filestream.Plo -# source='src/antlr3filestream.c' object='antlr3filestream.lo' libtool=yes \ -# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ -# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o antlr3filestream.lo `test -f 'src/antlr3filestream.c' || echo '$(srcdir)/'`src/antlr3filestream.c - -antlr3inputstream.lo: src/antlr3inputstream.c - $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT antlr3inputstream.lo -MD -MP -MF $(DEPDIR)/antlr3inputstream.Tpo -c -o antlr3inputstream.lo `test -f 'src/antlr3inputstream.c' || echo '$(srcdir)/'`src/antlr3inputstream.c - $(am__mv) $(DEPDIR)/antlr3inputstream.Tpo $(DEPDIR)/antlr3inputstream.Plo -# source='src/antlr3inputstream.c' object='antlr3inputstream.lo' libtool=yes \ -# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ -# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o antlr3inputstream.lo `test -f 'src/antlr3inputstream.c' || echo '$(srcdir)/'`src/antlr3inputstream.c - -antlr3intstream.lo: src/antlr3intstream.c - $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT antlr3intstream.lo -MD -MP -MF $(DEPDIR)/antlr3intstream.Tpo -c -o antlr3intstream.lo `test -f 'src/antlr3intstream.c' || echo '$(srcdir)/'`src/antlr3intstream.c - $(am__mv) $(DEPDIR)/antlr3intstream.Tpo $(DEPDIR)/antlr3intstream.Plo -# source='src/antlr3intstream.c' object='antlr3intstream.lo' libtool=yes \ -# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ -# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o antlr3intstream.lo `test -f 'src/antlr3intstream.c' || echo '$(srcdir)/'`src/antlr3intstream.c - -antlr3lexer.lo: src/antlr3lexer.c - $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT antlr3lexer.lo -MD -MP -MF $(DEPDIR)/antlr3lexer.Tpo -c -o antlr3lexer.lo `test -f 'src/antlr3lexer.c' || echo '$(srcdir)/'`src/antlr3lexer.c - $(am__mv) $(DEPDIR)/antlr3lexer.Tpo $(DEPDIR)/antlr3lexer.Plo -# source='src/antlr3lexer.c' object='antlr3lexer.lo' libtool=yes \ -# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ -# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o antlr3lexer.lo `test -f 'src/antlr3lexer.c' || echo '$(srcdir)/'`src/antlr3lexer.c - -antlr3parser.lo: src/antlr3parser.c - $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT antlr3parser.lo -MD -MP -MF $(DEPDIR)/antlr3parser.Tpo -c -o antlr3parser.lo `test -f 'src/antlr3parser.c' || echo '$(srcdir)/'`src/antlr3parser.c - $(am__mv) $(DEPDIR)/antlr3parser.Tpo $(DEPDIR)/antlr3parser.Plo -# source='src/antlr3parser.c' object='antlr3parser.lo' libtool=yes \ -# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ -# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o antlr3parser.lo `test -f 'src/antlr3parser.c' || echo '$(srcdir)/'`src/antlr3parser.c - -antlr3rewritestreams.lo: src/antlr3rewritestreams.c - $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT antlr3rewritestreams.lo -MD -MP -MF $(DEPDIR)/antlr3rewritestreams.Tpo -c -o antlr3rewritestreams.lo `test -f 'src/antlr3rewritestreams.c' || echo '$(srcdir)/'`src/antlr3rewritestreams.c - $(am__mv) $(DEPDIR)/antlr3rewritestreams.Tpo $(DEPDIR)/antlr3rewritestreams.Plo -# source='src/antlr3rewritestreams.c' object='antlr3rewritestreams.lo' libtool=yes \ -# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ -# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o antlr3rewritestreams.lo `test -f 'src/antlr3rewritestreams.c' || echo '$(srcdir)/'`src/antlr3rewritestreams.c - -antlr3string.lo: src/antlr3string.c - $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT antlr3string.lo -MD -MP -MF $(DEPDIR)/antlr3string.Tpo -c -o antlr3string.lo `test -f 'src/antlr3string.c' || echo '$(srcdir)/'`src/antlr3string.c - $(am__mv) $(DEPDIR)/antlr3string.Tpo $(DEPDIR)/antlr3string.Plo -# source='src/antlr3string.c' object='antlr3string.lo' libtool=yes \ -# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ -# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o antlr3string.lo `test -f 'src/antlr3string.c' || echo '$(srcdir)/'`src/antlr3string.c - -antlr3tokenstream.lo: src/antlr3tokenstream.c - $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT antlr3tokenstream.lo -MD -MP -MF $(DEPDIR)/antlr3tokenstream.Tpo -c -o antlr3tokenstream.lo `test -f 'src/antlr3tokenstream.c' || echo '$(srcdir)/'`src/antlr3tokenstream.c - $(am__mv) $(DEPDIR)/antlr3tokenstream.Tpo $(DEPDIR)/antlr3tokenstream.Plo -# source='src/antlr3tokenstream.c' object='antlr3tokenstream.lo' libtool=yes \ -# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ -# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o antlr3tokenstream.lo `test -f 'src/antlr3tokenstream.c' || echo '$(srcdir)/'`src/antlr3tokenstream.c - -antlr3treeparser.lo: src/antlr3treeparser.c - $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT antlr3treeparser.lo -MD -MP -MF $(DEPDIR)/antlr3treeparser.Tpo -c -o antlr3treeparser.lo `test -f 'src/antlr3treeparser.c' || echo '$(srcdir)/'`src/antlr3treeparser.c - $(am__mv) $(DEPDIR)/antlr3treeparser.Tpo $(DEPDIR)/antlr3treeparser.Plo -# source='src/antlr3treeparser.c' object='antlr3treeparser.lo' libtool=yes \ -# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ -# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o antlr3treeparser.lo `test -f 'src/antlr3treeparser.c' || echo '$(srcdir)/'`src/antlr3treeparser.c - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool config.lt -install-includeHEADERS: $(include_HEADERS) - @$(NORMAL_INSTALL) - test -z "$(includedir)" || $(MKDIR_P) "$(DESTDIR)$(includedir)" - @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \ - for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; \ - done | $(am__base_list) | \ - while read files; do \ - echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includedir)'"; \ - $(INSTALL_HEADER) $$files "$(DESTDIR)$(includedir)" || exit $$?; \ - done - -uninstall-includeHEADERS: - @$(NORMAL_UNINSTALL) - @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \ - files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - test -n "$$files" || exit 0; \ - echo " ( cd '$(DESTDIR)$(includedir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(includedir)" && rm -f $$files - -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) antlr3config.h.in $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - set x; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) antlr3config.h.in $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - shift; \ - if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - if test $$# -gt 0; then \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - "$$@" $$unique; \ - else \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$unique; \ - fi; \ - fi -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) antlr3config.h.in $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - list='$(SOURCES) $(HEADERS) antlr3config.h.in $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - test -z "$(CTAGS_ARGS)$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && $(am__cd) $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) "$$here" - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(DISTFILES) - $(am__remove_distdir) - test -d "$(distdir)" || mkdir "$(distdir)" - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done - -test -n "$(am__skip_mode_fix)" \ - || find "$(distdir)" -type d ! -perm -755 \ - -exec chmod u+rwx,go+rx {} \; -o \ - ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ - ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ - ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ - || chmod -R a+r "$(distdir)" -dist-gzip: distdir - tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz - $(am__remove_distdir) - -dist-bzip2: distdir - tardir=$(distdir) && $(am__tar) | bzip2 -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-xz: distdir - tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz - $(am__remove_distdir) - -dist-tarZ: distdir - tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z - $(am__remove_distdir) - -dist-shar: distdir - shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz - $(am__remove_distdir) - -dist-zip: distdir - -rm -f $(distdir).zip - zip -rq $(distdir).zip $(distdir) - $(am__remove_distdir) - -dist dist-all: distdir - tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz - $(am__remove_distdir) - -# This target untars the dist file and tries a VPATH configuration. Then -# it guarantees that the distribution is self-contained by making another -# tarfile. -distcheck: dist - case '$(DIST_ARCHIVES)' in \ - *.tar.gz*) \ - GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ - *.tar.bz2*) \ - bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ - *.tar.lzma*) \ - lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\ - *.tar.xz*) \ - xz -dc $(distdir).tar.xz | $(am__untar) ;;\ - *.tar.Z*) \ - uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ - *.shar.gz*) \ - GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ - *.zip*) \ - unzip $(distdir).zip ;;\ - esac - chmod -R a-w $(distdir); chmod a+w $(distdir) - mkdir $(distdir)/_build - mkdir $(distdir)/_inst - chmod a-w $(distdir) - test -d $(distdir)/_build || exit 0; \ - dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ - && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ - && am__cwd=`pwd` \ - && $(am__cd) $(distdir)/_build \ - && ../configure --srcdir=.. --prefix="$$dc_install_base" \ - $(DISTCHECK_CONFIGURE_FLAGS) \ - && $(MAKE) $(AM_MAKEFLAGS) \ - && $(MAKE) $(AM_MAKEFLAGS) dvi \ - && $(MAKE) $(AM_MAKEFLAGS) check \ - && $(MAKE) $(AM_MAKEFLAGS) install \ - && $(MAKE) $(AM_MAKEFLAGS) installcheck \ - && $(MAKE) $(AM_MAKEFLAGS) uninstall \ - && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ - distuninstallcheck \ - && chmod -R a-w "$$dc_install_base" \ - && ({ \ - (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ - && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ - && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ - && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ - distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ - } || { rm -rf "$$dc_destdir"; exit 1; }) \ - && rm -rf "$$dc_destdir" \ - && $(MAKE) $(AM_MAKEFLAGS) dist \ - && rm -rf $(DIST_ARCHIVES) \ - && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ - && cd "$$am__cwd" \ - || exit 1 - $(am__remove_distdir) - @(echo "$(distdir) archives ready for distribution: "; \ - list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ - sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' -distuninstallcheck: - @$(am__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 $(LTLIBRARIES) $(HEADERS) antlr3config.h -installdirs: - for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)"; 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) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libLTLIBRARIES 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 - -html-am: - -info: info-am - -info-am: - -install-data-am: install-includeHEADERS - -install-dvi: install-dvi-am - -install-dvi-am: - -install-exec-am: install-libLTLIBRARIES - -install-html: install-html-am - -install-html-am: - -install-info: install-info-am - -install-info-am: - -install-man: - -install-pdf: install-pdf-am - -install-pdf-am: - -install-ps: install-ps-am - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -f $(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-includeHEADERS uninstall-libLTLIBRARIES - -.MAKE: all install-am install-strip - -.PHONY: CTAGS GTAGS all all-am am--refresh check check-am clean \ - clean-generic clean-libLTLIBRARIES clean-libtool ctags dist \ - dist-all dist-bzip2 dist-gzip dist-lzma dist-shar dist-tarZ \ - dist-xz dist-zip distcheck distclean distclean-compile \ - distclean-generic distclean-hdr distclean-libtool \ - distclean-tags distcleancheck distdir distuninstallcheck dvi \ - dvi-am html html-am info info-am install install-am \ - install-data install-data-am install-dvi install-dvi-am \ - install-exec install-exec-am install-html install-html-am \ - install-includeHEADERS install-info install-info-am \ - install-libLTLIBRARIES 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-includeHEADERS \ - uninstall-libLTLIBRARIES - - -export OBJECT_MODE - -# 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/impl/antlr/libantlr3c-3.4/Makefile.am b/impl/antlr/libantlr3c-3.4/Makefile.am deleted file mode 100644 index 9867f7e..0000000 --- a/impl/antlr/libantlr3c-3.4/Makefile.am +++ /dev/null @@ -1,78 +0,0 @@ -AUTOMAKE_OPTIONS = gnu -AM_LIBTOOLFLAGS = -## --silent -ACLOCAL_AMFLAGS = -I m4 -lib_LTLIBRARIES = libantlr3c.la - -LIBSOURCES = src/antlr3baserecognizer.c \ - src/antlr3basetree.c \ - src/antlr3basetreeadaptor.c \ - src/antlr3bitset.c \ - src/antlr3collections.c \ - src/antlr3commontoken.c \ - src/antlr3commontree.c \ - src/antlr3commontreeadaptor.c \ - src/antlr3commontreenodestream.c \ - src/antlr3convertutf.c \ - src/antlr3cyclicdfa.c \ - src/antlr3debughandlers.c \ - src/antlr3encodings.c \ - src/antlr3exception.c \ - src/antlr3filestream.c \ - src/antlr3inputstream.c \ - src/antlr3intstream.c \ - src/antlr3lexer.c \ - src/antlr3parser.c \ - src/antlr3rewritestreams.c \ - src/antlr3string.c \ - src/antlr3tokenstream.c \ - src/antlr3treeparser.c - -libantlr3c_la_SOURCES = $(LIBSOURCES) - -include_HEADERS = include/antlr3.h \ - include/antlr3baserecognizer.h \ - include/antlr3basetree.h \ - include/antlr3basetreeadaptor.h \ - include/antlr3bitset.h \ - include/antlr3collections.h \ - include/antlr3commontoken.h \ - include/antlr3commontree.h \ - include/antlr3commontreeadaptor.h \ - include/antlr3commontreenodestream.h \ - include/antlr3convertutf.h \ - include/antlr3cyclicdfa.h \ - include/antlr3debugeventlistener.h \ - include/antlr3defs.h \ - include/antlr3encodings.h \ - include/antlr3errors.h \ - include/antlr3exception.h \ - include/antlr3filestream.h \ - include/antlr3input.h \ - include/antlr3interfaces.h \ - include/antlr3intstream.h \ - include/antlr3lexer.h \ - include/antlr3memory.h \ - include/antlr3parser.h \ - include/antlr3parsetree.h \ - include/antlr3recognizersharedstate.h \ - include/antlr3rewritestreams.h \ - include/antlr3string.h \ - include/antlr3tokenstream.h \ - include/antlr3treeparser.h \ - antlr3config.h - -libantlr3c_la_LDFLAGS = -avoid-version - -INCLUDES = -Iinclude - -EXTRA_DIST = \ - vsrulefiles/antlr3lexerandparser.rules \ - vsrulefiles/antlr3lexer.rules \ - vsrulefiles/antlr3parser.rules \ - vsrulefiles/antlr3treeparser.rules \ - C.sln C.vcproj C.vcproj.vspscc \ - C.vssscc doxyfile doxygen - -export OBJECT_MODE - diff --git a/impl/antlr/libantlr3c-3.4/Makefile.in b/impl/antlr/libantlr3c-3.4/Makefile.in deleted file mode 100644 index e48d2ae..0000000 --- a/impl/antlr/libantlr3c-3.4/Makefile.in +++ /dev/null @@ -1,968 +0,0 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 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@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -subdir = . -DIST_COMMON = README $(am__configure_deps) $(include_HEADERS) \ - $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ - $(srcdir)/antlr3config.h.in $(top_srcdir)/configure AUTHORS \ - COPYING ChangeLog INSTALL NEWS config.guess config.sub depcomp \ - install-sh ltmain.sh missing -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(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 = antlr3config.h -CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; -am__install_max = 40 -am__nobase_strip_setup = \ - srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` -am__nobase_strip = \ - for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" -am__nobase_list = $(am__nobase_strip_setup); \ - for p in $$list; do echo "$$p $$p"; done | \ - sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ - $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ - if (++n[$$2] == $(am__install_max)) \ - { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ - END { for (dir in files) print dir, files[dir] }' -am__base_list = \ - sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ - sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)" -LTLIBRARIES = $(lib_LTLIBRARIES) -libantlr3c_la_LIBADD = -am__objects_1 = antlr3baserecognizer.lo antlr3basetree.lo \ - antlr3basetreeadaptor.lo antlr3bitset.lo antlr3collections.lo \ - antlr3commontoken.lo antlr3commontree.lo \ - antlr3commontreeadaptor.lo antlr3commontreenodestream.lo \ - antlr3convertutf.lo antlr3cyclicdfa.lo antlr3debughandlers.lo \ - antlr3encodings.lo antlr3exception.lo antlr3filestream.lo \ - antlr3inputstream.lo antlr3intstream.lo antlr3lexer.lo \ - antlr3parser.lo antlr3rewritestreams.lo antlr3string.lo \ - antlr3tokenstream.lo antlr3treeparser.lo -am_libantlr3c_la_OBJECTS = $(am__objects_1) -libantlr3c_la_OBJECTS = $(am_libantlr3c_la_OBJECTS) -libantlr3c_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(libantlr3c_la_LDFLAGS) $(LDFLAGS) -o $@ -DEFAULT_INCLUDES = -I.@am__isrc@ -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -am__mv = mv -f -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -CCLD = $(CC) -LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ - $(LDFLAGS) -o $@ -SOURCES = $(libantlr3c_la_SOURCES) -DIST_SOURCES = $(libantlr3c_la_SOURCES) -HEADERS = $(include_HEADERS) -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 -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@ -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@ -LIBS = @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@ -OBJECT_MODE = @OBJECT_MODE@ -OBJEXT = @OBJEXT@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -RANLIB = @RANLIB@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_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@ -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@ -AUTOMAKE_OPTIONS = gnu -AM_LIBTOOLFLAGS = -ACLOCAL_AMFLAGS = -I m4 -lib_LTLIBRARIES = libantlr3c.la -LIBSOURCES = src/antlr3baserecognizer.c \ - src/antlr3basetree.c \ - src/antlr3basetreeadaptor.c \ - src/antlr3bitset.c \ - src/antlr3collections.c \ - src/antlr3commontoken.c \ - src/antlr3commontree.c \ - src/antlr3commontreeadaptor.c \ - src/antlr3commontreenodestream.c \ - src/antlr3convertutf.c \ - src/antlr3cyclicdfa.c \ - src/antlr3debughandlers.c \ - src/antlr3encodings.c \ - src/antlr3exception.c \ - src/antlr3filestream.c \ - src/antlr3inputstream.c \ - src/antlr3intstream.c \ - src/antlr3lexer.c \ - src/antlr3parser.c \ - src/antlr3rewritestreams.c \ - src/antlr3string.c \ - src/antlr3tokenstream.c \ - src/antlr3treeparser.c - -libantlr3c_la_SOURCES = $(LIBSOURCES) -include_HEADERS = include/antlr3.h \ - include/antlr3baserecognizer.h \ - include/antlr3basetree.h \ - include/antlr3basetreeadaptor.h \ - include/antlr3bitset.h \ - include/antlr3collections.h \ - include/antlr3commontoken.h \ - include/antlr3commontree.h \ - include/antlr3commontreeadaptor.h \ - include/antlr3commontreenodestream.h \ - include/antlr3convertutf.h \ - include/antlr3cyclicdfa.h \ - include/antlr3debugeventlistener.h \ - include/antlr3defs.h \ - include/antlr3encodings.h \ - include/antlr3errors.h \ - include/antlr3exception.h \ - include/antlr3filestream.h \ - include/antlr3input.h \ - include/antlr3interfaces.h \ - include/antlr3intstream.h \ - include/antlr3lexer.h \ - include/antlr3memory.h \ - include/antlr3parser.h \ - include/antlr3parsetree.h \ - include/antlr3recognizersharedstate.h \ - include/antlr3rewritestreams.h \ - include/antlr3string.h \ - include/antlr3tokenstream.h \ - include/antlr3treeparser.h \ - antlr3config.h - -libantlr3c_la_LDFLAGS = -avoid-version -INCLUDES = -Iinclude -EXTRA_DIST = \ - vsrulefiles/antlr3lexerandparser.rules \ - vsrulefiles/antlr3lexer.rules \ - vsrulefiles/antlr3parser.rules \ - vsrulefiles/antlr3treeparser.rules \ - C.sln C.vcproj C.vcproj.vspscc \ - C.vssscc doxyfile doxygen - -all: antlr3config.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) --gnu'; \ - $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \ - && exit 0; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ - $(am__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) - $(am__cd) $(srcdir) && $(AUTOCONF) -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) - $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) -$(am__aclocal_m4_deps): - -antlr3config.h: stamp-h1 - @if test ! -f $@; then \ - rm -f stamp-h1; \ - $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \ - else :; fi - -stamp-h1: $(srcdir)/antlr3config.h.in $(top_builddir)/config.status - @rm -f stamp-h1 - cd $(top_builddir) && $(SHELL) ./config.status antlr3config.h -$(srcdir)/antlr3config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) - ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) - rm -f stamp-h1 - touch $@ - -distclean-hdr: - -rm -f antlr3config.h stamp-h1 -install-libLTLIBRARIES: $(lib_LTLIBRARIES) - @$(NORMAL_INSTALL) - test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" - @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ - list2=; for p in $$list; do \ - if test -f $$p; then \ - list2="$$list2 $$p"; \ - else :; fi; \ - done; \ - test -z "$$list2" || { \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ - } - -uninstall-libLTLIBRARIES: - @$(NORMAL_UNINSTALL) - @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ - for p in $$list; do \ - $(am__strip_dir) \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ - 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 -libantlr3c.la: $(libantlr3c_la_OBJECTS) $(libantlr3c_la_DEPENDENCIES) - $(libantlr3c_la_LINK) -rpath $(libdir) $(libantlr3c_la_OBJECTS) $(libantlr3c_la_LIBADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/antlr3baserecognizer.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/antlr3basetree.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/antlr3basetreeadaptor.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/antlr3bitset.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/antlr3collections.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/antlr3commontoken.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/antlr3commontree.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/antlr3commontreeadaptor.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/antlr3commontreenodestream.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/antlr3convertutf.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/antlr3cyclicdfa.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/antlr3debughandlers.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/antlr3encodings.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/antlr3exception.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/antlr3filestream.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/antlr3inputstream.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/antlr3intstream.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/antlr3lexer.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/antlr3parser.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/antlr3rewritestreams.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/antlr3string.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/antlr3tokenstream.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/antlr3treeparser.Plo@am__quote@ - -.c.o: -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c $< - -.c.obj: -@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` - -.c.lo: -@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< - -antlr3baserecognizer.lo: src/antlr3baserecognizer.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT antlr3baserecognizer.lo -MD -MP -MF $(DEPDIR)/antlr3baserecognizer.Tpo -c -o antlr3baserecognizer.lo `test -f 'src/antlr3baserecognizer.c' || echo '$(srcdir)/'`src/antlr3baserecognizer.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/antlr3baserecognizer.Tpo $(DEPDIR)/antlr3baserecognizer.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='src/antlr3baserecognizer.c' object='antlr3baserecognizer.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o antlr3baserecognizer.lo `test -f 'src/antlr3baserecognizer.c' || echo '$(srcdir)/'`src/antlr3baserecognizer.c - -antlr3basetree.lo: src/antlr3basetree.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT antlr3basetree.lo -MD -MP -MF $(DEPDIR)/antlr3basetree.Tpo -c -o antlr3basetree.lo `test -f 'src/antlr3basetree.c' || echo '$(srcdir)/'`src/antlr3basetree.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/antlr3basetree.Tpo $(DEPDIR)/antlr3basetree.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='src/antlr3basetree.c' object='antlr3basetree.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o antlr3basetree.lo `test -f 'src/antlr3basetree.c' || echo '$(srcdir)/'`src/antlr3basetree.c - -antlr3basetreeadaptor.lo: src/antlr3basetreeadaptor.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT antlr3basetreeadaptor.lo -MD -MP -MF $(DEPDIR)/antlr3basetreeadaptor.Tpo -c -o antlr3basetreeadaptor.lo `test -f 'src/antlr3basetreeadaptor.c' || echo '$(srcdir)/'`src/antlr3basetreeadaptor.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/antlr3basetreeadaptor.Tpo $(DEPDIR)/antlr3basetreeadaptor.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='src/antlr3basetreeadaptor.c' object='antlr3basetreeadaptor.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o antlr3basetreeadaptor.lo `test -f 'src/antlr3basetreeadaptor.c' || echo '$(srcdir)/'`src/antlr3basetreeadaptor.c - -antlr3bitset.lo: src/antlr3bitset.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT antlr3bitset.lo -MD -MP -MF $(DEPDIR)/antlr3bitset.Tpo -c -o antlr3bitset.lo `test -f 'src/antlr3bitset.c' || echo '$(srcdir)/'`src/antlr3bitset.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/antlr3bitset.Tpo $(DEPDIR)/antlr3bitset.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='src/antlr3bitset.c' object='antlr3bitset.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o antlr3bitset.lo `test -f 'src/antlr3bitset.c' || echo '$(srcdir)/'`src/antlr3bitset.c - -antlr3collections.lo: src/antlr3collections.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT antlr3collections.lo -MD -MP -MF $(DEPDIR)/antlr3collections.Tpo -c -o antlr3collections.lo `test -f 'src/antlr3collections.c' || echo '$(srcdir)/'`src/antlr3collections.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/antlr3collections.Tpo $(DEPDIR)/antlr3collections.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='src/antlr3collections.c' object='antlr3collections.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o antlr3collections.lo `test -f 'src/antlr3collections.c' || echo '$(srcdir)/'`src/antlr3collections.c - -antlr3commontoken.lo: src/antlr3commontoken.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT antlr3commontoken.lo -MD -MP -MF $(DEPDIR)/antlr3commontoken.Tpo -c -o antlr3commontoken.lo `test -f 'src/antlr3commontoken.c' || echo '$(srcdir)/'`src/antlr3commontoken.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/antlr3commontoken.Tpo $(DEPDIR)/antlr3commontoken.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='src/antlr3commontoken.c' object='antlr3commontoken.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o antlr3commontoken.lo `test -f 'src/antlr3commontoken.c' || echo '$(srcdir)/'`src/antlr3commontoken.c - -antlr3commontree.lo: src/antlr3commontree.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT antlr3commontree.lo -MD -MP -MF $(DEPDIR)/antlr3commontree.Tpo -c -o antlr3commontree.lo `test -f 'src/antlr3commontree.c' || echo '$(srcdir)/'`src/antlr3commontree.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/antlr3commontree.Tpo $(DEPDIR)/antlr3commontree.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='src/antlr3commontree.c' object='antlr3commontree.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o antlr3commontree.lo `test -f 'src/antlr3commontree.c' || echo '$(srcdir)/'`src/antlr3commontree.c - -antlr3commontreeadaptor.lo: src/antlr3commontreeadaptor.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT antlr3commontreeadaptor.lo -MD -MP -MF $(DEPDIR)/antlr3commontreeadaptor.Tpo -c -o antlr3commontreeadaptor.lo `test -f 'src/antlr3commontreeadaptor.c' || echo '$(srcdir)/'`src/antlr3commontreeadaptor.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/antlr3commontreeadaptor.Tpo $(DEPDIR)/antlr3commontreeadaptor.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='src/antlr3commontreeadaptor.c' object='antlr3commontreeadaptor.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o antlr3commontreeadaptor.lo `test -f 'src/antlr3commontreeadaptor.c' || echo '$(srcdir)/'`src/antlr3commontreeadaptor.c - -antlr3commontreenodestream.lo: src/antlr3commontreenodestream.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT antlr3commontreenodestream.lo -MD -MP -MF $(DEPDIR)/antlr3commontreenodestream.Tpo -c -o antlr3commontreenodestream.lo `test -f 'src/antlr3commontreenodestream.c' || echo '$(srcdir)/'`src/antlr3commontreenodestream.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/antlr3commontreenodestream.Tpo $(DEPDIR)/antlr3commontreenodestream.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='src/antlr3commontreenodestream.c' object='antlr3commontreenodestream.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o antlr3commontreenodestream.lo `test -f 'src/antlr3commontreenodestream.c' || echo '$(srcdir)/'`src/antlr3commontreenodestream.c - -antlr3convertutf.lo: src/antlr3convertutf.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT antlr3convertutf.lo -MD -MP -MF $(DEPDIR)/antlr3convertutf.Tpo -c -o antlr3convertutf.lo `test -f 'src/antlr3convertutf.c' || echo '$(srcdir)/'`src/antlr3convertutf.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/antlr3convertutf.Tpo $(DEPDIR)/antlr3convertutf.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='src/antlr3convertutf.c' object='antlr3convertutf.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o antlr3convertutf.lo `test -f 'src/antlr3convertutf.c' || echo '$(srcdir)/'`src/antlr3convertutf.c - -antlr3cyclicdfa.lo: src/antlr3cyclicdfa.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT antlr3cyclicdfa.lo -MD -MP -MF $(DEPDIR)/antlr3cyclicdfa.Tpo -c -o antlr3cyclicdfa.lo `test -f 'src/antlr3cyclicdfa.c' || echo '$(srcdir)/'`src/antlr3cyclicdfa.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/antlr3cyclicdfa.Tpo $(DEPDIR)/antlr3cyclicdfa.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='src/antlr3cyclicdfa.c' object='antlr3cyclicdfa.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o antlr3cyclicdfa.lo `test -f 'src/antlr3cyclicdfa.c' || echo '$(srcdir)/'`src/antlr3cyclicdfa.c - -antlr3debughandlers.lo: src/antlr3debughandlers.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT antlr3debughandlers.lo -MD -MP -MF $(DEPDIR)/antlr3debughandlers.Tpo -c -o antlr3debughandlers.lo `test -f 'src/antlr3debughandlers.c' || echo '$(srcdir)/'`src/antlr3debughandlers.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/antlr3debughandlers.Tpo $(DEPDIR)/antlr3debughandlers.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='src/antlr3debughandlers.c' object='antlr3debughandlers.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o antlr3debughandlers.lo `test -f 'src/antlr3debughandlers.c' || echo '$(srcdir)/'`src/antlr3debughandlers.c - -antlr3encodings.lo: src/antlr3encodings.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT antlr3encodings.lo -MD -MP -MF $(DEPDIR)/antlr3encodings.Tpo -c -o antlr3encodings.lo `test -f 'src/antlr3encodings.c' || echo '$(srcdir)/'`src/antlr3encodings.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/antlr3encodings.Tpo $(DEPDIR)/antlr3encodings.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='src/antlr3encodings.c' object='antlr3encodings.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o antlr3encodings.lo `test -f 'src/antlr3encodings.c' || echo '$(srcdir)/'`src/antlr3encodings.c - -antlr3exception.lo: src/antlr3exception.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT antlr3exception.lo -MD -MP -MF $(DEPDIR)/antlr3exception.Tpo -c -o antlr3exception.lo `test -f 'src/antlr3exception.c' || echo '$(srcdir)/'`src/antlr3exception.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/antlr3exception.Tpo $(DEPDIR)/antlr3exception.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='src/antlr3exception.c' object='antlr3exception.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o antlr3exception.lo `test -f 'src/antlr3exception.c' || echo '$(srcdir)/'`src/antlr3exception.c - -antlr3filestream.lo: src/antlr3filestream.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT antlr3filestream.lo -MD -MP -MF $(DEPDIR)/antlr3filestream.Tpo -c -o antlr3filestream.lo `test -f 'src/antlr3filestream.c' || echo '$(srcdir)/'`src/antlr3filestream.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/antlr3filestream.Tpo $(DEPDIR)/antlr3filestream.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='src/antlr3filestream.c' object='antlr3filestream.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o antlr3filestream.lo `test -f 'src/antlr3filestream.c' || echo '$(srcdir)/'`src/antlr3filestream.c - -antlr3inputstream.lo: src/antlr3inputstream.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT antlr3inputstream.lo -MD -MP -MF $(DEPDIR)/antlr3inputstream.Tpo -c -o antlr3inputstream.lo `test -f 'src/antlr3inputstream.c' || echo '$(srcdir)/'`src/antlr3inputstream.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/antlr3inputstream.Tpo $(DEPDIR)/antlr3inputstream.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='src/antlr3inputstream.c' object='antlr3inputstream.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o antlr3inputstream.lo `test -f 'src/antlr3inputstream.c' || echo '$(srcdir)/'`src/antlr3inputstream.c - -antlr3intstream.lo: src/antlr3intstream.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT antlr3intstream.lo -MD -MP -MF $(DEPDIR)/antlr3intstream.Tpo -c -o antlr3intstream.lo `test -f 'src/antlr3intstream.c' || echo '$(srcdir)/'`src/antlr3intstream.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/antlr3intstream.Tpo $(DEPDIR)/antlr3intstream.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='src/antlr3intstream.c' object='antlr3intstream.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o antlr3intstream.lo `test -f 'src/antlr3intstream.c' || echo '$(srcdir)/'`src/antlr3intstream.c - -antlr3lexer.lo: src/antlr3lexer.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT antlr3lexer.lo -MD -MP -MF $(DEPDIR)/antlr3lexer.Tpo -c -o antlr3lexer.lo `test -f 'src/antlr3lexer.c' || echo '$(srcdir)/'`src/antlr3lexer.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/antlr3lexer.Tpo $(DEPDIR)/antlr3lexer.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='src/antlr3lexer.c' object='antlr3lexer.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o antlr3lexer.lo `test -f 'src/antlr3lexer.c' || echo '$(srcdir)/'`src/antlr3lexer.c - -antlr3parser.lo: src/antlr3parser.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT antlr3parser.lo -MD -MP -MF $(DEPDIR)/antlr3parser.Tpo -c -o antlr3parser.lo `test -f 'src/antlr3parser.c' || echo '$(srcdir)/'`src/antlr3parser.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/antlr3parser.Tpo $(DEPDIR)/antlr3parser.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='src/antlr3parser.c' object='antlr3parser.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o antlr3parser.lo `test -f 'src/antlr3parser.c' || echo '$(srcdir)/'`src/antlr3parser.c - -antlr3rewritestreams.lo: src/antlr3rewritestreams.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT antlr3rewritestreams.lo -MD -MP -MF $(DEPDIR)/antlr3rewritestreams.Tpo -c -o antlr3rewritestreams.lo `test -f 'src/antlr3rewritestreams.c' || echo '$(srcdir)/'`src/antlr3rewritestreams.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/antlr3rewritestreams.Tpo $(DEPDIR)/antlr3rewritestreams.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='src/antlr3rewritestreams.c' object='antlr3rewritestreams.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o antlr3rewritestreams.lo `test -f 'src/antlr3rewritestreams.c' || echo '$(srcdir)/'`src/antlr3rewritestreams.c - -antlr3string.lo: src/antlr3string.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT antlr3string.lo -MD -MP -MF $(DEPDIR)/antlr3string.Tpo -c -o antlr3string.lo `test -f 'src/antlr3string.c' || echo '$(srcdir)/'`src/antlr3string.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/antlr3string.Tpo $(DEPDIR)/antlr3string.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='src/antlr3string.c' object='antlr3string.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o antlr3string.lo `test -f 'src/antlr3string.c' || echo '$(srcdir)/'`src/antlr3string.c - -antlr3tokenstream.lo: src/antlr3tokenstream.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT antlr3tokenstream.lo -MD -MP -MF $(DEPDIR)/antlr3tokenstream.Tpo -c -o antlr3tokenstream.lo `test -f 'src/antlr3tokenstream.c' || echo '$(srcdir)/'`src/antlr3tokenstream.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/antlr3tokenstream.Tpo $(DEPDIR)/antlr3tokenstream.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='src/antlr3tokenstream.c' object='antlr3tokenstream.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o antlr3tokenstream.lo `test -f 'src/antlr3tokenstream.c' || echo '$(srcdir)/'`src/antlr3tokenstream.c - -antlr3treeparser.lo: src/antlr3treeparser.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT antlr3treeparser.lo -MD -MP -MF $(DEPDIR)/antlr3treeparser.Tpo -c -o antlr3treeparser.lo `test -f 'src/antlr3treeparser.c' || echo '$(srcdir)/'`src/antlr3treeparser.c -@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/antlr3treeparser.Tpo $(DEPDIR)/antlr3treeparser.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='src/antlr3treeparser.c' object='antlr3treeparser.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o antlr3treeparser.lo `test -f 'src/antlr3treeparser.c' || echo '$(srcdir)/'`src/antlr3treeparser.c - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -rm -f libtool config.lt -install-includeHEADERS: $(include_HEADERS) - @$(NORMAL_INSTALL) - test -z "$(includedir)" || $(MKDIR_P) "$(DESTDIR)$(includedir)" - @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \ - for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; \ - done | $(am__base_list) | \ - while read files; do \ - echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includedir)'"; \ - $(INSTALL_HEADER) $$files "$(DESTDIR)$(includedir)" || exit $$?; \ - done - -uninstall-includeHEADERS: - @$(NORMAL_UNINSTALL) - @list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \ - files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - test -n "$$files" || exit 0; \ - echo " ( cd '$(DESTDIR)$(includedir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(includedir)" && rm -f $$files - -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) antlr3config.h.in $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - set x; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) antlr3config.h.in $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - shift; \ - if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - if test $$# -gt 0; then \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - "$$@" $$unique; \ - else \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$unique; \ - fi; \ - fi -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) antlr3config.h.in $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - list='$(SOURCES) $(HEADERS) antlr3config.h.in $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - test -z "$(CTAGS_ARGS)$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && $(am__cd) $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) "$$here" - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(DISTFILES) - $(am__remove_distdir) - test -d "$(distdir)" || mkdir "$(distdir)" - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done - -test -n "$(am__skip_mode_fix)" \ - || find "$(distdir)" -type d ! -perm -755 \ - -exec chmod u+rwx,go+rx {} \; -o \ - ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ - ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ - ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ - || chmod -R a+r "$(distdir)" -dist-gzip: distdir - tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz - $(am__remove_distdir) - -dist-bzip2: distdir - tardir=$(distdir) && $(am__tar) | bzip2 -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-xz: distdir - tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz - $(am__remove_distdir) - -dist-tarZ: distdir - tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z - $(am__remove_distdir) - -dist-shar: distdir - shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz - $(am__remove_distdir) - -dist-zip: distdir - -rm -f $(distdir).zip - zip -rq $(distdir).zip $(distdir) - $(am__remove_distdir) - -dist dist-all: distdir - tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz - $(am__remove_distdir) - -# This target untars the dist file and tries a VPATH configuration. Then -# it guarantees that the distribution is self-contained by making another -# tarfile. -distcheck: dist - case '$(DIST_ARCHIVES)' in \ - *.tar.gz*) \ - GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ - *.tar.bz2*) \ - bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ - *.tar.lzma*) \ - lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\ - *.tar.xz*) \ - xz -dc $(distdir).tar.xz | $(am__untar) ;;\ - *.tar.Z*) \ - uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ - *.shar.gz*) \ - GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ - *.zip*) \ - unzip $(distdir).zip ;;\ - esac - chmod -R a-w $(distdir); chmod a+w $(distdir) - mkdir $(distdir)/_build - mkdir $(distdir)/_inst - chmod a-w $(distdir) - test -d $(distdir)/_build || exit 0; \ - dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ - && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ - && am__cwd=`pwd` \ - && $(am__cd) $(distdir)/_build \ - && ../configure --srcdir=.. --prefix="$$dc_install_base" \ - $(DISTCHECK_CONFIGURE_FLAGS) \ - && $(MAKE) $(AM_MAKEFLAGS) \ - && $(MAKE) $(AM_MAKEFLAGS) dvi \ - && $(MAKE) $(AM_MAKEFLAGS) check \ - && $(MAKE) $(AM_MAKEFLAGS) install \ - && $(MAKE) $(AM_MAKEFLAGS) installcheck \ - && $(MAKE) $(AM_MAKEFLAGS) uninstall \ - && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ - distuninstallcheck \ - && chmod -R a-w "$$dc_install_base" \ - && ({ \ - (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ - && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ - && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ - && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ - distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ - } || { rm -rf "$$dc_destdir"; exit 1; }) \ - && rm -rf "$$dc_destdir" \ - && $(MAKE) $(AM_MAKEFLAGS) dist \ - && rm -rf $(DIST_ARCHIVES) \ - && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ - && cd "$$am__cwd" \ - || exit 1 - $(am__remove_distdir) - @(echo "$(distdir) archives ready for distribution: "; \ - list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ - sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' -distuninstallcheck: - @$(am__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 $(LTLIBRARIES) $(HEADERS) antlr3config.h -installdirs: - for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)"; 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) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libLTLIBRARIES 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 - -html-am: - -info: info-am - -info-am: - -install-data-am: install-includeHEADERS - -install-dvi: install-dvi-am - -install-dvi-am: - -install-exec-am: install-libLTLIBRARIES - -install-html: install-html-am - -install-html-am: - -install-info: install-info-am - -install-info-am: - -install-man: - -install-pdf: install-pdf-am - -install-pdf-am: - -install-ps: install-ps-am - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -f $(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-includeHEADERS uninstall-libLTLIBRARIES - -.MAKE: all install-am install-strip - -.PHONY: CTAGS GTAGS all all-am am--refresh check check-am clean \ - clean-generic clean-libLTLIBRARIES clean-libtool ctags dist \ - dist-all dist-bzip2 dist-gzip dist-lzma dist-shar dist-tarZ \ - dist-xz dist-zip distcheck distclean distclean-compile \ - distclean-generic distclean-hdr distclean-libtool \ - distclean-tags distcleancheck distdir distuninstallcheck dvi \ - dvi-am html html-am info info-am install install-am \ - install-data install-data-am install-dvi install-dvi-am \ - install-exec install-exec-am install-html install-html-am \ - install-includeHEADERS install-info install-info-am \ - install-libLTLIBRARIES 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-includeHEADERS \ - uninstall-libLTLIBRARIES - - -export OBJECT_MODE - -# 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/impl/antlr/libantlr3c-3.4/NEWS b/impl/antlr/libantlr3c-3.4/NEWS deleted file mode 100644 index aea82ff..0000000 --- a/impl/antlr/libantlr3c-3.4/NEWS +++ /dev/null @@ -1,2 +0,0 @@ -See www.antlr.org and the associated email forums for release dates and -other announcements. diff --git a/impl/antlr/libantlr3c-3.4/README b/impl/antlr/libantlr3c-3.4/README deleted file mode 100644 index a1c0555..0000000 --- a/impl/antlr/libantlr3c-3.4/README +++ /dev/null @@ -1,1924 +0,0 @@ -ANTLR v3.0.1 C Runtime -ANTLR 3.0.1 -January 1, 2008 - -At the moment, the use of the C runtime engine for the parser is not generally -for the inexperienced C programmer. However this is mainly because of the lack -of documentation on use, which will be corrected shortly. The C runtime -code itself is however well documented with doxygen style comments and a -reasonably experienced C programmer should be able to piece it together. You -can visit the documentation at: http://www.antlr.org/api/C/index.html - -The general make up is that everything is implemented as a pseudo class/object -initialized with pointers to its 'member' functions and data. All objects are -(usually) created by factories, which auto manage the memory allocation and -release and generally make life easier. If you remember this rule, everything -should fall in to place. - -Jim Idle - Portland Oregon, Jan 2008 -jimi idle ws - -=============================================================================== - -Terence Parr, parrt at cs usfca edu -ANTLR project lead and supreme dictator for life -University of San Francisco - -INTRODUCTION - -Welcome to ANTLR v3! I've been working on this for nearly 4 years and it's -almost ready! I plan no feature additions between this beta and first -3.0 release. I have lots of features to add later, but this will be -the first set. Ultimately, I need to rewrite ANTLR v3 in itself (it's -written in 2.7.7 at the moment and also needs StringTemplate 3.0 or -later). - -You should use v3 in conjunction with ANTLRWorks: - - http://www.antlr.org/works/index.html - -WARNING: We have bits of documentation started, but nothing super-complete -yet. The book will be printed May 2007: - -http://www.pragmaticprogrammer.com/titles/tpantlr/index.html - -but we should have a beta PDF available on that page in Feb 2007. - -You also have the examples plus the source to guide you. - -See the new wiki FAQ: - - http://www.antlr.org/wiki/display/ANTLR3/ANTLR+v3+FAQ - -and general doc root: - - http://www.antlr.org/wiki/display/ANTLR3/ANTLR+3+Wiki+Home - -Please help add/update FAQ entries. - -I have made very little effort at this point to deal well with -erroneous input (e.g., bad syntax might make ANTLR crash). I will clean -this up after I've rewritten v3 in v3. - -Per the license in LICENSE.txt, this software is not guaranteed to -work and might even destroy all life on this planet: - -THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, -INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING -IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. - -EXAMPLES - -ANTLR v3 sample grammars: - - http://www.antlr.org/download/examples-v3.tar.gz - -contains the following examples: LL-star, cminus, dynamic-scope, -fuzzy, hoistedPredicates, island-grammar, java, python, scopes, -simplecTreeParser, treeparser, tweak, xmlLexer. - -Also check out Mantra Programming Language for a prototype (work in -progress) using v3: - - http://www.linguamantra.org/ - ----------------------------------------------------------------------- - -What is ANTLR? - -ANTLR stands for (AN)other (T)ool for (L)anguage (R)ecognition and was -originally known as PCCTS. ANTLR is a language tool that provides a -framework for constructing recognizers, compilers, and translators -from grammatical descriptions containing actions. Target language list: - -http://www.antlr.org/wiki/display/ANTLR3/Code+Generation+Targets - ----------------------------------------------------------------------- - -How is ANTLR v3 different than ANTLR v2? - -See migration guide: - http://www.antlr.org/wiki/display/ANTLR3/Migrating+from+ANTLR+2+to+ANTLR+3 - -ANTLR v3 has a far superior parsing algorithm called LL(*) that -handles many more grammars than v2 does. In practice, it means you -can throw almost any grammar at ANTLR that is non-left-recursive and -unambiguous (same input can be matched by multiple rules); the cost is -perhaps a tiny bit of backtracking, but with a DFA not a full parser. -You can manually set the max lookahead k as an option for any decision -though. The LL(*) algorithm ramps up to use more lookahead when it -needs to and is much more efficient than normal LL backtracking. There -is support for syntactic predicate (full LL backtracking) when LL(*) -fails. - -Lexers are much easier due to the LL(*) algorithm as well. Previously -these two lexer rules would cause trouble because ANTLR couldn't -distinguish between them with finite lookahead to see the decimal -point: - -INT : ('0'..'9')+ ; -FLOAT : INT '.' INT ; - -The syntax is almost identical for features in common, but you should -note that labels are always '=' not ':'. So do id=ID not id:ID. - -You can do combined lexer/parser grammars again (ala PCCTS) both lexer -and parser rules are defined in the same file. See the examples. -Really nice. You can reference strings and characters in the grammar -and ANTLR will generate the lexer for you. - -The attribute structure has been enhanced. Rules may have multiple -return values, for example. Further, there are dynamically scoped -attributes whereby a rule may define a value usable by any rule it -invokes directly or indirectly w/o having to pass a parameter all the -way down. - -ANTLR v3 tree construction is far superior--it provides tree rewrite -rules where the right hand side is simply the tree grammar fragment -describing the tree you want to build: - -formalArgs - : typename declarator (',' typename declarator )* - -> ^(ARG typename declarator)+ - ; - -That builds tree sequences like: - -^(ARG int v1) ^(ARG int v2) - -ANTLR v3 also incorporates StringTemplate: - - http://www.stringtemplate.org - -just like AST support. It is useful for generating output. For -example this rule creates a template called 'import' for each import -definition found in the input stream: - -grammar Java; -options { - output=template; -} -... -importDefinition - : 'import' identifierStar SEMI - -> import(name={$identifierStar.st}, - begin={$identifierStar.start}, - end={$identifierStar.stop}) - ; - -The attributes are set via assignments in the argument list. The -arguments are actions with arbitrary expressions in the target -language. The .st label property is the result template from a rule -reference. There is a nice shorthand in actions too: - - %foo(a={},b={},...) ctor - %({name-expr})(a={},...) indirect template ctor reference - %{string-expr} anonymous template from string expr - %{expr}.y = z; template attribute y of StringTemplate-typed expr to z - %x.y = z; set template attribute y of x (always set never get attr) - to z [languages like python without ';' must still use the - ';' which the code generator is free to remove during code gen] - Same as '(x).setAttribute("y", z);' - -For ANTLR v3 I decided to make the most common tasks easy by default -rather. This means that some of the basic objects are heavier weight -than some speed demons would like, but they are free to pare it down -leaving most programmers the luxury of having it "just work." For -example, to read in some input, tweak it, and write it back out -preserving whitespace, is easy in v3. - -The ANTLR source code is much prettier. You'll also note that the -run-time classes are conveniently encapsulated in the -org.antlr.runtime package. - ----------------------------------------------------------------------- - -How do I install this damn thing? - -Just untar and you'll get: - -antlr-3.0b6/README.txt (this file) -antlr-3.0b6/LICENSE.txt -antlr-3.0b6/src/org/antlr/... -antlr-3.0b6/lib/stringtemplate-3.0.jar (3.0b6 needs 3.0) -antlr-3.0b6/lib/antlr-2.7.7.jar -antlr-3.0b6/lib/antlr-3.0b6.jar - -Then you need to add all the jars in lib to your CLASSPATH. - ----------------------------------------------------------------------- - -How do I use ANTLR v3? - -[I am assuming you are only using the command-line (and not the -ANTLRWorks GUI)]. - -Running ANTLR with no parameters shows you: - -ANTLR Parser Generator Early Access Version 3.0b6 (Jan 31, 2007) 1989-2007 -usage: java org.antlr.Tool [args] file.g [file2.g file3.g ...] - -o outputDir specify output directory where all output is generated - -lib dir specify location of token files - -report print out a report about the grammar(s) processed - -print print out the grammar without actions - -debug generate a parser that emits debugging events - -profile generate a parser that computes profiling information - -nfa generate an NFA for each rule - -dfa generate a DFA for each decision point - -message-format name specify output style for messages - -X display extended argument list - -For example, consider how to make the LL-star example from the examples -tarball you can get at http://www.antlr.org/download/examples-v3.tar.gz - -$ cd examples/java/LL-star -$ java org.antlr.Tool simplec.g -$ jikes *.java - -For input: - -char c; -int x; -void bar(int x); -int foo(int y, char d) { - int i; - for (i=0; i<3; i=i+1) { - x=3; - y=5; - } -} - -you will see output as follows: - -$ java Main input -bar is a declaration -foo is a definition - -What if I want to test my parser without generating code? Easy. Just -run ANTLR in interpreter mode. It can't execute your actions, but it -can create a parse tree from your input to show you how it would be -matched. Use the org.antlr.tool.Interp main class. In the following, -I interpret simplec.g on t.c, which contains "int x;" - -$ java org.antlr.tool.Interp simplec.g WS program t.c -( - ( program - ( declaration - ( variable - ( type [@0,0:2='int',<14>,1:0] ) - ( declarator [@2,4:4='x',<2>,1:4] ) - [@3,5:5=';',<5>,1:5] - ) - ) - ) -) - -where I have formatted the output to make it more readable. I have -told it to ignore all WS tokens. - ----------------------------------------------------------------------- - -How do I rebuild ANTLR v3? - -Make sure the following two jars are in your CLASSPATH - -antlr-3.0b6/lib/stringtemplate-3.0.jar -antlr-3.0b6/lib/antlr-2.7.7.jar -junit.jar [if you want to build the test directories] - -then jump into antlr-3.0b6/src directory and then type: - -$ javac -d . org/antlr/Tool.java org/antlr/*/*.java org/antlr/*/*/*.java - -Takes 9 seconds on my 1Ghz laptop or 4 seconds with jikes. Later I'll -have a real build mechanism, though I must admit the one-liner appeals -to me. I use Intellij so I never type anything actually to build. - -There is also an ANT build.xml file, but I know nothing of ANT; contributed -by others (I'm opposed to any tool with an XML interface for Humans). - ------------------------------------------------------------------------ -C# Target Notes - -1. Auto-generated lexers do not inherit parent parser's @namespace - {...} value. Use @lexer::namespace{...}. - ------------------------------------------------------------------------ - -CHANGES - -March 17, 2007 - -* Jonathan DeKlotz updated C# templates to be 3.0b6 current - -March 14, 2007 - -* Manually-specified (...)=> force backtracking eval of that predicate. - backtracking=true mode does not however. Added unit test. - -March 14, 2007 - -* Fixed bug in lexer where ~T didn't compute the set from rule T. - -* Added -Xnoinlinedfa make all DFA with tables; no inline prediction with IFs - -* Fixed http://www.antlr.org:8888/browse/ANTLR-80. - Sem pred states didn't define lookahead vars. - -* Fixed http://www.antlr.org:8888/browse/ANTLR-91. - When forcing some acyclic DFA to be state tables, they broke. - Forcing all DFA to be state tables should give same results. - -March 12, 2007 - -* setTokenSource in CommonTokenStream didn't clear tokens list. - setCharStream calls reset in Lexer. - -* Altered -depend. No longer printing grammar files for multiple input - files with -depend. Doesn't show T__.g temp file anymore. Added - TLexer.tokens. Added .h files if defined. - -February 11, 2007 - -* Added -depend command-line option that, instead of processing files, - it shows you what files the input grammar(s) depend on and what files - they generate. For combined grammar T.g: - - $ java org.antlr.Tool -depend T.g - - You get: - - TParser.java : T.g - T.tokens : T.g - T__.g : T.g - - Now, assuming U.g is a tree grammar ref'd T's tokens: - - $ java org.antlr.Tool -depend T.g U.g - - TParser.java : T.g - T.tokens : T.g - T__.g : T.g - U.g: T.tokens - U.java : U.g - U.tokens : U.g - - Handles spaces by escaping them. Pays attention to -o, -fo and -lib. - Dir 'x y' is a valid dir in current dir. - - $ java org.antlr.Tool -depend -lib /usr/local/lib -o 'x y' T.g U.g - x\ y/TParser.java : T.g - x\ y/T.tokens : T.g - x\ y/T__.g : T.g - U.g: /usr/local/lib/T.tokens - x\ y/U.java : U.g - x\ y/U.tokens : U.g - - You have API access via org.antlr.tool.BuildDependencyGenerator class: - getGeneratedFileList(), getDependenciesFileList(). You can also access - the output template: getDependencies(). The file - org/antlr/tool/templates/depend.stg contains the template. You can - modify as you want. File objects go in so you can play with path etc... - -February 10, 2007 - -* no more .gl files generated. All .g all the time. - -* changed @finally to be @after and added a finally clause to the - exception stuff. I also removed the superfluous "exception" - keyword. Here's what the new syntax looks like: - - a - @after { System.out.println("ick"); } - : 'a' - ; - catch[RecognitionException e] { System.out.println("foo"); } - catch[IOException e] { System.out.println("io"); } - finally { System.out.println("foobar"); } - - @after executes after bookkeeping to set $rule.stop, $rule.tree but - before scopes pop and any memoization happens. Dynamic scopes and - memoization are still in generated finally block because they must - exec even if error in rule. The @after action and tree setting - stuff can technically be skipped upon syntax error in rule. [Later - we might add something to finally to stick an ERROR token in the - tree and set the return value.] Sequence goes: set $stop, $tree (if - any), @after (if any), pop scopes (if any), memoize (if needed), - grammar finally clause. Last 3 are in generated code's finally - clause. - -3.0b6 - January 31, 2007 - -January 30, 2007 - -* Fixed bug in IntervalSet.and: it returned the same empty set all the time - rather than new empty set. Code altered the same empty set. - -* Made analysis terminate faster upon a decision that takes too long; - it seemed to keep doing work for a while. Refactored some names - and updated comments. Also made it terminate when it realizes it's - non-LL(*) due to recursion. just added terminate conditions to loop - in convert(). - -* Sometimes fatal non-LL(*) messages didn't appear; instead you got - "antlr couldn't analyze", which is actually untrue. I had the - order of some prints wrong in the DecisionProbe. - -* The code generator incorrectly detected when it could use a fixed, - acyclic inline DFA (i.e., using an IF). Upon non-LL(*) decisions - with predicates, analysis made cyclic DFA. But this stops - the computation detecting whether they are cyclic. I just added - a protection in front of the acyclic DFA generator to avoid if - non-LL(*). Updated comments. - -January 23, 2007 - -* Made tree node streams use adaptor to create navigation nodes. - Thanks to Emond Papegaaij. - -January 22, 2007 - -* Added lexer rule properties: start, stop - -January 1, 2007 - -* analysis failsafe is back on; if a decision takes too long, it bails out - and uses k=1 - -January 1, 2007 - -* += labels for rules only work for output option; previously elements - of list were the return value structs, but are now either the tree or - StringTemplate return value. You can label different rules now - x+=a x+=b. - -December 30, 2006 - -* Allow \" to work correctly in "..." template. - -December 28, 2006 - -* errors that are now warnings: missing AST label type in trees. - Also "no start rule detected" is warning. - -* tree grammars also can do rewrite=true for output=template. - Only works for alts with single node or tree as alt elements. - If you are going to use $text in a tree grammar or do rewrite=true - for templates, you must use in your main: - - nodes.setTokenStream(tokens); - -* You get a warning for tree grammars that do rewrite=true and - output=template and have -> for alts that are not simple nodes - or simple trees. new unit tests in TestRewriteTemplates at end. - -December 27, 2006 - -* Error message appears when you use -> in tree grammar with - output=template and rewrite=true for alt that is not simple - node or tree ref. - -* no more $stop attribute for tree parsers; meaningless/useless. - Removed from TreeRuleReturnScope also. - -* rule text attribute in tree parser must pull from token buffer. - Makes no sense otherwise. added getTokenStream to TreeNodeStream - so rule $text attr works. CommonTreeNodeStream etc... now let - you set the token stream so you can access later from tree parser. - $text is not well-defined for rules like - - slist : stat+ ; - - because stat is not a single node nor rooted with a single node. - $slist.text will get only first stat. I need to add a warning about - this... - -* Fixed http://www.antlr.org:8888/browse/ANTLR-76 for Java. - Enhanced TokenRewriteStream so it accepts any object; converts - to string at last second. Allows you to rewrite with StringTemplate - templates now :) - -* added rewrite option that makes -> template rewrites do replace ops for - TokenRewriteStream input stream. In output=template and rewrite=true mode - same as before 'cept that the parser does - - ((TokenRewriteStream)input).replace( - ((Token)retval.start).getTokenIndex(), - input.LT(-1).getTokenIndex(), - retval.st); - - after each rewrite so that the input stream is altered. Later refs to - $text will have rewrites. Here's a sample test program for grammar Rew. - - FileReader groupFileR = new FileReader("Rew.stg"); - StringTemplateGroup templates = new StringTemplateGroup(groupFileR); - ANTLRInputStream input = new ANTLRInputStream(System.in); - RewLexer lexer = new RewLexer(input); - TokenRewriteStream tokens = new TokenRewriteStream(lexer); - RewParser parser = new RewParser(tokens); - parser.setTemplateLib(templates); - parser.program(); - System.out.println(tokens.toString()); - groupFileR.close(); - -December 26, 2006 - -* BaseTree.dupTree didn't dup recursively. - -December 24, 2006 - -* Cleaned up some comments and removed field treeNode - from MismatchedTreeNodeException class. It is "node" in - RecognitionException. - -* Changed type from Object to BitSet for expecting fields in - MismatchedSetException and MismatchedNotSetException - -* Cleaned up error printing in lexers and the messages that it creates. - -* Added this to TreeAdaptor: - /** Return the token object from which this node was created. - * Currently used only for printing an error message. - * The error display routine in BaseRecognizer needs to - * display where the input the error occurred. If your - * tree of limitation does not store information that can - * lead you to the token, you can create a token filled with - * the appropriate information and pass that back. See - * BaseRecognizer.getErrorMessage(). - */ - public Token getToken(Object t); - -December 23, 2006 - -* made BaseRecognizer.displayRecognitionError nonstatic so people can - override it. Not sure why it was static before. - -* Removed state/decision message that comes out of no - viable alternative exceptions, as that was too much. - removed the decision number from the early exit exception - also. During development, you can simply override - displayRecognitionError from BaseRecognizer to add the stuff - back in if you want. - -* made output go to an output method you can override: emitErrorMessage() - -* general cleanup of the error emitting code in BaseRecognizer. Lots - more stuff you can override: getErrorHeader, getTokenErrorDisplay, - emitErrorMessage, getErrorMessage. - -December 22, 2006 - -* Altered Tree.Parser.matchAny() so that it skips entire trees if - node has children otherwise skips one node. Now this works to - skip entire body of function if single-rooted subtree: - ^(FUNC name=ID arg=ID .) - -* Added "reverse index" from node to stream index. Override - fillReverseIndex() in CommonTreeNodeStream if you want to change. - Use getNodeIndex(node) to find stream index for a specific tree node. - See getNodeIndex(), reverseIndex(Set tokenTypes), - reverseIndex(int tokenType), fillReverseIndex(). The indexing - costs time and memory to fill, but pulling stuff out will be lots - faster as it can jump from a node ptr straight to a stream index. - -* Added TreeNodeStream.get(index) to make it easier for interpreters to - jump around in tree node stream. - -* New CommonTreeNodeStream buffers all nodes in stream for fast jumping - around. It now has push/pop methods to invoke other locations in - the stream for building interpreters. - -* Moved CommonTreeNodeStream to UnBufferedTreeNodeStream and removed - Iterator implementation. moved toNodesOnlyString() to TestTreeNodeStream - -* [BREAKS ANY TREE IMPLEMENTATION] - made CommonTreeNodeStream work with any tree node type. TreeAdaptor - now implements isNil so must add; trivial, but does break back - compatibility. - -December 17, 2006 - -* Added traceIn/Out methods to recognizers so that you can override them; - previously they were in-line print statements. The message has also - been slightly improved. - -* Factored BuildParseTree into debug package; cleaned stuff up. Fixed - unit tests. - -December 15, 2006 - -* [BREAKS ANY TREE IMPLEMENTATION] - org.antlr.runtime.tree.Tree; needed to add get/set for token start/stop - index so CommonTreeAdaptor can assume Tree interface not CommonTree - implementation. Otherwise, no way to create your own nodes that satisfy - Tree because CommonTreeAdaptor was doing - - public int getTokenStartIndex(Object t) { - return ((CommonTree)t).startIndex; - } - - Added to Tree: - - /** What is the smallest token index (indexing from 0) for this node - * and its children? - */ - int getTokenStartIndex(); - - void setTokenStartIndex(int index); - - /** What is the largest token index (indexing from 0) for this node - * and its children? - */ - int getTokenStopIndex(); - - void setTokenStopIndex(int index); - -December 13, 2006 - -* Added org.antlr.runtime.tree.DOTTreeGenerator so you can generate DOT - diagrams easily from trees. - - CharStream input = new ANTLRInputStream(System.in); - TLexer lex = new TLexer(input); - CommonTokenStream tokens = new CommonTokenStream(lex); - TParser parser = new TParser(tokens); - TParser.e_return r = parser.e(); - Tree t = (Tree)r.tree; - System.out.println(t.toStringTree()); - DOTTreeGenerator gen = new DOTTreeGenerator(); - StringTemplate st = gen.toDOT(t); - System.out.println(st); - -* Changed the way mark()/rewind() work in CommonTreeNode stream to mirror - more flexible solution in ANTLRStringStream. Forgot to set lastMarker - anyway. Now you can rewind to non-most-recent marker. - -December 12, 2006 - -* Temp lexer now end in .gl (T__.gl, for example) - -* TreeParser suffix no longer generated for tree grammars - -* Defined reset for lexer, parser, tree parser; rewinds the input stream also - -December 10, 2006 - -* Made Grammar.abortNFAToDFAConversion() abort in middle of a DFA. - -December 9, 2006 - -* fixed bug in OrderedHashSet.add(). It didn't track elements correctly. - -December 6, 2006 - -* updated build.xml for future Ant compatibility, thanks to Matt Benson. - -* various tests in TestRewriteTemplate and TestSyntacticPredicateEvaluation - were using the old 'channel' vs. new '$channel' notation. - TestInterpretedParsing didn't pick up an earlier change to CommonToken. - Reported by Matt Benson. - -* fixed platform dependent test failures in TestTemplates, supplied by Matt - Benson. - -November 29, 2006 - -* optimized semantic predicate evaluation so that p||!p yields true. - -November 22, 2006 - -* fixed bug that prevented var = $rule.some_retval from working in anything - but the first alternative of a rule or subrule. - -* attribute names containing digits were not allowed, this is now fixed, - allowing attributes like 'name1' but not '1name1'. - -November 19, 2006 - -* Removed LeftRecursionMessage and apparatus because it seems that I check - for left recursion upfront before analysis and everything gets specified as - recursion cycles at this point. - -November 16, 2006 - -* TokenRewriteStream.replace was not passing programName to next method. - -November 15, 2006 - -* updated DOT files for DFA generation to make smaller circles. - -* made epsilon edges italics in the NFA diagrams. - -3.0b5 - November 15, 2006 - -The biggest thing is that your grammar file names must match the grammar name -inside (your generated class names will also be different) and we use -$channel=HIDDEN now instead of channel=99 inside lexer actions. -Should be compatible other than that. Please look at complete list of -changes. - -November 14, 2006 - -* Force token index to be -1 for CommonIndex in case not set. - -November 11, 2006 - -* getUniqueID for TreeAdaptor now uses identityHashCode instead of hashCode. - -November 10, 2006 - -* No grammar nondeterminism warning now when wildcard '.' is final alt. - Examples: - - a : A | B | . ; - - A : 'a' - | . - ; - - SL_COMMENT - : '//' (options {greedy=false;} : .)* '\r'? '\n' - ; - - SL_COMMENT2 - : '//' (options {greedy=false;} : 'x'|.)* '\r'? '\n' - ; - - -November 8, 2006 - -* Syntactic predicates did not get hoisting properly upon non-LL(*) decision. Other hoisting issues fixed. Cleaned up code. - -* Removed failsafe that check to see if I'm spending too much time on a single DFA; I don't think we need it anymore. - -November 3, 2006 - -* $text, $line, etc... were not working in assignments. Fixed and added - test case. - -* $label.text translated to label.getText in lexer even if label was on a char - -November 2, 2006 - -* Added error if you don't specify what the AST type is; actions in tree - grammar won't work without it. - - $ cat x.g - tree grammar x; - a : ID {String s = $ID.text;} ; - - ANTLR Parser Generator Early Access Version 3.0b5 (??, 2006) 1989-2006 - error: x.g:0:0: (152) tree grammar x has no ASTLabelType option - -November 1, 2006 - -* $text, $line, etc... were not working properly within lexer rule. - -October 32, 2006 - -* Finally actions now execute before dynamic scopes are popped it in the - rule. Previously was not possible to access the rules scoped variables - in a finally action. - -October 29, 2006 - -* Altered ActionTranslator to emit errors on setting read-only attributes - such as $start, $stop, $text in a rule. Also forbid setting any attributes - in rules/tokens referenced by a label or name. - Setting dynamic scopes's attributes and your own parameter attributes - is legal. - -October 27, 2006 - -* Altered how ANTLR figures out what decision is associated with which - block of grammar. Makes ANTLRWorks correctly find DFA for a block. - -October 26, 2006 - -* Fixed bug where EOT transitions led to no NFA configs in a DFA state, - yielding an error in DFA table generation. - -* renamed action.g to ActionTranslator.g - the ActionTranslator class is now called ActionTranslatorLexer, as ANTLR - generates this classname now. Fixed rest of codebase accordingly. - -* added rules recognizing setting of scopes' attributes to ActionTranslator.g - the Objective C target needed access to the right-hand side of the assignment - in order to generate correct code - -* changed ANTLRCore.sti to reflect the new mandatory templates to support the above - namely: scopeSetAttributeRef, returnSetAttributeRef and the ruleSetPropertyRef_* - templates, with the exception of ruleSetPropertyRef_text. we cannot set this attribute - -October 19, 2006 - -* Fixed 2 bugs in DFA conversion that caused exceptions. - altered functionality of getMinElement so it ignores elements<0. - -October 18, 2006 - -* moved resetStateNumbersToBeContiguous() to after issuing of warnings; - an internal error in that routine should make more sense as issues - with decision will appear first. - -* fixed cut/paste bug I introduced when fixed EOF in min/max - bug. Prevented C grammar from working briefly. - -October 17, 2006 - -* Removed a failsafe that seems to be unnecessary that ensure DFA didn't - get too big. It was resulting in some failures in code generation that - led me on quite a strange debugging trip. - -October 16, 2006 - -* Use channel=HIDDEN not channel=99 to put tokens on hidden channel. - -October 12, 2006 - -* ANTLR now has a customizable message format for errors and warnings, - to make it easier to fulfill requirements by IDEs and such. - The format to be used can be specified via the '-message-format name' - command line switch. The default for name is 'antlr', also available - at the moment is 'gnu'. This is done via StringTemplate, for details - on the requirements look in org/antlr/tool/templates/messages/formats/ - -* line numbers for lexers in combined grammars are now reported correctly. - -September 29, 2006 - -* ANTLRReaderStream improperly checked for end of input. - -September 28, 2006 - -* For ANTLRStringStream, LA(-1) was off by one...gave you LA(-2). - -3.0b4 - August 24, 2006 - -* error when no rules in grammar. doesn't crash now. - -* Token is now an interface. - -* remove dependence on non runtime classes in runtime package. - -* filename and grammar name must be same Foo in Foo.g. Generates FooParser, - FooLexer, ... Combined grammar Foo generates Foo$Lexer.g which generates - FooLexer.java. tree grammars generate FooTreeParser.java - -August 24, 2006 - -* added C# target to lib, codegen, templates - -August 11, 2006 - -* added tree arg to navigation methods in treeadaptor - -August 07, 2006 - -* fixed bug related to (a|)+ on end of lexer rules. crashed instead - of warning. - -* added warning that interpreter doesn't do synpreds yet - -* allow different source of classloader: -ClassLoader cl = Thread.currentThread().getContextClassLoader(); -if ( cl==null ) { - cl = this.getClass().getClassLoader(); -} - - -July 26, 2006 - -* compressed DFA edge tables significantly. All edge tables are - unique. The transition table can reuse arrays. Look like this now: - - public static readonly DFA30_transition0 = - new short[] { 46, 46, -1, 46, 46, -1, -1, -1, -1, -1, -1, -1,...}; - public static readonly DFA30_transition1 = - new short[] { 21 }; - public static readonly short[][] DFA30_transition = { - DFA30_transition0, - DFA30_transition0, - DFA30_transition1, - ... - }; - -* If you defined both a label like EQ and '=', sometimes the '=' was - used instead of the EQ label. - -* made headerFile template have same arg list as outputFile for consistency - -* outputFile, lexer, genericParser, parser, treeParser templates - reference cyclicDFAs attribute which was no longer used after I - started the new table-based DFA. I made cyclicDFADescriptors - argument to outputFile and headerFile (only). I think this is - correct as only OO languages will want the DFA in the recognizer. - At the top level, C and friends can use it. Changed name to use - cyclicDFAs again as it's a better name probably. Removed parameter - from the lexer, ... For example, my parser template says this now: - - - -* made all token ref token types go thru code gen's - getTokenTypeAsTargetLabel() - -* no more computing DFA transition tables for acyclic DFA. - -July 25, 2006 - -* fixed a place where I was adding syn predicates into rewrite stuff. - -* turned off invalid token index warning in AW support; had a problem. - -* bad location event generated with -debug for synpreds in autobacktrack mode. - -July 24, 2006 - -* changed runtime.DFA so that it treats all chars and token types as - char (unsigned 16 bit int). -1 becomes '\uFFFF' then or 65535. - -* changed MAX_STATE_TRANSITIONS_FOR_TABLE to be 65534 by default - now. This means that all states can use a table to do transitions. - -* was not making synpreds on (C)* type loops with backtrack=true - -* was copying tree stuff and actions into synpreds with backtrack=true - -* was making synpreds on even single alt rules / blocks with backtrack=true - -3.0b3 - July 21, 2006 - -* ANTLR fails to analyze complex decisions much less frequently. It - turns out that the set of decisions for which ANTLR fails (times - out) is the same set (so far) of non-LL(*) decisions. Morever, I'm - able to detect this situation quickly and report rather than timing - out. Errors look like: - - java.g:468:23: [fatal] rule concreteDimensions has non-LL(*) - decision due to recursive rule invocations in alts 1,2. Resolve - by left-factoring or using syntactic predicates with fixed k - lookahead or use backtrack=true option. - - This message only appears when k=*. - -* Shortened no viable alt messages to not include decision - description: - -[compilationUnit, declaration]: line 8:8 decision=<<67:1: declaration -: ( ( fieldDeclaration )=> fieldDeclaration | ( methodDeclaration )=> -methodDeclaration | ( constructorDeclaration )=> -constructorDeclaration | ( classDeclaration )=> classDeclaration | ( -interfaceDeclaration )=> interfaceDeclaration | ( blockDeclaration )=> -blockDeclaration | emptyDeclaration );>> state 3 (decision=14) no -viable alt; token=[@1,184:187='java',<122>,8:8] - - too long and hard to read. - -July 19, 2006 - -* Code gen bug: states with no emanating edges were ignored by ST. - Now an empty list is used. - -* Added grammar parameter to recognizer templates so they can access - properties like getName(), ... - -July 10, 2006 - -* Fixed the gated pred merged state bug. Added unit test. - -* added new method to Target: getTokenTypeAsTargetLabel() - -July 7, 2006 - -* I was doing an AND instead of OR in the gated predicate stuff. - Thanks to Stephen Kou! - -* Reduce op for combining predicates was insanely slow sometimes and - didn't actually work well. Now it's fast and works. - -* There is a bug in merging of DFA stop states related to gated - preds...turned it off for now. - -3.0b2 - July 5, 2006 - -July 5, 2006 - -* token emission not properly protected in lexer filter mode. - -* EOT, EOT DFA state transition tables should be init'd to -1 (only - was doing this for compressed tables). Fixed. - -* in trace mode, exit method not shown for memoized rules - -* added -Xmaxdfaedges to allow you to increase number of edges allowed - for a single DFA state before it becomes "special" and can't fit in - a simple table. - -* Bug in tables. Short are signed so min/max tables for DFA are now - char[]. Bizarre. - -July 3, 2006 - -* Added a method to reset the tool error state for current thread. - See ErrorManager.java - -* [Got this working properly today] backtrack mode that let's you type - in any old crap and ANTLR will backtrack if it can't figure out what - you meant. No errors are reported by antlr during analysis. It - implicitly adds a syn pred in front of every production, using them - only if static grammar LL(*) analysis fails. Syn pred code is not - generated if the pred is not used in a decision. - - This is essentially a rapid prototyping mode. - -* Added backtracking report to the -report option - -* Added NFA->DFA conversion early termination report to the -report option - -* Added grammar level k and backtrack options to -report - -* Added a dozen unit tests to test autobacktrack NFA construction. - -* If you are using filter mode, you must manually use option - memoize=true now. - -July 2, 2006 - -* Added k=* option so you can set k=2, for example, on whole grammar, - but an individual decision can be LL(*). - -* memoize option for grammars, rules, blocks. Remove -nomemo cmd-line option - -* but in DOT generator for DFA; fixed. - -* runtime.DFA reported errors even when backtracking - -July 1, 2006 - -* Added -X option list to help - -* Syn preds were being hoisted into other rules, causing lots of extra - backtracking. - -June 29, 2006 - -* unnecessary files removed during build. - -* Matt Benson updated build.xml - -* Detecting use of synpreds in analysis now instead of codegen. In - this way, I can avoid analyzing decisions in synpreds for synpreds - not used in a DFA for a real rule. This is used to optimize things - for backtrack option. - -* Code gen must add _fragment or whatever to end of pred name in - template synpredRule to avoid having ANTLR know anything about - method names. - -* Added -IdbgST option to emit ST delimiters at start/stop of all - templates spit out. - -June 28, 2006 - -* Tweaked message when ANTLR cannot handle analysis. - -3.0b1 - June 27, 2006 - -June 24, 2006 - -* syn preds no longer generate little static classes; they also don't - generate a whole bunch of extra crap in the rules built to test syn - preds. Removed GrammarFragmentPointer class from runtime. - -June 23-24, 2006 - -* added output option to -report output. - -* added profiling info: - Number of rule invocations in "guessing" mode - number of rule memoization cache hits - number of rule memoization cache misses - -* made DFA DOT diagrams go left to right not top to bottom - -* I try to recursive overflow states now by resolving these states - with semantic/syntactic predicates if they exist. The DFA is then - deterministic rather than simply resolving by choosing first - nondeterministic alt. I used to generated errors: - -~/tmp $ java org.antlr.Tool -dfa t.g -ANTLR Parser Generator Early Access Version 3.0b2 (July 5, 2006) 1989-2006 -t.g:2:5: Alternative 1: after matching input such as A A A A A decision cannot predict what comes next due to recursion overflow to b from b -t.g:2:5: Alternative 2: after matching input such as A A A A A decision cannot predict what comes next due to recursion overflow to b from b - - Now, I uses predicates if available and emits no warnings. - -* made sem preds share accept states. Previously, multiple preds in a -decision forked new accepts each time for each nondet state. - -June 19, 2006 - -* Need parens around the prediction expressions in templates. - -* Referencing $ID.text in an action forced bad code gen in lexer rule ID. - -* Fixed a bug in how predicates are collected. The definition of - "last predicated alternative" was incorrect in the analysis. Further, - gated predicates incorrectly missed a case where an edge should become - true (a tautology). - -* Removed an unnecessary input.consume() reference in the runtime/DFA class. - -June 14, 2006 - -* -> ($rulelabel)? didn't generate proper code for ASTs. - -* bug in code gen (did not compile) -a : ID -> ID - | ID -> ID - ; -Problem is repeated ref to ID from left side. Juergen pointed this out. - -* use of tokenVocab with missing file yielded exception - -* (A|B)=> foo yielded an exception as (A|B) is a set not a block. Fixed. - -* Didn't set ID1= and INT1= for this alt: - | ^(ID INT+ {System.out.print(\"^(\"+$ID+\" \"+$INT+\")\");}) - -* Fixed so repeated dangling state errors only occur once like: -t.g:4:17: the decision cannot distinguish between alternative(s) 2,1 for at least one input sequence - -* tracking of rule elements was on (making list defs at start of - method) with templates instead of just with ASTs. Turned off. - -* Doesn't crash when you give it a missing file now. - -* -report: add output info: how many LL(1) decisions. - -June 13, 2006 - -* ^(ROOT ID?) Didn't work; nor did any other nullable child list such as - ^(ROOT ID* INT?). Now, I check to see if child list is nullable using - Grammar.LOOK() and, if so, I generate an "IF lookahead is DOWN" gate - around the child list so the whole thing is optional. - -* Fixed a bug in LOOK that made it not look through nullable rules. - -* Using AST suffixes or -> rewrite syntax now gives an error w/o a grammar - output option. Used to crash ;) - -* References to EOF ended up with improper -1 refs instead of EOF in output. - -* didn't warn of ambig ref to $expr in rewrite; fixed. -list - : '[' expr 'for' type ID 'in' expr ']' - -> comprehension(expr={$expr.st},type={},list={},i={}) - ; - -June 12, 2006 - -* EOF works in the parser as a token name. - -* Rule b:(A B?)*; didn't display properly in AW due to the way ANTLR - generated NFA. - -* "scope x;" in a rule for unknown x gives no error. Fixed. Added unit test. - -* Label type for refs to start/stop in tree parser and other parsers were - not used. Lots of casting. Ick. Fixed. - -* couldn't refer to $tokenlabel in isolation; but need so we can test if - something was matched. Fixed. - -* Lots of little bugs fixed in $x.y, %... translation due to new - action translator. - -* Improperly tracking block nesting level; result was that you couldn't - see $ID in action of rule "a : A+ | ID {Token t = $ID;} | C ;" - -* a : ID ID {$ID.text;} ; did not get a warning about ambiguous $ID ref. - -* No error was found on $COMMENT.text: - -COMMENT - : '/*' (options {greedy=false;} : . )* '*/' - {System.out.println("found method "+$COMMENT.text);} - ; - - $enclosinglexerrule scope does not exist. Use text or setText() here. - -June 11, 2006 - -* Single return values are initialized now to default or to your spec. - -* cleaned up input stream stuff. Added ANTLRReaderStream, ANTLRInputStream - and refactored. You can specify encodings now on ANTLRFileStream (and - ANTLRInputStream) now. - -* You can set text local var now in a lexer rule and token gets that text. - start/stop indexes are still set for the token. - -* Changed lexer slightly. Calling a nonfragment rule from a - nonfragment rule does not set the overall token. - -June 10, 2006 - -* Fixed bug where unnecessary escapes yield char==0 like '\{'. - -* Fixed analysis bug. This grammar didn't report a recursion warning: -x : y X - | y Y - ; -y : L y R - | B - ; - The DFAState.equals() method was messed up. - -* Added @synpredgate {...} action so you can tell ANTLR how to gate actions - in/out during syntactic predicate evaluation. - -* Fuzzy parsing should be more efficient. It should backtrack over a rule - and then rewind and do it again "with feeling" to exec actions. It was - actually doing it 3x not 2x. - -June 9, 2006 - -* Gutted and rebuilt the action translator for $x.y, $x::y, ... - Uses ANTLR v3 now for the first time inside v3 source. :) - ActionTranslator.java - -* Fixed a bug where referencing a return value on a rule didn't work - because later a ref to that rule's predefined properties didn't - properly force a return value struct to be built. Added unit test. - -June 6, 2006 - -* New DFA mechanisms. Cyclic DFA are implemented as state tables, - encoded via strings as java cannot handle large static arrays :( - States with edges emanating that have predicates are specially - treated. A method is generated to do these states. The DFA - simulation routine uses the "special" array to figure out if the - state is special. See March 25, 2006 entry for description: - http://www.antlr.org/blog/antlr3/codegen.tml. analysis.DFA now has - all the state tables generated for code gen. CyclicCodeGenerator.java - disappeared as it's unneeded code. :) - -* Internal general clean up of the DFA.states vs uniqueStates thing. - Fixed lookahead decisions no longer fill uniqueStates. Waste of - time. Also noted that when adding sem pred edges, I didn't check - for state reuse. Fixed. - -June 4, 2006 - -* When resolving ambig DFA states predicates, I did not add the new states - to the list of unique DFA states. No observable effect on output except - that DFA state numbers were not always contiguous for predicated decisions. - I needed this fix for new DFA tables. - -3.0ea10 - June 2, 2006 - -June 2, 2006 - -* Improved grammar stats and added syntactic pred tracking. - -June 1, 2006 - -* Due to a type mismatch, the DebugParser.recoverFromMismatchedToken() - method was not called. Debug events for mismatched token error - notification were not sent to ANTLRWorks probably - -* Added getBacktrackingLevel() for any recognizer; needed for profiler. - -* Only writes profiling data for antlr grammar analysis with -profile set - -* Major update and bug fix to (runtime) Profiler. - -May 27, 2006 - -* Added Lexer.skip() to force lexer to ignore current token and look for - another; no token is created for current rule and is not passed on to - parser (or other consumer of the lexer). - -* Parsers are much faster now. I removed use of java.util.Stack for pushing - follow sets and use a hardcoded array stack instead. Dropped from - 5900ms to 3900ms for parse+lex time parsing entire java 1.4.2 source. Lex - time alone was about 1500ms. Just looking at parse time, we get about 2x - speed improvement. :) - -May 26, 2006 - -* Fixed NFA construction so it generates NFA for (A*)* such that ANTLRWorks - can display it properly. - -May 25, 2006 - -* added abort method to Grammar so AW can terminate the conversion if it's - taking too long. - -May 24, 2006 - -* added method to get left recursive rules from grammar without doing full - grammar analysis. - -* analysis, code gen not attempted if serious error (like - left-recursion or missing rule definition) occurred while reading - the grammar in and defining symbols. - -* added amazing optimization; reduces analysis time by 90% for java - grammar; simple IF statement addition! - -3.0ea9 - May 20, 2006 - -* added global k value for grammar to limit lookahead for all decisions unless -overridden in a particular decision. - -* added failsafe so that any decision taking longer than 2 seconds to create -the DFA will fall back on k=1. Use -ImaxtimeforDFA n (in ms) to set the time. - -* added an option (turned off for now) to use multiple threads to -perform grammar analysis. Not much help on a 2-CPU computer as -garbage collection seems to peg the 2nd CPU already. :( Gotta wait for -a 4 CPU box ;) - -* switched from #src to // $ANTLR src directive. - -* CommonTokenStream.getTokens() looked past end of buffer sometimes. fixed. - -* unicode literals didn't really work in DOT output and generated code. fixed. - -* fixed the unit test rig so it compiles nicely with Java 1.5 - -* Added ant build.xml file (reads build.properties file) - -* predicates sometimes failed to compile/eval properly due to missing (...) - in IF expressions. Forced (..) - -* (...)? with only one alt were not optimized. Was: - - // t.g:4:7: ( B )? - int alt1=2; - int LA1_0 = input.LA(1); - if ( LA1_0==B ) { - alt1=1; - } - else if ( LA1_0==-1 ) { - alt1=2; - } - else { - NoViableAltException nvae = - new NoViableAltException("4:7: ( B )?", 1, 0, input); - throw nvae; - } - -is now: - - // t.g:4:7: ( B )? - int alt1=2; - int LA1_0 = input.LA(1); - if ( LA1_0==B ) { - alt1=1; - } - - Smaller, faster and more readable. - -* Allow manual init of return values now: - functionHeader returns [int x=3*4, char (*f)()=null] : ... ; - -* Added optimization for DFAs that fixed a codegen bug with rules in lexer: - EQ : '=' ; - ASSIGNOP : '=' | '+=' ; - EQ is a subset of other rule. It did not given an error which is - correct, but generated bad code. - -* ANTLR was sending column not char position to ANTLRWorks. - -* Bug fix: location 0, 0 emitted for synpreds and empty alts. - -* debugging event handshake how sends grammar file name. Added getGrammarFileName() to recognizers. Java.stg generates it: - - public String getGrammarFileName() { return ""; } - -* tree parsers can do arbitrary lookahead now including backtracking. I - updated CommonTreeNodeStream. - -* added events for debugging tree parsers: - - /** Input for a tree parser is an AST, but we know nothing for sure - * about a node except its type and text (obtained from the adaptor). - * This is the analog of the consumeToken method. Again, the ID is - * the hashCode usually of the node so it only works if hashCode is - * not implemented. - */ - public void consumeNode(int ID, String text, int type); - - /** The tree parser looked ahead */ - public void LT(int i, int ID, String text, int type); - - /** The tree parser has popped back up from the child list to the - * root node. - */ - public void goUp(); - - /** The tree parser has descended to the first child of a the current - * root node. - */ - public void goDown(); - -* Added DebugTreeNodeStream and DebugTreeParser classes - -* Added ctor because the debug tree node stream will need to ask quesitons about nodes and since nodes are just Object, it needs an adaptor to decode the nodes and get text/type info for the debugger. - -public CommonTreeNodeStream(TreeAdaptor adaptor, Tree tree); - -* added getter to TreeNodeStream: - public TreeAdaptor getTreeAdaptor(); - -* Implemented getText/getType in CommonTreeAdaptor. - -* Added TraceDebugEventListener that can dump all events to stdout. - -* I broke down and make Tree implement getText - -* tree rewrites now gen location debug events. - -* added AST debug events to listener; added blank listener for convenience - -* updated debug events to send begin/end backtrack events for debugging - -* with a : (b->b) ('+' b -> ^(PLUS $a b))* ; you get b[0] each time as - there is no loop in rewrite rule itself. Need to know context that - the -> is inside the rule and hence b means last value of b not all - values. - -* Bug in TokenRewriteStream; ops at indexes < start index blocked proper op. - -* Actions in ST rewrites "-> ({$op})()" were not translated - -* Added new action name: - -@rulecatch { -catch (RecognitionException re) { - reportError(re); - recover(input,re); -} -catch (Throwable t) { - System.err.println(t); -} -} -Overrides rule catch stuff. - -* Isolated $ refs caused exception - -3.0ea8 - March 11, 2006 - -* added @finally {...} action like @init for rules. Executes in - finally block (java target) after all other stuff like rule memoization. - No code changes needs; ST just refs a new action: - - -* hideous bug fixed: PLUS='+' didn't result in '+' rule in lexer - -* TokenRewriteStream didn't do toString() right when no rewrites had been done. - -* lexer errors in interpreter were not printed properly - -* bitsets are dumped in hex not decimal now for FOLLOW sets - -* /* epsilon */ is not printed now when printing out grammars with empty alts - -* Fixed another bug in tree rewrite stuff where it was checking that elements - had at least one element. Strange...commented out for now to see if I can remember what's up. - -* Tree rewrites had problems when you didn't have x+=FOO variables. Rules - like this work now: - - a : (x=ID)? y=ID -> ($x $y)?; - -* filter=true for lexers turns on k=1 and backtracking for every token - alternative. Put the rules in priority order. - -* added getLine() etc... to Tree to support better error reporting for - trees. Added MismatchedTreeNodeException. - -* $templates::foo() is gone. added % as special template symbol. - %foo(a={},b={},...) ctor (even shorter than $templates::foo(...)) - %({name-expr})(a={},...) indirect template ctor reference - - The above are parsed by antlr.g and translated by codegen.g - The following are parsed manually here: - - %{string-expr} anonymous template from string expr - %{expr}.y = z; template attribute y of StringTemplate-typed expr to z - %x.y = z; set template attribute y of x (always set never get attr) - to z [languages like python without ';' must still use the - ';' which the code generator is free to remove during code gen] - -* -> ({expr})(a={},...) notation for indirect template rewrite. - expr is the name of the template. - -* $x[i]::y and $x[-i]::y notation for accesssing absolute scope stack - indexes and relative negative scopes. $x[-1]::y is the y attribute - of the previous scope (stack top - 1). - -* filter=true mode for lexers; can do this now...upon mismatch, just - consumes a char and tries again: -lexer grammar FuzzyJava; -options {filter=true;} - -FIELD - : TYPE WS? name=ID WS? (';'|'=') - {System.out.println("found var "+$name.text);} - ; - -* refactored char streams so ANTLRFileStream is now a subclass of - ANTLRStringStream. - -* char streams for lexer now allowed nested backtracking in lexer. - -* added TokenLabelType for lexer/parser for all token labels - -* line numbers for error messages were not updated properly in antlr.g - for strings, char literals and <<...>> - -* init action in lexer rules was before the type,start,line,... decls. - -* Tree grammars can now specify output; I've only tested output=templat - though. - -* You can reference EOF now in the parser and lexer. It's just token type - or char value -1. - -* Bug fix: $ID refs in the *lexer* were all messed up. Cleaned up the - set of properties available... - -* Bug fix: .st not found in rule ref when rule has scope: -field -scope { - StringTemplate funcDef; -} - : ... - {$field::funcDef = $field.st;} - ; -it gets field_stack.st instead - -* return in backtracking must return retval or null if return value. - -* $property within a rule now works like $text, $st, ... - -* AST/Template Rewrites were not gated by backtracking==0 so they - executed even when guessing. Auto AST construction is now gated also. - -* CommonTokenStream was somehow returning tokens not text in toString() - -* added useful methods to runtime.BitSet and also to CommonToken so you can - update the text. Added nice Token stream method: - - /** Given a start and stop index, return a List of all tokens in - * the token type BitSet. Return null if no tokens were found. This - * method looks at both on and off channel tokens. - */ - public List getTokens(int start, int stop, BitSet types); - -* literals are now passed in the .tokens files so you can ref them in - tree parses, for example. - -* added basic exception handling; no labels, just general catches: - -a : {;}A | B ; - exception - catch[RecognitionException re] { - System.out.println("recog error"); - } - catch[Exception e] { - System.out.println("error"); - } - -* Added method to TokenStream: - public String toString(Token start, Token stop); - -* antlr generates #src lines in lexer grammars generated from combined grammars - so error messages refer to original file. - -* lexers generated from combined grammars now use originally formatting. - -* predicates have $x.y stuff translated now. Warning: predicates might be - hoisted out of context. - -* return values in return val structs are now public. - -* output=template with return values on rules was broken. I assume return values with ASTs was broken too. Fixed. - -3.0ea7 - December 14, 2005 - -* Added -print option to print out grammar w/o actions - -* Renamed BaseParser to be BaseRecognizer and even made Lexer derive from - this; nice as it now shares backtracking support code. - -* Added syntactic predicates (...)=>. See December 4, 2005 entry: - - http://www.antlr.org/blog/antlr3/lookahead.tml - - Note that we have a new option for turning off rule memoization during - backtracking: - - -nomemo when backtracking don't generate memoization code - -* Predicates are now tested in order that you specify the alts. If you - leave the last alt "naked" (w/o pred), it will assume a true pred rather - than union of other preds. - -* Added gated predicates "{p}?=>" that literally turn off a production whereas -disambiguating predicates are only hoisted into the predictor when syntax alone -is not sufficient to uniquely predict alternatives. - -A : {p}? => "a" ; -B : {!p}? => ("a"|"b")+ ; - -* bug fixed related to predicates in predictor -lexer grammar w; -A : {p}? "a" ; -B : {!p}? ("a"|"b")+ ; -DFA is correct. A state splits for input "a" on the pred. -Generated code though was hosed. No pred tests in prediction code! -I added testLexerPreds() and others in TestSemanticPredicateEvaluation.java - -* added execAction template in case we want to do something in front of - each action execution or something. - -* left-recursive cycles from rules w/o decisions were not detected. - -* undefined lexer rules were not announced! fixed. - -* unreachable messages for Tokens rule now indicate rule name not alt. E.g., - - Ruby.lexer.g:24:1: The following token definitions are unreachable: IVAR - -* nondeterminism warnings improved for Tokens rule: - -Ruby.lexer.g:10:1: Multiple token rules can match input such as ""0".."9"": INT, FLOAT -As a result, tokens(s) FLOAT were disabled for that input - - -* DOT diagrams didn't show escaped char properly. - -* Char/string literals are now all 'abc' not "abc". - -* action syntax changed "@scope::actionname {action}" where scope defaults - to "parser" if parser grammar or combined grammar, "lexer" if lexer grammar, - and "treeparser" if tree grammar. The code generation targets decide - what scopes are available. Each "scope" yields a hashtable for use in - the output templates. The scopes full of actions are sent to all output - file templates (currently headerFile and outputFile) as attribute actions. - Then you can reference to get the map of actions associated - with scope and to get the parser's header action - for example. This should be very flexible. The target should only have - to define which scopes are valid, but the action names should be variable - so we don't have to recompile ANTLR to add actions to code gen templates. - - grammar T; - options {language=Java;} - @header { package foo; } - @parser::stuff { int i; } // names within scope not checked; target dependent - @members { int i; } - @lexer::header {head} - @lexer::members { int j; } - @headerfile::blort {...} // error: this target doesn't have headerfile - @treeparser::members {...} // error: this is not a tree parser - a - @init {int i;} - : ID - ; - ID : 'a'..'z'; - - For now, the Java target uses members and header as a valid name. Within a - rule, the init action name is valid. - -* changed $dynamicscope.value to $dynamicscope::value even if value is defined - in same rule such as $function::name where rule function defines name. - -* $dynamicscope gets you the stack - -* rule scopes go like this now: - - rule - scope {...} - scope slist,Symbols; - : ... - ; - -* Created RuleReturnScope as a generic rule return value. Makes it easier - to do this: - RuleReturnScope r = parser.program(); - System.out.println(r.getTemplate().toString()); - -* $template, $tree, $start, etc... - -* $r.x in current rule. $r is ignored as fully-qualified name. $r.start works too - -* added warning about $r referring to both return value of rule and dynamic scope of rule - -* integrated StringTemplate in a very simple manner - -Syntax: --> template(arglist) "..." --> template(arglist) <<...>> --> namedTemplate(arglist) --> {free expression} --> // empty - -Predicate syntax: -a : A B -> {p1}? foo(a={$A.text}) - -> {p2}? foo(a={$B.text}) - -> // return nothing - -An arg list is just a list of template attribute assignments to actions in curlies. - -There is a setTemplateLib() method for you to use with named template rewrites. - -Use a new option: - -grammar t; -options {output=template;} -... - -This all should work for tree grammars too, but I'm still testing. - -* fixed bugs where strings were improperly escaped in exceptions, comments, etc.. For example, newlines came out as newlines not the escaped version - -3.0ea6 - November 13, 2005 - -* turned off -debug/-profile, which was on by default - -* completely refactored the output templates; added some missing templates. - -* dramatically improved infinite recursion error messages (actually - left-recursion never even was printed out before). - -* wasn't printing dangling state messages when it reanalyzes with k=1. - -* fixed a nasty bug in the analysis engine dealing with infinite recursion. - Spent all day thinking about it and cleaned up the code dramatically. - Bug fixed and software is more powerful and I understand it better! :) - -* improved verbose DFA nodes; organized by alt - -* got much better random phrase generation. For example: - - $ java org.antlr.tool.RandomPhrase simple.g program - int Ktcdn ';' method wh '(' ')' '{' return 5 ';' '}' - -* empty rules like "a : ;" generated code that didn't compile due to - try/catch for RecognitionException. Generated code couldn't possibly - throw that exception. - -* when printing out a grammar, such as in comments in generated code, - ANTLR didn't print ast suffix stuff back out for literals. - -* This never exited loop: - DATA : (options {greedy=false;}: .* '\n' )* '\n' '.' ; - and now it works due to new default nongreedy .* Also this works: - DATA : (options {greedy=false;}: .* '\n' )* '.' ; - -* Dot star ".*" syntax didn't work; in lexer it is nongreedy by - default. In parser it is on greedy but also k=1 by default. Added - unit tests. Added blog entry to describe. - -* ~T where T is the only token yielded an empty set but no error - -* Used to generate unreachable message here: - - parser grammar t; - a : ID a - | ID - ; - - z.g:3:11: The following alternatives are unreachable: 2 - - In fact it should really be an error; now it generates: - - no start rule in grammar t (no rule can obviously be followed by EOF) - - Per next change item, ANTLR cannot know that EOF follows rule 'a'. - -* added error message indicating that ANTLR can't figure out what your - start rule is. Required to properly generate code in some cases. - -* validating semantic predicates now work (if they are false, they - throw a new FailedPredicateException - -* two hideous bug fixes in the IntervalSet, which made analysis go wrong - in a few cases. Thanks to Oliver Zeigermann for finding lots of bugs - and making suggested fixes (including the next two items)! - -* cyclic DFAs are now nonstatic and hence can access instance variables - -* labels are now allowed on lexical elements (in the lexer) - -* added some internal debugging options - -* ~'a'* and ~('a')* were not working properly; refactored antlr.g grammar - -3.0ea5 - July 5, 2005 - -* Using '\n' in a parser grammar resulted in a nonescaped version of '\n' in the token names table making compilation fail. I fixed this by reorganizing/cleaning up portion of ANTLR that deals with literals. See comment org.antlr.codegen.Target. - -* Target.getMaxCharValue() did not use the appropriate max value constant. - -* ALLCHAR was a constant when it should use the Target max value def. set complement for wildcard also didn't use the Target def. Generally cleaned up the max char value stuff. - -* Code gen didn't deal with ASTLabelType properly...I think even the 3.0ea7 example tree parser was broken! :( - -* Added a few more unit tests dealing with escaped literals - -3.0ea4 - June 29, 2005 - -* tree parsers work; added CommonTreeNodeStream. See simplecTreeParser - example in examples-v3 tarball. - -* added superClass and ASTLabelType options - -* refactored Parser to have a BaseParser and added TreeParser - -* bug fix: actions being dumped in description strings; compile errors - resulted - -3.0ea3 - June 23, 2005 - -Enhancements - -* Automatic tree construction operators are in: ! ^ ^^ - -* Tree construction rewrite rules are in - -> {pred1}? rewrite1 - -> {pred2}? rewrite2 - ... - -> rewriteN - - The rewrite rules may be elements like ID, expr, $label, {node expr} - and trees ^( ). You have have (...)?, (...)*, (...)+ - subrules as well. - - You may have rewrites in subrules not just at outer level of rule, but - any -> rewrite forces auto AST construction off for that alternative - of that rule. - - To avoid cycles, copy semantics are used: - - r : INT -> INT INT ; - - means make two new nodes from the same INT token. - - Repeated references to a rule element implies a copy for at least one - tree: - - a : atom -> ^(atom atom) ; // NOT CYCLE! (dup atom tree) - -* $ruleLabel.tree refers to tree created by matching the labeled element. - -* A description of the blocks/alts is generated as a comment in output code - -* A timestamp / signature is put at top of each generated code file - -3.0ea2 - June 12, 2005 - -Bug fixes - -* Some error messages were missing the stackTrace parameter - -* Removed the file locking mechanism as it's not cross platform - -* Some absolute vs relative path name problems with writing output - files. Rules are now more concrete. -o option takes precedence - // -o /tmp /var/lib/t.g => /tmp/T.java - // -o subdir/output /usr/lib/t.g => subdir/output/T.java - // -o . /usr/lib/t.g => ./T.java - // -o /tmp subdir/t.g => /tmp/subdir/t.g - // If they didn't specify a -o dir so just write to location - // where grammar is, absolute or relative - -* does error checking on unknown option names now - -* Using just language code not locale name for error message file. I.e., - the default (and for any English speaking locale) is en.stg not en_US.stg - anymore. - -* The error manager now asks the Tool to panic rather than simply doing - a System.exit(). - -* Lots of refactoring concerning grammar, rule, subrule options. Now - detects invalid options. - -3.0ea1 - June 1, 2005 - -Initial early access release - diff --git a/impl/antlr/libantlr3c-3.4/aclocal.m4 b/impl/antlr/libantlr3c-3.4/aclocal.m4 deleted file mode 100644 index f078e56..0000000 --- a/impl/antlr/libantlr3c-3.4/aclocal.m4 +++ /dev/null @@ -1,996 +0,0 @@ -# generated automatically by aclocal 1.11.1 -*- Autoconf -*- - -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -# 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc. -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# 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.66],, -[m4_warning([this file was generated for autoconf 2.66. -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.11' -dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to -dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.11.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 AM_INIT_AUTOMAKE. -AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.11.1])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, 2008 -# Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 9 - -# AM_CONDITIONAL(NAME, SHELL-CONDITION) -# ------------------------------------- -# Define a conditional. -AC_DEFUN([AM_CONDITIONAL], -[AC_PREREQ(2.52)dnl - ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], - [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl -AC_SUBST([$1_TRUE])dnl -AC_SUBST([$1_FALSE])dnl -_AM_SUBST_NOTMAKE([$1_TRUE])dnl -_AM_SUBST_NOTMAKE([$1_FALSE])dnl -m4_define([_AM_COND_VALUE_$1], [$2])dnl -if $2; then - $1_TRUE= - $1_FALSE='#' -else - $1_TRUE='#' - $1_FALSE= -fi -AC_CONFIG_COMMANDS_PRE( -[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then - AC_MSG_ERROR([[conditional "$1" was never defined. -Usually this means the macro was only invoked conditionally.]]) -fi])]) - -# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009 -# 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 10 - -# 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 - am__universal=false - m4_case([$1], [CC], - [case " $depcc " in #( - *\ -arch\ *\ -arch\ *) am__universal=true ;; - esac], - [CXX], - [case " $depcc " in #( - *\ -arch\ *\ -arch\ *) am__universal=true ;; - esac]) - - for depmode in $am_compiler_list; do - # Setup a source with many dependencies, because some compilers - # like to wrap large dependency lists on column 80 (with \), and - # we should not choose a depcomp mode which is confused by this. - # - # We need to recreate these files for each test, as the compiler may - # overwrite some of them when testing with obscure command lines. - # This happens at least with the AIX C compiler. - : > sub/conftest.c - for i in 1 2 3 4 5 6; do - echo '#include "conftst'$i'.h"' >> sub/conftest.c - # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with - # Solaris 8's {/usr,}/bin/sh. - touch sub/conftst$i.h - done - echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf - - # We check with `-c' and `-o' for the sake of the "dashmstdout" - # mode. It turns out that the SunPro C++ compiler does not properly - # handle `-M -o', and we need to detect this. Also, some Intel - # versions had trouble with output in subdirs - am__obj=sub/conftest.${OBJEXT-o} - am__minus_obj="-o $am__obj" - case $depmode in - gcc) - # This depmode causes a compiler race in universal mode. - test "$am__universal" = false || continue - ;; - nosideeffect) - # after this tag, mechanisms are not by side-effect, so they'll - # only be used when explicitly requested - if test "x$enable_dependency_tracking" = xyes; then - continue - else - break - fi - ;; - msvisualcpp | msvcmsys) - # This compiler won't grok `-c -o', but also, the minuso test has - # not run yet. These depmodes are late enough in the game, and - # so weak that their functioning should not be impacted. - am__obj=conftest.${OBJEXT-o} - am__minus_obj= - ;; - none) break ;; - esac - if depmode=$depmode \ - source=sub/conftest.c object=$am__obj \ - depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ - $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ - >/dev/null 2>conftest.err && - grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && - grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && - grep $am__obj sub/conftest.Po > /dev/null 2>&1 && - ${MAKE-make} -s -f confmf > /dev/null 2>&1; then - # icc doesn't choke on unknown options, it will just issue warnings - # or remarks (even with -Werror). So we grep stderr for any message - # that says an option was ignored or not supported. - # When given -MP, icc 7.0 and 7.1 complain thusly: - # icc: Command line warning: ignoring option '-M'; no argument required - # The diagnosis changed in icc 8.0: - # icc: Command line remark: option '-MP' not supported - if (grep 'ignoring option' conftest.err || - grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else - am_cv_$1_dependencies_compiler_type=$depmode - break - fi - fi - done - - cd .. - rm -rf conftest.dir -else - am_cv_$1_dependencies_compiler_type=none -fi -]) -AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) -AM_CONDITIONAL([am__fastdep$1], [ - test "x$enable_dependency_tracking" != xno \ - && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) -]) - - -# AM_SET_DEPDIR -# ------------- -# Choose a directory name for dependency files. -# This macro is AC_REQUIREd in _AM_DEPENDENCIES -AC_DEFUN([AM_SET_DEPDIR], -[AC_REQUIRE([AM_SET_LEADING_DOT])dnl -AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl -]) - - -# AM_DEP_TRACK -# ------------ -AC_DEFUN([AM_DEP_TRACK], -[AC_ARG_ENABLE(dependency-tracking, -[ --disable-dependency-tracking speeds up one-time build - --enable-dependency-tracking do not reject slow dependency extractors]) -if test "x$enable_dependency_tracking" != xno; then - am_depcomp="$ac_aux_dir/depcomp" - AMDEPBACKSLASH='\' -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 5 - -# _AM_OUTPUT_DEPENDENCY_COMMANDS -# ------------------------------ -AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], -[{ - # Autoconf 2.62 quotes --file arguments for eval, but not when files - # are listed without --file. Let's play safe and only enable the eval - # if we detect the quoting. - case $CONFIG_FILES in - *\'*) eval set x "$CONFIG_FILES" ;; - *) set x $CONFIG_FILES ;; - esac - shift - for mf - do - # Strip MF so we end up with the name of the file. - mf=`echo "$mf" | sed -e 's/:.*$//'` - # Check whether this is an Automake generated Makefile or not. - # We used to match only the files named `Makefile.in', but - # some people rename them; so instead we look at the file content. - # Grep'ing the first line is not enough: some people post-process - # each Makefile.in and add a new line on top of each file to say so. - # Grep'ing the whole file is not good either: AIX grep has a line - # limit of 2048, but all sed's we know have understand at least 4000. - if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then - dirpart=`AS_DIRNAME("$mf")` - else - continue - fi - # Extract the definition of DEPDIR, am__include, and am__quote - # from the Makefile without running `make'. - DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` - test -z "$DEPDIR" && continue - am__include=`sed -n 's/^am__include = //p' < "$mf"` - test -z "am__include" && continue - am__quote=`sed -n 's/^am__quote = //p' < "$mf"` - # When using ansi2knr, U may be empty or an underscore; expand it - U=`sed -n 's/^U = //p' < "$mf"` - # Find all dependency output files, they are included files with - # $(DEPDIR) in their names. We invoke sed twice because it is the - # simplest approach to changing $(DEPDIR) to its actual value in the - # expansion. - for file in `sed -n " - s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ - sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do - # Make sure the directory exists. - test -f "$dirpart/$file" && continue - fdir=`AS_DIRNAME(["$file"])` - AS_MKDIR_P([$dirpart/$fdir]) - # echo "creating $dirpart/$file" - echo '# dummy' > "$dirpart/$file" - done - done -} -])# _AM_OUTPUT_DEPENDENCY_COMMANDS - - -# AM_OUTPUT_DEPENDENCY_COMMANDS -# ----------------------------- -# This macro should only be invoked once -- use via AC_REQUIRE. -# -# This code is only required when automatic dependency tracking -# is enabled. FIXME. This creates each `.P' file that we will -# need in order to bootstrap the dependency handling code. -AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], -[AC_CONFIG_COMMANDS([depfiles], - [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], - [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) -]) - -# Do all the work for Automake. -*- Autoconf -*- - -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -# 2005, 2006, 2008, 2009 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 16 - -# This macro actually does too much. Some checks are only needed if -# your package does certain things. But this isn't really a big deal. - -# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) -# AM_INIT_AUTOMAKE([OPTIONS]) -# ----------------------------------------------- -# The call with PACKAGE and VERSION arguments is the old style -# call (pre autoconf-2.50), which is being phased out. PACKAGE -# and VERSION should now be passed to AC_INIT and removed from -# the call to AM_INIT_AUTOMAKE. -# We support both call styles for the transition. After -# the next Automake release, Autoconf can make the AC_INIT -# arguments mandatory, and then we can depend on a new Autoconf -# release and drop the old call support. -AC_DEFUN([AM_INIT_AUTOMAKE], -[AC_PREREQ([2.62])dnl -dnl Autoconf wants to disallow AM_ names. We explicitly allow -dnl the ones we care about. -m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl -AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl -AC_REQUIRE([AC_PROG_INSTALL])dnl -if test "`cd $srcdir && pwd`" != "`pwd`"; then - # Use -I$(srcdir) only when $(srcdir) != ., so that make's output - # is not polluted with repeated "-I." - AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl - # test to see if srcdir already configured - if test -f $srcdir/config.status; then - AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) - fi -fi - -# test whether we have cygpath -if test -z "$CYGPATH_W"; then - if (cygpath --version) >/dev/null 2>/dev/null; then - CYGPATH_W='cygpath -w' - else - CYGPATH_W=echo - fi -fi -AC_SUBST([CYGPATH_W]) - -# Define the identity of the package. -dnl Distinguish between old-style and new-style calls. -m4_ifval([$2], -[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl - AC_SUBST([PACKAGE], [$1])dnl - AC_SUBST([VERSION], [$2])], -[_AM_SET_OPTIONS([$1])dnl -dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. -m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, - [m4_fatal([AC_INIT should be called with package and version arguments])])dnl - AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl - AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl - -_AM_IF_OPTION([no-define],, -[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) - AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl - -# Some tools Automake needs. -AC_REQUIRE([AM_SANITY_CHECK])dnl -AC_REQUIRE([AC_ARG_PROGRAM])dnl -AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) -AM_MISSING_PROG(AUTOCONF, autoconf) -AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) -AM_MISSING_PROG(AUTOHEADER, autoheader) -AM_MISSING_PROG(MAKEINFO, makeinfo) -AC_REQUIRE([AM_PROG_INSTALL_SH])dnl -AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl -AC_REQUIRE([AM_PROG_MKDIR_P])dnl -# We need awk for the "check" target. The system "awk" is bad on -# some platforms. -AC_REQUIRE([AC_PROG_AWK])dnl -AC_REQUIRE([AC_PROG_MAKE_SET])dnl -AC_REQUIRE([AM_SET_LEADING_DOT])dnl -_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], - [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], - [_AM_PROG_TAR([v7])])]) -_AM_IF_OPTION([no-dependencies],, -[AC_PROVIDE_IFELSE([AC_PROG_CC], - [_AM_DEPENDENCIES(CC)], - [define([AC_PROG_CC], - defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl -AC_PROVIDE_IFELSE([AC_PROG_CXX], - [_AM_DEPENDENCIES(CXX)], - [define([AC_PROG_CXX], - defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl -AC_PROVIDE_IFELSE([AC_PROG_OBJC], - [_AM_DEPENDENCIES(OBJC)], - [define([AC_PROG_OBJC], - defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl -]) -_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl -dnl The `parallel-tests' driver may need to know about EXEEXT, so add the -dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro -dnl is hooked onto _AC_COMPILER_EXEEXT early, see below. -AC_CONFIG_COMMANDS_PRE(dnl -[m4_provide_if([_AM_COMPILER_EXEEXT], - [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl -]) - -dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not -dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further -dnl mangled by Autoconf and run in a shell conditional statement. -m4_define([_AC_COMPILER_EXEEXT], -m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) - - -# When config.status generates a header, we must update the stamp-h file. -# This file resides in the same directory as the config header -# that is generated. The stamp files are numbered to have different names. - -# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the -# loop where config.status creates the headers, so we can generate -# our stamp files there. -AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], -[# Compute $1's index in $config_headers. -_am_arg=$1 -_am_stamp_count=1 -for _am_header in $config_headers :; do - case $_am_header in - $_am_arg | $_am_arg:* ) - break ;; - * ) - _am_stamp_count=`expr $_am_stamp_count + 1` ;; - esac -done -echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) - -# Copyright (C) 2001, 2003, 2005, 2008 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_PROG_INSTALL_SH -# ------------------ -# Define $install_sh. -AC_DEFUN([AM_PROG_INSTALL_SH], -[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -if test x"${install_sh}" != xset; then - case $am_aux_dir in - *\ * | *\ *) - install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; - *) - install_sh="\${SHELL} $am_aux_dir/install-sh" - esac -fi -AC_SUBST(install_sh)]) - -# Copyright (C) 2003, 2005 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 2 - -# Check whether the underlying file-system supports filenames -# with a leading dot. For instance MS-DOS doesn't. -AC_DEFUN([AM_SET_LEADING_DOT], -[rm -rf .tst 2>/dev/null -mkdir .tst 2>/dev/null -if test -d .tst; then - am__leading_dot=. -else - am__leading_dot=_ -fi -rmdir .tst 2>/dev/null -AC_SUBST([am__leading_dot])]) - -# Add --enable-maintainer-mode option to configure. -*- Autoconf -*- -# From Jim Meyering - -# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008 -# Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 5 - -# AM_MAINTAINER_MODE([DEFAULT-MODE]) -# ---------------------------------- -# Control maintainer-specific portions of Makefiles. -# Default is to disable them, unless `enable' is passed literally. -# For symmetry, `disable' may be passed as well. Anyway, the user -# can override the default with the --enable/--disable switch. -AC_DEFUN([AM_MAINTAINER_MODE], -[m4_case(m4_default([$1], [disable]), - [enable], [m4_define([am_maintainer_other], [disable])], - [disable], [m4_define([am_maintainer_other], [enable])], - [m4_define([am_maintainer_other], [enable]) - m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])]) -AC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles]) - dnl maintainer-mode's default is 'disable' unless 'enable' is passed - AC_ARG_ENABLE([maintainer-mode], -[ --][am_maintainer_other][-maintainer-mode am_maintainer_other make rules and dependencies not useful - (and sometimes confusing) to the casual installer], - [USE_MAINTAINER_MODE=$enableval], - [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes])) - AC_MSG_RESULT([$USE_MAINTAINER_MODE]) - AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes]) - MAINT=$MAINTAINER_MODE_TRUE - AC_SUBST([MAINT])dnl -] -) - -AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE]) - -# Check to see how 'make' treats includes. -*- Autoconf -*- - -# Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 4 - -# AM_MAKE_INCLUDE() -# ----------------- -# Check to see how make treats includes. -AC_DEFUN([AM_MAKE_INCLUDE], -[am_make=${MAKE-make} -cat > confinc << 'END' -am__doit: - @echo this is the am__doit target -.PHONY: am__doit -END -# If we don't find an include directive, just comment out the code. -AC_MSG_CHECKING([for style of include used by $am_make]) -am__include="#" -am__quote= -_am_result=none -# First try GNU make style include. -echo "include confinc" > confmf -# Ignore all kinds of additional output from `make'. -case `$am_make -s -f confmf 2> /dev/null` in #( -*the\ am__doit\ target*) - am__include=include - am__quote= - _am_result=GNU - ;; -esac -# Now try BSD make style include. -if test "$am__include" = "#"; then - echo '.include "confinc"' > confmf - case `$am_make -s -f confmf 2> /dev/null` in #( - *the\ am__doit\ target*) - am__include=.include - am__quote="\"" - _am_result=BSD - ;; - esac -fi -AC_SUBST([am__include]) -AC_SUBST([am__quote]) -AC_MSG_RESULT([$_am_result]) -rm -f confinc confmf -]) - -# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- - -# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008 -# Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 6 - -# AM_MISSING_PROG(NAME, PROGRAM) -# ------------------------------ -AC_DEFUN([AM_MISSING_PROG], -[AC_REQUIRE([AM_MISSING_HAS_RUN]) -$1=${$1-"${am_missing_run}$2"} -AC_SUBST($1)]) - - -# AM_MISSING_HAS_RUN -# ------------------ -# Define MISSING if not defined so far and test if it supports --run. -# If it does, set am_missing_run to use it, otherwise, to nothing. -AC_DEFUN([AM_MISSING_HAS_RUN], -[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -AC_REQUIRE_AUX_FILE([missing])dnl -if test x"${MISSING+set}" != xset; then - case $am_aux_dir in - *\ * | *\ *) - MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; - *) - MISSING="\${SHELL} $am_aux_dir/missing" ;; - esac -fi -# Use eval to expand $SHELL -if eval "$MISSING --run true"; then - am_missing_run="$MISSING --run " -else - am_missing_run= - AC_MSG_WARN([`missing' script is too old or missing]) -fi -]) - -# Copyright (C) 2003, 2004, 2005, 2006 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, 2008 -# Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 5 - -# AM_SANITY_CHECK -# --------------- -AC_DEFUN([AM_SANITY_CHECK], -[AC_MSG_CHECKING([whether build environment is sane]) -# Just in case -sleep 1 -echo timestamp > conftest.file -# Reject unsafe characters in $srcdir or the absolute working directory -# name. Accept space and tab only in the latter. -am_lf=' -' -case `pwd` in - *[[\\\"\#\$\&\'\`$am_lf]]*) - AC_MSG_ERROR([unsafe absolute working directory name]);; -esac -case $srcdir in - *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) - AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);; -esac - -# Do `set' in a subshell so we don't clobber the current shell's -# arguments. Must try -L first in case configure is actually a -# symlink; some systems play weird games with the mod time of symlinks -# (eg FreeBSD returns the mod time of the symlink's containing -# directory). -if ( - set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` - if test "$[*]" = "X"; then - # -L didn't work. - set X `ls -t "$srcdir/configure" conftest.file` - fi - rm -f conftest.file - if test "$[*]" != "X $srcdir/configure conftest.file" \ - && test "$[*]" != "X conftest.file $srcdir/configure"; then - - # If neither matched, then we have a broken ls. This can happen - # if, for instance, CONFIG_SHELL is bash and it inherits a - # broken ls alias from the environment. This has actually - # happened. Such a system could not be considered "sane". - AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken -alias in your environment]) - fi - - test "$[2]" = conftest.file - ) -then - # Ok. - : -else - AC_MSG_ERROR([newly created file is older than distributed files! -Check your system clock]) -fi -AC_MSG_RESULT(yes)]) - -# Copyright (C) 2001, 2003, 2005 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, 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 2 - -# _AM_SUBST_NOTMAKE(VARIABLE) -# --------------------------- -# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. -# This macro is traced by Automake. -AC_DEFUN([_AM_SUBST_NOTMAKE]) - -# AM_SUBST_NOTMAKE(VARIABLE) -# --------------------------- -# Public sister of _AM_SUBST_NOTMAKE. -AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) - -# Check how to create a tarball. -*- Autoconf -*- - -# Copyright (C) 2004, 2005 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 2 - -# _AM_PROG_TAR(FORMAT) -# -------------------- -# Check how to create a tarball in format FORMAT. -# FORMAT should be one of `v7', `ustar', or `pax'. -# -# Substitute a variable $(am__tar) that is a command -# writing to stdout a FORMAT-tarball containing the directory -# $tardir. -# tardir=directory && $(am__tar) > result.tar -# -# Substitute a variable $(am__untar) that extract such -# a tarball read from stdin. -# $(am__untar) < result.tar -AC_DEFUN([_AM_PROG_TAR], -[# Always define AMTAR for backward compatibility. -AM_MISSING_PROG([AMTAR], [tar]) -m4_if([$1], [v7], - [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], - [m4_case([$1], [ustar],, [pax],, - [m4_fatal([Unknown tar format])]) -AC_MSG_CHECKING([how to create a $1 tar archive]) -# Loop over all known methods to create a tar archive until one works. -_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' -_am_tools=${am_cv_prog_tar_$1-$_am_tools} -# Do not fold the above two line into one, because Tru64 sh and -# Solaris sh will not grok spaces in the rhs of `-'. -for _am_tool in $_am_tools -do - case $_am_tool in - gnutar) - for _am_tar in tar gnutar gtar; - do - AM_RUN_LOG([$_am_tar --version]) && break - done - am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' - am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' - am__untar="$_am_tar -xf -" - ;; - plaintar) - # Must skip GNU tar: if it does not support --format= it doesn't create - # ustar tarball either. - (tar --version) >/dev/null 2>&1 && continue - am__tar='tar chf - "$$tardir"' - am__tar_='tar chf - "$tardir"' - am__untar='tar xf -' - ;; - pax) - am__tar='pax -L -x $1 -w "$$tardir"' - am__tar_='pax -L -x $1 -w "$tardir"' - am__untar='pax -r' - ;; - cpio) - am__tar='find "$$tardir" -print | cpio -o -H $1 -L' - am__tar_='find "$tardir" -print | cpio -o -H $1 -L' - am__untar='cpio -i -H $1 -d' - ;; - none) - am__tar=false - am__tar_=false - am__untar=false - ;; - esac - - # If the value was cached, stop now. We just wanted to have am__tar - # and am__untar set. - test -n "${am_cv_prog_tar_$1}" && break - - # tar/untar a dummy directory, and stop if the command works - rm -rf conftest.dir - mkdir conftest.dir - echo GrepMe > conftest.dir/file - AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) - rm -rf conftest.dir - if test -s conftest.tar; then - AM_RUN_LOG([$am__untar /dev/null 2>&1 && break - fi -done -rm -rf conftest.dir - -AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) -AC_MSG_RESULT([$am_cv_prog_tar_$1])]) -AC_SUBST([am__tar]) -AC_SUBST([am__untar]) -]) # _AM_PROG_TAR - -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/impl/antlr/libantlr3c-3.4/antlr3config.h b/impl/antlr/libantlr3c-3.4/antlr3config.h deleted file mode 100644 index eb5d955..0000000 --- a/impl/antlr/libantlr3c-3.4/antlr3config.h +++ /dev/null @@ -1,187 +0,0 @@ -/* antlr3config.h. Generated from antlr3config.h.in by configure. */ -/* antlr3config.h.in. Generated from configure.ac by autoheader. */ - -/* Define if ANTLR debugger not required */ -/* #undef ANTLR3_NODEBUGGER */ - -/* Define if 64 bit mode required */ -/* #undef ANTLR3_USE_64BIT */ - -/* Define to 1 if you have the `accept' function. */ -/* #undef HAVE_ACCEPT */ - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_ARPA_NAMESER_H */ - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_CTYPE_H */ - -/* Define to 1 if you have the header file. */ -#define HAVE_DLFCN_H 1 - -/* Define to 1 if the system has the type `intptr_t'. */ -/* #undef HAVE_INTPTR_T */ - -/* Define to 1 if you have the header file. */ -#define HAVE_INTTYPES_H 1 - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_MALLOC_H */ - -/* Define to 1 if you have the `memmove' function. */ -/* #undef HAVE_MEMMOVE */ - -/* Define to 1 if you have the header file. */ -#define HAVE_MEMORY_H 1 - -/* Define to 1 if you have the `memset' function. */ -/* #undef HAVE_MEMSET */ - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_NETDB_H */ - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_NETINET_IN_H */ - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_NETINET_TCP_H */ - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_RESOLV_H */ - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_SOCKET_H */ - -/* Define to 1 if you have the header file. */ -#define HAVE_STDARG_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STDINT_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STDLIB_H 1 - -/* Define to 1 if you have the `strdup' function. */ -/* #undef HAVE_STRDUP */ - -/* Define to 1 if you have the header file. */ -#define HAVE_STRINGS_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STRING_H 1 - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_SYS_MALLOC_H */ - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_SYS_SOCKET_H */ - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_STAT_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_TYPES_H 1 - -/* Define to 1 if the system has the type `uintptr_t'. */ -/* #undef HAVE_UINTPTR_T */ - -/* Define to 1 if you have the header file. */ -#define HAVE_UNISTD_H 1 - -/* Define to the sub-directory in which libtool stores uninstalled libraries. - */ -#define LT_OBJDIR ".libs/" - -/* Name of package */ -#define PACKAGE "libantlr3c" - -/* Define to the address where bug reports for this package should be sent. */ -#define PACKAGE_BUGREPORT "jimi@temporal-wave.com" - -/* Define to the full name of this package. */ -#define PACKAGE_NAME "libantlr3c" - -/* Define to the full name and version of this package. */ -#define PACKAGE_STRING "libantlr3c 3.4" - -/* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "libantlr3c" - -/* Define to the home page for this package. */ -#define PACKAGE_URL "" - -/* Define to the version of this package. */ -#define PACKAGE_VERSION "3.4" - -/* Define to 1 if you have the ANSI C header files. */ -#define STDC_HEADERS 1 - -/* Version number of package */ -#define VERSION "3.4" - -/* Define for Solaris 2.5.1 so the uint32_t typedef from , - , or is not used. If the typedef were allowed, the - #define below would cause a syntax error. */ -/* #undef _UINT32_T */ - -/* Define for Solaris 2.5.1 so the uint64_t typedef from , - , or is not used. If the typedef were allowed, the - #define below would cause a syntax error. */ -/* #undef _UINT64_T */ - -/* Define for Solaris 2.5.1 so the uint8_t typedef from , - , or is not used. If the typedef were allowed, the - #define below would cause a syntax error. */ -/* #undef _UINT8_T */ - -/* 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 - -/* Define to the type of a signed integer type of width exactly 16 bits if - such a type exists and the standard includes do not define it. */ -/* #undef int16_t */ - -/* Define to the type of a signed integer type of width exactly 32 bits if - such a type exists and the standard includes do not define it. */ -/* #undef int32_t */ - -/* Define to the type of a signed integer type of width exactly 64 bits if - such a type exists and the standard includes do not define it. */ -/* #undef int64_t */ - -/* Define to the type of a signed integer type of width exactly 8 bits if such - a type exists and the standard includes do not define it. */ -/* #undef int8_t */ - -/* Define to the type of a signed integer type wide enough to hold a pointer, - if such a type exists, and if the system does not define it. */ -/* #undef intptr_t */ - -/* Define to `unsigned int' if does not define. */ -#define size_t unsigned int - -/* Define to the type of an unsigned integer type of width exactly 16 bits if - such a type exists and the standard includes do not define it. */ -/* #undef uint16_t */ - -/* Define to the type of an unsigned integer type of width exactly 32 bits if - such a type exists and the standard includes do not define it. */ -/* #undef uint32_t */ - -/* Define to the type of an unsigned integer type of width exactly 64 bits if - such a type exists and the standard includes do not define it. */ -/* #undef uint64_t */ - -/* Define to the type of an unsigned integer type of width exactly 8 bits if - such a type exists and the standard includes do not define it. */ -/* #undef uint8_t */ - -/* Define to the type of an unsigned integer type wide enough to hold a - pointer, if such a type exists, and if the system does not define it. */ -/* #undef uintptr_t */ diff --git a/impl/antlr/libantlr3c-3.4/antlr3config.h.in b/impl/antlr/libantlr3c-3.4/antlr3config.h.in deleted file mode 100644 index b9525ff..0000000 --- a/impl/antlr/libantlr3c-3.4/antlr3config.h.in +++ /dev/null @@ -1,186 +0,0 @@ -/* antlr3config.h.in. Generated from configure.ac by autoheader. */ - -/* Define if ANTLR debugger not required */ -#undef ANTLR3_NODEBUGGER - -/* Define if 64 bit mode required */ -#undef ANTLR3_USE_64BIT - -/* Define to 1 if you have the `accept' function. */ -#undef HAVE_ACCEPT - -/* Define to 1 if you have the header file. */ -#undef HAVE_ARPA_NAMESER_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_CTYPE_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_DLFCN_H - -/* Define to 1 if the system has the type `intptr_t'. */ -#undef HAVE_INTPTR_T - -/* Define to 1 if you have the header file. */ -#undef HAVE_INTTYPES_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_MALLOC_H - -/* Define to 1 if you have the `memmove' function. */ -#undef HAVE_MEMMOVE - -/* Define to 1 if you have the header file. */ -#undef HAVE_MEMORY_H - -/* Define to 1 if you have the `memset' function. */ -#undef HAVE_MEMSET - -/* Define to 1 if you have the header file. */ -#undef HAVE_NETDB_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_NETINET_IN_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_NETINET_TCP_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_RESOLV_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SOCKET_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDARG_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDINT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDLIB_H - -/* Define to 1 if you have the `strdup' function. */ -#undef HAVE_STRDUP - -/* Define to 1 if you have the header file. */ -#undef HAVE_STRINGS_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STRING_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_MALLOC_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_SOCKET_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_STAT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_TYPES_H - -/* Define to 1 if the system has the type `uintptr_t'. */ -#undef HAVE_UINTPTR_T - -/* Define to 1 if you have the 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 home page for this package. */ -#undef PACKAGE_URL - -/* 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 - -/* Define for Solaris 2.5.1 so the uint32_t typedef from , - , or is not used. If the typedef were allowed, the - #define below would cause a syntax error. */ -#undef _UINT32_T - -/* Define for Solaris 2.5.1 so the uint64_t typedef from , - , or is not used. If the typedef were allowed, the - #define below would cause a syntax error. */ -#undef _UINT64_T - -/* Define for Solaris 2.5.1 so the uint8_t typedef from , - , or is not used. If the typedef were allowed, the - #define below would cause a syntax error. */ -#undef _UINT8_T - -/* 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 - -/* Define to the type of a signed integer type of width exactly 16 bits if - such a type exists and the standard includes do not define it. */ -#undef int16_t - -/* Define to the type of a signed integer type of width exactly 32 bits if - such a type exists and the standard includes do not define it. */ -#undef int32_t - -/* Define to the type of a signed integer type of width exactly 64 bits if - such a type exists and the standard includes do not define it. */ -#undef int64_t - -/* Define to the type of a signed integer type of width exactly 8 bits if such - a type exists and the standard includes do not define it. */ -#undef int8_t - -/* Define to the type of a signed integer type wide enough to hold a pointer, - if such a type exists, and if the system does not define it. */ -#undef intptr_t - -/* Define to `unsigned int' if does not define. */ -#undef size_t - -/* Define to the type of an unsigned integer type of width exactly 16 bits if - such a type exists and the standard includes do not define it. */ -#undef uint16_t - -/* Define to the type of an unsigned integer type of width exactly 32 bits if - such a type exists and the standard includes do not define it. */ -#undef uint32_t - -/* Define to the type of an unsigned integer type of width exactly 64 bits if - such a type exists and the standard includes do not define it. */ -#undef uint64_t - -/* Define to the type of an unsigned integer type of width exactly 8 bits if - such a type exists and the standard includes do not define it. */ -#undef uint8_t - -/* Define to the type of an unsigned integer type wide enough to hold a - pointer, if such a type exists, and if the system does not define it. */ -#undef uintptr_t diff --git a/impl/antlr/libantlr3c-3.4/config.guess b/impl/antlr/libantlr3c-3.4/config.guess deleted file mode 100755 index dc84c68..0000000 --- a/impl/antlr/libantlr3c-3.4/config.guess +++ /dev/null @@ -1,1501 +0,0 @@ -#! /bin/sh -# Attempt to guess a canonical system name. -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 -# Free Software Foundation, Inc. - -timestamp='2009-11-20' - -# This file is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA -# 02110-1301, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - - -# Originally written by Per Bothner. Please send patches (context -# diff format) to and include a ChangeLog -# entry. -# -# This script attempts to guess a canonical system name similar to -# config.sub. If it succeeds, it prints the system name on stdout, and -# exits with 0. Otherwise, it exits with 1. -# -# You can get the latest version of this script from: -# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD - -me=`echo "$0" | sed -e 's,.*/,,'` - -usage="\ -Usage: $0 [OPTION] - -Output the configuration name of the system \`$me' is run on. - -Operation modes: - -h, --help print this help, then exit - -t, --time-stamp print date of last modification, then exit - -v, --version print version number, then exit - -Report bugs and patches to ." - -version="\ -GNU config.guess ($timestamp) - -Originally written by Per Bothner. -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, -2002, 2003, 2004, 2005, 2006, 2007, 2008 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 -q __ELF__ - then - # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). - # Return netbsd for either. FIX? - os=netbsd - else - os=netbsdelf - fi - ;; - *) - os=netbsd - ;; - esac - # The OS release - # Debian GNU/NetBSD machines have a different userland, and - # thus, need a distinct triplet. However, they do not need - # kernel version information, so it can be replaced with a - # suitable tag, in the style of linux-gnu. - case "${UNAME_VERSION}" in - Debian*) - release='-gnu' - ;; - *) - release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` - ;; - esac - # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: - # contains redundant information, the shorter form: - # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. - echo "${machine}-${os}${release}" - exit ;; - *:OpenBSD:*:*) - UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` - echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} - exit ;; - *:ekkoBSD:*:*) - echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} - exit ;; - *:SolidBSD:*:*) - echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} - exit ;; - macppc:MirBSD:*:*) - echo powerpc-unknown-mirbsd${UNAME_RELEASE} - exit ;; - *:MirBSD:*:*) - echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} - exit ;; - alpha:OSF1:*:*) - case $UNAME_RELEASE in - *4.0) - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` - ;; - *5.*) - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` - ;; - esac - # According to Compaq, /usr/sbin/psrinfo has been available on - # OSF/1 and Tru64 systems produced since 1995. I hope that - # covers most systems running today. This code pipes the CPU - # types through head -n 1, so we only detect the type of CPU 0. - ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` - case "$ALPHA_CPU_TYPE" in - "EV4 (21064)") - UNAME_MACHINE="alpha" ;; - "EV4.5 (21064)") - UNAME_MACHINE="alpha" ;; - "LCA4 (21066/21068)") - UNAME_MACHINE="alpha" ;; - "EV5 (21164)") - UNAME_MACHINE="alphaev5" ;; - "EV5.6 (21164A)") - UNAME_MACHINE="alphaev56" ;; - "EV5.6 (21164PC)") - UNAME_MACHINE="alphapca56" ;; - "EV5.7 (21164PC)") - UNAME_MACHINE="alphapca57" ;; - "EV6 (21264)") - UNAME_MACHINE="alphaev6" ;; - "EV6.7 (21264A)") - UNAME_MACHINE="alphaev67" ;; - "EV6.8CB (21264C)") - UNAME_MACHINE="alphaev68" ;; - "EV6.8AL (21264B)") - UNAME_MACHINE="alphaev68" ;; - "EV6.8CX (21264D)") - UNAME_MACHINE="alphaev68" ;; - "EV6.9A (21264/EV69A)") - UNAME_MACHINE="alphaev69" ;; - "EV7 (21364)") - UNAME_MACHINE="alphaev7" ;; - "EV7.9 (21364A)") - UNAME_MACHINE="alphaev79" ;; - esac - # A Pn.n version is a patched version. - # A Vn.n version is a released version. - # A Tn.n version is a released field test version. - # A Xn.n version is an unreleased experimental baselevel. - # 1.2 uses "1.2" for uname -r. - echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - 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 ;; - s390x:SunOS:*:*) - echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - sun4H:SunOS:5.*:*) - echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) - echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) - echo i386-pc-auroraux${UNAME_RELEASE} - exit ;; - i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) - eval $set_cc_for_build - SUN_ARCH="i386" - # If there is a compiler, see if it is configured for 64-bit objects. - # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. - # This test works for both compilers. - if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then - if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_64BIT_ARCH >/dev/null - then - SUN_ARCH="x86_64" - fi - fi - echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - sun4*:SunOS:6*:*) - # According to config.sub, this is the proper way to canonicalize - # SunOS6. Hard to guess exactly what SunOS6 will be like, but - # it's likely to be more like Solaris than SunOS4. - echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - sun4*:SunOS:*:*) - case "`/usr/bin/arch -k`" in - Series*|S4*) - UNAME_RELEASE=`uname -v` - ;; - esac - # Japanese Language versions have a version number like `4.1.3-JL'. - echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` - exit ;; - sun3*:SunOS:*:*) - echo m68k-sun-sunos${UNAME_RELEASE} - exit ;; - sun*:*:4.2BSD:*) - UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` - test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 - case "`/bin/arch`" in - sun3) - echo m68k-sun-sunos${UNAME_RELEASE} - ;; - sun4) - echo sparc-sun-sunos${UNAME_RELEASE} - ;; - esac - exit ;; - aushp:SunOS:*:*) - echo sparc-auspex-sunos${UNAME_RELEASE} - exit ;; - # The situation for MiNT is a little confusing. The machine name - # can be virtually everything (everything which is not - # "atarist" or "atariste" at least should have a processor - # > m68000). The system name ranges from "MiNT" over "FreeMiNT" - # to the lowercase version "mint" (or "freemint"). Finally - # the system name "TOS" denotes a system which is actually not - # MiNT. But MiNT is downward compatible to TOS, so this should - # be no problem. - atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit ;; - atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit ;; - *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit ;; - milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) - echo m68k-milan-mint${UNAME_RELEASE} - exit ;; - hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) - echo m68k-hades-mint${UNAME_RELEASE} - exit ;; - *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) - echo m68k-unknown-mint${UNAME_RELEASE} - exit ;; - m68k:machten:*:*) - echo m68k-apple-machten${UNAME_RELEASE} - exit ;; - powerpc:machten:*:*) - echo powerpc-apple-machten${UNAME_RELEASE} - exit ;; - RISC*:Mach:*:*) - echo mips-dec-mach_bsd4.3 - exit ;; - RISC*:ULTRIX:*:*) - echo mips-dec-ultrix${UNAME_RELEASE} - exit ;; - VAX*:ULTRIX*:*:*) - echo vax-dec-ultrix${UNAME_RELEASE} - exit ;; - 2020:CLIX:*:* | 2430:CLIX:*:*) - echo clipper-intergraph-clix${UNAME_RELEASE} - exit ;; - mips:*:*:UMIPS | mips:*:*:RISCos) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c -#ifdef __cplusplus -#include /* for printf() prototype */ - int main (int argc, char *argv[]) { -#else - int main (argc, argv) int argc; char *argv[]; { -#endif - #if defined (host_mips) && defined (MIPSEB) - #if defined (SYSTYPE_SYSV) - printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); - #endif - #if defined (SYSTYPE_SVR4) - printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); - #endif - #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) - printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); - #endif - #endif - exit (-1); - } -EOF - $CC_FOR_BUILD -o $dummy $dummy.c && - dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && - SYSTEM_NAME=`$dummy $dummyarg` && - { echo "$SYSTEM_NAME"; exit; } - echo mips-mips-riscos${UNAME_RELEASE} - exit ;; - Motorola:PowerMAX_OS:*:*) - echo powerpc-motorola-powermax - exit ;; - Motorola:*:4.3:PL8-*) - echo powerpc-harris-powermax - exit ;; - Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) - echo powerpc-harris-powermax - exit ;; - Night_Hawk:Power_UNIX:*:*) - echo powerpc-harris-powerunix - exit ;; - m88k:CX/UX:7*:*) - echo m88k-harris-cxux7 - exit ;; - m88k:*:4*:R4*) - echo m88k-motorola-sysv4 - exit ;; - m88k:*:3*:R3*) - echo m88k-motorola-sysv3 - exit ;; - AViiON:dgux:*:*) - # DG/UX returns AViiON for all architectures - UNAME_PROCESSOR=`/usr/bin/uname -p` - if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] - then - if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ - [ ${TARGET_BINARY_INTERFACE}x = x ] - then - echo m88k-dg-dgux${UNAME_RELEASE} - else - echo m88k-dg-dguxbcs${UNAME_RELEASE} - fi - else - echo i586-dg-dgux${UNAME_RELEASE} - fi - exit ;; - M88*:DolphinOS:*:*) # DolphinOS (SVR3) - echo m88k-dolphin-sysv3 - exit ;; - M88*:*:R3*:*) - # Delta 88k system running SVR3 - echo m88k-motorola-sysv3 - exit ;; - XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) - echo m88k-tektronix-sysv3 - exit ;; - Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) - echo m68k-tektronix-bsd - exit ;; - *:IRIX*:*:*) - echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` - exit ;; - ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. - echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id - exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' - i*86:AIX:*:*) - echo i386-ibm-aix - exit ;; - ia64:AIX:*:*) - if [ -x /usr/bin/oslevel ] ; then - IBM_REV=`/usr/bin/oslevel` - else - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} - fi - echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} - exit ;; - *:AIX:2:3) - if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #include - - main() - { - if (!__power_pc()) - exit(1); - puts("powerpc-ibm-aix3.2.5"); - exit(0); - } -EOF - if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` - then - echo "$SYSTEM_NAME" - else - echo rs6000-ibm-aix3.2.5 - fi - elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then - echo rs6000-ibm-aix3.2.4 - else - echo rs6000-ibm-aix3.2 - fi - exit ;; - *:AIX:*:[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 - #include - - int main () - { - #if defined(_SC_KERNEL_BITS) - long bits = sysconf(_SC_KERNEL_BITS); - #endif - long cpu = sysconf (_SC_CPU_VERSION); - - switch (cpu) - { - case CPU_PA_RISC1_0: puts ("hppa1.0"); break; - case CPU_PA_RISC1_1: puts ("hppa1.1"); break; - case CPU_PA_RISC2_0: - #if defined(_SC_KERNEL_BITS) - switch (bits) - { - case 64: puts ("hppa2.0w"); break; - case 32: puts ("hppa2.0n"); break; - default: puts ("hppa2.0"); break; - } break; - #else /* !defined(_SC_KERNEL_BITS) */ - puts ("hppa2.0"); break; - #endif - default: puts ("hppa1.0"); break; - } - exit (0); - } -EOF - (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` - test -z "$HP_ARCH" && HP_ARCH=hppa - fi ;; - esac - if [ ${HP_ARCH} = "hppa2.0w" ] - then - eval $set_cc_for_build - - # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating - # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler - # generating 64-bit code. GNU and HP use different nomenclature: - # - # $ CC_FOR_BUILD=cc ./config.guess - # => hppa2.0w-hp-hpux11.23 - # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess - # => hppa64-hp-hpux11.23 - - if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | - grep -q __LP64__ - then - HP_ARCH="hppa2.0w" - else - HP_ARCH="hppa64" - fi - fi - echo ${HP_ARCH}-hp-hpux${HPUX_REV} - exit ;; - ia64:HP-UX:*:*) - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` - echo ia64-hp-hpux${HPUX_REV} - exit ;; - 3050*:HI-UX:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #include - int - main () - { - long cpu = sysconf (_SC_CPU_VERSION); - /* The order matters, because CPU_IS_HP_MC68K erroneously returns - true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct - results, however. */ - if (CPU_IS_PA_RISC (cpu)) - { - switch (cpu) - { - case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; - case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; - case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; - default: puts ("hppa-hitachi-hiuxwe2"); break; - } - } - else if (CPU_IS_HP_MC68K (cpu)) - puts ("m68k-hitachi-hiuxwe2"); - else puts ("unknown-hitachi-hiuxwe2"); - exit (0); - } -EOF - $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && - { echo "$SYSTEM_NAME"; exit; } - echo unknown-hitachi-hiuxwe2 - exit ;; - 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) - echo hppa1.1-hp-bsd - exit ;; - 9000/8??:4.3bsd:*:*) - echo hppa1.0-hp-bsd - exit ;; - *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) - echo hppa1.0-hp-mpeix - exit ;; - hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) - echo hppa1.1-hp-osf - exit ;; - hp8??:OSF1:*:*) - echo hppa1.0-hp-osf - exit ;; - i*86:OSF1:*:*) - if [ -x /usr/sbin/sysversion ] ; then - echo ${UNAME_MACHINE}-unknown-osf1mk - else - echo ${UNAME_MACHINE}-unknown-osf1 - fi - exit ;; - parisc*:Lites*:*:*) - echo hppa1.1-hp-lites - exit ;; - C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) - echo c1-convex-bsd - exit ;; - C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) - if getsysinfo -f scalar_acc - then echo c32-convex-bsd - else echo c2-convex-bsd - fi - exit ;; - C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) - echo c34-convex-bsd - exit ;; - C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) - echo c38-convex-bsd - exit ;; - C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) - echo c4-convex-bsd - exit ;; - CRAY*Y-MP:*:*:*) - echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; - CRAY*[A-Z]90:*:*:*) - echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ - | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ - -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ - -e 's/\.[^.]*$/.X/' - exit ;; - CRAY*TS:*:*:*) - echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; - CRAY*T3E:*:*:*) - echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; - CRAY*SV1:*:*:*) - echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; - *:UNICOS/mp:*:*) - echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' - exit ;; - F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) - FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` - echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit ;; - 5000:UNIX_System_V:4.*:*) - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` - echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit ;; - i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) - echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} - exit ;; - sparc*:BSD/OS:*:*) - echo sparc-unknown-bsdi${UNAME_RELEASE} - exit ;; - *:BSD/OS:*:*) - echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} - exit ;; - *:FreeBSD:*:*) - 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*:*) - case ${UNAME_MACHINE} in - x86) - echo i586-pc-interix${UNAME_RELEASE} - exit ;; - authenticamd | genuineintel | EM64T) - echo x86_64-unknown-interix${UNAME_RELEASE} - exit ;; - IA64) - echo ia64-unknown-interix${UNAME_RELEASE} - exit ;; - esac ;; - [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) - echo i${UNAME_MACHINE}-pc-mks - exit ;; - 8664:Windows_NT:*) - echo x86_64-pc-mks - exit ;; - i*:Windows_NT*:* | Pentium*:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we - # UNAME_MACHINE based on the output of uname instead of i386? - echo i586-pc-interix - exit ;; - i*:UWIN*:*) - echo ${UNAME_MACHINE}-pc-uwin - exit ;; - amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) - echo x86_64-unknown-cygwin - exit ;; - p*:CYGWIN*:*) - echo powerpcle-unknown-cygwin - exit ;; - prep*:SunOS:5.*:*) - echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` - exit ;; - *:GNU:*:*) - # the GNU system - echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` - exit ;; - *:GNU/*:*:*) - # other systems with GNU libc and userland - echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu - exit ;; - i*86:Minix:*:*) - echo ${UNAME_MACHINE}-pc-minix - exit ;; - alpha:Linux:*:*) - case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in - EV5) UNAME_MACHINE=alphaev5 ;; - EV56) UNAME_MACHINE=alphaev56 ;; - PCA56) UNAME_MACHINE=alphapca56 ;; - PCA57) UNAME_MACHINE=alphapca56 ;; - EV6) UNAME_MACHINE=alphaev6 ;; - EV67) UNAME_MACHINE=alphaev67 ;; - EV68*) UNAME_MACHINE=alphaev68 ;; - esac - objdump --private-headers /bin/sh | grep -q ld.so.1 - if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi - echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} - exit ;; - arm*:Linux:*:*) - eval $set_cc_for_build - if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep -q __ARM_EABI__ - then - echo ${UNAME_MACHINE}-unknown-linux-gnu - else - 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 ;; - i*86:Linux:*:*) - LIBC=gnu - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #ifdef __dietlibc__ - LIBC=dietlibc - #endif -EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` - echo "${UNAME_MACHINE}-pc-linux-${LIBC}" - exit ;; - ia64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - m32r*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - m68*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - mips:Linux:*:* | mips64:Linux:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #undef CPU - #undef ${UNAME_MACHINE} - #undef ${UNAME_MACHINE}el - #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) - CPU=${UNAME_MACHINE}el - #else - #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) - CPU=${UNAME_MACHINE} - #else - CPU= - #endif - #endif -EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` - test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } - ;; - or32:Linux:*:*) - echo or32-unknown-linux-gnu - exit ;; - padre:Linux:*:*) - echo sparc-unknown-linux-gnu - exit ;; - parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-unknown-linux-gnu - exit ;; - parisc:Linux:*:* | hppa:Linux:*:*) - # Look for CPU level - case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in - PA7*) echo hppa1.1-unknown-linux-gnu ;; - PA8*) echo hppa2.0-unknown-linux-gnu ;; - *) echo hppa-unknown-linux-gnu ;; - esac - exit ;; - ppc64:Linux:*:*) - echo powerpc64-unknown-linux-gnu - exit ;; - ppc:Linux:*:*) - echo powerpc-unknown-linux-gnu - exit ;; - s390:Linux:*:* | s390x:Linux:*:*) - echo ${UNAME_MACHINE}-ibm-linux - exit ;; - sh64*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - sh*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - sparc:Linux:*:* | sparc64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu - exit ;; - 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:DYNIX/ptx:4*:*) - # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. - # earlier versions are messed up and put the nodename in both - # sysname and nodename. - echo i386-sequent-sysv4 - exit ;; - i*86:UNIX_SV:4.2MP:2.*) - # Unixware is an offshoot of SVR4, but it has its own version - # number series starting with 2... - # I am not positive that other SVR4 systems won't match this, - # I just have to hope. -- rms. - # Use sysv4.2uw... so that sysv4* matches it. - echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} - exit ;; - i*86:OS/2:*:*) - # If we were able to find `uname', then EMX Unix compatibility - # is probably installed. - echo ${UNAME_MACHINE}-pc-os2-emx - exit ;; - i*86:XTS-300:*:STOP) - echo ${UNAME_MACHINE}-unknown-stop - exit ;; - i*86:atheos:*:*) - echo ${UNAME_MACHINE}-unknown-atheos - exit ;; - i*86:syllable:*:*) - echo ${UNAME_MACHINE}-pc-syllable - exit ;; - i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) - echo i386-unknown-lynxos${UNAME_RELEASE} - exit ;; - i*86:*DOS:*:*) - echo ${UNAME_MACHINE}-pc-msdosdjgpp - exit ;; - i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) - UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` - if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then - echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} - else - echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} - fi - exit ;; - i*86:*:5:[678]*) - # UnixWare 7.x, OpenUNIX and OpenServer 6. - case `/bin/uname -X | grep "^Machine"` in - *486*) UNAME_MACHINE=i486 ;; - *Pentium) UNAME_MACHINE=i586 ;; - *Pent*|*Celeron) UNAME_MACHINE=i686 ;; - esac - echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} - exit ;; - i*86:*:3.2:*) - if test -f /usr/options/cb.name; then - UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then - UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` - (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 - (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ - && UNAME_MACHINE=i586 - (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ - && UNAME_MACHINE=i686 - (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ - && UNAME_MACHINE=i686 - echo ${UNAME_MACHINE}-pc-sco$UNAME_REL - else - echo ${UNAME_MACHINE}-pc-sysv32 - fi - exit ;; - pc:*:*:*) - # Left here for compatibility: - # uname -m prints for DJGPP always 'pc', but it prints nothing about - # the processor, so we play safe by assuming i586. - # Note: whatever this is, it MUST be the same as what config.sub - # prints for the "djgpp" host, or else GDB configury will decide that - # this is a cross-build. - echo i586-pc-msdosdjgpp - exit ;; - Intel:Mach:3*:*) - echo i386-pc-mach3 - exit ;; - paragon:*:*:*) - echo i860-intel-osf1 - exit ;; - i860:*:4.*:*) # i860-SVR4 - if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then - echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 - else # Add other i860-SVR4 vendors below as they are discovered. - echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 - fi - exit ;; - mini*:CTIX:SYS*5:*) - # "miniframe" - echo m68010-convergent-sysv - exit ;; - mc68k:UNIX:SYSTEM5:3.51m) - echo m68k-convergent-sysv - exit ;; - M680?0:D-NIX:5.3:*) - echo m68k-diab-dnix - exit ;; - M68*:*:R3V[5678]*:*) - test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; - 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) - OS_REL='' - test -r /etc/.relid \ - && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4.3${OS_REL}; exit; } - /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; - 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4; exit; } ;; - NCR*:*:4.2:* | MPRAS*:*:4.2:*) - OS_REL='.3' - test -r /etc/.relid \ - && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4.3${OS_REL}; exit; } - /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } - /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; - m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) - echo m68k-unknown-lynxos${UNAME_RELEASE} - exit ;; - mc68030:UNIX_System_V:4.*:*) - echo m68k-atari-sysv4 - exit ;; - TSUNAMI:LynxOS:2.*:*) - echo sparc-unknown-lynxos${UNAME_RELEASE} - exit ;; - rs6000:LynxOS:2.*:*) - echo rs6000-unknown-lynxos${UNAME_RELEASE} - exit ;; - PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) - echo powerpc-unknown-lynxos${UNAME_RELEASE} - exit ;; - SM[BE]S:UNIX_SV:*:*) - echo mips-dde-sysv${UNAME_RELEASE} - exit ;; - RM*:ReliantUNIX-*:*:*) - echo mips-sni-sysv4 - exit ;; - RM*:SINIX-*:*:*) - echo mips-sni-sysv4 - exit ;; - *:SINIX-*:*:*) - if uname -p 2>/dev/null >/dev/null ; then - UNAME_MACHINE=`(uname -p) 2>/dev/null` - echo ${UNAME_MACHINE}-sni-sysv4 - else - echo ns32k-sni-sysv - fi - exit ;; - PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort - # says - echo i586-unisys-sysv4 - exit ;; - *:UNIX_System_V:4*:FTX*) - # From Gerald Hewes . - # How about differentiating between stratus architectures? -djm - echo hppa1.1-stratus-sysv4 - exit ;; - *:*:*:FTX*) - # From seanf@swdc.stratus.com. - echo i860-stratus-sysv4 - exit ;; - i*86:VOS:*:*) - # From Paul.Green@stratus.com. - echo ${UNAME_MACHINE}-stratus-vos - exit ;; - *:VOS:*:*) - # From Paul.Green@stratus.com. - echo hppa1.1-stratus-vos - exit ;; - mc68*:A/UX:*:*) - echo m68k-apple-aux${UNAME_RELEASE} - exit ;; - news*:NEWS-OS:6*:*) - echo mips-sony-newsos6 - exit ;; - R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) - if [ -d /usr/nec ]; then - echo mips-nec-sysv${UNAME_RELEASE} - else - echo mips-unknown-sysv${UNAME_RELEASE} - fi - exit ;; - BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. - echo powerpc-be-beos - exit ;; - BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. - echo powerpc-apple-beos - exit ;; - BePC:BeOS:*:*) # BeOS running on Intel PC compatible. - echo i586-pc-beos - exit ;; - BePC:Haiku:*:*) # Haiku running on Intel PC compatible. - echo i586-pc-haiku - exit ;; - SX-4:SUPER-UX:*:*) - echo sx4-nec-superux${UNAME_RELEASE} - exit ;; - SX-5:SUPER-UX:*:*) - echo sx5-nec-superux${UNAME_RELEASE} - exit ;; - SX-6:SUPER-UX:*:*) - echo sx6-nec-superux${UNAME_RELEASE} - exit ;; - SX-7:SUPER-UX:*:*) - echo sx7-nec-superux${UNAME_RELEASE} - exit ;; - SX-8:SUPER-UX:*:*) - echo sx8-nec-superux${UNAME_RELEASE} - exit ;; - SX-8R:SUPER-UX:*:*) - echo sx8r-nec-superux${UNAME_RELEASE} - exit ;; - Power*:Rhapsody:*:*) - echo powerpc-apple-rhapsody${UNAME_RELEASE} - exit ;; - *:Rhapsody:*:*) - echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} - exit ;; - *:Darwin:*:*) - UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown - case $UNAME_PROCESSOR in - i386) - eval $set_cc_for_build - if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then - if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_64BIT_ARCH >/dev/null - then - UNAME_PROCESSOR="x86_64" - fi - fi ;; - unknown) UNAME_PROCESSOR=powerpc ;; - esac - echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} - exit ;; - *:procnto*:*:* | *:QNX:[0123456789]*:*) - UNAME_PROCESSOR=`uname -p` - if test "$UNAME_PROCESSOR" = "x86"; then - UNAME_PROCESSOR=i386 - UNAME_MACHINE=pc - fi - echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} - exit ;; - *:QNX:*:4*) - echo i386-pc-qnx - exit ;; - NSE-?:NONSTOP_KERNEL:*:*) - echo nse-tandem-nsk${UNAME_RELEASE} - exit ;; - NSR-?:NONSTOP_KERNEL:*:*) - echo nsr-tandem-nsk${UNAME_RELEASE} - exit ;; - *:NonStop-UX:*:*) - echo mips-compaq-nonstopux - exit ;; - BS2000:POSIX*:*:*) - echo bs2000-siemens-sysv - exit ;; - DS/*:UNIX_System_V:*:*) - echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} - exit ;; - *:Plan9:*:*) - # "uname -m" is not consistent, so use $cputype instead. 386 - # is converted to i386 for consistency with other x86 - # operating systems. - if test "$cputype" = "386"; then - UNAME_MACHINE=i386 - else - UNAME_MACHINE="$cputype" - fi - echo ${UNAME_MACHINE}-unknown-plan9 - exit ;; - *:TOPS-10:*:*) - echo pdp10-unknown-tops10 - exit ;; - *:TENEX:*:*) - echo pdp10-unknown-tenex - exit ;; - KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) - echo pdp10-dec-tops20 - exit ;; - XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) - echo pdp10-xkl-tops20 - exit ;; - *:TOPS-20:*:*) - echo pdp10-unknown-tops20 - exit ;; - *:ITS:*:*) - echo pdp10-unknown-its - exit ;; - SEI:*:*:SEIUX) - echo mips-sei-seiux${UNAME_RELEASE} - exit ;; - *:DragonFly:*:*) - echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` - exit ;; - *:*VMS:*:*) - UNAME_MACHINE=`(uname -p) 2>/dev/null` - case "${UNAME_MACHINE}" in - A*) echo alpha-dec-vms ; exit ;; - I*) echo ia64-dec-vms ; exit ;; - V*) echo vax-dec-vms ; exit ;; - esac ;; - *:XENIX:*:SysV) - echo i386-pc-xenix - exit ;; - i*86:skyos:*:*) - echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' - exit ;; - i*86:rdos:*:*) - echo ${UNAME_MACHINE}-pc-rdos - exit ;; - i*86:AROS:*:*) - echo ${UNAME_MACHINE}-pc-aros - exit ;; -esac - -#echo '(No uname command or uname output not recognized.)' 1>&2 -#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 - -eval $set_cc_for_build -cat >$dummy.c < -# include -#endif -main () -{ -#if defined (sony) -#if defined (MIPSEB) - /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, - I don't know.... */ - printf ("mips-sony-bsd\n"); exit (0); -#else -#include - printf ("m68k-sony-newsos%s\n", -#ifdef NEWSOS4 - "4" -#else - "" -#endif - ); exit (0); -#endif -#endif - -#if defined (__arm) && defined (__acorn) && defined (__unix) - printf ("arm-acorn-riscix\n"); exit (0); -#endif - -#if defined (hp300) && !defined (hpux) - printf ("m68k-hp-bsd\n"); exit (0); -#endif - -#if defined (NeXT) -#if !defined (__ARCHITECTURE__) -#define __ARCHITECTURE__ "m68k" -#endif - int version; - version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; - if (version < 4) - printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); - else - printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); - exit (0); -#endif - -#if defined (MULTIMAX) || defined (n16) -#if defined (UMAXV) - printf ("ns32k-encore-sysv\n"); exit (0); -#else -#if defined (CMU) - printf ("ns32k-encore-mach\n"); exit (0); -#else - printf ("ns32k-encore-bsd\n"); exit (0); -#endif -#endif -#endif - -#if defined (__386BSD__) - printf ("i386-pc-bsd\n"); exit (0); -#endif - -#if defined (sequent) -#if defined (i386) - printf ("i386-sequent-dynix\n"); exit (0); -#endif -#if defined (ns32000) - printf ("ns32k-sequent-dynix\n"); exit (0); -#endif -#endif - -#if defined (_SEQUENT_) - struct utsname un; - - uname(&un); - - if (strncmp(un.version, "V2", 2) == 0) { - printf ("i386-sequent-ptx2\n"); exit (0); - } - if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ - printf ("i386-sequent-ptx1\n"); exit (0); - } - printf ("i386-sequent-ptx\n"); exit (0); - -#endif - -#if defined (vax) -# if !defined (ultrix) -# include -# if defined (BSD) -# if BSD == 43 - printf ("vax-dec-bsd4.3\n"); exit (0); -# else -# if BSD == 199006 - printf ("vax-dec-bsd4.3reno\n"); exit (0); -# else - printf ("vax-dec-bsd\n"); exit (0); -# endif -# endif -# else - printf ("vax-dec-bsd\n"); exit (0); -# endif -# else - printf ("vax-dec-ultrix\n"); exit (0); -# endif -#endif - -#if defined (alliant) && defined (i860) - printf ("i860-alliant-bsd\n"); exit (0); -#endif - - exit (1); -} -EOF - -$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && - { echo "$SYSTEM_NAME"; exit; } - -# Apollos put the system type in the environment. - -test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } - -# Convex versions that predate uname can use getsysinfo(1) - -if [ -x /usr/convex/getsysinfo ] -then - case `getsysinfo -f cpu_type` in - c1*) - echo c1-convex-bsd - exit ;; - c2*) - if getsysinfo -f scalar_acc - then echo c32-convex-bsd - else echo c2-convex-bsd - fi - exit ;; - c34*) - echo c34-convex-bsd - exit ;; - c38*) - echo c38-convex-bsd - exit ;; - c4*) - echo c4-convex-bsd - exit ;; - esac -fi - -cat >&2 < in order to provide the needed -information to handle your system. - -config.guess timestamp = $timestamp - -uname -m = `(uname -m) 2>/dev/null || echo unknown` -uname -r = `(uname -r) 2>/dev/null || echo unknown` -uname -s = `(uname -s) 2>/dev/null || echo unknown` -uname -v = `(uname -v) 2>/dev/null || echo unknown` - -/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` -/bin/uname -X = `(/bin/uname -X) 2>/dev/null` - -hostinfo = `(hostinfo) 2>/dev/null` -/bin/universe = `(/bin/universe) 2>/dev/null` -/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` -/bin/arch = `(/bin/arch) 2>/dev/null` -/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` -/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` - -UNAME_MACHINE = ${UNAME_MACHINE} -UNAME_RELEASE = ${UNAME_RELEASE} -UNAME_SYSTEM = ${UNAME_SYSTEM} -UNAME_VERSION = ${UNAME_VERSION} -EOF - -exit 1 - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "timestamp='" -# time-stamp-format: "%:y-%02m-%02d" -# time-stamp-end: "'" -# End: diff --git a/impl/antlr/libantlr3c-3.4/config.log b/impl/antlr/libantlr3c-3.4/config.log deleted file mode 100644 index 656285a..0000000 --- a/impl/antlr/libantlr3c-3.4/config.log +++ /dev/null @@ -1,5651 +0,0 @@ -This file contains any messages produced by compilers while -running configure, to aid debugging if configure makes a mistake. - -It was created by libantlr3c configure 3.4, which was -generated by GNU Autoconf 2.66. Invocation command line was - - $ ./configure - -## --------- ## -## Platform. ## -## --------- ## - -hostname = pc-4w14-0 -uname -m = x86_64 -uname -r = 3.2.0-2-amd64 -uname -s = Linux -uname -v = #1 SMP Tue Mar 20 18:36:37 UTC 2012 - -/usr/bin/uname -p = unknown -/bin/uname -X = unknown - -/bin/arch = unknown -/usr/bin/arch -k = unknown -/usr/convex/getsysinfo = unknown -/usr/bin/hostinfo = unknown -/bin/machine = unknown -/usr/bin/oslevel = unknown -/bin/universe = unknown - -PATH: /usr/local/bin -PATH: /usr/bin -PATH: /bin -PATH: /usr/local/games -PATH: /usr/games - - -## ----------- ## -## Core tests. ## -## ----------- ## - -configure:2416: checking for a BSD-compatible install -configure:2484: result: /usr/bin/install -c -configure:2495: checking whether build environment is sane -configure:2545: result: yes -configure:2686: checking for a thread-safe mkdir -p -configure:2725: result: /bin/mkdir -p -configure:2738: checking for gawk -configure:2768: result: no -configure:2738: checking for mawk -configure:2754: found /usr/bin/mawk -configure:2765: result: mawk -configure:2776: checking whether make sets $(MAKE) -configure:2798: result: yes -configure:2938: checking for xlc -configure:2968: result: no -configure:2938: checking for aCC -configure:2968: result: no -configure:2938: checking for gcc -configure:2954: found /usr/bin/gcc -configure:2965: result: gcc -configure:2996: checking for C compiler version -configure:3005: gcc --version >&5 -gcc (Debian 4.6.3-4) 4.6.3 -Copyright (C) 2011 Free Software Foundation, Inc. -This is free software; see the source for copying conditions. There is NO -warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -configure:3016: $? = 0 -configure:3005: gcc -v >&5 -Using built-in specs. -COLLECT_GCC=gcc -COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.6/lto-wrapper -Target: x86_64-linux-gnu -Configured with: ../src/configure -v --with-pkgversion='Debian 4.6.3-4' --with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.6 --enable-shared --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.6 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --enable-plugin --enable-objc-gc --with-arch-32=i586 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu -Thread model: posix -gcc version 4.6.3 (Debian 4.6.3-4) -configure:3016: $? = 0 -configure:3005: gcc -V >&5 -gcc: error: unrecognized option '-V' -gcc: fatal error: no input files -compilation terminated. -configure:3016: $? = 4 -configure:3005: gcc -qversion >&5 -gcc: error: unrecognized option '-qversion' -gcc: fatal error: no input files -compilation terminated. -configure:3016: $? = 4 -configure:3036: checking whether the C compiler works -configure:3058: gcc conftest.c >&5 -configure:3062: $? = 0 -configure:3110: result: yes -configure:3113: checking for C compiler default output file name -configure:3115: result: a.out -configure:3121: checking for suffix of executables -configure:3128: gcc -o conftest conftest.c >&5 -configure:3132: $? = 0 -configure:3154: result: -configure:3176: checking whether we are cross compiling -configure:3184: gcc -o conftest conftest.c >&5 -configure:3188: $? = 0 -configure:3195: ./conftest -configure:3199: $? = 0 -configure:3214: result: no -configure:3219: checking for suffix of object files -configure:3241: gcc -c conftest.c >&5 -configure:3245: $? = 0 -configure:3266: result: o -configure:3270: checking whether we are using the GNU C compiler -configure:3289: gcc -c conftest.c >&5 -configure:3289: $? = 0 -configure:3298: result: yes -configure:3307: checking whether gcc accepts -g -configure:3327: gcc -c -g conftest.c >&5 -configure:3327: $? = 0 -configure:3368: result: yes -configure:3385: checking for gcc option to accept ISO C89 -configure:3449: gcc -c -g -O2 conftest.c >&5 -configure:3449: $? = 0 -configure:3462: result: none needed -configure:3493: checking for style of include used by make -configure:3521: result: GNU -configure:3546: checking dependency style of gcc -configure:3656: result: gcc3 -configure:3672: checking whether to enable maintainer-specific portions of Makefiles -configure:3681: result: no -configure:3723: checking build system type -configure:3737: result: x86_64-unknown-linux-gnu -configure:3757: checking host system type -configure:3770: result: x86_64-unknown-linux-gnu -configure:3811: checking how to print strings -configure:3838: result: printf -configure:3859: checking for a sed that does not truncate output -configure:3923: result: /bin/sed -configure:3941: checking for grep that handles long lines and -e -configure:3999: result: /bin/grep -configure:4004: checking for egrep -configure:4066: result: /bin/grep -E -configure:4071: checking for fgrep -configure:4133: result: /bin/grep -F -configure:4168: checking for ld used by gcc -configure:4235: result: /usr/bin/ld -configure:4242: checking if the linker (/usr/bin/ld) is GNU ld -configure:4257: result: yes -configure:4269: checking for BSD- or MS-compatible name lister (nm) -configure:4318: result: /usr/bin/nm -B -configure:4448: checking the name lister (/usr/bin/nm -B) interface -configure:4455: gcc -c -g -O2 conftest.c >&5 -configure:4458: /usr/bin/nm -B "conftest.o" -configure:4461: output -0000000000000000 B some_variable -configure:4468: result: BSD nm -configure:4471: checking whether ln -s works -configure:4475: result: yes -configure:4483: checking the maximum length of command line arguments -configure:4608: result: 1572864 -configure:4625: checking whether the shell understands some XSI constructs -configure:4635: result: yes -configure:4639: checking whether the shell understands "+=" -configure:4645: result: yes -configure:4680: checking for /usr/bin/ld option to reload object files -configure:4687: result: -r -configure:4756: checking for objdump -configure:4772: found /usr/bin/objdump -configure:4783: result: objdump -configure:4815: checking how to recognize dependent libraries -configure:5017: result: pass_all -configure:5077: checking for ar -configure:5093: found /usr/bin/ar -configure:5104: result: ar -configure:5182: checking for strip -configure:5198: found /usr/bin/strip -configure:5209: result: strip -configure:5281: checking for ranlib -configure:5297: found /usr/bin/ranlib -configure:5308: result: ranlib -configure:5410: checking command to parse /usr/bin/nm -B output from gcc object -configure:5528: gcc -c -g -O2 conftest.c >&5 -configure:5531: $? = 0 -configure:5535: /usr/bin/nm -B conftest.o \| sed -n -e 's/^.*[ ]\([ABCDGIRSTW][ABCDGIRSTW]*\)[ ][ ]*\([_A-Za-z][_A-Za-z0-9]*\)$/\1 \2 \2/p' \> conftest.nm -configure:5538: $? = 0 -configure:5592: gcc -o conftest -g -O2 conftest.c conftstm.o >&5 -configure:5595: $? = 0 -configure:5633: result: ok -configure:5729: gcc -c -g -O2 conftest.c >&5 -configure:5732: $? = 0 -configure:6474: checking how to run the C preprocessor -configure:6505: gcc -E conftest.c -configure:6505: $? = 0 -configure:6519: gcc -E conftest.c -conftest.c:11:28: fatal error: ac_nonexistent.h: No such file or directory -compilation terminated. -configure:6519: $? = 1 -configure: failed program was: -| /* confdefs.h */ -| #define PACKAGE_NAME "libantlr3c" -| #define PACKAGE_TARNAME "libantlr3c" -| #define PACKAGE_VERSION "3.4" -| #define PACKAGE_STRING "libantlr3c 3.4" -| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" -| #define PACKAGE_URL "" -| #define PACKAGE "libantlr3c" -| #define VERSION "3.4" -| /* end confdefs.h. */ -| #include -configure:6544: result: gcc -E -configure:6564: gcc -E conftest.c -configure:6564: $? = 0 -configure:6578: gcc -E conftest.c -conftest.c:11:28: fatal error: ac_nonexistent.h: No such file or directory -compilation terminated. -configure:6578: $? = 1 -configure: failed program was: -| /* confdefs.h */ -| #define PACKAGE_NAME "libantlr3c" -| #define PACKAGE_TARNAME "libantlr3c" -| #define PACKAGE_VERSION "3.4" -| #define PACKAGE_STRING "libantlr3c 3.4" -| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" -| #define PACKAGE_URL "" -| #define PACKAGE "libantlr3c" -| #define VERSION "3.4" -| /* end confdefs.h. */ -| #include -configure:6607: checking for ANSI C header files -configure:6627: gcc -c -g -O2 conftest.c >&5 -configure:6627: $? = 0 -configure:6700: gcc -o conftest -g -O2 conftest.c >&5 -configure:6700: $? = 0 -configure:6700: ./conftest -configure:6700: $? = 0 -configure:6711: result: yes -configure:6724: checking for sys/types.h -configure:6724: gcc -c -g -O2 conftest.c >&5 -configure:6724: $? = 0 -configure:6724: result: yes -configure:6724: checking for sys/stat.h -configure:6724: gcc -c -g -O2 conftest.c >&5 -configure:6724: $? = 0 -configure:6724: result: yes -configure:6724: checking for stdlib.h -configure:6724: gcc -c -g -O2 conftest.c >&5 -configure:6724: $? = 0 -configure:6724: result: yes -configure:6724: checking for string.h -configure:6724: gcc -c -g -O2 conftest.c >&5 -configure:6724: $? = 0 -configure:6724: result: yes -configure:6724: checking for memory.h -configure:6724: gcc -c -g -O2 conftest.c >&5 -configure:6724: $? = 0 -configure:6724: result: yes -configure:6724: checking for strings.h -configure:6724: gcc -c -g -O2 conftest.c >&5 -configure:6724: $? = 0 -configure:6724: result: yes -configure:6724: checking for inttypes.h -configure:6724: gcc -c -g -O2 conftest.c >&5 -configure:6724: $? = 0 -configure:6724: result: yes -configure:6724: checking for stdint.h -configure:6724: gcc -c -g -O2 conftest.c >&5 -configure:6724: $? = 0 -configure:6724: result: yes -configure:6724: checking for unistd.h -configure:6724: gcc -c -g -O2 conftest.c >&5 -configure:6724: $? = 0 -configure:6724: result: yes -configure:6738: checking for dlfcn.h -configure:6738: gcc -c -g -O2 conftest.c >&5 -configure:6738: $? = 0 -configure:6738: result: yes -configure:6925: checking for objdir -configure:6940: result: .libs -configure:7211: checking if gcc supports -fno-rtti -fno-exceptions -configure:7229: gcc -c -g -O2 -fno-rtti -fno-exceptions conftest.c >&5 -cc1: warning: command line option '-fno-rtti' is valid for C++/ObjC++ but not for C [enabled by default] -configure:7233: $? = 0 -configure:7246: result: no -configure:7266: checking for gcc option to produce PIC -configure:7551: result: -fPIC -DPIC -configure:7563: checking if gcc PIC flag -fPIC -DPIC works -configure:7581: gcc -c -g -O2 -fPIC -DPIC -DPIC conftest.c >&5 -configure:7585: $? = 0 -configure:7598: result: yes -configure:7622: checking if gcc static flag -static works -configure:7650: result: yes -configure:7665: checking if gcc supports -c -o file.o -configure:7686: gcc -c -g -O2 -o out/conftest2.o conftest.c >&5 -configure:7690: $? = 0 -configure:7712: result: yes -configure:7720: checking if gcc supports -c -o file.o -configure:7767: result: yes -configure:7800: checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries -configure:8875: result: yes -configure:8912: checking whether -lc should be explicitly linked in -configure:8920: gcc -c -g -O2 conftest.c >&5 -configure:8923: $? = 0 -configure:8938: gcc -shared conftest.o -v -Wl,-soname -Wl,conftest -o conftest 2\>\&1 \| /bin/grep -lc \>/dev/null 2\>\&1 -configure:8941: $? = 0 -configure:8955: result: no -configure:9120: checking dynamic linker characteristics -configure:9575: gcc -o conftest -g -O2 -Wl,-rpath -Wl,/foo conftest.c >&5 -configure:9575: $? = 0 -configure:9801: result: GNU/Linux ld.so -configure:9908: checking how to hardcode library paths into programs -configure:9933: result: immediate -configure:10473: checking whether stripping libraries is possible -configure:10478: result: yes -configure:10513: checking if libtool supports shared libraries -configure:10515: result: yes -configure:10518: checking whether to build shared libraries -configure:10539: result: yes -configure:10542: checking whether to build static libraries -configure:10546: result: yes -configure:10587: checking compiler flags required for compiling ANTLR with gcc C compiler on host x86_64-unknown-linux-gnu -configure:10661: result: -m32 -O2 -Wall -configure:10677: checking whether ln -s works -configure:10681: result: yes -configure:10688: checking whether make sets $(MAKE) -configure:10710: result: yes -configure:10727: checking for sys/types.h -configure:10727: result: yes -configure:10727: checking for netinet/in.h -configure:10727: gcc -c -m32 -O2 -Wall conftest.c >&5 -conftest.c:25:25: fatal error: sys/types.h: No such file or directory -compilation terminated. -configure:10727: $? = 1 -configure: failed program was: -| /* confdefs.h */ -| #define PACKAGE_NAME "libantlr3c" -| #define PACKAGE_TARNAME "libantlr3c" -| #define PACKAGE_VERSION "3.4" -| #define PACKAGE_STRING "libantlr3c 3.4" -| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" -| #define PACKAGE_URL "" -| #define PACKAGE "libantlr3c" -| #define VERSION "3.4" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define HAVE_DLFCN_H 1 -| #define LT_OBJDIR ".libs/" -| #define HAVE_SYS_TYPES_H 1 -| /* end confdefs.h. */ -| #ifdef HAVE_SYS_TYPES_H -| # include -| #endif -| #ifdef HAVE_NETINET_IN_H -| # include /* inet_ functions / structs */ -| #endif -| #ifdef HAVE_ARPA_NAMESER_H -| # include /* DNS HEADER struct */ -| #endif -| #ifdef HAVE_NETDB_H -| # include -| #endif -| -| #include -configure:10727: result: no -configure:10727: checking for arpa/nameser.h -configure:10727: gcc -c -m32 -O2 -Wall conftest.c >&5 -conftest.c:25:25: fatal error: sys/types.h: No such file or directory -compilation terminated. -configure:10727: $? = 1 -configure: failed program was: -| /* confdefs.h */ -| #define PACKAGE_NAME "libantlr3c" -| #define PACKAGE_TARNAME "libantlr3c" -| #define PACKAGE_VERSION "3.4" -| #define PACKAGE_STRING "libantlr3c 3.4" -| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" -| #define PACKAGE_URL "" -| #define PACKAGE "libantlr3c" -| #define VERSION "3.4" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define HAVE_DLFCN_H 1 -| #define LT_OBJDIR ".libs/" -| #define HAVE_SYS_TYPES_H 1 -| /* end confdefs.h. */ -| #ifdef HAVE_SYS_TYPES_H -| # include -| #endif -| #ifdef HAVE_NETINET_IN_H -| # include /* inet_ functions / structs */ -| #endif -| #ifdef HAVE_ARPA_NAMESER_H -| # include /* DNS HEADER struct */ -| #endif -| #ifdef HAVE_NETDB_H -| # include -| #endif -| -| #include -configure:10727: result: no -configure:10727: checking for netdb.h -configure:10727: gcc -c -m32 -O2 -Wall conftest.c >&5 -conftest.c:25:25: fatal error: sys/types.h: No such file or directory -compilation terminated. -configure:10727: $? = 1 -configure: failed program was: -| /* confdefs.h */ -| #define PACKAGE_NAME "libantlr3c" -| #define PACKAGE_TARNAME "libantlr3c" -| #define PACKAGE_VERSION "3.4" -| #define PACKAGE_STRING "libantlr3c 3.4" -| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" -| #define PACKAGE_URL "" -| #define PACKAGE "libantlr3c" -| #define VERSION "3.4" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define HAVE_DLFCN_H 1 -| #define LT_OBJDIR ".libs/" -| #define HAVE_SYS_TYPES_H 1 -| /* end confdefs.h. */ -| #ifdef HAVE_SYS_TYPES_H -| # include -| #endif -| #ifdef HAVE_NETINET_IN_H -| # include /* inet_ functions / structs */ -| #endif -| #ifdef HAVE_ARPA_NAMESER_H -| # include /* DNS HEADER struct */ -| #endif -| #ifdef HAVE_NETDB_H -| # include -| #endif -| -| #include -configure:10727: result: no -configure:10727: checking for resolv.h -configure:10727: gcc -c -m32 -O2 -Wall conftest.c >&5 -conftest.c:25:25: fatal error: sys/types.h: No such file or directory -compilation terminated. -configure:10727: $? = 1 -configure: failed program was: -| /* confdefs.h */ -| #define PACKAGE_NAME "libantlr3c" -| #define PACKAGE_TARNAME "libantlr3c" -| #define PACKAGE_VERSION "3.4" -| #define PACKAGE_STRING "libantlr3c 3.4" -| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" -| #define PACKAGE_URL "" -| #define PACKAGE "libantlr3c" -| #define VERSION "3.4" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define HAVE_DLFCN_H 1 -| #define LT_OBJDIR ".libs/" -| #define HAVE_SYS_TYPES_H 1 -| /* end confdefs.h. */ -| #ifdef HAVE_SYS_TYPES_H -| # include -| #endif -| #ifdef HAVE_NETINET_IN_H -| # include /* inet_ functions / structs */ -| #endif -| #ifdef HAVE_ARPA_NAMESER_H -| # include /* DNS HEADER struct */ -| #endif -| #ifdef HAVE_NETDB_H -| # include -| #endif -| -| #include -configure:10727: result: no -configure:10753: checking for sys/malloc.h -configure:10753: gcc -c -m32 -O2 -Wall conftest.c >&5 -conftest.c:32:24: fatal error: sys/malloc.h: No such file or directory -compilation terminated. -configure:10753: $? = 1 -configure: failed program was: -| /* confdefs.h */ -| #define PACKAGE_NAME "libantlr3c" -| #define PACKAGE_TARNAME "libantlr3c" -| #define PACKAGE_VERSION "3.4" -| #define PACKAGE_STRING "libantlr3c 3.4" -| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" -| #define PACKAGE_URL "" -| #define PACKAGE "libantlr3c" -| #define VERSION "3.4" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define HAVE_DLFCN_H 1 -| #define LT_OBJDIR ".libs/" -| #define HAVE_SYS_TYPES_H 1 -| /* end confdefs.h. */ -| #ifdef HAVE_SYS_MALLOC_H -| #include -| #endif -| #ifdef HAVE_MALLOC_H -| #include -| #endif -| -| -| #include -configure:10753: result: no -configure:10753: checking for malloc.h -configure:10753: gcc -c -m32 -O2 -Wall conftest.c >&5 -In file included from /usr/include/malloc.h:24:0, - from conftest.c:32: -/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory -compilation terminated. -configure:10753: $? = 1 -configure: failed program was: -| /* confdefs.h */ -| #define PACKAGE_NAME "libantlr3c" -| #define PACKAGE_TARNAME "libantlr3c" -| #define PACKAGE_VERSION "3.4" -| #define PACKAGE_STRING "libantlr3c 3.4" -| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" -| #define PACKAGE_URL "" -| #define PACKAGE "libantlr3c" -| #define VERSION "3.4" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define HAVE_DLFCN_H 1 -| #define LT_OBJDIR ".libs/" -| #define HAVE_SYS_TYPES_H 1 -| /* end confdefs.h. */ -| #ifdef HAVE_SYS_MALLOC_H -| #include -| #endif -| #ifdef HAVE_MALLOC_H -| #include -| #endif -| -| -| #include -configure:10753: result: no -configure:10772: checking for stdarg.h -configure:10772: gcc -c -m32 -O2 -Wall conftest.c >&5 -configure:10772: $? = 0 -configure:10772: result: yes -configure:10789: checking for sys/stat.h -configure:10789: result: yes -configure:10806: checking for ctype.h -configure:10806: gcc -c -m32 -O2 -Wall conftest.c >&5 -In file included from /usr/include/ctype.h:27:0, - from conftest.c:31: -/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory -compilation terminated. -configure:10806: $? = 1 -configure: failed program was: -| /* confdefs.h */ -| #define PACKAGE_NAME "libantlr3c" -| #define PACKAGE_TARNAME "libantlr3c" -| #define PACKAGE_VERSION "3.4" -| #define PACKAGE_STRING "libantlr3c 3.4" -| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" -| #define PACKAGE_URL "" -| #define PACKAGE "libantlr3c" -| #define VERSION "3.4" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define HAVE_DLFCN_H 1 -| #define LT_OBJDIR ".libs/" -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_STDARG_H 1 -| #define HAVE_SYS_STAT_H 1 -| /* end confdefs.h. */ -| #ifdef HAVE_CTYPE_H -| #include -| #endif -| -| -| #include -configure:10806: result: no -configure:10823: checking for netinet/tcp.h -configure:10823: gcc -c -m32 -O2 -Wall conftest.c >&5 -In file included from /usr/include/netinet/tcp.h:35:0, - from conftest.c:31: -/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory -compilation terminated. -configure:10823: $? = 1 -configure: failed program was: -| /* confdefs.h */ -| #define PACKAGE_NAME "libantlr3c" -| #define PACKAGE_TARNAME "libantlr3c" -| #define PACKAGE_VERSION "3.4" -| #define PACKAGE_STRING "libantlr3c 3.4" -| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" -| #define PACKAGE_URL "" -| #define PACKAGE "libantlr3c" -| #define VERSION "3.4" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define HAVE_DLFCN_H 1 -| #define LT_OBJDIR ".libs/" -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_STDARG_H 1 -| #define HAVE_SYS_STAT_H 1 -| /* end confdefs.h. */ -| #ifdef HAVE_NETINET_TCP_H -| #include -| #endif -| -| -| #include -configure:10823: result: no -configure:10841: checking for sys/socket.h -configure:10841: gcc -c -m32 -O2 -Wall conftest.c >&5 -conftest.c:34:24: fatal error: sys/socket.h: No such file or directory -compilation terminated. -configure:10841: $? = 1 -configure: failed program was: -| /* confdefs.h */ -| #define PACKAGE_NAME "libantlr3c" -| #define PACKAGE_TARNAME "libantlr3c" -| #define PACKAGE_VERSION "3.4" -| #define PACKAGE_STRING "libantlr3c 3.4" -| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" -| #define PACKAGE_URL "" -| #define PACKAGE "libantlr3c" -| #define VERSION "3.4" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define HAVE_DLFCN_H 1 -| #define LT_OBJDIR ".libs/" -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_STDARG_H 1 -| #define HAVE_SYS_STAT_H 1 -| /* end confdefs.h. */ -| #ifdef HAVE_SYS_SOCKET_H -| #include -| #endif -| #ifdef HAVE_SOCKET_H -| #include -| #endif -| -| -| #include -configure:10841: result: no -configure:10841: checking for socket.h -configure:10841: gcc -c -m32 -O2 -Wall conftest.c >&5 -conftest.c:34:20: fatal error: socket.h: No such file or directory -compilation terminated. -configure:10841: $? = 1 -configure: failed program was: -| /* confdefs.h */ -| #define PACKAGE_NAME "libantlr3c" -| #define PACKAGE_TARNAME "libantlr3c" -| #define PACKAGE_VERSION "3.4" -| #define PACKAGE_STRING "libantlr3c 3.4" -| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" -| #define PACKAGE_URL "" -| #define PACKAGE "libantlr3c" -| #define VERSION "3.4" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define HAVE_DLFCN_H 1 -| #define LT_OBJDIR ".libs/" -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_STDARG_H 1 -| #define HAVE_SYS_STAT_H 1 -| /* end confdefs.h. */ -| #ifdef HAVE_SYS_SOCKET_H -| #include -| #endif -| #ifdef HAVE_SOCKET_H -| #include -| #endif -| -| -| #include -configure:10841: result: no -configure:10860: checking for an ANSI C-conforming const -configure:10925: gcc -c -m32 -O2 -Wall conftest.c >&5 -conftest.c: In function 'main': -conftest.c:55:10: warning: 't' is used uninitialized in this function [-Wuninitialized] -configure:10925: $? = 0 -configure:10932: result: yes -configure:10940: checking for size_t -configure:10940: gcc -c -m32 -O2 -Wall conftest.c >&5 -In file included from /usr/include/stdio.h:28:0, - from conftest.c:26: -/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory -compilation terminated. -configure:10940: $? = 1 -configure: failed program was: -| /* confdefs.h */ -| #define PACKAGE_NAME "libantlr3c" -| #define PACKAGE_TARNAME "libantlr3c" -| #define PACKAGE_VERSION "3.4" -| #define PACKAGE_STRING "libantlr3c 3.4" -| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" -| #define PACKAGE_URL "" -| #define PACKAGE "libantlr3c" -| #define VERSION "3.4" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define HAVE_DLFCN_H 1 -| #define LT_OBJDIR ".libs/" -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_STDARG_H 1 -| #define HAVE_SYS_STAT_H 1 -| /* end confdefs.h. */ -| #include -| #ifdef HAVE_SYS_TYPES_H -| # include -| #endif -| #ifdef HAVE_SYS_STAT_H -| # include -| #endif -| #ifdef STDC_HEADERS -| # include -| # include -| #else -| # ifdef HAVE_STDLIB_H -| # include -| # endif -| #endif -| #ifdef HAVE_STRING_H -| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H -| # include -| # endif -| # include -| #endif -| #ifdef HAVE_STRINGS_H -| # include -| #endif -| #ifdef HAVE_INTTYPES_H -| # include -| #endif -| #ifdef HAVE_STDINT_H -| # include -| #endif -| #ifdef HAVE_UNISTD_H -| # include -| #endif -| int -| main () -| { -| if (sizeof (size_t)) -| return 0; -| ; -| return 0; -| } -configure:10940: result: no -configure:10951: checking for int8_t -configure:10951: gcc -c -m32 -O2 -Wall conftest.c >&5 -In file included from /usr/include/stdio.h:28:0, - from conftest.c:27: -/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory -compilation terminated. -configure:10951: $? = 1 -configure: failed program was: -| /* confdefs.h */ -| #define PACKAGE_NAME "libantlr3c" -| #define PACKAGE_TARNAME "libantlr3c" -| #define PACKAGE_VERSION "3.4" -| #define PACKAGE_STRING "libantlr3c 3.4" -| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" -| #define PACKAGE_URL "" -| #define PACKAGE "libantlr3c" -| #define VERSION "3.4" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define HAVE_DLFCN_H 1 -| #define LT_OBJDIR ".libs/" -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_STDARG_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define size_t unsigned int -| /* end confdefs.h. */ -| #include -| #ifdef HAVE_SYS_TYPES_H -| # include -| #endif -| #ifdef HAVE_SYS_STAT_H -| # include -| #endif -| #ifdef STDC_HEADERS -| # include -| # include -| #else -| # ifdef HAVE_STDLIB_H -| # include -| # endif -| #endif -| #ifdef HAVE_STRING_H -| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H -| # include -| # endif -| # include -| #endif -| #ifdef HAVE_STRINGS_H -| # include -| #endif -| #ifdef HAVE_INTTYPES_H -| # include -| #endif -| #ifdef HAVE_STDINT_H -| # include -| #endif -| #ifdef HAVE_UNISTD_H -| # include -| #endif -| enum { N = 8 / 2 - 1 }; -| int -| main () -| { -| static int test_array [1 - 2 * !(0 < (int8_t) (((((int8_t) 1 << N) << N) - 1) * 2 + 1))]; -| test_array [0] = 0 -| -| ; -| return 0; -| } -configure:10951: gcc -c -m32 -O2 -Wall conftest.c >&5 -In file included from /usr/include/stdio.h:28:0, - from conftest.c:27: -/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory -compilation terminated. -configure:10951: $? = 1 -configure: failed program was: -| /* confdefs.h */ -| #define PACKAGE_NAME "libantlr3c" -| #define PACKAGE_TARNAME "libantlr3c" -| #define PACKAGE_VERSION "3.4" -| #define PACKAGE_STRING "libantlr3c 3.4" -| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" -| #define PACKAGE_URL "" -| #define PACKAGE "libantlr3c" -| #define VERSION "3.4" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define HAVE_DLFCN_H 1 -| #define LT_OBJDIR ".libs/" -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_STDARG_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define size_t unsigned int -| /* end confdefs.h. */ -| #include -| #ifdef HAVE_SYS_TYPES_H -| # include -| #endif -| #ifdef HAVE_SYS_STAT_H -| # include -| #endif -| #ifdef STDC_HEADERS -| # include -| # include -| #else -| # ifdef HAVE_STDLIB_H -| # include -| # endif -| #endif -| #ifdef HAVE_STRING_H -| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H -| # include -| # endif -| # include -| #endif -| #ifdef HAVE_STRINGS_H -| # include -| #endif -| #ifdef HAVE_INTTYPES_H -| # include -| #endif -| #ifdef HAVE_STDINT_H -| # include -| #endif -| #ifdef HAVE_UNISTD_H -| # include -| #endif -| enum { N = 8 / 2 - 1 }; -| int -| main () -| { -| static int test_array [1 - 2 * !(0 < (int) (((((int) 1 << N) << N) - 1) * 2 + 1))]; -| test_array [0] = 0 -| -| ; -| return 0; -| } -configure:10951: gcc -c -m32 -O2 -Wall conftest.c >&5 -In file included from /usr/include/stdio.h:28:0, - from conftest.c:27: -/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory -compilation terminated. -configure:10951: $? = 1 -configure: failed program was: -| /* confdefs.h */ -| #define PACKAGE_NAME "libantlr3c" -| #define PACKAGE_TARNAME "libantlr3c" -| #define PACKAGE_VERSION "3.4" -| #define PACKAGE_STRING "libantlr3c 3.4" -| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" -| #define PACKAGE_URL "" -| #define PACKAGE "libantlr3c" -| #define VERSION "3.4" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define HAVE_DLFCN_H 1 -| #define LT_OBJDIR ".libs/" -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_STDARG_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define size_t unsigned int -| /* end confdefs.h. */ -| #include -| #ifdef HAVE_SYS_TYPES_H -| # include -| #endif -| #ifdef HAVE_SYS_STAT_H -| # include -| #endif -| #ifdef STDC_HEADERS -| # include -| # include -| #else -| # ifdef HAVE_STDLIB_H -| # include -| # endif -| #endif -| #ifdef HAVE_STRING_H -| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H -| # include -| # endif -| # include -| #endif -| #ifdef HAVE_STRINGS_H -| # include -| #endif -| #ifdef HAVE_INTTYPES_H -| # include -| #endif -| #ifdef HAVE_STDINT_H -| # include -| #endif -| #ifdef HAVE_UNISTD_H -| # include -| #endif -| enum { N = 8 / 2 - 1 }; -| int -| main () -| { -| static int test_array [1 - 2 * !(0 < (long int) (((((long int) 1 << N) << N) - 1) * 2 + 1))]; -| test_array [0] = 0 -| -| ; -| return 0; -| } -configure:10951: gcc -c -m32 -O2 -Wall conftest.c >&5 -In file included from /usr/include/stdio.h:28:0, - from conftest.c:27: -/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory -compilation terminated. -configure:10951: $? = 1 -configure: failed program was: -| /* confdefs.h */ -| #define PACKAGE_NAME "libantlr3c" -| #define PACKAGE_TARNAME "libantlr3c" -| #define PACKAGE_VERSION "3.4" -| #define PACKAGE_STRING "libantlr3c 3.4" -| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" -| #define PACKAGE_URL "" -| #define PACKAGE "libantlr3c" -| #define VERSION "3.4" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define HAVE_DLFCN_H 1 -| #define LT_OBJDIR ".libs/" -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_STDARG_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define size_t unsigned int -| /* end confdefs.h. */ -| #include -| #ifdef HAVE_SYS_TYPES_H -| # include -| #endif -| #ifdef HAVE_SYS_STAT_H -| # include -| #endif -| #ifdef STDC_HEADERS -| # include -| # include -| #else -| # ifdef HAVE_STDLIB_H -| # include -| # endif -| #endif -| #ifdef HAVE_STRING_H -| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H -| # include -| # endif -| # include -| #endif -| #ifdef HAVE_STRINGS_H -| # include -| #endif -| #ifdef HAVE_INTTYPES_H -| # include -| #endif -| #ifdef HAVE_STDINT_H -| # include -| #endif -| #ifdef HAVE_UNISTD_H -| # include -| #endif -| enum { N = 8 / 2 - 1 }; -| int -| main () -| { -| static int test_array [1 - 2 * !(0 < (long long int) (((((long long int) 1 << N) << N) - 1) * 2 + 1))]; -| test_array [0] = 0 -| -| ; -| return 0; -| } -configure:10951: gcc -c -m32 -O2 -Wall conftest.c >&5 -In file included from /usr/include/stdio.h:28:0, - from conftest.c:27: -/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory -compilation terminated. -configure:10951: $? = 1 -configure: failed program was: -| /* confdefs.h */ -| #define PACKAGE_NAME "libantlr3c" -| #define PACKAGE_TARNAME "libantlr3c" -| #define PACKAGE_VERSION "3.4" -| #define PACKAGE_STRING "libantlr3c 3.4" -| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" -| #define PACKAGE_URL "" -| #define PACKAGE "libantlr3c" -| #define VERSION "3.4" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define HAVE_DLFCN_H 1 -| #define LT_OBJDIR ".libs/" -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_STDARG_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define size_t unsigned int -| /* end confdefs.h. */ -| #include -| #ifdef HAVE_SYS_TYPES_H -| # include -| #endif -| #ifdef HAVE_SYS_STAT_H -| # include -| #endif -| #ifdef STDC_HEADERS -| # include -| # include -| #else -| # ifdef HAVE_STDLIB_H -| # include -| # endif -| #endif -| #ifdef HAVE_STRING_H -| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H -| # include -| # endif -| # include -| #endif -| #ifdef HAVE_STRINGS_H -| # include -| #endif -| #ifdef HAVE_INTTYPES_H -| # include -| #endif -| #ifdef HAVE_STDINT_H -| # include -| #endif -| #ifdef HAVE_UNISTD_H -| # include -| #endif -| enum { N = 8 / 2 - 1 }; -| int -| main () -| { -| static int test_array [1 - 2 * !(0 < (short int) (((((short int) 1 << N) << N) - 1) * 2 + 1))]; -| test_array [0] = 0 -| -| ; -| return 0; -| } -configure:10951: gcc -c -m32 -O2 -Wall conftest.c >&5 -In file included from /usr/include/stdio.h:28:0, - from conftest.c:27: -/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory -compilation terminated. -configure:10951: $? = 1 -configure: failed program was: -| /* confdefs.h */ -| #define PACKAGE_NAME "libantlr3c" -| #define PACKAGE_TARNAME "libantlr3c" -| #define PACKAGE_VERSION "3.4" -| #define PACKAGE_STRING "libantlr3c 3.4" -| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" -| #define PACKAGE_URL "" -| #define PACKAGE "libantlr3c" -| #define VERSION "3.4" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define HAVE_DLFCN_H 1 -| #define LT_OBJDIR ".libs/" -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_STDARG_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define size_t unsigned int -| /* end confdefs.h. */ -| #include -| #ifdef HAVE_SYS_TYPES_H -| # include -| #endif -| #ifdef HAVE_SYS_STAT_H -| # include -| #endif -| #ifdef STDC_HEADERS -| # include -| # include -| #else -| # ifdef HAVE_STDLIB_H -| # include -| # endif -| #endif -| #ifdef HAVE_STRING_H -| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H -| # include -| # endif -| # include -| #endif -| #ifdef HAVE_STRINGS_H -| # include -| #endif -| #ifdef HAVE_INTTYPES_H -| # include -| #endif -| #ifdef HAVE_STDINT_H -| # include -| #endif -| #ifdef HAVE_UNISTD_H -| # include -| #endif -| enum { N = 8 / 2 - 1 }; -| int -| main () -| { -| static int test_array [1 - 2 * !(0 < (signed char) (((((signed char) 1 << N) << N) - 1) * 2 + 1))]; -| test_array [0] = 0 -| -| ; -| return 0; -| } -configure:10951: result: no -configure:10962: checking for int16_t -configure:10962: gcc -c -m32 -O2 -Wall conftest.c >&5 -In file included from /usr/include/stdio.h:28:0, - from conftest.c:27: -/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory -compilation terminated. -configure:10962: $? = 1 -configure: failed program was: -| /* confdefs.h */ -| #define PACKAGE_NAME "libantlr3c" -| #define PACKAGE_TARNAME "libantlr3c" -| #define PACKAGE_VERSION "3.4" -| #define PACKAGE_STRING "libantlr3c 3.4" -| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" -| #define PACKAGE_URL "" -| #define PACKAGE "libantlr3c" -| #define VERSION "3.4" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define HAVE_DLFCN_H 1 -| #define LT_OBJDIR ".libs/" -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_STDARG_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define size_t unsigned int -| /* end confdefs.h. */ -| #include -| #ifdef HAVE_SYS_TYPES_H -| # include -| #endif -| #ifdef HAVE_SYS_STAT_H -| # include -| #endif -| #ifdef STDC_HEADERS -| # include -| # include -| #else -| # ifdef HAVE_STDLIB_H -| # include -| # endif -| #endif -| #ifdef HAVE_STRING_H -| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H -| # include -| # endif -| # include -| #endif -| #ifdef HAVE_STRINGS_H -| # include -| #endif -| #ifdef HAVE_INTTYPES_H -| # include -| #endif -| #ifdef HAVE_STDINT_H -| # include -| #endif -| #ifdef HAVE_UNISTD_H -| # include -| #endif -| enum { N = 16 / 2 - 1 }; -| int -| main () -| { -| static int test_array [1 - 2 * !(0 < (int16_t) (((((int16_t) 1 << N) << N) - 1) * 2 + 1))]; -| test_array [0] = 0 -| -| ; -| return 0; -| } -configure:10962: gcc -c -m32 -O2 -Wall conftest.c >&5 -In file included from /usr/include/stdio.h:28:0, - from conftest.c:27: -/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory -compilation terminated. -configure:10962: $? = 1 -configure: failed program was: -| /* confdefs.h */ -| #define PACKAGE_NAME "libantlr3c" -| #define PACKAGE_TARNAME "libantlr3c" -| #define PACKAGE_VERSION "3.4" -| #define PACKAGE_STRING "libantlr3c 3.4" -| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" -| #define PACKAGE_URL "" -| #define PACKAGE "libantlr3c" -| #define VERSION "3.4" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define HAVE_DLFCN_H 1 -| #define LT_OBJDIR ".libs/" -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_STDARG_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define size_t unsigned int -| /* end confdefs.h. */ -| #include -| #ifdef HAVE_SYS_TYPES_H -| # include -| #endif -| #ifdef HAVE_SYS_STAT_H -| # include -| #endif -| #ifdef STDC_HEADERS -| # include -| # include -| #else -| # ifdef HAVE_STDLIB_H -| # include -| # endif -| #endif -| #ifdef HAVE_STRING_H -| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H -| # include -| # endif -| # include -| #endif -| #ifdef HAVE_STRINGS_H -| # include -| #endif -| #ifdef HAVE_INTTYPES_H -| # include -| #endif -| #ifdef HAVE_STDINT_H -| # include -| #endif -| #ifdef HAVE_UNISTD_H -| # include -| #endif -| enum { N = 16 / 2 - 1 }; -| int -| main () -| { -| static int test_array [1 - 2 * !(0 < (int) (((((int) 1 << N) << N) - 1) * 2 + 1))]; -| test_array [0] = 0 -| -| ; -| return 0; -| } -configure:10962: gcc -c -m32 -O2 -Wall conftest.c >&5 -In file included from /usr/include/stdio.h:28:0, - from conftest.c:27: -/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory -compilation terminated. -configure:10962: $? = 1 -configure: failed program was: -| /* confdefs.h */ -| #define PACKAGE_NAME "libantlr3c" -| #define PACKAGE_TARNAME "libantlr3c" -| #define PACKAGE_VERSION "3.4" -| #define PACKAGE_STRING "libantlr3c 3.4" -| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" -| #define PACKAGE_URL "" -| #define PACKAGE "libantlr3c" -| #define VERSION "3.4" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define HAVE_DLFCN_H 1 -| #define LT_OBJDIR ".libs/" -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_STDARG_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define size_t unsigned int -| /* end confdefs.h. */ -| #include -| #ifdef HAVE_SYS_TYPES_H -| # include -| #endif -| #ifdef HAVE_SYS_STAT_H -| # include -| #endif -| #ifdef STDC_HEADERS -| # include -| # include -| #else -| # ifdef HAVE_STDLIB_H -| # include -| # endif -| #endif -| #ifdef HAVE_STRING_H -| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H -| # include -| # endif -| # include -| #endif -| #ifdef HAVE_STRINGS_H -| # include -| #endif -| #ifdef HAVE_INTTYPES_H -| # include -| #endif -| #ifdef HAVE_STDINT_H -| # include -| #endif -| #ifdef HAVE_UNISTD_H -| # include -| #endif -| enum { N = 16 / 2 - 1 }; -| int -| main () -| { -| static int test_array [1 - 2 * !(0 < (long int) (((((long int) 1 << N) << N) - 1) * 2 + 1))]; -| test_array [0] = 0 -| -| ; -| return 0; -| } -configure:10962: gcc -c -m32 -O2 -Wall conftest.c >&5 -In file included from /usr/include/stdio.h:28:0, - from conftest.c:27: -/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory -compilation terminated. -configure:10962: $? = 1 -configure: failed program was: -| /* confdefs.h */ -| #define PACKAGE_NAME "libantlr3c" -| #define PACKAGE_TARNAME "libantlr3c" -| #define PACKAGE_VERSION "3.4" -| #define PACKAGE_STRING "libantlr3c 3.4" -| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" -| #define PACKAGE_URL "" -| #define PACKAGE "libantlr3c" -| #define VERSION "3.4" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define HAVE_DLFCN_H 1 -| #define LT_OBJDIR ".libs/" -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_STDARG_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define size_t unsigned int -| /* end confdefs.h. */ -| #include -| #ifdef HAVE_SYS_TYPES_H -| # include -| #endif -| #ifdef HAVE_SYS_STAT_H -| # include -| #endif -| #ifdef STDC_HEADERS -| # include -| # include -| #else -| # ifdef HAVE_STDLIB_H -| # include -| # endif -| #endif -| #ifdef HAVE_STRING_H -| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H -| # include -| # endif -| # include -| #endif -| #ifdef HAVE_STRINGS_H -| # include -| #endif -| #ifdef HAVE_INTTYPES_H -| # include -| #endif -| #ifdef HAVE_STDINT_H -| # include -| #endif -| #ifdef HAVE_UNISTD_H -| # include -| #endif -| enum { N = 16 / 2 - 1 }; -| int -| main () -| { -| static int test_array [1 - 2 * !(0 < (long long int) (((((long long int) 1 << N) << N) - 1) * 2 + 1))]; -| test_array [0] = 0 -| -| ; -| return 0; -| } -configure:10962: gcc -c -m32 -O2 -Wall conftest.c >&5 -In file included from /usr/include/stdio.h:28:0, - from conftest.c:27: -/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory -compilation terminated. -configure:10962: $? = 1 -configure: failed program was: -| /* confdefs.h */ -| #define PACKAGE_NAME "libantlr3c" -| #define PACKAGE_TARNAME "libantlr3c" -| #define PACKAGE_VERSION "3.4" -| #define PACKAGE_STRING "libantlr3c 3.4" -| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" -| #define PACKAGE_URL "" -| #define PACKAGE "libantlr3c" -| #define VERSION "3.4" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define HAVE_DLFCN_H 1 -| #define LT_OBJDIR ".libs/" -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_STDARG_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define size_t unsigned int -| /* end confdefs.h. */ -| #include -| #ifdef HAVE_SYS_TYPES_H -| # include -| #endif -| #ifdef HAVE_SYS_STAT_H -| # include -| #endif -| #ifdef STDC_HEADERS -| # include -| # include -| #else -| # ifdef HAVE_STDLIB_H -| # include -| # endif -| #endif -| #ifdef HAVE_STRING_H -| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H -| # include -| # endif -| # include -| #endif -| #ifdef HAVE_STRINGS_H -| # include -| #endif -| #ifdef HAVE_INTTYPES_H -| # include -| #endif -| #ifdef HAVE_STDINT_H -| # include -| #endif -| #ifdef HAVE_UNISTD_H -| # include -| #endif -| enum { N = 16 / 2 - 1 }; -| int -| main () -| { -| static int test_array [1 - 2 * !(0 < (short int) (((((short int) 1 << N) << N) - 1) * 2 + 1))]; -| test_array [0] = 0 -| -| ; -| return 0; -| } -configure:10962: gcc -c -m32 -O2 -Wall conftest.c >&5 -In file included from /usr/include/stdio.h:28:0, - from conftest.c:27: -/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory -compilation terminated. -configure:10962: $? = 1 -configure: failed program was: -| /* confdefs.h */ -| #define PACKAGE_NAME "libantlr3c" -| #define PACKAGE_TARNAME "libantlr3c" -| #define PACKAGE_VERSION "3.4" -| #define PACKAGE_STRING "libantlr3c 3.4" -| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" -| #define PACKAGE_URL "" -| #define PACKAGE "libantlr3c" -| #define VERSION "3.4" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define HAVE_DLFCN_H 1 -| #define LT_OBJDIR ".libs/" -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_STDARG_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define size_t unsigned int -| /* end confdefs.h. */ -| #include -| #ifdef HAVE_SYS_TYPES_H -| # include -| #endif -| #ifdef HAVE_SYS_STAT_H -| # include -| #endif -| #ifdef STDC_HEADERS -| # include -| # include -| #else -| # ifdef HAVE_STDLIB_H -| # include -| # endif -| #endif -| #ifdef HAVE_STRING_H -| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H -| # include -| # endif -| # include -| #endif -| #ifdef HAVE_STRINGS_H -| # include -| #endif -| #ifdef HAVE_INTTYPES_H -| # include -| #endif -| #ifdef HAVE_STDINT_H -| # include -| #endif -| #ifdef HAVE_UNISTD_H -| # include -| #endif -| enum { N = 16 / 2 - 1 }; -| int -| main () -| { -| static int test_array [1 - 2 * !(0 < (signed char) (((((signed char) 1 << N) << N) - 1) * 2 + 1))]; -| test_array [0] = 0 -| -| ; -| return 0; -| } -configure:10962: result: no -configure:10973: checking for int32_t -configure:10973: gcc -c -m32 -O2 -Wall conftest.c >&5 -In file included from /usr/include/stdio.h:28:0, - from conftest.c:27: -/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory -compilation terminated. -configure:10973: $? = 1 -configure: failed program was: -| /* confdefs.h */ -| #define PACKAGE_NAME "libantlr3c" -| #define PACKAGE_TARNAME "libantlr3c" -| #define PACKAGE_VERSION "3.4" -| #define PACKAGE_STRING "libantlr3c 3.4" -| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" -| #define PACKAGE_URL "" -| #define PACKAGE "libantlr3c" -| #define VERSION "3.4" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define HAVE_DLFCN_H 1 -| #define LT_OBJDIR ".libs/" -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_STDARG_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define size_t unsigned int -| /* end confdefs.h. */ -| #include -| #ifdef HAVE_SYS_TYPES_H -| # include -| #endif -| #ifdef HAVE_SYS_STAT_H -| # include -| #endif -| #ifdef STDC_HEADERS -| # include -| # include -| #else -| # ifdef HAVE_STDLIB_H -| # include -| # endif -| #endif -| #ifdef HAVE_STRING_H -| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H -| # include -| # endif -| # include -| #endif -| #ifdef HAVE_STRINGS_H -| # include -| #endif -| #ifdef HAVE_INTTYPES_H -| # include -| #endif -| #ifdef HAVE_STDINT_H -| # include -| #endif -| #ifdef HAVE_UNISTD_H -| # include -| #endif -| enum { N = 32 / 2 - 1 }; -| int -| main () -| { -| static int test_array [1 - 2 * !(0 < (int32_t) (((((int32_t) 1 << N) << N) - 1) * 2 + 1))]; -| test_array [0] = 0 -| -| ; -| return 0; -| } -configure:10973: gcc -c -m32 -O2 -Wall conftest.c >&5 -In file included from /usr/include/stdio.h:28:0, - from conftest.c:27: -/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory -compilation terminated. -configure:10973: $? = 1 -configure: failed program was: -| /* confdefs.h */ -| #define PACKAGE_NAME "libantlr3c" -| #define PACKAGE_TARNAME "libantlr3c" -| #define PACKAGE_VERSION "3.4" -| #define PACKAGE_STRING "libantlr3c 3.4" -| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" -| #define PACKAGE_URL "" -| #define PACKAGE "libantlr3c" -| #define VERSION "3.4" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define HAVE_DLFCN_H 1 -| #define LT_OBJDIR ".libs/" -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_STDARG_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define size_t unsigned int -| /* end confdefs.h. */ -| #include -| #ifdef HAVE_SYS_TYPES_H -| # include -| #endif -| #ifdef HAVE_SYS_STAT_H -| # include -| #endif -| #ifdef STDC_HEADERS -| # include -| # include -| #else -| # ifdef HAVE_STDLIB_H -| # include -| # endif -| #endif -| #ifdef HAVE_STRING_H -| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H -| # include -| # endif -| # include -| #endif -| #ifdef HAVE_STRINGS_H -| # include -| #endif -| #ifdef HAVE_INTTYPES_H -| # include -| #endif -| #ifdef HAVE_STDINT_H -| # include -| #endif -| #ifdef HAVE_UNISTD_H -| # include -| #endif -| enum { N = 32 / 2 - 1 }; -| int -| main () -| { -| static int test_array [1 - 2 * !(0 < (int) (((((int) 1 << N) << N) - 1) * 2 + 1))]; -| test_array [0] = 0 -| -| ; -| return 0; -| } -configure:10973: gcc -c -m32 -O2 -Wall conftest.c >&5 -In file included from /usr/include/stdio.h:28:0, - from conftest.c:27: -/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory -compilation terminated. -configure:10973: $? = 1 -configure: failed program was: -| /* confdefs.h */ -| #define PACKAGE_NAME "libantlr3c" -| #define PACKAGE_TARNAME "libantlr3c" -| #define PACKAGE_VERSION "3.4" -| #define PACKAGE_STRING "libantlr3c 3.4" -| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" -| #define PACKAGE_URL "" -| #define PACKAGE "libantlr3c" -| #define VERSION "3.4" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define HAVE_DLFCN_H 1 -| #define LT_OBJDIR ".libs/" -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_STDARG_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define size_t unsigned int -| /* end confdefs.h. */ -| #include -| #ifdef HAVE_SYS_TYPES_H -| # include -| #endif -| #ifdef HAVE_SYS_STAT_H -| # include -| #endif -| #ifdef STDC_HEADERS -| # include -| # include -| #else -| # ifdef HAVE_STDLIB_H -| # include -| # endif -| #endif -| #ifdef HAVE_STRING_H -| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H -| # include -| # endif -| # include -| #endif -| #ifdef HAVE_STRINGS_H -| # include -| #endif -| #ifdef HAVE_INTTYPES_H -| # include -| #endif -| #ifdef HAVE_STDINT_H -| # include -| #endif -| #ifdef HAVE_UNISTD_H -| # include -| #endif -| enum { N = 32 / 2 - 1 }; -| int -| main () -| { -| static int test_array [1 - 2 * !(0 < (long int) (((((long int) 1 << N) << N) - 1) * 2 + 1))]; -| test_array [0] = 0 -| -| ; -| return 0; -| } -configure:10973: gcc -c -m32 -O2 -Wall conftest.c >&5 -In file included from /usr/include/stdio.h:28:0, - from conftest.c:27: -/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory -compilation terminated. -configure:10973: $? = 1 -configure: failed program was: -| /* confdefs.h */ -| #define PACKAGE_NAME "libantlr3c" -| #define PACKAGE_TARNAME "libantlr3c" -| #define PACKAGE_VERSION "3.4" -| #define PACKAGE_STRING "libantlr3c 3.4" -| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" -| #define PACKAGE_URL "" -| #define PACKAGE "libantlr3c" -| #define VERSION "3.4" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define HAVE_DLFCN_H 1 -| #define LT_OBJDIR ".libs/" -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_STDARG_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define size_t unsigned int -| /* end confdefs.h. */ -| #include -| #ifdef HAVE_SYS_TYPES_H -| # include -| #endif -| #ifdef HAVE_SYS_STAT_H -| # include -| #endif -| #ifdef STDC_HEADERS -| # include -| # include -| #else -| # ifdef HAVE_STDLIB_H -| # include -| # endif -| #endif -| #ifdef HAVE_STRING_H -| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H -| # include -| # endif -| # include -| #endif -| #ifdef HAVE_STRINGS_H -| # include -| #endif -| #ifdef HAVE_INTTYPES_H -| # include -| #endif -| #ifdef HAVE_STDINT_H -| # include -| #endif -| #ifdef HAVE_UNISTD_H -| # include -| #endif -| enum { N = 32 / 2 - 1 }; -| int -| main () -| { -| static int test_array [1 - 2 * !(0 < (long long int) (((((long long int) 1 << N) << N) - 1) * 2 + 1))]; -| test_array [0] = 0 -| -| ; -| return 0; -| } -configure:10973: gcc -c -m32 -O2 -Wall conftest.c >&5 -In file included from /usr/include/stdio.h:28:0, - from conftest.c:27: -/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory -compilation terminated. -configure:10973: $? = 1 -configure: failed program was: -| /* confdefs.h */ -| #define PACKAGE_NAME "libantlr3c" -| #define PACKAGE_TARNAME "libantlr3c" -| #define PACKAGE_VERSION "3.4" -| #define PACKAGE_STRING "libantlr3c 3.4" -| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" -| #define PACKAGE_URL "" -| #define PACKAGE "libantlr3c" -| #define VERSION "3.4" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define HAVE_DLFCN_H 1 -| #define LT_OBJDIR ".libs/" -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_STDARG_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define size_t unsigned int -| /* end confdefs.h. */ -| #include -| #ifdef HAVE_SYS_TYPES_H -| # include -| #endif -| #ifdef HAVE_SYS_STAT_H -| # include -| #endif -| #ifdef STDC_HEADERS -| # include -| # include -| #else -| # ifdef HAVE_STDLIB_H -| # include -| # endif -| #endif -| #ifdef HAVE_STRING_H -| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H -| # include -| # endif -| # include -| #endif -| #ifdef HAVE_STRINGS_H -| # include -| #endif -| #ifdef HAVE_INTTYPES_H -| # include -| #endif -| #ifdef HAVE_STDINT_H -| # include -| #endif -| #ifdef HAVE_UNISTD_H -| # include -| #endif -| enum { N = 32 / 2 - 1 }; -| int -| main () -| { -| static int test_array [1 - 2 * !(0 < (short int) (((((short int) 1 << N) << N) - 1) * 2 + 1))]; -| test_array [0] = 0 -| -| ; -| return 0; -| } -configure:10973: gcc -c -m32 -O2 -Wall conftest.c >&5 -In file included from /usr/include/stdio.h:28:0, - from conftest.c:27: -/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory -compilation terminated. -configure:10973: $? = 1 -configure: failed program was: -| /* confdefs.h */ -| #define PACKAGE_NAME "libantlr3c" -| #define PACKAGE_TARNAME "libantlr3c" -| #define PACKAGE_VERSION "3.4" -| #define PACKAGE_STRING "libantlr3c 3.4" -| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" -| #define PACKAGE_URL "" -| #define PACKAGE "libantlr3c" -| #define VERSION "3.4" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define HAVE_DLFCN_H 1 -| #define LT_OBJDIR ".libs/" -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_STDARG_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define size_t unsigned int -| /* end confdefs.h. */ -| #include -| #ifdef HAVE_SYS_TYPES_H -| # include -| #endif -| #ifdef HAVE_SYS_STAT_H -| # include -| #endif -| #ifdef STDC_HEADERS -| # include -| # include -| #else -| # ifdef HAVE_STDLIB_H -| # include -| # endif -| #endif -| #ifdef HAVE_STRING_H -| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H -| # include -| # endif -| # include -| #endif -| #ifdef HAVE_STRINGS_H -| # include -| #endif -| #ifdef HAVE_INTTYPES_H -| # include -| #endif -| #ifdef HAVE_STDINT_H -| # include -| #endif -| #ifdef HAVE_UNISTD_H -| # include -| #endif -| enum { N = 32 / 2 - 1 }; -| int -| main () -| { -| static int test_array [1 - 2 * !(0 < (signed char) (((((signed char) 1 << N) << N) - 1) * 2 + 1))]; -| test_array [0] = 0 -| -| ; -| return 0; -| } -configure:10973: result: no -configure:10984: checking for int64_t -configure:10984: gcc -c -m32 -O2 -Wall conftest.c >&5 -In file included from /usr/include/stdio.h:28:0, - from conftest.c:27: -/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory -compilation terminated. -configure:10984: $? = 1 -configure: failed program was: -| /* confdefs.h */ -| #define PACKAGE_NAME "libantlr3c" -| #define PACKAGE_TARNAME "libantlr3c" -| #define PACKAGE_VERSION "3.4" -| #define PACKAGE_STRING "libantlr3c 3.4" -| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" -| #define PACKAGE_URL "" -| #define PACKAGE "libantlr3c" -| #define VERSION "3.4" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define HAVE_DLFCN_H 1 -| #define LT_OBJDIR ".libs/" -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_STDARG_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define size_t unsigned int -| /* end confdefs.h. */ -| #include -| #ifdef HAVE_SYS_TYPES_H -| # include -| #endif -| #ifdef HAVE_SYS_STAT_H -| # include -| #endif -| #ifdef STDC_HEADERS -| # include -| # include -| #else -| # ifdef HAVE_STDLIB_H -| # include -| # endif -| #endif -| #ifdef HAVE_STRING_H -| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H -| # include -| # endif -| # include -| #endif -| #ifdef HAVE_STRINGS_H -| # include -| #endif -| #ifdef HAVE_INTTYPES_H -| # include -| #endif -| #ifdef HAVE_STDINT_H -| # include -| #endif -| #ifdef HAVE_UNISTD_H -| # include -| #endif -| enum { N = 64 / 2 - 1 }; -| int -| main () -| { -| static int test_array [1 - 2 * !(0 < (int64_t) (((((int64_t) 1 << N) << N) - 1) * 2 + 1))]; -| test_array [0] = 0 -| -| ; -| return 0; -| } -configure:10984: gcc -c -m32 -O2 -Wall conftest.c >&5 -In file included from /usr/include/stdio.h:28:0, - from conftest.c:27: -/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory -compilation terminated. -configure:10984: $? = 1 -configure: failed program was: -| /* confdefs.h */ -| #define PACKAGE_NAME "libantlr3c" -| #define PACKAGE_TARNAME "libantlr3c" -| #define PACKAGE_VERSION "3.4" -| #define PACKAGE_STRING "libantlr3c 3.4" -| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" -| #define PACKAGE_URL "" -| #define PACKAGE "libantlr3c" -| #define VERSION "3.4" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define HAVE_DLFCN_H 1 -| #define LT_OBJDIR ".libs/" -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_STDARG_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define size_t unsigned int -| /* end confdefs.h. */ -| #include -| #ifdef HAVE_SYS_TYPES_H -| # include -| #endif -| #ifdef HAVE_SYS_STAT_H -| # include -| #endif -| #ifdef STDC_HEADERS -| # include -| # include -| #else -| # ifdef HAVE_STDLIB_H -| # include -| # endif -| #endif -| #ifdef HAVE_STRING_H -| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H -| # include -| # endif -| # include -| #endif -| #ifdef HAVE_STRINGS_H -| # include -| #endif -| #ifdef HAVE_INTTYPES_H -| # include -| #endif -| #ifdef HAVE_STDINT_H -| # include -| #endif -| #ifdef HAVE_UNISTD_H -| # include -| #endif -| enum { N = 64 / 2 - 1 }; -| int -| main () -| { -| static int test_array [1 - 2 * !(0 < (int) (((((int) 1 << N) << N) - 1) * 2 + 1))]; -| test_array [0] = 0 -| -| ; -| return 0; -| } -configure:10984: gcc -c -m32 -O2 -Wall conftest.c >&5 -In file included from /usr/include/stdio.h:28:0, - from conftest.c:27: -/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory -compilation terminated. -configure:10984: $? = 1 -configure: failed program was: -| /* confdefs.h */ -| #define PACKAGE_NAME "libantlr3c" -| #define PACKAGE_TARNAME "libantlr3c" -| #define PACKAGE_VERSION "3.4" -| #define PACKAGE_STRING "libantlr3c 3.4" -| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" -| #define PACKAGE_URL "" -| #define PACKAGE "libantlr3c" -| #define VERSION "3.4" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define HAVE_DLFCN_H 1 -| #define LT_OBJDIR ".libs/" -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_STDARG_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define size_t unsigned int -| /* end confdefs.h. */ -| #include -| #ifdef HAVE_SYS_TYPES_H -| # include -| #endif -| #ifdef HAVE_SYS_STAT_H -| # include -| #endif -| #ifdef STDC_HEADERS -| # include -| # include -| #else -| # ifdef HAVE_STDLIB_H -| # include -| # endif -| #endif -| #ifdef HAVE_STRING_H -| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H -| # include -| # endif -| # include -| #endif -| #ifdef HAVE_STRINGS_H -| # include -| #endif -| #ifdef HAVE_INTTYPES_H -| # include -| #endif -| #ifdef HAVE_STDINT_H -| # include -| #endif -| #ifdef HAVE_UNISTD_H -| # include -| #endif -| enum { N = 64 / 2 - 1 }; -| int -| main () -| { -| static int test_array [1 - 2 * !(0 < (long int) (((((long int) 1 << N) << N) - 1) * 2 + 1))]; -| test_array [0] = 0 -| -| ; -| return 0; -| } -configure:10984: gcc -c -m32 -O2 -Wall conftest.c >&5 -In file included from /usr/include/stdio.h:28:0, - from conftest.c:27: -/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory -compilation terminated. -configure:10984: $? = 1 -configure: failed program was: -| /* confdefs.h */ -| #define PACKAGE_NAME "libantlr3c" -| #define PACKAGE_TARNAME "libantlr3c" -| #define PACKAGE_VERSION "3.4" -| #define PACKAGE_STRING "libantlr3c 3.4" -| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" -| #define PACKAGE_URL "" -| #define PACKAGE "libantlr3c" -| #define VERSION "3.4" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define HAVE_DLFCN_H 1 -| #define LT_OBJDIR ".libs/" -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_STDARG_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define size_t unsigned int -| /* end confdefs.h. */ -| #include -| #ifdef HAVE_SYS_TYPES_H -| # include -| #endif -| #ifdef HAVE_SYS_STAT_H -| # include -| #endif -| #ifdef STDC_HEADERS -| # include -| # include -| #else -| # ifdef HAVE_STDLIB_H -| # include -| # endif -| #endif -| #ifdef HAVE_STRING_H -| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H -| # include -| # endif -| # include -| #endif -| #ifdef HAVE_STRINGS_H -| # include -| #endif -| #ifdef HAVE_INTTYPES_H -| # include -| #endif -| #ifdef HAVE_STDINT_H -| # include -| #endif -| #ifdef HAVE_UNISTD_H -| # include -| #endif -| enum { N = 64 / 2 - 1 }; -| int -| main () -| { -| static int test_array [1 - 2 * !(0 < (long long int) (((((long long int) 1 << N) << N) - 1) * 2 + 1))]; -| test_array [0] = 0 -| -| ; -| return 0; -| } -configure:10984: gcc -c -m32 -O2 -Wall conftest.c >&5 -In file included from /usr/include/stdio.h:28:0, - from conftest.c:27: -/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory -compilation terminated. -configure:10984: $? = 1 -configure: failed program was: -| /* confdefs.h */ -| #define PACKAGE_NAME "libantlr3c" -| #define PACKAGE_TARNAME "libantlr3c" -| #define PACKAGE_VERSION "3.4" -| #define PACKAGE_STRING "libantlr3c 3.4" -| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" -| #define PACKAGE_URL "" -| #define PACKAGE "libantlr3c" -| #define VERSION "3.4" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define HAVE_DLFCN_H 1 -| #define LT_OBJDIR ".libs/" -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_STDARG_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define size_t unsigned int -| /* end confdefs.h. */ -| #include -| #ifdef HAVE_SYS_TYPES_H -| # include -| #endif -| #ifdef HAVE_SYS_STAT_H -| # include -| #endif -| #ifdef STDC_HEADERS -| # include -| # include -| #else -| # ifdef HAVE_STDLIB_H -| # include -| # endif -| #endif -| #ifdef HAVE_STRING_H -| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H -| # include -| # endif -| # include -| #endif -| #ifdef HAVE_STRINGS_H -| # include -| #endif -| #ifdef HAVE_INTTYPES_H -| # include -| #endif -| #ifdef HAVE_STDINT_H -| # include -| #endif -| #ifdef HAVE_UNISTD_H -| # include -| #endif -| enum { N = 64 / 2 - 1 }; -| int -| main () -| { -| static int test_array [1 - 2 * !(0 < (short int) (((((short int) 1 << N) << N) - 1) * 2 + 1))]; -| test_array [0] = 0 -| -| ; -| return 0; -| } -configure:10984: gcc -c -m32 -O2 -Wall conftest.c >&5 -In file included from /usr/include/stdio.h:28:0, - from conftest.c:27: -/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory -compilation terminated. -configure:10984: $? = 1 -configure: failed program was: -| /* confdefs.h */ -| #define PACKAGE_NAME "libantlr3c" -| #define PACKAGE_TARNAME "libantlr3c" -| #define PACKAGE_VERSION "3.4" -| #define PACKAGE_STRING "libantlr3c 3.4" -| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" -| #define PACKAGE_URL "" -| #define PACKAGE "libantlr3c" -| #define VERSION "3.4" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define HAVE_DLFCN_H 1 -| #define LT_OBJDIR ".libs/" -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_STDARG_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define size_t unsigned int -| /* end confdefs.h. */ -| #include -| #ifdef HAVE_SYS_TYPES_H -| # include -| #endif -| #ifdef HAVE_SYS_STAT_H -| # include -| #endif -| #ifdef STDC_HEADERS -| # include -| # include -| #else -| # ifdef HAVE_STDLIB_H -| # include -| # endif -| #endif -| #ifdef HAVE_STRING_H -| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H -| # include -| # endif -| # include -| #endif -| #ifdef HAVE_STRINGS_H -| # include -| #endif -| #ifdef HAVE_INTTYPES_H -| # include -| #endif -| #ifdef HAVE_STDINT_H -| # include -| #endif -| #ifdef HAVE_UNISTD_H -| # include -| #endif -| enum { N = 64 / 2 - 1 }; -| int -| main () -| { -| static int test_array [1 - 2 * !(0 < (signed char) (((((signed char) 1 << N) << N) - 1) * 2 + 1))]; -| test_array [0] = 0 -| -| ; -| return 0; -| } -configure:10984: result: no -configure:10996: checking for intptr_t -configure:10996: gcc -c -m32 -O2 -Wall conftest.c >&5 -In file included from /usr/include/stdio.h:28:0, - from conftest.c:27: -/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory -compilation terminated. -configure:10996: $? = 1 -configure: failed program was: -| /* confdefs.h */ -| #define PACKAGE_NAME "libantlr3c" -| #define PACKAGE_TARNAME "libantlr3c" -| #define PACKAGE_VERSION "3.4" -| #define PACKAGE_STRING "libantlr3c 3.4" -| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" -| #define PACKAGE_URL "" -| #define PACKAGE "libantlr3c" -| #define VERSION "3.4" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define HAVE_DLFCN_H 1 -| #define LT_OBJDIR ".libs/" -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_STDARG_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define size_t unsigned int -| /* end confdefs.h. */ -| #include -| #ifdef HAVE_SYS_TYPES_H -| # include -| #endif -| #ifdef HAVE_SYS_STAT_H -| # include -| #endif -| #ifdef STDC_HEADERS -| # include -| # include -| #else -| # ifdef HAVE_STDLIB_H -| # include -| # endif -| #endif -| #ifdef HAVE_STRING_H -| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H -| # include -| # endif -| # include -| #endif -| #ifdef HAVE_STRINGS_H -| # include -| #endif -| #ifdef HAVE_INTTYPES_H -| # include -| #endif -| #ifdef HAVE_STDINT_H -| # include -| #endif -| #ifdef HAVE_UNISTD_H -| # include -| #endif -| int -| main () -| { -| if (sizeof (intptr_t)) -| return 0; -| ; -| return 0; -| } -configure:10996: result: no -configure:11016: gcc -c -m32 -O2 -Wall conftest.c >&5 -In file included from /usr/include/stdio.h:28:0, - from conftest.c:27: -/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory -compilation terminated. -configure:11016: $? = 1 -configure: failed program was: -| /* confdefs.h */ -| #define PACKAGE_NAME "libantlr3c" -| #define PACKAGE_TARNAME "libantlr3c" -| #define PACKAGE_VERSION "3.4" -| #define PACKAGE_STRING "libantlr3c 3.4" -| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" -| #define PACKAGE_URL "" -| #define PACKAGE "libantlr3c" -| #define VERSION "3.4" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define HAVE_DLFCN_H 1 -| #define LT_OBJDIR ".libs/" -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_STDARG_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define size_t unsigned int -| /* end confdefs.h. */ -| #include -| #ifdef HAVE_SYS_TYPES_H -| # include -| #endif -| #ifdef HAVE_SYS_STAT_H -| # include -| #endif -| #ifdef STDC_HEADERS -| # include -| # include -| #else -| # ifdef HAVE_STDLIB_H -| # include -| # endif -| #endif -| #ifdef HAVE_STRING_H -| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H -| # include -| # endif -| # include -| #endif -| #ifdef HAVE_STRINGS_H -| # include -| #endif -| #ifdef HAVE_INTTYPES_H -| # include -| #endif -| #ifdef HAVE_STDINT_H -| # include -| #endif -| #ifdef HAVE_UNISTD_H -| # include -| #endif -| int -| main () -| { -| static int test_array [1 - 2 * !(sizeof (void *) <= sizeof (int))]; -| test_array [0] = 0 -| -| ; -| return 0; -| } -configure:11016: gcc -c -m32 -O2 -Wall conftest.c >&5 -In file included from /usr/include/stdio.h:28:0, - from conftest.c:27: -/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory -compilation terminated. -configure:11016: $? = 1 -configure: failed program was: -| /* confdefs.h */ -| #define PACKAGE_NAME "libantlr3c" -| #define PACKAGE_TARNAME "libantlr3c" -| #define PACKAGE_VERSION "3.4" -| #define PACKAGE_STRING "libantlr3c 3.4" -| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" -| #define PACKAGE_URL "" -| #define PACKAGE "libantlr3c" -| #define VERSION "3.4" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define HAVE_DLFCN_H 1 -| #define LT_OBJDIR ".libs/" -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_STDARG_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define size_t unsigned int -| /* end confdefs.h. */ -| #include -| #ifdef HAVE_SYS_TYPES_H -| # include -| #endif -| #ifdef HAVE_SYS_STAT_H -| # include -| #endif -| #ifdef STDC_HEADERS -| # include -| # include -| #else -| # ifdef HAVE_STDLIB_H -| # include -| # endif -| #endif -| #ifdef HAVE_STRING_H -| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H -| # include -| # endif -| # include -| #endif -| #ifdef HAVE_STRINGS_H -| # include -| #endif -| #ifdef HAVE_INTTYPES_H -| # include -| #endif -| #ifdef HAVE_STDINT_H -| # include -| #endif -| #ifdef HAVE_UNISTD_H -| # include -| #endif -| int -| main () -| { -| static int test_array [1 - 2 * !(sizeof (void *) <= sizeof (long int))]; -| test_array [0] = 0 -| -| ; -| return 0; -| } -configure:11016: gcc -c -m32 -O2 -Wall conftest.c >&5 -In file included from /usr/include/stdio.h:28:0, - from conftest.c:27: -/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory -compilation terminated. -configure:11016: $? = 1 -configure: failed program was: -| /* confdefs.h */ -| #define PACKAGE_NAME "libantlr3c" -| #define PACKAGE_TARNAME "libantlr3c" -| #define PACKAGE_VERSION "3.4" -| #define PACKAGE_STRING "libantlr3c 3.4" -| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" -| #define PACKAGE_URL "" -| #define PACKAGE "libantlr3c" -| #define VERSION "3.4" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define HAVE_DLFCN_H 1 -| #define LT_OBJDIR ".libs/" -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_STDARG_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define size_t unsigned int -| /* end confdefs.h. */ -| #include -| #ifdef HAVE_SYS_TYPES_H -| # include -| #endif -| #ifdef HAVE_SYS_STAT_H -| # include -| #endif -| #ifdef STDC_HEADERS -| # include -| # include -| #else -| # ifdef HAVE_STDLIB_H -| # include -| # endif -| #endif -| #ifdef HAVE_STRING_H -| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H -| # include -| # endif -| # include -| #endif -| #ifdef HAVE_STRINGS_H -| # include -| #endif -| #ifdef HAVE_INTTYPES_H -| # include -| #endif -| #ifdef HAVE_STDINT_H -| # include -| #endif -| #ifdef HAVE_UNISTD_H -| # include -| #endif -| int -| main () -| { -| static int test_array [1 - 2 * !(sizeof (void *) <= sizeof (long long int))]; -| test_array [0] = 0 -| -| ; -| return 0; -| } -configure:11030: checking for uint8_t -configure:11030: gcc -c -m32 -O2 -Wall conftest.c >&5 -In file included from /usr/include/stdio.h:28:0, - from conftest.c:27: -/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory -compilation terminated. -configure:11030: $? = 1 -configure: failed program was: -| /* confdefs.h */ -| #define PACKAGE_NAME "libantlr3c" -| #define PACKAGE_TARNAME "libantlr3c" -| #define PACKAGE_VERSION "3.4" -| #define PACKAGE_STRING "libantlr3c 3.4" -| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" -| #define PACKAGE_URL "" -| #define PACKAGE "libantlr3c" -| #define VERSION "3.4" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define HAVE_DLFCN_H 1 -| #define LT_OBJDIR ".libs/" -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_STDARG_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define size_t unsigned int -| /* end confdefs.h. */ -| #include -| #ifdef HAVE_SYS_TYPES_H -| # include -| #endif -| #ifdef HAVE_SYS_STAT_H -| # include -| #endif -| #ifdef STDC_HEADERS -| # include -| # include -| #else -| # ifdef HAVE_STDLIB_H -| # include -| # endif -| #endif -| #ifdef HAVE_STRING_H -| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H -| # include -| # endif -| # include -| #endif -| #ifdef HAVE_STRINGS_H -| # include -| #endif -| #ifdef HAVE_INTTYPES_H -| # include -| #endif -| #ifdef HAVE_STDINT_H -| # include -| #endif -| #ifdef HAVE_UNISTD_H -| # include -| #endif -| int -| main () -| { -| static int test_array [1 - 2 * !(((uint8_t) -1 >> (8 / 2 - 1)) >> (8 / 2 - 1) == 3)]; -| test_array [0] = 0 -| -| ; -| return 0; -| } -configure:11030: gcc -c -m32 -O2 -Wall conftest.c >&5 -In file included from /usr/include/stdio.h:28:0, - from conftest.c:27: -/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory -compilation terminated. -configure:11030: $? = 1 -configure: failed program was: -| /* confdefs.h */ -| #define PACKAGE_NAME "libantlr3c" -| #define PACKAGE_TARNAME "libantlr3c" -| #define PACKAGE_VERSION "3.4" -| #define PACKAGE_STRING "libantlr3c 3.4" -| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" -| #define PACKAGE_URL "" -| #define PACKAGE "libantlr3c" -| #define VERSION "3.4" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define HAVE_DLFCN_H 1 -| #define LT_OBJDIR ".libs/" -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_STDARG_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define size_t unsigned int -| /* end confdefs.h. */ -| #include -| #ifdef HAVE_SYS_TYPES_H -| # include -| #endif -| #ifdef HAVE_SYS_STAT_H -| # include -| #endif -| #ifdef STDC_HEADERS -| # include -| # include -| #else -| # ifdef HAVE_STDLIB_H -| # include -| # endif -| #endif -| #ifdef HAVE_STRING_H -| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H -| # include -| # endif -| # include -| #endif -| #ifdef HAVE_STRINGS_H -| # include -| #endif -| #ifdef HAVE_INTTYPES_H -| # include -| #endif -| #ifdef HAVE_STDINT_H -| # include -| #endif -| #ifdef HAVE_UNISTD_H -| # include -| #endif -| int -| main () -| { -| static int test_array [1 - 2 * !(((unsigned int) -1 >> (8 / 2 - 1)) >> (8 / 2 - 1) == 3)]; -| test_array [0] = 0 -| -| ; -| return 0; -| } -configure:11030: gcc -c -m32 -O2 -Wall conftest.c >&5 -In file included from /usr/include/stdio.h:28:0, - from conftest.c:27: -/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory -compilation terminated. -configure:11030: $? = 1 -configure: failed program was: -| /* confdefs.h */ -| #define PACKAGE_NAME "libantlr3c" -| #define PACKAGE_TARNAME "libantlr3c" -| #define PACKAGE_VERSION "3.4" -| #define PACKAGE_STRING "libantlr3c 3.4" -| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" -| #define PACKAGE_URL "" -| #define PACKAGE "libantlr3c" -| #define VERSION "3.4" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define HAVE_DLFCN_H 1 -| #define LT_OBJDIR ".libs/" -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_STDARG_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define size_t unsigned int -| /* end confdefs.h. */ -| #include -| #ifdef HAVE_SYS_TYPES_H -| # include -| #endif -| #ifdef HAVE_SYS_STAT_H -| # include -| #endif -| #ifdef STDC_HEADERS -| # include -| # include -| #else -| # ifdef HAVE_STDLIB_H -| # include -| # endif -| #endif -| #ifdef HAVE_STRING_H -| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H -| # include -| # endif -| # include -| #endif -| #ifdef HAVE_STRINGS_H -| # include -| #endif -| #ifdef HAVE_INTTYPES_H -| # include -| #endif -| #ifdef HAVE_STDINT_H -| # include -| #endif -| #ifdef HAVE_UNISTD_H -| # include -| #endif -| int -| main () -| { -| static int test_array [1 - 2 * !(((unsigned long int) -1 >> (8 / 2 - 1)) >> (8 / 2 - 1) == 3)]; -| test_array [0] = 0 -| -| ; -| return 0; -| } -configure:11030: gcc -c -m32 -O2 -Wall conftest.c >&5 -In file included from /usr/include/stdio.h:28:0, - from conftest.c:27: -/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory -compilation terminated. -configure:11030: $? = 1 -configure: failed program was: -| /* confdefs.h */ -| #define PACKAGE_NAME "libantlr3c" -| #define PACKAGE_TARNAME "libantlr3c" -| #define PACKAGE_VERSION "3.4" -| #define PACKAGE_STRING "libantlr3c 3.4" -| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" -| #define PACKAGE_URL "" -| #define PACKAGE "libantlr3c" -| #define VERSION "3.4" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define HAVE_DLFCN_H 1 -| #define LT_OBJDIR ".libs/" -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_STDARG_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define size_t unsigned int -| /* end confdefs.h. */ -| #include -| #ifdef HAVE_SYS_TYPES_H -| # include -| #endif -| #ifdef HAVE_SYS_STAT_H -| # include -| #endif -| #ifdef STDC_HEADERS -| # include -| # include -| #else -| # ifdef HAVE_STDLIB_H -| # include -| # endif -| #endif -| #ifdef HAVE_STRING_H -| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H -| # include -| # endif -| # include -| #endif -| #ifdef HAVE_STRINGS_H -| # include -| #endif -| #ifdef HAVE_INTTYPES_H -| # include -| #endif -| #ifdef HAVE_STDINT_H -| # include -| #endif -| #ifdef HAVE_UNISTD_H -| # include -| #endif -| int -| main () -| { -| static int test_array [1 - 2 * !(((unsigned long long int) -1 >> (8 / 2 - 1)) >> (8 / 2 - 1) == 3)]; -| test_array [0] = 0 -| -| ; -| return 0; -| } -configure:11030: gcc -c -m32 -O2 -Wall conftest.c >&5 -In file included from /usr/include/stdio.h:28:0, - from conftest.c:27: -/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory -compilation terminated. -configure:11030: $? = 1 -configure: failed program was: -| /* confdefs.h */ -| #define PACKAGE_NAME "libantlr3c" -| #define PACKAGE_TARNAME "libantlr3c" -| #define PACKAGE_VERSION "3.4" -| #define PACKAGE_STRING "libantlr3c 3.4" -| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" -| #define PACKAGE_URL "" -| #define PACKAGE "libantlr3c" -| #define VERSION "3.4" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define HAVE_DLFCN_H 1 -| #define LT_OBJDIR ".libs/" -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_STDARG_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define size_t unsigned int -| /* end confdefs.h. */ -| #include -| #ifdef HAVE_SYS_TYPES_H -| # include -| #endif -| #ifdef HAVE_SYS_STAT_H -| # include -| #endif -| #ifdef STDC_HEADERS -| # include -| # include -| #else -| # ifdef HAVE_STDLIB_H -| # include -| # endif -| #endif -| #ifdef HAVE_STRING_H -| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H -| # include -| # endif -| # include -| #endif -| #ifdef HAVE_STRINGS_H -| # include -| #endif -| #ifdef HAVE_INTTYPES_H -| # include -| #endif -| #ifdef HAVE_STDINT_H -| # include -| #endif -| #ifdef HAVE_UNISTD_H -| # include -| #endif -| int -| main () -| { -| static int test_array [1 - 2 * !(((unsigned short int) -1 >> (8 / 2 - 1)) >> (8 / 2 - 1) == 3)]; -| test_array [0] = 0 -| -| ; -| return 0; -| } -configure:11030: gcc -c -m32 -O2 -Wall conftest.c >&5 -In file included from /usr/include/stdio.h:28:0, - from conftest.c:27: -/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory -compilation terminated. -configure:11030: $? = 1 -configure: failed program was: -| /* confdefs.h */ -| #define PACKAGE_NAME "libantlr3c" -| #define PACKAGE_TARNAME "libantlr3c" -| #define PACKAGE_VERSION "3.4" -| #define PACKAGE_STRING "libantlr3c 3.4" -| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" -| #define PACKAGE_URL "" -| #define PACKAGE "libantlr3c" -| #define VERSION "3.4" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define HAVE_DLFCN_H 1 -| #define LT_OBJDIR ".libs/" -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_STDARG_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define size_t unsigned int -| /* end confdefs.h. */ -| #include -| #ifdef HAVE_SYS_TYPES_H -| # include -| #endif -| #ifdef HAVE_SYS_STAT_H -| # include -| #endif -| #ifdef STDC_HEADERS -| # include -| # include -| #else -| # ifdef HAVE_STDLIB_H -| # include -| # endif -| #endif -| #ifdef HAVE_STRING_H -| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H -| # include -| # endif -| # include -| #endif -| #ifdef HAVE_STRINGS_H -| # include -| #endif -| #ifdef HAVE_INTTYPES_H -| # include -| #endif -| #ifdef HAVE_STDINT_H -| # include -| #endif -| #ifdef HAVE_UNISTD_H -| # include -| #endif -| int -| main () -| { -| static int test_array [1 - 2 * !(((unsigned char) -1 >> (8 / 2 - 1)) >> (8 / 2 - 1) == 3)]; -| test_array [0] = 0 -| -| ; -| return 0; -| } -configure:11030: result: no -configure:11044: checking for uint16_t -configure:11044: gcc -c -m32 -O2 -Wall conftest.c >&5 -In file included from /usr/include/stdio.h:28:0, - from conftest.c:27: -/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory -compilation terminated. -configure:11044: $? = 1 -configure: failed program was: -| /* confdefs.h */ -| #define PACKAGE_NAME "libantlr3c" -| #define PACKAGE_TARNAME "libantlr3c" -| #define PACKAGE_VERSION "3.4" -| #define PACKAGE_STRING "libantlr3c 3.4" -| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" -| #define PACKAGE_URL "" -| #define PACKAGE "libantlr3c" -| #define VERSION "3.4" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define HAVE_DLFCN_H 1 -| #define LT_OBJDIR ".libs/" -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_STDARG_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define size_t unsigned int -| /* end confdefs.h. */ -| #include -| #ifdef HAVE_SYS_TYPES_H -| # include -| #endif -| #ifdef HAVE_SYS_STAT_H -| # include -| #endif -| #ifdef STDC_HEADERS -| # include -| # include -| #else -| # ifdef HAVE_STDLIB_H -| # include -| # endif -| #endif -| #ifdef HAVE_STRING_H -| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H -| # include -| # endif -| # include -| #endif -| #ifdef HAVE_STRINGS_H -| # include -| #endif -| #ifdef HAVE_INTTYPES_H -| # include -| #endif -| #ifdef HAVE_STDINT_H -| # include -| #endif -| #ifdef HAVE_UNISTD_H -| # include -| #endif -| int -| main () -| { -| static int test_array [1 - 2 * !(((uint16_t) -1 >> (16 / 2 - 1)) >> (16 / 2 - 1) == 3)]; -| test_array [0] = 0 -| -| ; -| return 0; -| } -configure:11044: gcc -c -m32 -O2 -Wall conftest.c >&5 -In file included from /usr/include/stdio.h:28:0, - from conftest.c:27: -/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory -compilation terminated. -configure:11044: $? = 1 -configure: failed program was: -| /* confdefs.h */ -| #define PACKAGE_NAME "libantlr3c" -| #define PACKAGE_TARNAME "libantlr3c" -| #define PACKAGE_VERSION "3.4" -| #define PACKAGE_STRING "libantlr3c 3.4" -| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" -| #define PACKAGE_URL "" -| #define PACKAGE "libantlr3c" -| #define VERSION "3.4" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define HAVE_DLFCN_H 1 -| #define LT_OBJDIR ".libs/" -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_STDARG_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define size_t unsigned int -| /* end confdefs.h. */ -| #include -| #ifdef HAVE_SYS_TYPES_H -| # include -| #endif -| #ifdef HAVE_SYS_STAT_H -| # include -| #endif -| #ifdef STDC_HEADERS -| # include -| # include -| #else -| # ifdef HAVE_STDLIB_H -| # include -| # endif -| #endif -| #ifdef HAVE_STRING_H -| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H -| # include -| # endif -| # include -| #endif -| #ifdef HAVE_STRINGS_H -| # include -| #endif -| #ifdef HAVE_INTTYPES_H -| # include -| #endif -| #ifdef HAVE_STDINT_H -| # include -| #endif -| #ifdef HAVE_UNISTD_H -| # include -| #endif -| int -| main () -| { -| static int test_array [1 - 2 * !(((unsigned int) -1 >> (16 / 2 - 1)) >> (16 / 2 - 1) == 3)]; -| test_array [0] = 0 -| -| ; -| return 0; -| } -configure:11044: gcc -c -m32 -O2 -Wall conftest.c >&5 -In file included from /usr/include/stdio.h:28:0, - from conftest.c:27: -/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory -compilation terminated. -configure:11044: $? = 1 -configure: failed program was: -| /* confdefs.h */ -| #define PACKAGE_NAME "libantlr3c" -| #define PACKAGE_TARNAME "libantlr3c" -| #define PACKAGE_VERSION "3.4" -| #define PACKAGE_STRING "libantlr3c 3.4" -| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" -| #define PACKAGE_URL "" -| #define PACKAGE "libantlr3c" -| #define VERSION "3.4" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define HAVE_DLFCN_H 1 -| #define LT_OBJDIR ".libs/" -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_STDARG_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define size_t unsigned int -| /* end confdefs.h. */ -| #include -| #ifdef HAVE_SYS_TYPES_H -| # include -| #endif -| #ifdef HAVE_SYS_STAT_H -| # include -| #endif -| #ifdef STDC_HEADERS -| # include -| # include -| #else -| # ifdef HAVE_STDLIB_H -| # include -| # endif -| #endif -| #ifdef HAVE_STRING_H -| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H -| # include -| # endif -| # include -| #endif -| #ifdef HAVE_STRINGS_H -| # include -| #endif -| #ifdef HAVE_INTTYPES_H -| # include -| #endif -| #ifdef HAVE_STDINT_H -| # include -| #endif -| #ifdef HAVE_UNISTD_H -| # include -| #endif -| int -| main () -| { -| static int test_array [1 - 2 * !(((unsigned long int) -1 >> (16 / 2 - 1)) >> (16 / 2 - 1) == 3)]; -| test_array [0] = 0 -| -| ; -| return 0; -| } -configure:11044: gcc -c -m32 -O2 -Wall conftest.c >&5 -In file included from /usr/include/stdio.h:28:0, - from conftest.c:27: -/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory -compilation terminated. -configure:11044: $? = 1 -configure: failed program was: -| /* confdefs.h */ -| #define PACKAGE_NAME "libantlr3c" -| #define PACKAGE_TARNAME "libantlr3c" -| #define PACKAGE_VERSION "3.4" -| #define PACKAGE_STRING "libantlr3c 3.4" -| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" -| #define PACKAGE_URL "" -| #define PACKAGE "libantlr3c" -| #define VERSION "3.4" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define HAVE_DLFCN_H 1 -| #define LT_OBJDIR ".libs/" -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_STDARG_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define size_t unsigned int -| /* end confdefs.h. */ -| #include -| #ifdef HAVE_SYS_TYPES_H -| # include -| #endif -| #ifdef HAVE_SYS_STAT_H -| # include -| #endif -| #ifdef STDC_HEADERS -| # include -| # include -| #else -| # ifdef HAVE_STDLIB_H -| # include -| # endif -| #endif -| #ifdef HAVE_STRING_H -| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H -| # include -| # endif -| # include -| #endif -| #ifdef HAVE_STRINGS_H -| # include -| #endif -| #ifdef HAVE_INTTYPES_H -| # include -| #endif -| #ifdef HAVE_STDINT_H -| # include -| #endif -| #ifdef HAVE_UNISTD_H -| # include -| #endif -| int -| main () -| { -| static int test_array [1 - 2 * !(((unsigned long long int) -1 >> (16 / 2 - 1)) >> (16 / 2 - 1) == 3)]; -| test_array [0] = 0 -| -| ; -| return 0; -| } -configure:11044: gcc -c -m32 -O2 -Wall conftest.c >&5 -In file included from /usr/include/stdio.h:28:0, - from conftest.c:27: -/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory -compilation terminated. -configure:11044: $? = 1 -configure: failed program was: -| /* confdefs.h */ -| #define PACKAGE_NAME "libantlr3c" -| #define PACKAGE_TARNAME "libantlr3c" -| #define PACKAGE_VERSION "3.4" -| #define PACKAGE_STRING "libantlr3c 3.4" -| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" -| #define PACKAGE_URL "" -| #define PACKAGE "libantlr3c" -| #define VERSION "3.4" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define HAVE_DLFCN_H 1 -| #define LT_OBJDIR ".libs/" -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_STDARG_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define size_t unsigned int -| /* end confdefs.h. */ -| #include -| #ifdef HAVE_SYS_TYPES_H -| # include -| #endif -| #ifdef HAVE_SYS_STAT_H -| # include -| #endif -| #ifdef STDC_HEADERS -| # include -| # include -| #else -| # ifdef HAVE_STDLIB_H -| # include -| # endif -| #endif -| #ifdef HAVE_STRING_H -| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H -| # include -| # endif -| # include -| #endif -| #ifdef HAVE_STRINGS_H -| # include -| #endif -| #ifdef HAVE_INTTYPES_H -| # include -| #endif -| #ifdef HAVE_STDINT_H -| # include -| #endif -| #ifdef HAVE_UNISTD_H -| # include -| #endif -| int -| main () -| { -| static int test_array [1 - 2 * !(((unsigned short int) -1 >> (16 / 2 - 1)) >> (16 / 2 - 1) == 3)]; -| test_array [0] = 0 -| -| ; -| return 0; -| } -configure:11044: gcc -c -m32 -O2 -Wall conftest.c >&5 -In file included from /usr/include/stdio.h:28:0, - from conftest.c:27: -/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory -compilation terminated. -configure:11044: $? = 1 -configure: failed program was: -| /* confdefs.h */ -| #define PACKAGE_NAME "libantlr3c" -| #define PACKAGE_TARNAME "libantlr3c" -| #define PACKAGE_VERSION "3.4" -| #define PACKAGE_STRING "libantlr3c 3.4" -| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" -| #define PACKAGE_URL "" -| #define PACKAGE "libantlr3c" -| #define VERSION "3.4" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define HAVE_DLFCN_H 1 -| #define LT_OBJDIR ".libs/" -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_STDARG_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define size_t unsigned int -| /* end confdefs.h. */ -| #include -| #ifdef HAVE_SYS_TYPES_H -| # include -| #endif -| #ifdef HAVE_SYS_STAT_H -| # include -| #endif -| #ifdef STDC_HEADERS -| # include -| # include -| #else -| # ifdef HAVE_STDLIB_H -| # include -| # endif -| #endif -| #ifdef HAVE_STRING_H -| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H -| # include -| # endif -| # include -| #endif -| #ifdef HAVE_STRINGS_H -| # include -| #endif -| #ifdef HAVE_INTTYPES_H -| # include -| #endif -| #ifdef HAVE_STDINT_H -| # include -| #endif -| #ifdef HAVE_UNISTD_H -| # include -| #endif -| int -| main () -| { -| static int test_array [1 - 2 * !(((unsigned char) -1 >> (16 / 2 - 1)) >> (16 / 2 - 1) == 3)]; -| test_array [0] = 0 -| -| ; -| return 0; -| } -configure:11044: result: no -configure:11056: checking for uint32_t -configure:11056: gcc -c -m32 -O2 -Wall conftest.c >&5 -In file included from /usr/include/stdio.h:28:0, - from conftest.c:27: -/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory -compilation terminated. -configure:11056: $? = 1 -configure: failed program was: -| /* confdefs.h */ -| #define PACKAGE_NAME "libantlr3c" -| #define PACKAGE_TARNAME "libantlr3c" -| #define PACKAGE_VERSION "3.4" -| #define PACKAGE_STRING "libantlr3c 3.4" -| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" -| #define PACKAGE_URL "" -| #define PACKAGE "libantlr3c" -| #define VERSION "3.4" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define HAVE_DLFCN_H 1 -| #define LT_OBJDIR ".libs/" -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_STDARG_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define size_t unsigned int -| /* end confdefs.h. */ -| #include -| #ifdef HAVE_SYS_TYPES_H -| # include -| #endif -| #ifdef HAVE_SYS_STAT_H -| # include -| #endif -| #ifdef STDC_HEADERS -| # include -| # include -| #else -| # ifdef HAVE_STDLIB_H -| # include -| # endif -| #endif -| #ifdef HAVE_STRING_H -| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H -| # include -| # endif -| # include -| #endif -| #ifdef HAVE_STRINGS_H -| # include -| #endif -| #ifdef HAVE_INTTYPES_H -| # include -| #endif -| #ifdef HAVE_STDINT_H -| # include -| #endif -| #ifdef HAVE_UNISTD_H -| # include -| #endif -| int -| main () -| { -| static int test_array [1 - 2 * !(((uint32_t) -1 >> (32 / 2 - 1)) >> (32 / 2 - 1) == 3)]; -| test_array [0] = 0 -| -| ; -| return 0; -| } -configure:11056: gcc -c -m32 -O2 -Wall conftest.c >&5 -In file included from /usr/include/stdio.h:28:0, - from conftest.c:27: -/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory -compilation terminated. -configure:11056: $? = 1 -configure: failed program was: -| /* confdefs.h */ -| #define PACKAGE_NAME "libantlr3c" -| #define PACKAGE_TARNAME "libantlr3c" -| #define PACKAGE_VERSION "3.4" -| #define PACKAGE_STRING "libantlr3c 3.4" -| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" -| #define PACKAGE_URL "" -| #define PACKAGE "libantlr3c" -| #define VERSION "3.4" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define HAVE_DLFCN_H 1 -| #define LT_OBJDIR ".libs/" -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_STDARG_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define size_t unsigned int -| /* end confdefs.h. */ -| #include -| #ifdef HAVE_SYS_TYPES_H -| # include -| #endif -| #ifdef HAVE_SYS_STAT_H -| # include -| #endif -| #ifdef STDC_HEADERS -| # include -| # include -| #else -| # ifdef HAVE_STDLIB_H -| # include -| # endif -| #endif -| #ifdef HAVE_STRING_H -| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H -| # include -| # endif -| # include -| #endif -| #ifdef HAVE_STRINGS_H -| # include -| #endif -| #ifdef HAVE_INTTYPES_H -| # include -| #endif -| #ifdef HAVE_STDINT_H -| # include -| #endif -| #ifdef HAVE_UNISTD_H -| # include -| #endif -| int -| main () -| { -| static int test_array [1 - 2 * !(((unsigned int) -1 >> (32 / 2 - 1)) >> (32 / 2 - 1) == 3)]; -| test_array [0] = 0 -| -| ; -| return 0; -| } -configure:11056: gcc -c -m32 -O2 -Wall conftest.c >&5 -In file included from /usr/include/stdio.h:28:0, - from conftest.c:27: -/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory -compilation terminated. -configure:11056: $? = 1 -configure: failed program was: -| /* confdefs.h */ -| #define PACKAGE_NAME "libantlr3c" -| #define PACKAGE_TARNAME "libantlr3c" -| #define PACKAGE_VERSION "3.4" -| #define PACKAGE_STRING "libantlr3c 3.4" -| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" -| #define PACKAGE_URL "" -| #define PACKAGE "libantlr3c" -| #define VERSION "3.4" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define HAVE_DLFCN_H 1 -| #define LT_OBJDIR ".libs/" -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_STDARG_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define size_t unsigned int -| /* end confdefs.h. */ -| #include -| #ifdef HAVE_SYS_TYPES_H -| # include -| #endif -| #ifdef HAVE_SYS_STAT_H -| # include -| #endif -| #ifdef STDC_HEADERS -| # include -| # include -| #else -| # ifdef HAVE_STDLIB_H -| # include -| # endif -| #endif -| #ifdef HAVE_STRING_H -| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H -| # include -| # endif -| # include -| #endif -| #ifdef HAVE_STRINGS_H -| # include -| #endif -| #ifdef HAVE_INTTYPES_H -| # include -| #endif -| #ifdef HAVE_STDINT_H -| # include -| #endif -| #ifdef HAVE_UNISTD_H -| # include -| #endif -| int -| main () -| { -| static int test_array [1 - 2 * !(((unsigned long int) -1 >> (32 / 2 - 1)) >> (32 / 2 - 1) == 3)]; -| test_array [0] = 0 -| -| ; -| return 0; -| } -configure:11056: gcc -c -m32 -O2 -Wall conftest.c >&5 -In file included from /usr/include/stdio.h:28:0, - from conftest.c:27: -/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory -compilation terminated. -configure:11056: $? = 1 -configure: failed program was: -| /* confdefs.h */ -| #define PACKAGE_NAME "libantlr3c" -| #define PACKAGE_TARNAME "libantlr3c" -| #define PACKAGE_VERSION "3.4" -| #define PACKAGE_STRING "libantlr3c 3.4" -| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" -| #define PACKAGE_URL "" -| #define PACKAGE "libantlr3c" -| #define VERSION "3.4" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define HAVE_DLFCN_H 1 -| #define LT_OBJDIR ".libs/" -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_STDARG_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define size_t unsigned int -| /* end confdefs.h. */ -| #include -| #ifdef HAVE_SYS_TYPES_H -| # include -| #endif -| #ifdef HAVE_SYS_STAT_H -| # include -| #endif -| #ifdef STDC_HEADERS -| # include -| # include -| #else -| # ifdef HAVE_STDLIB_H -| # include -| # endif -| #endif -| #ifdef HAVE_STRING_H -| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H -| # include -| # endif -| # include -| #endif -| #ifdef HAVE_STRINGS_H -| # include -| #endif -| #ifdef HAVE_INTTYPES_H -| # include -| #endif -| #ifdef HAVE_STDINT_H -| # include -| #endif -| #ifdef HAVE_UNISTD_H -| # include -| #endif -| int -| main () -| { -| static int test_array [1 - 2 * !(((unsigned long long int) -1 >> (32 / 2 - 1)) >> (32 / 2 - 1) == 3)]; -| test_array [0] = 0 -| -| ; -| return 0; -| } -configure:11056: gcc -c -m32 -O2 -Wall conftest.c >&5 -In file included from /usr/include/stdio.h:28:0, - from conftest.c:27: -/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory -compilation terminated. -configure:11056: $? = 1 -configure: failed program was: -| /* confdefs.h */ -| #define PACKAGE_NAME "libantlr3c" -| #define PACKAGE_TARNAME "libantlr3c" -| #define PACKAGE_VERSION "3.4" -| #define PACKAGE_STRING "libantlr3c 3.4" -| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" -| #define PACKAGE_URL "" -| #define PACKAGE "libantlr3c" -| #define VERSION "3.4" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define HAVE_DLFCN_H 1 -| #define LT_OBJDIR ".libs/" -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_STDARG_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define size_t unsigned int -| /* end confdefs.h. */ -| #include -| #ifdef HAVE_SYS_TYPES_H -| # include -| #endif -| #ifdef HAVE_SYS_STAT_H -| # include -| #endif -| #ifdef STDC_HEADERS -| # include -| # include -| #else -| # ifdef HAVE_STDLIB_H -| # include -| # endif -| #endif -| #ifdef HAVE_STRING_H -| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H -| # include -| # endif -| # include -| #endif -| #ifdef HAVE_STRINGS_H -| # include -| #endif -| #ifdef HAVE_INTTYPES_H -| # include -| #endif -| #ifdef HAVE_STDINT_H -| # include -| #endif -| #ifdef HAVE_UNISTD_H -| # include -| #endif -| int -| main () -| { -| static int test_array [1 - 2 * !(((unsigned short int) -1 >> (32 / 2 - 1)) >> (32 / 2 - 1) == 3)]; -| test_array [0] = 0 -| -| ; -| return 0; -| } -configure:11056: gcc -c -m32 -O2 -Wall conftest.c >&5 -In file included from /usr/include/stdio.h:28:0, - from conftest.c:27: -/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory -compilation terminated. -configure:11056: $? = 1 -configure: failed program was: -| /* confdefs.h */ -| #define PACKAGE_NAME "libantlr3c" -| #define PACKAGE_TARNAME "libantlr3c" -| #define PACKAGE_VERSION "3.4" -| #define PACKAGE_STRING "libantlr3c 3.4" -| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" -| #define PACKAGE_URL "" -| #define PACKAGE "libantlr3c" -| #define VERSION "3.4" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define HAVE_DLFCN_H 1 -| #define LT_OBJDIR ".libs/" -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_STDARG_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define size_t unsigned int -| /* end confdefs.h. */ -| #include -| #ifdef HAVE_SYS_TYPES_H -| # include -| #endif -| #ifdef HAVE_SYS_STAT_H -| # include -| #endif -| #ifdef STDC_HEADERS -| # include -| # include -| #else -| # ifdef HAVE_STDLIB_H -| # include -| # endif -| #endif -| #ifdef HAVE_STRING_H -| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H -| # include -| # endif -| # include -| #endif -| #ifdef HAVE_STRINGS_H -| # include -| #endif -| #ifdef HAVE_INTTYPES_H -| # include -| #endif -| #ifdef HAVE_STDINT_H -| # include -| #endif -| #ifdef HAVE_UNISTD_H -| # include -| #endif -| int -| main () -| { -| static int test_array [1 - 2 * !(((unsigned char) -1 >> (32 / 2 - 1)) >> (32 / 2 - 1) == 3)]; -| test_array [0] = 0 -| -| ; -| return 0; -| } -configure:11056: result: no -configure:11070: checking for uint64_t -configure:11070: gcc -c -m32 -O2 -Wall conftest.c >&5 -In file included from /usr/include/stdio.h:28:0, - from conftest.c:27: -/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory -compilation terminated. -configure:11070: $? = 1 -configure: failed program was: -| /* confdefs.h */ -| #define PACKAGE_NAME "libantlr3c" -| #define PACKAGE_TARNAME "libantlr3c" -| #define PACKAGE_VERSION "3.4" -| #define PACKAGE_STRING "libantlr3c 3.4" -| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" -| #define PACKAGE_URL "" -| #define PACKAGE "libantlr3c" -| #define VERSION "3.4" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define HAVE_DLFCN_H 1 -| #define LT_OBJDIR ".libs/" -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_STDARG_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define size_t unsigned int -| /* end confdefs.h. */ -| #include -| #ifdef HAVE_SYS_TYPES_H -| # include -| #endif -| #ifdef HAVE_SYS_STAT_H -| # include -| #endif -| #ifdef STDC_HEADERS -| # include -| # include -| #else -| # ifdef HAVE_STDLIB_H -| # include -| # endif -| #endif -| #ifdef HAVE_STRING_H -| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H -| # include -| # endif -| # include -| #endif -| #ifdef HAVE_STRINGS_H -| # include -| #endif -| #ifdef HAVE_INTTYPES_H -| # include -| #endif -| #ifdef HAVE_STDINT_H -| # include -| #endif -| #ifdef HAVE_UNISTD_H -| # include -| #endif -| int -| main () -| { -| static int test_array [1 - 2 * !(((uint64_t) -1 >> (64 / 2 - 1)) >> (64 / 2 - 1) == 3)]; -| test_array [0] = 0 -| -| ; -| return 0; -| } -configure:11070: gcc -c -m32 -O2 -Wall conftest.c >&5 -In file included from /usr/include/stdio.h:28:0, - from conftest.c:27: -/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory -compilation terminated. -configure:11070: $? = 1 -configure: failed program was: -| /* confdefs.h */ -| #define PACKAGE_NAME "libantlr3c" -| #define PACKAGE_TARNAME "libantlr3c" -| #define PACKAGE_VERSION "3.4" -| #define PACKAGE_STRING "libantlr3c 3.4" -| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" -| #define PACKAGE_URL "" -| #define PACKAGE "libantlr3c" -| #define VERSION "3.4" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define HAVE_DLFCN_H 1 -| #define LT_OBJDIR ".libs/" -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_STDARG_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define size_t unsigned int -| /* end confdefs.h. */ -| #include -| #ifdef HAVE_SYS_TYPES_H -| # include -| #endif -| #ifdef HAVE_SYS_STAT_H -| # include -| #endif -| #ifdef STDC_HEADERS -| # include -| # include -| #else -| # ifdef HAVE_STDLIB_H -| # include -| # endif -| #endif -| #ifdef HAVE_STRING_H -| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H -| # include -| # endif -| # include -| #endif -| #ifdef HAVE_STRINGS_H -| # include -| #endif -| #ifdef HAVE_INTTYPES_H -| # include -| #endif -| #ifdef HAVE_STDINT_H -| # include -| #endif -| #ifdef HAVE_UNISTD_H -| # include -| #endif -| int -| main () -| { -| static int test_array [1 - 2 * !(((unsigned int) -1 >> (64 / 2 - 1)) >> (64 / 2 - 1) == 3)]; -| test_array [0] = 0 -| -| ; -| return 0; -| } -configure:11070: gcc -c -m32 -O2 -Wall conftest.c >&5 -In file included from /usr/include/stdio.h:28:0, - from conftest.c:27: -/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory -compilation terminated. -configure:11070: $? = 1 -configure: failed program was: -| /* confdefs.h */ -| #define PACKAGE_NAME "libantlr3c" -| #define PACKAGE_TARNAME "libantlr3c" -| #define PACKAGE_VERSION "3.4" -| #define PACKAGE_STRING "libantlr3c 3.4" -| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" -| #define PACKAGE_URL "" -| #define PACKAGE "libantlr3c" -| #define VERSION "3.4" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define HAVE_DLFCN_H 1 -| #define LT_OBJDIR ".libs/" -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_STDARG_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define size_t unsigned int -| /* end confdefs.h. */ -| #include -| #ifdef HAVE_SYS_TYPES_H -| # include -| #endif -| #ifdef HAVE_SYS_STAT_H -| # include -| #endif -| #ifdef STDC_HEADERS -| # include -| # include -| #else -| # ifdef HAVE_STDLIB_H -| # include -| # endif -| #endif -| #ifdef HAVE_STRING_H -| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H -| # include -| # endif -| # include -| #endif -| #ifdef HAVE_STRINGS_H -| # include -| #endif -| #ifdef HAVE_INTTYPES_H -| # include -| #endif -| #ifdef HAVE_STDINT_H -| # include -| #endif -| #ifdef HAVE_UNISTD_H -| # include -| #endif -| int -| main () -| { -| static int test_array [1 - 2 * !(((unsigned long int) -1 >> (64 / 2 - 1)) >> (64 / 2 - 1) == 3)]; -| test_array [0] = 0 -| -| ; -| return 0; -| } -configure:11070: gcc -c -m32 -O2 -Wall conftest.c >&5 -In file included from /usr/include/stdio.h:28:0, - from conftest.c:27: -/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory -compilation terminated. -configure:11070: $? = 1 -configure: failed program was: -| /* confdefs.h */ -| #define PACKAGE_NAME "libantlr3c" -| #define PACKAGE_TARNAME "libantlr3c" -| #define PACKAGE_VERSION "3.4" -| #define PACKAGE_STRING "libantlr3c 3.4" -| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" -| #define PACKAGE_URL "" -| #define PACKAGE "libantlr3c" -| #define VERSION "3.4" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define HAVE_DLFCN_H 1 -| #define LT_OBJDIR ".libs/" -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_STDARG_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define size_t unsigned int -| /* end confdefs.h. */ -| #include -| #ifdef HAVE_SYS_TYPES_H -| # include -| #endif -| #ifdef HAVE_SYS_STAT_H -| # include -| #endif -| #ifdef STDC_HEADERS -| # include -| # include -| #else -| # ifdef HAVE_STDLIB_H -| # include -| # endif -| #endif -| #ifdef HAVE_STRING_H -| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H -| # include -| # endif -| # include -| #endif -| #ifdef HAVE_STRINGS_H -| # include -| #endif -| #ifdef HAVE_INTTYPES_H -| # include -| #endif -| #ifdef HAVE_STDINT_H -| # include -| #endif -| #ifdef HAVE_UNISTD_H -| # include -| #endif -| int -| main () -| { -| static int test_array [1 - 2 * !(((unsigned long long int) -1 >> (64 / 2 - 1)) >> (64 / 2 - 1) == 3)]; -| test_array [0] = 0 -| -| ; -| return 0; -| } -configure:11070: gcc -c -m32 -O2 -Wall conftest.c >&5 -In file included from /usr/include/stdio.h:28:0, - from conftest.c:27: -/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory -compilation terminated. -configure:11070: $? = 1 -configure: failed program was: -| /* confdefs.h */ -| #define PACKAGE_NAME "libantlr3c" -| #define PACKAGE_TARNAME "libantlr3c" -| #define PACKAGE_VERSION "3.4" -| #define PACKAGE_STRING "libantlr3c 3.4" -| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" -| #define PACKAGE_URL "" -| #define PACKAGE "libantlr3c" -| #define VERSION "3.4" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define HAVE_DLFCN_H 1 -| #define LT_OBJDIR ".libs/" -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_STDARG_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define size_t unsigned int -| /* end confdefs.h. */ -| #include -| #ifdef HAVE_SYS_TYPES_H -| # include -| #endif -| #ifdef HAVE_SYS_STAT_H -| # include -| #endif -| #ifdef STDC_HEADERS -| # include -| # include -| #else -| # ifdef HAVE_STDLIB_H -| # include -| # endif -| #endif -| #ifdef HAVE_STRING_H -| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H -| # include -| # endif -| # include -| #endif -| #ifdef HAVE_STRINGS_H -| # include -| #endif -| #ifdef HAVE_INTTYPES_H -| # include -| #endif -| #ifdef HAVE_STDINT_H -| # include -| #endif -| #ifdef HAVE_UNISTD_H -| # include -| #endif -| int -| main () -| { -| static int test_array [1 - 2 * !(((unsigned short int) -1 >> (64 / 2 - 1)) >> (64 / 2 - 1) == 3)]; -| test_array [0] = 0 -| -| ; -| return 0; -| } -configure:11070: gcc -c -m32 -O2 -Wall conftest.c >&5 -In file included from /usr/include/stdio.h:28:0, - from conftest.c:27: -/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory -compilation terminated. -configure:11070: $? = 1 -configure: failed program was: -| /* confdefs.h */ -| #define PACKAGE_NAME "libantlr3c" -| #define PACKAGE_TARNAME "libantlr3c" -| #define PACKAGE_VERSION "3.4" -| #define PACKAGE_STRING "libantlr3c 3.4" -| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" -| #define PACKAGE_URL "" -| #define PACKAGE "libantlr3c" -| #define VERSION "3.4" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define HAVE_DLFCN_H 1 -| #define LT_OBJDIR ".libs/" -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_STDARG_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define size_t unsigned int -| /* end confdefs.h. */ -| #include -| #ifdef HAVE_SYS_TYPES_H -| # include -| #endif -| #ifdef HAVE_SYS_STAT_H -| # include -| #endif -| #ifdef STDC_HEADERS -| # include -| # include -| #else -| # ifdef HAVE_STDLIB_H -| # include -| # endif -| #endif -| #ifdef HAVE_STRING_H -| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H -| # include -| # endif -| # include -| #endif -| #ifdef HAVE_STRINGS_H -| # include -| #endif -| #ifdef HAVE_INTTYPES_H -| # include -| #endif -| #ifdef HAVE_STDINT_H -| # include -| #endif -| #ifdef HAVE_UNISTD_H -| # include -| #endif -| int -| main () -| { -| static int test_array [1 - 2 * !(((unsigned char) -1 >> (64 / 2 - 1)) >> (64 / 2 - 1) == 3)]; -| test_array [0] = 0 -| -| ; -| return 0; -| } -configure:11070: result: no -configure:11085: checking for uintptr_t -configure:11085: gcc -c -m32 -O2 -Wall conftest.c >&5 -In file included from /usr/include/stdio.h:28:0, - from conftest.c:27: -/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory -compilation terminated. -configure:11085: $? = 1 -configure: failed program was: -| /* confdefs.h */ -| #define PACKAGE_NAME "libantlr3c" -| #define PACKAGE_TARNAME "libantlr3c" -| #define PACKAGE_VERSION "3.4" -| #define PACKAGE_STRING "libantlr3c 3.4" -| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" -| #define PACKAGE_URL "" -| #define PACKAGE "libantlr3c" -| #define VERSION "3.4" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define HAVE_DLFCN_H 1 -| #define LT_OBJDIR ".libs/" -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_STDARG_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define size_t unsigned int -| /* end confdefs.h. */ -| #include -| #ifdef HAVE_SYS_TYPES_H -| # include -| #endif -| #ifdef HAVE_SYS_STAT_H -| # include -| #endif -| #ifdef STDC_HEADERS -| # include -| # include -| #else -| # ifdef HAVE_STDLIB_H -| # include -| # endif -| #endif -| #ifdef HAVE_STRING_H -| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H -| # include -| # endif -| # include -| #endif -| #ifdef HAVE_STRINGS_H -| # include -| #endif -| #ifdef HAVE_INTTYPES_H -| # include -| #endif -| #ifdef HAVE_STDINT_H -| # include -| #endif -| #ifdef HAVE_UNISTD_H -| # include -| #endif -| int -| main () -| { -| if (sizeof (uintptr_t)) -| return 0; -| ; -| return 0; -| } -configure:11085: result: no -configure:11106: gcc -c -m32 -O2 -Wall conftest.c >&5 -In file included from /usr/include/stdio.h:28:0, - from conftest.c:27: -/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory -compilation terminated. -configure:11106: $? = 1 -configure: failed program was: -| /* confdefs.h */ -| #define PACKAGE_NAME "libantlr3c" -| #define PACKAGE_TARNAME "libantlr3c" -| #define PACKAGE_VERSION "3.4" -| #define PACKAGE_STRING "libantlr3c 3.4" -| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" -| #define PACKAGE_URL "" -| #define PACKAGE "libantlr3c" -| #define VERSION "3.4" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define HAVE_DLFCN_H 1 -| #define LT_OBJDIR ".libs/" -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_STDARG_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define size_t unsigned int -| /* end confdefs.h. */ -| #include -| #ifdef HAVE_SYS_TYPES_H -| # include -| #endif -| #ifdef HAVE_SYS_STAT_H -| # include -| #endif -| #ifdef STDC_HEADERS -| # include -| # include -| #else -| # ifdef HAVE_STDLIB_H -| # include -| # endif -| #endif -| #ifdef HAVE_STRING_H -| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H -| # include -| # endif -| # include -| #endif -| #ifdef HAVE_STRINGS_H -| # include -| #endif -| #ifdef HAVE_INTTYPES_H -| # include -| #endif -| #ifdef HAVE_STDINT_H -| # include -| #endif -| #ifdef HAVE_UNISTD_H -| # include -| #endif -| int -| main () -| { -| static int test_array [1 - 2 * !(sizeof (void *) <= sizeof (unsigned int))]; -| test_array [0] = 0 -| -| ; -| return 0; -| } -configure:11106: gcc -c -m32 -O2 -Wall conftest.c >&5 -In file included from /usr/include/stdio.h:28:0, - from conftest.c:27: -/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory -compilation terminated. -configure:11106: $? = 1 -configure: failed program was: -| /* confdefs.h */ -| #define PACKAGE_NAME "libantlr3c" -| #define PACKAGE_TARNAME "libantlr3c" -| #define PACKAGE_VERSION "3.4" -| #define PACKAGE_STRING "libantlr3c 3.4" -| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" -| #define PACKAGE_URL "" -| #define PACKAGE "libantlr3c" -| #define VERSION "3.4" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define HAVE_DLFCN_H 1 -| #define LT_OBJDIR ".libs/" -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_STDARG_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define size_t unsigned int -| /* end confdefs.h. */ -| #include -| #ifdef HAVE_SYS_TYPES_H -| # include -| #endif -| #ifdef HAVE_SYS_STAT_H -| # include -| #endif -| #ifdef STDC_HEADERS -| # include -| # include -| #else -| # ifdef HAVE_STDLIB_H -| # include -| # endif -| #endif -| #ifdef HAVE_STRING_H -| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H -| # include -| # endif -| # include -| #endif -| #ifdef HAVE_STRINGS_H -| # include -| #endif -| #ifdef HAVE_INTTYPES_H -| # include -| #endif -| #ifdef HAVE_STDINT_H -| # include -| #endif -| #ifdef HAVE_UNISTD_H -| # include -| #endif -| int -| main () -| { -| static int test_array [1 - 2 * !(sizeof (void *) <= sizeof (unsigned long int))]; -| test_array [0] = 0 -| -| ; -| return 0; -| } -configure:11106: gcc -c -m32 -O2 -Wall conftest.c >&5 -In file included from /usr/include/stdio.h:28:0, - from conftest.c:27: -/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory -compilation terminated. -configure:11106: $? = 1 -configure: failed program was: -| /* confdefs.h */ -| #define PACKAGE_NAME "libantlr3c" -| #define PACKAGE_TARNAME "libantlr3c" -| #define PACKAGE_VERSION "3.4" -| #define PACKAGE_STRING "libantlr3c 3.4" -| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" -| #define PACKAGE_URL "" -| #define PACKAGE "libantlr3c" -| #define VERSION "3.4" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define HAVE_DLFCN_H 1 -| #define LT_OBJDIR ".libs/" -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_STDARG_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define size_t unsigned int -| /* end confdefs.h. */ -| #include -| #ifdef HAVE_SYS_TYPES_H -| # include -| #endif -| #ifdef HAVE_SYS_STAT_H -| # include -| #endif -| #ifdef STDC_HEADERS -| # include -| # include -| #else -| # ifdef HAVE_STDLIB_H -| # include -| # endif -| #endif -| #ifdef HAVE_STRING_H -| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H -| # include -| # endif -| # include -| #endif -| #ifdef HAVE_STRINGS_H -| # include -| #endif -| #ifdef HAVE_INTTYPES_H -| # include -| #endif -| #ifdef HAVE_STDINT_H -| # include -| #endif -| #ifdef HAVE_UNISTD_H -| # include -| #endif -| int -| main () -| { -| static int test_array [1 - 2 * !(sizeof (void *) <= sizeof (unsigned long long int))]; -| test_array [0] = 0 -| -| ; -| return 0; -| } -configure:11120: checking for inline -configure:11136: gcc -c -m32 -O2 -Wall conftest.c >&5 -configure:11136: $? = 0 -configure:11144: result: inline -configure:11168: checking for memmove -configure:11168: gcc -o conftest -m32 -O2 -Wall conftest.c >&5 -In file included from /usr/include/limits.h:27:0, - from /usr/lib/gcc/x86_64-linux-gnu/4.6/include-fixed/limits.h:169, - from /usr/lib/gcc/x86_64-linux-gnu/4.6/include-fixed/syslimits.h:7, - from /usr/lib/gcc/x86_64-linux-gnu/4.6/include-fixed/limits.h:34, - from conftest.c:37: -/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory -compilation terminated. -configure:11168: $? = 1 -configure: failed program was: -| /* confdefs.h */ -| #define PACKAGE_NAME "libantlr3c" -| #define PACKAGE_TARNAME "libantlr3c" -| #define PACKAGE_VERSION "3.4" -| #define PACKAGE_STRING "libantlr3c 3.4" -| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" -| #define PACKAGE_URL "" -| #define PACKAGE "libantlr3c" -| #define VERSION "3.4" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define HAVE_DLFCN_H 1 -| #define LT_OBJDIR ".libs/" -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_STDARG_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define size_t unsigned int -| /* end confdefs.h. */ -| /* Define memmove to an innocuous variant, in case declares memmove. -| For example, HP-UX 11i declares gettimeofday. */ -| #define memmove innocuous_memmove -| -| /* System header to define __stub macros and hopefully few prototypes, -| which can conflict with char memmove (); below. -| Prefer to if __STDC__ is defined, since -| exists even on freestanding compilers. */ -| -| #ifdef __STDC__ -| # include -| #else -| # include -| #endif -| -| #undef memmove -| -| /* 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 memmove (); -| /* 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_memmove || defined __stub___memmove -| choke me -| #endif -| -| int -| main () -| { -| return memmove (); -| ; -| return 0; -| } -configure:11168: result: no -configure:11168: checking for memset -configure:11168: gcc -o conftest -m32 -O2 -Wall conftest.c >&5 -In file included from /usr/include/limits.h:27:0, - from /usr/lib/gcc/x86_64-linux-gnu/4.6/include-fixed/limits.h:169, - from /usr/lib/gcc/x86_64-linux-gnu/4.6/include-fixed/syslimits.h:7, - from /usr/lib/gcc/x86_64-linux-gnu/4.6/include-fixed/limits.h:34, - from conftest.c:37: -/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory -compilation terminated. -configure:11168: $? = 1 -configure: failed program was: -| /* confdefs.h */ -| #define PACKAGE_NAME "libantlr3c" -| #define PACKAGE_TARNAME "libantlr3c" -| #define PACKAGE_VERSION "3.4" -| #define PACKAGE_STRING "libantlr3c 3.4" -| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" -| #define PACKAGE_URL "" -| #define PACKAGE "libantlr3c" -| #define VERSION "3.4" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define HAVE_DLFCN_H 1 -| #define LT_OBJDIR ".libs/" -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_STDARG_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define size_t unsigned int -| /* end confdefs.h. */ -| /* Define memset to an innocuous variant, in case declares memset. -| For example, HP-UX 11i declares gettimeofday. */ -| #define memset innocuous_memset -| -| /* System header to define __stub macros and hopefully few prototypes, -| which can conflict with char memset (); below. -| Prefer to if __STDC__ is defined, since -| exists even on freestanding compilers. */ -| -| #ifdef __STDC__ -| # include -| #else -| # include -| #endif -| -| #undef memset -| -| /* 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 memset (); -| /* 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_memset || defined __stub___memset -| choke me -| #endif -| -| int -| main () -| { -| return memset (); -| ; -| return 0; -| } -configure:11168: result: no -configure:11168: checking for strdup -configure:11168: gcc -o conftest -m32 -O2 -Wall conftest.c >&5 -In file included from /usr/include/limits.h:27:0, - from /usr/lib/gcc/x86_64-linux-gnu/4.6/include-fixed/limits.h:169, - from /usr/lib/gcc/x86_64-linux-gnu/4.6/include-fixed/syslimits.h:7, - from /usr/lib/gcc/x86_64-linux-gnu/4.6/include-fixed/limits.h:34, - from conftest.c:37: -/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory -compilation terminated. -configure:11168: $? = 1 -configure: failed program was: -| /* confdefs.h */ -| #define PACKAGE_NAME "libantlr3c" -| #define PACKAGE_TARNAME "libantlr3c" -| #define PACKAGE_VERSION "3.4" -| #define PACKAGE_STRING "libantlr3c 3.4" -| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" -| #define PACKAGE_URL "" -| #define PACKAGE "libantlr3c" -| #define VERSION "3.4" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define HAVE_DLFCN_H 1 -| #define LT_OBJDIR ".libs/" -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_STDARG_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define size_t unsigned int -| /* end confdefs.h. */ -| /* Define strdup to an innocuous variant, in case declares strdup. -| For example, HP-UX 11i declares gettimeofday. */ -| #define strdup innocuous_strdup -| -| /* System header to define __stub macros and hopefully few prototypes, -| which can conflict with char strdup (); below. -| Prefer to if __STDC__ is defined, since -| exists even on freestanding compilers. */ -| -| #ifdef __STDC__ -| # include -| #else -| # include -| #endif -| -| #undef strdup -| -| /* 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 strdup (); -| /* 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_strdup || defined __stub___strdup -| choke me -| #endif -| -| int -| main () -| { -| return strdup (); -| ; -| return 0; -| } -configure:11168: result: no -configure:11168: checking for accept -configure:11168: gcc -o conftest -m32 -O2 -Wall conftest.c >&5 -In file included from /usr/include/limits.h:27:0, - from /usr/lib/gcc/x86_64-linux-gnu/4.6/include-fixed/limits.h:169, - from /usr/lib/gcc/x86_64-linux-gnu/4.6/include-fixed/syslimits.h:7, - from /usr/lib/gcc/x86_64-linux-gnu/4.6/include-fixed/limits.h:34, - from conftest.c:37: -/usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory -compilation terminated. -configure:11168: $? = 1 -configure: failed program was: -| /* confdefs.h */ -| #define PACKAGE_NAME "libantlr3c" -| #define PACKAGE_TARNAME "libantlr3c" -| #define PACKAGE_VERSION "3.4" -| #define PACKAGE_STRING "libantlr3c 3.4" -| #define PACKAGE_BUGREPORT "jimi@temporal-wave.com" -| #define PACKAGE_URL "" -| #define PACKAGE "libantlr3c" -| #define VERSION "3.4" -| #define STDC_HEADERS 1 -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define HAVE_STDLIB_H 1 -| #define HAVE_STRING_H 1 -| #define HAVE_MEMORY_H 1 -| #define HAVE_STRINGS_H 1 -| #define HAVE_INTTYPES_H 1 -| #define HAVE_STDINT_H 1 -| #define HAVE_UNISTD_H 1 -| #define HAVE_DLFCN_H 1 -| #define LT_OBJDIR ".libs/" -| #define HAVE_SYS_TYPES_H 1 -| #define HAVE_STDARG_H 1 -| #define HAVE_SYS_STAT_H 1 -| #define size_t unsigned int -| /* end confdefs.h. */ -| /* Define accept to an innocuous variant, in case declares accept. -| For example, HP-UX 11i declares gettimeofday. */ -| #define accept innocuous_accept -| -| /* System header to define __stub macros and hopefully few prototypes, -| which can conflict with char accept (); below. -| Prefer to if __STDC__ is defined, since -| exists even on freestanding compilers. */ -| -| #ifdef __STDC__ -| # include -| #else -| # include -| #endif -| -| #undef accept -| -| /* 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 accept (); -| /* 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_accept || defined __stub___accept -| choke me -| #endif -| -| int -| main () -| { -| return accept (); -| ; -| return 0; -| } -configure:11168: result: no -configure:11307: creating ./config.status - -## ---------------------- ## -## Running config.status. ## -## ---------------------- ## - -This file was extended by libantlr3c config.status 3.4, which was -generated by GNU Autoconf 2.66. Invocation command line was - - CONFIG_FILES = - CONFIG_HEADERS = - CONFIG_LINKS = - CONFIG_COMMANDS = - $ ./config.status - -on pc-4w14-0 - -config.status:1073: creating Makefile -config.status:1073: creating antlr3config.h -config.status:1253: antlr3config.h is unchanged -config.status:1301: executing depfiles commands -config.status:1301: executing libtool commands - -## ---------------- ## -## Cache variables. ## -## ---------------- ## - -ac_cv_build=x86_64-unknown-linux-gnu -ac_cv_c_compiler_gnu=yes -ac_cv_c_const=yes -ac_cv_c_inline=inline -ac_cv_c_int16_t=no -ac_cv_c_int32_t=no -ac_cv_c_int64_t=no -ac_cv_c_int8_t=no -ac_cv_c_uint16_t=no -ac_cv_c_uint32_t=no -ac_cv_c_uint64_t=no -ac_cv_c_uint8_t=no -ac_cv_env_CC_set= -ac_cv_env_CC_value= -ac_cv_env_CFLAGS_set= -ac_cv_env_CFLAGS_value= -ac_cv_env_CPPFLAGS_set= -ac_cv_env_CPPFLAGS_value= -ac_cv_env_CPP_set= -ac_cv_env_CPP_value= -ac_cv_env_LDFLAGS_set= -ac_cv_env_LDFLAGS_value= -ac_cv_env_LIBS_set= -ac_cv_env_LIBS_value= -ac_cv_env_build_alias_set= -ac_cv_env_build_alias_value= -ac_cv_env_host_alias_set= -ac_cv_env_host_alias_value= -ac_cv_env_target_alias_set= -ac_cv_env_target_alias_value= -ac_cv_func_accept=no -ac_cv_func_memmove=no -ac_cv_func_memset=no -ac_cv_func_strdup=no -ac_cv_header_arpa_nameser_h=no -ac_cv_header_ctype_h=no -ac_cv_header_dlfcn_h=yes -ac_cv_header_inttypes_h=yes -ac_cv_header_malloc_h=no -ac_cv_header_memory_h=yes -ac_cv_header_netdb_h=no -ac_cv_header_netinet_in_h=no -ac_cv_header_netinet_tcp_h=no -ac_cv_header_resolv_h=no -ac_cv_header_socket_h=no -ac_cv_header_stdarg_h=yes -ac_cv_header_stdc=yes -ac_cv_header_stdint_h=yes -ac_cv_header_stdlib_h=yes -ac_cv_header_string_h=yes -ac_cv_header_strings_h=yes -ac_cv_header_sys_malloc_h=no -ac_cv_header_sys_socket_h=no -ac_cv_header_sys_stat_h=yes -ac_cv_header_sys_types_h=yes -ac_cv_header_unistd_h=yes -ac_cv_host=x86_64-unknown-linux-gnu -ac_cv_objext=o -ac_cv_path_EGREP='/bin/grep -E' -ac_cv_path_FGREP='/bin/grep -F' -ac_cv_path_GREP=/bin/grep -ac_cv_path_SED=/bin/sed -ac_cv_path_install='/usr/bin/install -c' -ac_cv_path_mkdir=/bin/mkdir -ac_cv_prog_AWK=mawk -ac_cv_prog_CPP='gcc -E' -ac_cv_prog_ac_ct_AR=ar -ac_cv_prog_ac_ct_CC=gcc -ac_cv_prog_ac_ct_OBJDUMP=objdump -ac_cv_prog_ac_ct_RANLIB=ranlib -ac_cv_prog_ac_ct_STRIP=strip -ac_cv_prog_cc_c89= -ac_cv_prog_cc_g=yes -ac_cv_prog_make_make_set=yes -ac_cv_type_intptr_t=no -ac_cv_type_size_t=no -ac_cv_type_uintptr_t=no -am_cv_CC_dependencies_compiler_type=gcc3 -lt_cv_archive_cmds_need_lc=no -lt_cv_deplibs_check_method=pass_all -lt_cv_file_magic_cmd='$MAGIC_CMD' -lt_cv_file_magic_test_file= -lt_cv_ld_reload_flag=-r -lt_cv_nm_interface='BSD nm' -lt_cv_objdir=.libs -lt_cv_path_LD=/usr/bin/ld -lt_cv_path_NM='/usr/bin/nm -B' -lt_cv_prog_compiler_c_o=yes -lt_cv_prog_compiler_pic_works=yes -lt_cv_prog_compiler_rtti_exceptions=no -lt_cv_prog_compiler_static_works=yes -lt_cv_prog_gnu_ld=yes -lt_cv_shlibpath_overrides_runpath=no -lt_cv_sys_global_symbol_pipe='sed -n -e '\''s/^.*[ ]\([ABCDGIRSTW][ABCDGIRSTW]*\)[ ][ ]*\([_A-Za-z][_A-Za-z0-9]*\)$/\1 \2 \2/p'\''' -lt_cv_sys_global_symbol_to_c_name_address='sed -n -e '\''s/^: \([^ ]*\) $/ {\"\1\", (void *) 0},/p'\'' -e '\''s/^[ABCDGIRSTW]* \([^ ]*\) \([^ ]*\)$/ {"\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/^[ABCDGIRSTW]* \([^ ]*\) \(lib[^ ]*\)$/ {"\2", (void *) \&\2},/p'\'' -e '\''s/^[ABCDGIRSTW]* \([^ ]*\) \([^ ]*\)$/ {"lib\2", (void *) \&\2},/p'\''' -lt_cv_sys_global_symbol_to_cdecl='sed -n -e '\''s/^T .* \(.*\)$/extern int \1();/p'\'' -e '\''s/^[ABCDGIRSTW]* .* \(.*\)$/extern char \1;/p'\''' -lt_cv_sys_max_cmd_len=1572864 - -## ----------------- ## -## Output variables. ## -## ----------------- ## - -ACLOCAL='${SHELL} /home/carlo/laptop-repository/impl/antlr/libantlr3c-3.4/missing --run aclocal-1.11' -AMDEPBACKSLASH='\' -AMDEP_FALSE='#' -AMDEP_TRUE='' -AMTAR='${SHELL} /home/carlo/laptop-repository/impl/antlr/libantlr3c-3.4/missing --run tar' -AR='ar' -AUTOCONF='${SHELL} /home/carlo/laptop-repository/impl/antlr/libantlr3c-3.4/missing --run autoconf' -AUTOHEADER='${SHELL} /home/carlo/laptop-repository/impl/antlr/libantlr3c-3.4/missing --run autoheader' -AUTOMAKE='${SHELL} /home/carlo/laptop-repository/impl/antlr/libantlr3c-3.4/missing --run automake-1.11' -AWK='mawk' -CC='gcc' -CCDEPMODE='depmode=gcc3' -CFLAGS='-m32 -O2 -Wall' -CPP='gcc -E' -CPPFLAGS='' -CYGPATH_W='echo' -DEFS='-DHAVE_CONFIG_H' -DEPDIR='.deps' -DSYMUTIL='' -DUMPBIN='' -ECHO_C='' -ECHO_N='-n' -ECHO_T='' -EGREP='/bin/grep -E' -EXEEXT='' -FGREP='/bin/grep -F' -GREP='/bin/grep' -INSTALL_DATA='${INSTALL} -m 644' -INSTALL_PROGRAM='${INSTALL}' -INSTALL_SCRIPT='${INSTALL}' -INSTALL_STRIP_PROGRAM='$(install_sh) -c -s' -LD='/usr/bin/ld -m elf_x86_64' -LDFLAGS='' -LIBOBJS='' -LIBS='' -LIBTOOL='$(SHELL) $(top_builddir)/libtool' -LIPO='' -LN_S='ln -s' -LTLIBOBJS='' -MAINT='#' -MAINTAINER_MODE_FALSE='' -MAINTAINER_MODE_TRUE='#' -MAKEINFO='${SHELL} /home/carlo/laptop-repository/impl/antlr/libantlr3c-3.4/missing --run makeinfo' -MKDIR_P='/bin/mkdir -p' -NM='/usr/bin/nm -B' -NMEDIT='' -OBJDUMP='objdump' -OBJECT_MODE='' -OBJEXT='o' -OTOOL64='' -OTOOL='' -PACKAGE='libantlr3c' -PACKAGE_BUGREPORT='jimi@temporal-wave.com' -PACKAGE_NAME='libantlr3c' -PACKAGE_STRING='libantlr3c 3.4' -PACKAGE_TARNAME='libantlr3c' -PACKAGE_URL='' -PACKAGE_VERSION='3.4' -PATH_SEPARATOR=':' -RANLIB='ranlib' -SED='/bin/sed' -SET_MAKE='' -SHELL='/bin/bash' -STRIP='strip' -VERSION='3.4' -ac_ct_CC='gcc' -ac_ct_DUMPBIN='' -am__EXEEXT_FALSE='' -am__EXEEXT_TRUE='#' -am__fastdepCC_FALSE='#' -am__fastdepCC_TRUE='' -am__include='include' -am__isrc='' -am__leading_dot='.' -am__quote='' -am__tar='${AMTAR} chof - "$$tardir"' -am__untar='${AMTAR} xf -' -bindir='${exec_prefix}/bin' -build='x86_64-unknown-linux-gnu' -build_alias='' -build_cpu='x86_64' -build_os='linux-gnu' -build_vendor='unknown' -datadir='${datarootdir}' -datarootdir='${prefix}/share' -docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' -dvidir='${docdir}' -exec_prefix='${prefix}' -host='x86_64-unknown-linux-gnu' -host_alias='' -host_cpu='x86_64' -host_os='linux-gnu' -host_vendor='unknown' -htmldir='${docdir}' -includedir='${prefix}/include' -infodir='${datarootdir}/info' -install_sh='${SHELL} /home/carlo/laptop-repository/impl/antlr/libantlr3c-3.4/install-sh' -libdir='${exec_prefix}/lib' -libexecdir='${exec_prefix}/libexec' -localedir='${datarootdir}/locale' -localstatedir='${prefix}/var' -mandir='${datarootdir}/man' -mkdir_p='/bin/mkdir -p' -oldincludedir='/usr/include' -pdfdir='${docdir}' -prefix='/usr/local' -program_transform_name='s,x,x,' -psdir='${docdir}' -sbindir='${exec_prefix}/sbin' -sharedstatedir='${prefix}/com' -sysconfdir='${prefix}/etc' -target_alias='' - -## ----------- ## -## confdefs.h. ## -## ----------- ## - -/* confdefs.h */ -#define PACKAGE_NAME "libantlr3c" -#define PACKAGE_TARNAME "libantlr3c" -#define PACKAGE_VERSION "3.4" -#define PACKAGE_STRING "libantlr3c 3.4" -#define PACKAGE_BUGREPORT "jimi@temporal-wave.com" -#define PACKAGE_URL "" -#define PACKAGE "libantlr3c" -#define VERSION "3.4" -#define STDC_HEADERS 1 -#define HAVE_SYS_TYPES_H 1 -#define HAVE_SYS_STAT_H 1 -#define HAVE_STDLIB_H 1 -#define HAVE_STRING_H 1 -#define HAVE_MEMORY_H 1 -#define HAVE_STRINGS_H 1 -#define HAVE_INTTYPES_H 1 -#define HAVE_STDINT_H 1 -#define HAVE_UNISTD_H 1 -#define HAVE_DLFCN_H 1 -#define LT_OBJDIR ".libs/" -#define HAVE_SYS_TYPES_H 1 -#define HAVE_STDARG_H 1 -#define HAVE_SYS_STAT_H 1 -#define size_t unsigned int - -configure: exit 0 diff --git a/impl/antlr/libantlr3c-3.4/config.status b/impl/antlr/libantlr3c-3.4/config.status deleted file mode 100755 index 3ab6ce7..0000000 --- a/impl/antlr/libantlr3c-3.4/config.status +++ /dev/null @@ -1,2048 +0,0 @@ -#! /bin/bash -# Generated 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 -ac_cs_recheck=false -ac_cs_silent=false - -SHELL=${CONFIG_SHELL-/bin/bash} -export SHELL -## -------------------- ## -## M4sh Initialization. ## -## -------------------- ## - -# Be more Bourne compatible -DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in #( - *posix*) : - set -o posix ;; #( - *) : - ;; -esac -fi - - -as_nl=' -' -export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -# Prefer a ksh shell builtin over an external printf program on Solaris, -# but without wasting forks for bash or zsh. -if test -z "$BASH_VERSION$ZSH_VERSION" \ - && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='print -r --' - as_echo_n='print -rn --' -elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in #( - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' -fi - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - PATH_SEPARATOR=: - (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { - (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || - PATH_SEPARATOR=';' - } -fi - - -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -IFS=" "" $as_nl" - -# Find who we are. Look in the path if we contain no directory separator. -case $0 in #(( - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break - done -IFS=$as_save_IFS - - ;; -esac -# We did not find ourselves, most probably we were run as `sh COMMAND' -# in which case we are not to be found in the path. -if test "x$as_myself" = x; then - as_myself=$0 -fi -if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - exit 1 -fi - -# Unset variables that we do not need and which cause bugs (e.g. in -# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" -# suppresses any "Segmentation fault" message there. '((' could -# trigger a bug in pdksh 5.2.14. -for as_var in BASH_ENV ENV MAIL MAILPATH -do eval test x\${$as_var+set} = xset \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - - -# as_fn_error STATUS ERROR [LINENO LOG_FD] -# ---------------------------------------- -# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are -# provided, also output the error to LOG_FD, referencing LINENO. Then exit the -# script with STATUS, using 1 if that was 0. -as_fn_error () -{ - as_status=$1; test $as_status -eq 0 && as_status=1 - if test "$4"; then - as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 - fi - $as_echo "$as_me: error: $2" >&2 - as_fn_exit $as_status -} # as_fn_error - - -# as_fn_set_status STATUS -# ----------------------- -# Set $? to STATUS, without forking. -as_fn_set_status () -{ - return $1 -} # as_fn_set_status - -# as_fn_exit STATUS -# ----------------- -# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. -as_fn_exit () -{ - set +e - as_fn_set_status $1 - exit $1 -} # as_fn_exit - -# as_fn_unset VAR -# --------------- -# Portably unset VAR. -as_fn_unset () -{ - { eval $1=; unset $1;} -} -as_unset=as_fn_unset -# as_fn_append VAR VALUE -# ---------------------- -# Append the text in VALUE to the end of the definition contained in VAR. Take -# advantage of any shell optimizations that allow amortized linear growth over -# repeated appends, instead of the typical quadratic growth present in naive -# implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : - eval 'as_fn_append () - { - eval $1+=\$2 - }' -else - as_fn_append () - { - eval $1=\$$1\$2 - } -fi # as_fn_append - -# as_fn_arith ARG... -# ------------------ -# Perform arithmetic evaluation on the ARGs, and store the result in the -# global $as_val. Take advantage of shells that can avoid forks. The arguments -# must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : - eval 'as_fn_arith () - { - as_val=$(( $* )) - }' -else - as_fn_arith () - { - as_val=`expr "$@" || test $? -eq 1` - } -fi # as_fn_arith - - -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in #((((( --n*) - case `echo 'xy\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - xy) ECHO_C='\c';; - *) echo `echo ksh88 bug on AIX 6.1` > /dev/null - ECHO_T=' ';; - esac;; -*) - ECHO_N='-n';; -esac - -rm -f conf$$ conf$$.exe conf$$.file -if test -d conf$$.dir; then - rm -f conf$$.dir/conf$$.file -else - rm -f conf$$.dir - mkdir conf$$.dir 2>/dev/null -fi -if (echo >conf$$.file) 2>/dev/null; then - if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' - elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln - else - as_ln_s='cp -p' - fi -else - as_ln_s='cp -p' -fi -rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -rmdir conf$$.dir 2>/dev/null - - -# as_fn_mkdir_p -# ------------- -# Create "$as_dir" as a directory, including parents if necessary. -as_fn_mkdir_p () -{ - - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || eval $as_mkdir_p || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( - *) as_qdir=$as_dir;; - esac - as_dirs="'$as_qdir' $as_dirs" - as_dir=`$as_dirname -- "$as_dir" || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - test -d "$as_dir" && break - done - test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" - - -} # as_fn_mkdir_p -if mkdir -p . 2>/dev/null; then - as_mkdir_p='mkdir -p "$as_dir"' -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in #( - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - - -exec 6>&1 -## ----------------------------------- ## -## Main body of $CONFIG_STATUS script. ## -## ----------------------------------- ## -# 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 libantlr3c $as_me 3.4, which was -generated by GNU Autoconf 2.66. 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` -" - -# Files that config.status was made for. -config_files=" Makefile" -config_headers=" antlr3config.h" -config_commands=" depfiles libtool" - -ac_cs_usage="\ -\`$as_me' instantiates files and other configuration actions -from templates according to the current configuration. Unless the files -and actions are specified as TAGs, all are instantiated by default. - -Usage: $0 [OPTION]... [TAG]... - - -h, --help print this help, then exit - -V, --version print version number and configuration settings, then exit - --config print configuration, then exit - -q, --quiet, --silent - do not print progress messages - -d, --debug don't remove temporary files - --recheck update $as_me by reconfiguring in the same conditions - --file=FILE[:TEMPLATE] - instantiate the configuration file FILE - --header=FILE[:TEMPLATE] - instantiate the configuration header FILE - -Configuration files: -$config_files - -Configuration headers: -$config_headers - -Configuration commands: -$config_commands - -Report bugs to ." - -ac_cs_config="" -ac_cs_version="\ -libantlr3c config.status 3.4 -configured by ./configure, generated by GNU Autoconf 2.66, - with options \"$ac_cs_config\" - -Copyright (C) 2010 Free Software Foundation, Inc. -This config.status script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it." - -ac_pwd='/home/carlo/laptop-repository/impl/antlr/libantlr3c-3.4' -srcdir='.' -INSTALL='/usr/bin/install -c' -MKDIR_P='/bin/mkdir -p' -AWK='mawk' -test -n "$AWK" || AWK=awk -# 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 ;; - --config | --confi | --conf | --con | --co | --c ) - $as_echo "$ac_cs_config"; exit ;; - --debug | --debu | --deb | --de | --d | -d ) - debug=: ;; - --file | --fil | --fi | --f ) - $ac_shift - case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - as_fn_append CONFIG_FILES " '$ac_optarg'" - ac_need_defaults=false;; - --header | --heade | --head | --hea ) - $ac_shift - case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - as_fn_append CONFIG_HEADERS " '$ac_optarg'" - ac_need_defaults=false;; - --he | --h) - # Conflict between --help and --header - as_fn_error $? "ambiguous option: \`$1' -Try \`$0 --help' for more information.";; - --help | --hel | -h ) - $as_echo "$ac_cs_usage"; exit ;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil | --si | --s) - ac_cs_silent=: ;; - - # This is an error. - -*) as_fn_error $? "unrecognized option: \`$1' -Try \`$0 --help' for more information." ;; - - *) as_fn_append ac_config_targets " $1" - ac_need_defaults=false ;; - - esac - shift -done - -ac_configure_extra_args= - -if $ac_cs_silent; then - exec 6>/dev/null - ac_configure_extra_args="$ac_configure_extra_args --silent" -fi - -if $ac_cs_recheck; then - set X '/bin/bash' './configure' $ac_configure_extra_args --no-create --no-recursion - shift - $as_echo "running CONFIG_SHELL=/bin/bash $*" >&6 - CONFIG_SHELL='/bin/bash' - export CONFIG_SHELL - exec "$@" -fi - -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 - -# -# INIT-COMMANDS -# -AMDEP_TRUE="" 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='s/\(["`$\\]\)/\\\1/g' -double_quote_subst='s/\(["`\\]\)/\\\1/g' -delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' -macro_version='2.2.10' -macro_revision='1.3175' -enable_shared='yes' -enable_static='yes' -pic_mode='default' -enable_fast_install='yes' -SHELL='/bin/bash' -ECHO='printf %s\n' -host_alias='' -host='x86_64-unknown-linux-gnu' -host_os='linux-gnu' -build_alias='' -build='x86_64-unknown-linux-gnu' -build_os='linux-gnu' -SED='/bin/sed' -Xsed='/bin/sed -e 1s/^X//' -GREP='/bin/grep' -EGREP='/bin/grep -E' -FGREP='/bin/grep -F' -LD='/usr/bin/ld -m elf_x86_64' -NM='/usr/bin/nm -B' -LN_S='ln -s' -max_cmd_len='1572864' -ac_objext='o' -exeext='' -lt_unset='unset' -lt_SP2NL='tr \040 \012' -lt_NL2SP='tr \015\012 \040\040' -reload_flag=' -r' -reload_cmds='$LD$reload_flag -o $output$reload_objs' -OBJDUMP='objdump' -deplibs_check_method='pass_all' -file_magic_cmd='$MAGIC_CMD' -AR='ar' -AR_FLAGS='cru' -STRIP='strip' -RANLIB='ranlib' -old_postinstall_cmds='chmod 644 $oldlib~$RANLIB $oldlib' -old_postuninstall_cmds='' -old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs~$RANLIB $oldlib' -lock_old_archive_extraction='no' -CC='gcc' -CFLAGS='-m32 -O2 -Wall' -compiler='gcc' -GCC='yes' -lt_cv_sys_global_symbol_pipe='sed -n -e '\''s/^.*[ ]\([ABCDGIRSTW][ABCDGIRSTW]*\)[ ][ ]*\([_A-Za-z][_A-Za-z0-9]*\)$/\1 \2 \2/p'\''' -lt_cv_sys_global_symbol_to_cdecl='sed -n -e '\''s/^T .* \(.*\)$/extern int \1();/p'\'' -e '\''s/^[ABCDGIRSTW]* .* \(.*\)$/extern char \1;/p'\''' -lt_cv_sys_global_symbol_to_c_name_address='sed -n -e '\''s/^: \([^ ]*\) $/ {\"\1\", (void *) 0},/p'\'' -e '\''s/^[ABCDGIRSTW]* \([^ ]*\) \([^ ]*\)$/ {"\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/^[ABCDGIRSTW]* \([^ ]*\) \(lib[^ ]*\)$/ {"\2", (void *) \&\2},/p'\'' -e '\''s/^[ABCDGIRSTW]* \([^ ]*\) \([^ ]*\)$/ {"lib\2", (void *) \&\2},/p'\''' -objdir='.libs' -MAGIC_CMD='file' -lt_prog_compiler_no_builtin_flag=' -fno-builtin' -lt_prog_compiler_wl='-Wl,' -lt_prog_compiler_pic=' -fPIC -DPIC' -lt_prog_compiler_static='-static' -lt_cv_prog_compiler_c_o='yes' -need_locks='no' -DSYMUTIL='' -NMEDIT='' -LIPO='' -OTOOL='' -OTOOL64='' -libext='a' -shrext_cmds='.so' -extract_expsyms_cmds='' -archive_cmds_need_lc='no' -enable_shared_with_static_runtimes='no' -export_dynamic_flag_spec='${wl}--export-dynamic' -whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive' -compiler_needs_object='no' -old_archive_from_new_cmds='' -old_archive_from_expsyms_cmds='' -archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' -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 -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' -module_cmds='' -module_expsym_cmds='' -with_gnu_ld='yes' -allow_undefined_flag='' -no_undefined_flag='' -hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' -hardcode_libdir_flag_spec_ld='' -hardcode_libdir_separator='' -hardcode_direct='no' -hardcode_direct_absolute='no' -hardcode_minus_L='no' -hardcode_shlibpath_var='unsupported' -hardcode_automatic='no' -inherit_rpath='no' -link_all_deplibs='unknown' -fix_srcfile_path='' -always_export_symbols='no' -export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' -exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' -include_expsyms='' -prelink_cmds='' -file_list_spec='' -variables_saved_for_relink='PATH LD_LIBRARY_PATH LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH' -need_lib_prefix='no' -need_version='no' -version_type='linux' -runpath_var='LD_RUN_PATH' -shlibpath_var='LD_LIBRARY_PATH' -shlibpath_overrides_runpath='no' -libname_spec='lib$name' -library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' -soname_spec='${libname}${release}${shared_ext}$major' -install_override_mode='' -postinstall_cmds='' -postuninstall_cmds='' -finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' -finish_eval='' -hardcode_into_libs='yes' -sys_lib_search_path_spec='/usr/lib/gcc/x86_64-linux-gnu/4.6 /usr/lib/x86_64-linux-gnu /usr/lib /lib/x86_64-linux-gnu /lib ' -sys_lib_dlsearch_path_spec='/lib64 /usr/lib64 /lib /usr/lib /usr/local/lib /lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu /lib32 /usr/lib32 ' -hardcode_action='immediate' -enable_dlopen='unknown' -enable_dlopen_self='unknown' -enable_dlopen_self_static='unknown' -old_striplib='strip --strip-debug' -striplib='strip --strip-unneeded' - -LTCC='gcc' -LTCFLAGS='-g -O2' -compiler='gcc' - -# A function that is used when there is no print builtin or printf. -func_fallback_echo () -{ - eval 'cat <<_LTECHO_EOF -$1 -_LTECHO_EOF' -} - -# Quote evaled strings. -for var in SHELL ECHO 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 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 install_override_mode finish_eval old_striplib striplib; do - case `eval \\$ECHO \\""\\$$var"\\"` in - *[\\\`\"\$]*) - eval "lt_$var=\\\"\`\$ECHO \"\$$var\" | \$SED \"\$sed_quote_subst\"\`\\\"" - ;; - *) - eval "lt_$var=\\\"\$$var\\\"" - ;; - esac -done - -# Double-quote double-evaled strings. -for var in reload_cmds old_postinstall_cmds old_postuninstall_cmds old_archive_cmds extract_expsyms_cmds old_archive_from_new_cmds old_archive_from_expsyms_cmds archive_cmds archive_expsym_cmds module_cmds module_expsym_cmds export_symbols_cmds prelink_cmds postinstall_cmds postuninstall_cmds finish_cmds sys_lib_search_path_spec sys_lib_dlsearch_path_spec; do - case `eval \\$ECHO \\""\\$$var"\\"` in - *[\\\`\"\$]*) - eval "lt_$var=\\\"\`\$ECHO \"\$$var\" | \$SED -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" - ;; - *) - eval "lt_$var=\\\"\$$var\\\"" - ;; - esac -done - -ac_aux_dir='.' -xsi_shell='yes' -lt_shell_append='yes' - -# 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='libantlr3c' - VERSION='3.4' - TIMESTAMP='' - RM='rm -f' - ofile='libtool' - - - - - -# 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" ;; - "antlr3config.h") CONFIG_HEADERS="$CONFIG_HEADERS antlr3config.h" ;; - "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; - - *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; - esac -done - - -# If the user did not use the arguments to specify the items to instantiate, -# then the envvar interface is used. Set only those that are not. -# We use the long form for the default assignment because of an extremely -# bizarre bug on SunOS 4.1.3. -if $ac_need_defaults; then - test "${CONFIG_FILES+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 'as_fn_exit 1' 1 2 13 15 -} -# Create a (secure) tmp directory for tmp files. - -{ - tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && - test -n "$tmp" && test -d "$tmp" -} || -{ - tmp=./conf$$-$RANDOM - (umask 077 && mkdir "$tmp") -} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 - -# Set up the scripts for CONFIG_FILES section. -# No need to generate them if there are no CONFIG_FILES. -# This happens for instance with `./config.status config.h'. -if test -n "$CONFIG_FILES"; then - - -ac_cr=`echo X | tr X '\015'` -# On cygwin, bash can eat \r inside `` if the user requested igncr. -# But we know of no other shell where ac_cr would be empty at this -# point, so we can use a bashism as a fallback. -if test "x$ac_cr" = x; then - eval ac_cr=\$\'\\r\' -fi -ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` -if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then - ac_cs_awk_cr='\\r' -else - ac_cs_awk_cr=$ac_cr -fi - -echo 'BEGIN {' >"$tmp/subs1.awk" && -cat >>"$tmp/subs1.awk" <<\_ACAWK && -S["am__EXEEXT_FALSE"]="" -S["am__EXEEXT_TRUE"]="#" -S["LTLIBOBJS"]="" -S["LIBOBJS"]="" -S["OBJECT_MODE"]="" -S["CPP"]="gcc -E" -S["OTOOL64"]="" -S["OTOOL"]="" -S["LIPO"]="" -S["NMEDIT"]="" -S["DSYMUTIL"]="" -S["RANLIB"]="ranlib" -S["AR"]="ar" -S["OBJDUMP"]="objdump" -S["LN_S"]="ln -s" -S["NM"]="/usr/bin/nm -B" -S["ac_ct_DUMPBIN"]="" -S["DUMPBIN"]="" -S["LD"]="/usr/bin/ld -m elf_x86_64" -S["FGREP"]="/bin/grep -F" -S["EGREP"]="/bin/grep -E" -S["GREP"]="/bin/grep" -S["SED"]="/bin/sed" -S["host_os"]="linux-gnu" -S["host_vendor"]="unknown" -S["host_cpu"]="x86_64" -S["host"]="x86_64-unknown-linux-gnu" -S["build_os"]="linux-gnu" -S["build_vendor"]="unknown" -S["build_cpu"]="x86_64" -S["build"]="x86_64-unknown-linux-gnu" -S["LIBTOOL"]="$(SHELL) $(top_builddir)/libtool" -S["MAINT"]="#" -S["MAINTAINER_MODE_FALSE"]="" -S["MAINTAINER_MODE_TRUE"]="#" -S["am__fastdepCC_FALSE"]="#" -S["am__fastdepCC_TRUE"]="" -S["CCDEPMODE"]="depmode=gcc3" -S["AMDEPBACKSLASH"]="\\" -S["AMDEP_FALSE"]="#" -S["AMDEP_TRUE"]="" -S["am__quote"]="" -S["am__include"]="include" -S["DEPDIR"]=".deps" -S["OBJEXT"]="o" -S["EXEEXT"]="" -S["ac_ct_CC"]="gcc" -S["CPPFLAGS"]="" -S["LDFLAGS"]="" -S["CFLAGS"]="-m32 -O2 -Wall" -S["CC"]="gcc" -S["am__untar"]="${AMTAR} xf -" -S["am__tar"]="${AMTAR} chof - \"$$tardir\"" -S["AMTAR"]="${SHELL} /home/carlo/laptop-repository/impl/antlr/libantlr3c-3.4/missing --run tar" -S["am__leading_dot"]="." -S["SET_MAKE"]="" -S["AWK"]="mawk" -S["mkdir_p"]="/bin/mkdir -p" -S["MKDIR_P"]="/bin/mkdir -p" -S["INSTALL_STRIP_PROGRAM"]="$(install_sh) -c -s" -S["STRIP"]="strip" -S["install_sh"]="${SHELL} /home/carlo/laptop-repository/impl/antlr/libantlr3c-3.4/install-sh" -S["MAKEINFO"]="${SHELL} /home/carlo/laptop-repository/impl/antlr/libantlr3c-3.4/missing --run makeinfo" -S["AUTOHEADER"]="${SHELL} /home/carlo/laptop-repository/impl/antlr/libantlr3c-3.4/missing --run autoheader" -S["AUTOMAKE"]="${SHELL} /home/carlo/laptop-repository/impl/antlr/libantlr3c-3.4/missing --run automake-1.11" -S["AUTOCONF"]="${SHELL} /home/carlo/laptop-repository/impl/antlr/libantlr3c-3.4/missing --run autoconf" -S["ACLOCAL"]="${SHELL} /home/carlo/laptop-repository/impl/antlr/libantlr3c-3.4/missing --run aclocal-1.11" -S["VERSION"]="3.4" -S["PACKAGE"]="libantlr3c" -S["CYGPATH_W"]="echo" -S["am__isrc"]="" -S["INSTALL_DATA"]="${INSTALL} -m 644" -S["INSTALL_SCRIPT"]="${INSTALL}" -S["INSTALL_PROGRAM"]="${INSTALL}" -S["target_alias"]="" -S["host_alias"]="" -S["build_alias"]="" -S["LIBS"]="" -S["ECHO_T"]="" -S["ECHO_N"]="-n" -S["ECHO_C"]="" -S["DEFS"]="-DHAVE_CONFIG_H" -S["mandir"]="${datarootdir}/man" -S["localedir"]="${datarootdir}/locale" -S["libdir"]="${exec_prefix}/lib" -S["psdir"]="${docdir}" -S["pdfdir"]="${docdir}" -S["dvidir"]="${docdir}" -S["htmldir"]="${docdir}" -S["infodir"]="${datarootdir}/info" -S["docdir"]="${datarootdir}/doc/${PACKAGE_TARNAME}" -S["oldincludedir"]="/usr/include" -S["includedir"]="${prefix}/include" -S["localstatedir"]="${prefix}/var" -S["sharedstatedir"]="${prefix}/com" -S["sysconfdir"]="${prefix}/etc" -S["datadir"]="${datarootdir}" -S["datarootdir"]="${prefix}/share" -S["libexecdir"]="${exec_prefix}/libexec" -S["sbindir"]="${exec_prefix}/sbin" -S["bindir"]="${exec_prefix}/bin" -S["program_transform_name"]="s,x,x," -S["prefix"]="/usr/local" -S["exec_prefix"]="${prefix}" -S["PACKAGE_URL"]="" -S["PACKAGE_BUGREPORT"]="jimi@temporal-wave.com" -S["PACKAGE_STRING"]="libantlr3c 3.4" -S["PACKAGE_VERSION"]="3.4" -S["PACKAGE_TARNAME"]="libantlr3c" -S["PACKAGE_NAME"]="libantlr3c" -S["PATH_SEPARATOR"]=":" -S["SHELL"]="/bin/bash" -_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 -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_fn_error $? "could not setup config files machinery" "$LINENO" 5 -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 { -D["PACKAGE_NAME"]=" \"libantlr3c\"" -D["PACKAGE_TARNAME"]=" \"libantlr3c\"" -D["PACKAGE_VERSION"]=" \"3.4\"" -D["PACKAGE_STRING"]=" \"libantlr3c 3.4\"" -D["PACKAGE_BUGREPORT"]=" \"jimi@temporal-wave.com\"" -D["PACKAGE_URL"]=" \"\"" -D["PACKAGE"]=" \"libantlr3c\"" -D["VERSION"]=" \"3.4\"" -D["STDC_HEADERS"]=" 1" -D["HAVE_SYS_TYPES_H"]=" 1" -D["HAVE_SYS_STAT_H"]=" 1" -D["HAVE_STDLIB_H"]=" 1" -D["HAVE_STRING_H"]=" 1" -D["HAVE_MEMORY_H"]=" 1" -D["HAVE_STRINGS_H"]=" 1" -D["HAVE_INTTYPES_H"]=" 1" -D["HAVE_STDINT_H"]=" 1" -D["HAVE_UNISTD_H"]=" 1" -D["HAVE_DLFCN_H"]=" 1" -D["LT_OBJDIR"]=" \".libs/\"" -D["HAVE_SYS_TYPES_H"]=" 1" -D["HAVE_STDARG_H"]=" 1" -D["HAVE_SYS_STAT_H"]=" 1" -D["size_t"]=" unsigned int" - for (key in D) D_is_set[key] = 1 - FS = "" -} -/^[\t ]*#[\t ]*(define|undef)[\t ]+[_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ][_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789]*([\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 - as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 -fi # test -n "$CONFIG_HEADERS" - - -eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" -shift -for ac_tag -do - case $ac_tag in - :[FHLC]) ac_mode=$ac_tag; continue;; - esac - case $ac_mode$ac_tag in - :[FHL]*:*);; - :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; - :[FH]-) ac_tag=-:-;; - :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; - esac - ac_save_IFS=$IFS - IFS=: - set x $ac_tag - IFS=$ac_save_IFS - shift - ac_file=$1 - shift - - case $ac_mode in - :L) ac_source=$1;; - :[FH]) - ac_file_inputs= - for ac_f - do - case $ac_f in - -) ac_f="$tmp/stdin";; - *) # Look for the file first in the build tree, then in the source tree - # (if the path is not absolute). The absolute path cannot be DOS-style, - # because $ac_f cannot contain `:'. - test -f "$ac_f" || - case $ac_f in - [\\/$]*) false;; - *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; - esac || - as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; - esac - case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac - as_fn_append ac_file_inputs " '$ac_f'" - done - - # Let's still pretend it is `configure' which instantiates (i.e., don't - # use $as_me), people would be surprised to read: - # /* config.h. Generated by config.status. */ - configure_input='Generated from '` - $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' - `' by configure.' - if test x"$ac_file" != x-; then - configure_input="$ac_file. $configure_input" - { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 -$as_echo "$as_me: creating $ac_file" >&6;} - fi - # Neutralize special characters interpreted by sed in replacement strings. - case $configure_input in #( - *\&* | *\|* | *\\* ) - ac_sed_conf_input=`$as_echo "$configure_input" | - sed 's/[\\\\&|]/\\\\&/g'`;; #( - *) ac_sed_conf_input=$configure_input;; - esac - - case $ac_tag in - *:-:* | *:-) cat >"$tmp/stdin" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; - esac - ;; - esac - - ac_dir=`$as_dirname -- "$ac_file" || -$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_file" : 'X\(//\)[^/]' \| \ - X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - as_dir="$ac_dir"; as_fn_mkdir_p - ac_builddir=. - -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` - case $ac_top_builddir_sub in - "") ac_top_builddir_sub=. ac_top_build_prefix= ;; - *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; - esac ;; -esac -ac_abs_top_builddir=$ac_pwd -ac_abs_builddir=$ac_pwd$ac_dir_suffix -# for backward compatibility: -ac_top_builddir=$ac_top_build_prefix - -case $srcdir in - .) # We are building in place. - ac_srcdir=. - ac_top_srcdir=$ac_top_builddir_sub - ac_abs_top_srcdir=$ac_pwd ;; - [\\/]* | ?:[\\/]* ) # Absolute name. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir - ac_abs_top_srcdir=$srcdir ;; - *) # Relative name. - ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_build_prefix$srcdir - ac_abs_top_srcdir=$ac_pwd/$srcdir ;; -esac -ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix - - - case $ac_mode in - :F) - # - # CONFIG_FILE - # - - case $INSTALL in - [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; - *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; - esac - ac_MKDIR_P=$MKDIR_P - case $MKDIR_P in - [\\/$]* | ?:[\\/]* ) ;; - */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; - esac -# If the template does not know about datarootdir, expand it. -# FIXME: This hack should be removed a few years after 2.60. -ac_datarootdir_hack=; ac_datarootdir_seen= -ac_sed_dataroot=' -/datarootdir/ { - p - q -} -/@datadir@/p -/@docdir@/p -/@infodir@/p -/@localedir@/p -/@mandir@/p' -case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in -*datarootdir*) ac_datarootdir_seen=yes;; -*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 -$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} - ac_datarootdir_hack=' - s&@datadir@&${datarootdir}&g - s&@docdir@&${datarootdir}/doc/${PACKAGE_TARNAME}&g - s&@infodir@&${datarootdir}/info&g - s&@localedir@&${datarootdir}/locale&g - s&@mandir@&${datarootdir}/man&g - s&\${datarootdir}&${prefix}/share&g' ;; -esac -ac_sed_extra="/^[ ]*VPATH[ ]*=[ ]*/{ -h -s/// -s/^/:/ -s/[ ]*$/:/ -s/:\$(srcdir):/:/g -s/:\${srcdir}:/:/g -s/:@srcdir@:/:/g -s/^:*// -s/:*$// -x -s/\(=[ ]*\).*/\1/ -G -s/\n// -s/^[^=]*=[ ]*$// -} - -: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_fn_error $? "could not create $ac_file" "$LINENO" 5 - -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:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined" >&5 -$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined" >&2;} - - rm -f "$tmp/stdin" - case $ac_file in - -) cat "$tmp/out" && rm -f "$tmp/out";; - *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; - esac \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - ;; - :H) - # - # CONFIG_HEADER - # - if test x"$ac_file" != x-; then - { - $as_echo "/* $configure_input */" \ - && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" - } >"$tmp/config.h" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then - { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 -$as_echo "$as_me: $ac_file is unchanged" >&6;} - else - rm -f "$ac_file" - mv "$tmp/config.h" "$ac_file" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - fi - else - $as_echo "/* $configure_input */" \ - && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \ - || as_fn_error $? "could not create -" "$LINENO" 5 - fi -# Compute "$ac_file"'s index in $config_headers. -_am_arg="$ac_file" -_am_stamp_count=1 -for _am_header in $config_headers :; do - case $_am_header in - $_am_arg | $_am_arg:* ) - break ;; - * ) - _am_stamp_count=`expr $_am_stamp_count + 1` ;; - esac -done -echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || -$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$_am_arg" : 'X\(//\)[^/]' \| \ - X"$_am_arg" : 'X\(//\)$' \| \ - X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$_am_arg" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'`/stamp-h$_am_stamp_count - ;; - - :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 -$as_echo "$as_me: executing $ac_file commands" >&6;} - ;; - esac - - - case $ac_file$ac_mode in - "depfiles":C) test x"$AMDEP_TRUE" != x"" || { - # Autoconf 2.62 quotes --file arguments for eval, but not when files - # are listed without --file. Let's play safe and only enable the eval - # if we detect the quoting. - case $CONFIG_FILES in - *\'*) eval set x "$CONFIG_FILES" ;; - *) set x $CONFIG_FILES ;; - esac - shift - for mf - do - # Strip MF so we end up with the name of the file. - mf=`echo "$mf" | sed -e 's/:.*$//'` - # Check whether this is an Automake generated Makefile or not. - # We used to match only the files named `Makefile.in', but - # some people rename them; so instead we look at the file content. - # Grep'ing the first line is not enough: some people post-process - # each Makefile.in and add a new line on top of each file to say so. - # Grep'ing the whole file is not good either: AIX grep has a line - # limit of 2048, but all sed's we know have understand at least 4000. - if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then - dirpart=`$as_dirname -- "$mf" || -$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$mf" : 'X\(//\)[^/]' \| \ - X"$mf" : 'X\(//\)$' \| \ - X"$mf" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$mf" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - else - continue - fi - # Extract the definition of DEPDIR, am__include, and am__quote - # from the Makefile without running `make'. - DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` - test -z "$DEPDIR" && continue - am__include=`sed -n 's/^am__include = //p' < "$mf"` - test -z "am__include" && continue - am__quote=`sed -n 's/^am__quote = //p' < "$mf"` - # When using ansi2knr, U may be empty or an underscore; expand it - U=`sed -n 's/^U = //p' < "$mf"` - # Find all dependency output files, they are included files with - # $(DEPDIR) in their names. We invoke sed twice because it is the - # simplest approach to changing $(DEPDIR) to its actual value in the - # expansion. - for file in `sed -n " - s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ - sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do - # Make sure the directory exists. - test -f "$dirpart/$file" && continue - fdir=`$as_dirname -- "$file" || -$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$file" : 'X\(//\)[^/]' \| \ - X"$file" : 'X\(//\)$' \| \ - X"$file" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - as_dir=$dirpart/$fdir; as_fn_mkdir_p - # echo "creating $dirpart/$file" - echo '# dummy' > "$dirpart/$file" - done - done -} - ;; - "libtool":C) - - # See if we are running on zsh, and set the options which allow our - # commands through without removal of \ escapes. - if test -n "${ZSH_VERSION+set}" ; then - setopt NO_GLOB_SUBST - fi - - cfgfile="${ofile}T" - trap "$RM \"$cfgfile\"; exit 1" 1 2 15 - $RM "$cfgfile" - - cat <<_LT_EOF >> "$cfgfile" -#! $SHELL - -# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. -# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION -# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: -# NOTE: Changes made to this file will be lost: look at ltmain.sh. -# -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, -# 2006, 2007, 2008, 2009, 2010 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 - -# Shell to use when invoking shell scripts. -SHELL=$lt_SHELL - -# An echo program that protects backslashes. -ECHO=$lt_ECHO - -# 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 - -# 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 - -# Whether to use a lock for old archive extraction. -lock_old_archive_extraction=$lock_old_archive_extraction - -# A C compiler. -LTCC=$lt_CC - -# LTCC compiler flags. -LTCFLAGS=$lt_CFLAGS - -# Take the output of nm and produce a listing of raw symbols and C names. -global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe - -# Transform the output of nm in a proper C declaration. -global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl - -# Transform the output of nm in a C name address pair. -global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address - -# Transform the output of nm in a C name address pair when lib prefix is needed. -global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix - -# The name of the directory that contains temporary libtool files. -objdir=$objdir - -# Used to examine libraries when file_magic_cmd begins with "file". -MAGIC_CMD=$MAGIC_CMD - -# Must we lock files when doing compilation? -need_locks=$lt_need_locks - -# Tool to manipulate archived DWARF debug symbol files on Mac OS X. -DSYMUTIL=$lt_DSYMUTIL - -# Tool to change global to local symbols on Mac OS X. -NMEDIT=$lt_NMEDIT - -# Tool to manipulate fat objects and archives on Mac OS X. -LIPO=$lt_LIPO - -# ldd/readelf like tool for Mach-O binaries on Mac OS X. -OTOOL=$lt_OTOOL - -# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. -OTOOL64=$lt_OTOOL64 - -# Old archive suffix (normally "a"). -libext=$libext - -# Shared library suffix (normally ".so"). -shrext_cmds=$lt_shrext_cmds - -# The commands to extract the exported symbol list from a shared archive. -extract_expsyms_cmds=$lt_extract_expsyms_cmds - -# Variables whose values should be saved in libtool wrapper scripts and -# restored at link time. -variables_saved_for_relink=$lt_variables_saved_for_relink - -# Do we need the "lib" prefix for modules? -need_lib_prefix=$need_lib_prefix - -# Do we need a version for libraries? -need_version=$need_version - -# Library versioning type. -version_type=$version_type - -# Shared library runtime path variable. -runpath_var=$runpath_var - -# Shared library path variable. -shlibpath_var=$shlibpath_var - -# Is shlibpath searched before the hard-coded library search path? -shlibpath_overrides_runpath=$shlibpath_overrides_runpath - -# Format of library name prefix. -libname_spec=$lt_libname_spec - -# List of archive names. First name is the real one, the rest are links. -# The last name is the one that the linker finds with -lNAME -library_names_spec=$lt_library_names_spec - -# The coded name of the library, if different from the real name. -soname_spec=$lt_soname_spec - -# Permission mode override for installation of shared libraries. -install_override_mode=$lt_install_override_mode - -# Command to use after installation of a shared archive. -postinstall_cmds=$lt_postinstall_cmds - -# Command to use after uninstallation of a shared archive. -postuninstall_cmds=$lt_postuninstall_cmds - -# Commands used to finish a libtool library installation in a directory. -finish_cmds=$lt_finish_cmds - -# As "finish_cmds", except a single script fragment to be evaled but -# not shown. -finish_eval=$lt_finish_eval - -# Whether we should hardcode library paths into libraries. -hardcode_into_libs=$hardcode_into_libs - -# Compile-time system search path for libraries. -sys_lib_search_path_spec=$lt_sys_lib_search_path_spec - -# Run-time system search path for libraries. -sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec - -# Whether dlopen is supported. -dlopen_support=$enable_dlopen - -# Whether dlopen of programs is supported. -dlopen_self=$enable_dlopen_self - -# Whether dlopen of statically linked programs is supported. -dlopen_self_static=$enable_dlopen_self_static - -# Commands to strip libraries. -old_striplib=$lt_old_striplib -striplib=$lt_striplib - - -# The linker used to build libraries. -LD=$lt_LD - -# How to create reloadable object files. -reload_flag=$lt_reload_flag -reload_cmds=$lt_reload_cmds - -# Commands used to build an old-style archive. -old_archive_cmds=$lt_old_archive_cmds - -# A language specific compiler. -CC=$lt_compiler - -# Is the compiler the GNU compiler? -with_gcc=$GCC - -# Compiler flag to turn off builtin functions. -no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag - -# 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 "${1}" | $SED "$dirname"` - if test "X$func_dirname_result" = "X${1}"; then - func_dirname_result="${3}" - else - func_dirname_result="$func_dirname_result${2}" - fi -} - -# func_basename file -func_basename () -{ - func_basename_result=`$ECHO "${1}" | $SED "$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 "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; - *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; 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 "${1}" | $SED "$my_sed_long_opt"` - func_opt_split_arg=`$ECHO "${1}" | $SED "$my_sed_long_arg"` -} - -# func_lo2o object -func_lo2o () -{ - func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` -} - -# func_xform libobj-or-source -func_xform () -{ - func_xform_result=`$ECHO "${1}" | $SED '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 - - -as_fn_exit 0 diff --git a/impl/antlr/libantlr3c-3.4/config.sub b/impl/antlr/libantlr3c-3.4/config.sub deleted file mode 100755 index 2a55a50..0000000 --- a/impl/antlr/libantlr3c-3.4/config.sub +++ /dev/null @@ -1,1705 +0,0 @@ -#! /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, 2009 -# Free Software Foundation, Inc. - -timestamp='2009-11-20' - -# 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 . Submit a context -# diff and a properly formatted GNU ChangeLog entry. -# -# Configuration subroutine to validate and canonicalize a configuration type. -# Supply the specified configuration type as an argument. -# If it is invalid, we print an error message on stderr and exit with code 1. -# Otherwise, we print the canonical config type on stdout and succeed. - -# You can get the latest version of this script from: -# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD - -# This file is supposed to be the same for all GNU packages -# and recognize all the CPU types, system types and aliases -# that are meaningful with *any* GNU software. -# Each package is responsible for reporting which valid configurations -# it does not support. The user should be able to distinguish -# a failure to support a valid configuration from a meaningless -# configuration. - -# The goal of this file is to map all the various variations of a given -# machine specification into a single specification in the form: -# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM -# or in some cases, the newer four-part form: -# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM -# It is wrong to echo any other type of specification. - -me=`echo "$0" | sed -e 's,.*/,,'` - -usage="\ -Usage: $0 [OPTION] CPU-MFR-OPSYS - $0 [OPTION] ALIAS - -Canonicalize a configuration name. - -Operation modes: - -h, --help print this help, then exit - -t, --time-stamp print date of last modification, then exit - -v, --version print version number, then exit - -Report bugs and patches to ." - -version="\ -GNU config.sub ($timestamp) - -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, -2002, 2003, 2004, 2005, 2006, 2007, 2008 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 | -microblaze) - os= - basic_machine=$1 - ;; - -bluegene*) - os=-cnk - ;; - -sim | -cisco | -oki | -wec | -winbond) - os= - basic_machine=$1 - ;; - -scout) - ;; - -wrs) - os=-vxworks - basic_machine=$1 - ;; - -chorusos*) - os=-chorusos - basic_machine=$1 - ;; - -chorusrdb) - os=-chorusrdb - basic_machine=$1 - ;; - -hiux*) - os=-hiuxwe2 - ;; - -sco6) - os=-sco5v6 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco5) - os=-sco3.2v5 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco4) - os=-sco3.2v4 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco3.2.[4-9]*) - os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco3.2v[4-9]*) - # Don't forget version if it is 3.2v4 or newer. - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco5v6*) - # Don't forget version if it is 3.2v4 or newer. - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco*) - os=-sco3.2v2 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -udk*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -isc) - os=-isc2.2 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -clix*) - basic_machine=clipper-intergraph - ;; - -isc*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -lynx*) - os=-lynxos - ;; - -ptx*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` - ;; - -windowsnt*) - os=`echo $os | sed -e 's/windowsnt/winnt/'` - ;; - -psos*) - os=-psos - ;; - -mint | -mint[0-9]*) - basic_machine=m68k-atari - os=-mint - ;; -esac - -# Decode aliases for certain CPU-COMPANY combinations. -case $basic_machine in - # Recognize the basic CPU types without company name. - # Some are omitted here because they have special meanings below. - 1750a | 580 \ - | a29k \ - | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ - | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ - | am33_2.0 \ - | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ - | 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 \ - | moxie \ - | mt \ - | msp430 \ - | nios | nios2 \ - | ns16k | ns32k \ - | or32 \ - | pdp10 | pdp11 | pj | pjl \ - | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ - | pyramid \ - | rx \ - | score \ - | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ - | sh64 | sh64le \ - | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ - | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ - | spu | strongarm \ - | tahoe | thumb | tic4x | tic80 | tron \ - | ubicom32 \ - | v850 | v850e \ - | we32k \ - | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ - | z8k | z80) - basic_machine=$basic_machine-unknown - ;; - m6811 | m68hc11 | m6812 | m68hc12 | picochip) - # 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-* | microblaze-* \ - | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ - | mips16-* \ - | mips64-* | mips64el-* \ - | mips64octeon-* | mips64octeonel-* \ - | mips64orion-* | mips64orionel-* \ - | mips64r5900-* | mips64r5900el-* \ - | mips64vr-* | mips64vrel-* \ - | mips64vr4100-* | mips64vr4100el-* \ - | mips64vr4300-* | mips64vr4300el-* \ - | mips64vr5000-* | mips64vr5000el-* \ - | mips64vr5900-* | mips64vr5900el-* \ - | mipsisa32-* | mipsisa32el-* \ - | mipsisa32r2-* | mipsisa32r2el-* \ - | mipsisa64-* | mipsisa64el-* \ - | mipsisa64r2-* | mipsisa64r2el-* \ - | mipsisa64sb1-* | mipsisa64sb1el-* \ - | mipsisa64sr71k-* | mipsisa64sr71kel-* \ - | mipstx39-* | mipstx39el-* \ - | mmix-* \ - | mt-* \ - | msp430-* \ - | nios-* | nios2-* \ - | none-* | np1-* | ns16k-* | ns32k-* \ - | orion-* \ - | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ - | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ - | pyramid-* \ - | romp-* | rs6000-* | rx-* \ - | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ - | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ - | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ - | sparclite-* \ - | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ - | tahoe-* | thumb-* \ - | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \ - | tron-* \ - | ubicom32-* \ - | 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 - ;; - bluegene*) - basic_machine=powerpc-ibm - os=-cnk - ;; - 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 - ;; - microblaze) - basic_machine=microblaze-xilinx - ;; - mingw32) - basic_machine=i386-pc - os=-mingw32 - ;; - mingw32ce) - basic_machine=arm-unknown - os=-mingw32ce - ;; - miniframe) - basic_machine=m68000-convergent - ;; - *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) - basic_machine=m68k-atari - os=-mint - ;; - mips3*-*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` - ;; - mips3*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown - ;; - monitor) - basic_machine=m68k-rom68k - os=-coff - ;; - morphos) - basic_machine=powerpc-unknown - os=-morphos - ;; - msdos) - basic_machine=i386-pc - os=-msdos - ;; - ms1-*) - basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` - ;; - 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. - -auroraux) - os=-auroraux - ;; - -solaris1 | -solaris1.*) - os=`echo $os | sed -e 's|solaris1|sunos4|'` - ;; - -solaris) - os=-solaris2 - ;; - -svr4*) - os=-sysv4 - ;; - -unixware*) - os=-sysv4.2uw - ;; - -gnu/linux*) - os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` - ;; - # First accept the basic system types. - # The portable systems comes first. - # Each alternative MUST END IN A *, to match a version number. - # -sysv* is not here because it comes later, after sysvr4. - -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ - | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ - | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ - | -sym* | -kopensolaris* \ - | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ - | -aos* | -aros* \ - | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ - | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ - | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ - | -openbsd* | -solidbsd* \ - | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ - | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ - | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ - | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ - | -chorusos* | -chorusrdb* | -cegcc* \ - | -cygwin* | -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* | -es*) - # Remember, each alternative MUST END IN *, to match a version number. - ;; - -qnx*) - case $basic_machine in - x86-* | i*86-*) - ;; - *) - os=-nto$os - ;; - esac - ;; - -nto-qnx*) - ;; - -nto*) - os=`echo $os | sed -e 's|nto|nto-qnx|'` - ;; - -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ - | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ - | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) - ;; - -mac*) - os=`echo $os | sed -e 's|mac|macos|'` - ;; - -linux-dietlibc) - os=-linux-dietlibc - ;; - -linux*) - os=`echo $os | sed -e 's|linux|linux-gnu|'` - ;; - -sunos5*) - os=`echo $os | sed -e 's|sunos5|solaris2|'` - ;; - -sunos6*) - os=`echo $os | sed -e 's|sunos6|solaris3|'` - ;; - -opened*) - os=-openedition - ;; - -os400*) - os=-os400 - ;; - -wince*) - os=-wince - ;; - -osfrose*) - os=-osfrose - ;; - -osf*) - os=-osf - ;; - -utek*) - os=-bsd - ;; - -dynix*) - os=-bsd - ;; - -acis*) - os=-aos - ;; - -atheos*) - os=-atheos - ;; - -syllable*) - os=-syllable - ;; - -386bsd) - os=-bsd - ;; - -ctix* | -uts*) - os=-sysv - ;; - -nova*) - os=-rtmk-nova - ;; - -ns2 ) - os=-nextstep2 - ;; - -nsk*) - os=-nsk - ;; - # Preserve the version number of sinix5. - -sinix5.*) - os=`echo $os | sed -e 's|sinix|sysv|'` - ;; - -sinix*) - os=-sysv4 - ;; - -tpf*) - os=-tpf - ;; - -triton*) - os=-sysv3 - ;; - -oss*) - os=-sysv3 - ;; - -svr4) - os=-sysv4 - ;; - -svr3) - os=-sysv3 - ;; - -sysvr4) - os=-sysv4 - ;; - # This must come after -sysvr4. - -sysv*) - ;; - -ose*) - os=-ose - ;; - -es1800*) - os=-ose - ;; - -xenix) - os=-xenix - ;; - -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) - os=-mint - ;; - -aros*) - os=-aros - ;; - -kaos*) - os=-kaos - ;; - -zvmoe) - os=-zvmoe - ;; - -dicos*) - os=-dicos - ;; - -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 - ;; - -cnk*|-aix*) - vendor=ibm - ;; - -beos*) - vendor=be - ;; - -hpux*) - vendor=hp - ;; - -mpeix*) - vendor=hp - ;; - -hiux*) - vendor=hitachi - ;; - -unos*) - vendor=crds - ;; - -dgux*) - vendor=dg - ;; - -luna*) - vendor=omron - ;; - -genix*) - vendor=ns - ;; - -mvs* | -opened*) - vendor=ibm - ;; - -os400*) - vendor=ibm - ;; - -ptx*) - vendor=sequent - ;; - -tpf*) - vendor=ibm - ;; - -vxsim* | -vxworks* | -windiss*) - vendor=wrs - ;; - -aux*) - vendor=apple - ;; - -hms*) - vendor=hitachi - ;; - -mpw* | -macos*) - vendor=apple - ;; - -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) - vendor=atari - ;; - -vos*) - vendor=stratus - ;; - esac - basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` - ;; -esac - -echo $basic_machine$os -exit - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "timestamp='" -# time-stamp-format: "%:y-%02m-%02d" -# time-stamp-end: "'" -# End: diff --git a/impl/antlr/libantlr3c-3.4/configure b/impl/antlr/libantlr3c-3.4/configure deleted file mode 100755 index c548a98..0000000 --- a/impl/antlr/libantlr3c-3.4/configure +++ /dev/null @@ -1,13527 +0,0 @@ -#! /bin/sh -# Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.66 for libantlr3c 3.4. -# -# Report bugs to . -# -# -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software -# Foundation, Inc. -# -# -# This configure script is free software; the Free Software Foundation -# gives unlimited permission to copy, distribute and modify it. -# -# -# (The "BSD licence") -# Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC -# http://www.temporal-wave.com -# http://www.linkedin.com/in/jimidle -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# -## -------------------- ## -## M4sh Initialization. ## -## -------------------- ## - -# Be more Bourne compatible -DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in #( - *posix*) : - set -o posix ;; #( - *) : - ;; -esac -fi - - -as_nl=' -' -export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -# Prefer a ksh shell builtin over an external printf program on Solaris, -# but without wasting forks for bash or zsh. -if test -z "$BASH_VERSION$ZSH_VERSION" \ - && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='print -r --' - as_echo_n='print -rn --' -elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in #( - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' -fi - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - PATH_SEPARATOR=: - (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { - (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || - PATH_SEPARATOR=';' - } -fi - - -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -IFS=" "" $as_nl" - -# Find who we are. Look in the path if we contain no directory separator. -case $0 in #(( - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break - done -IFS=$as_save_IFS - - ;; -esac -# We did not find ourselves, most probably we were run as `sh COMMAND' -# in which case we are not to be found in the path. -if test "x$as_myself" = x; then - as_myself=$0 -fi -if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - exit 1 -fi - -# Unset variables that we do not need and which cause bugs (e.g. in -# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" -# suppresses any "Segmentation fault" message there. '((' could -# trigger a bug in pdksh 5.2.14. -for as_var in BASH_ENV ENV MAIL MAILPATH -do eval test x\${$as_var+set} = xset \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -if test "x$CONFIG_SHELL" = x; then - as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which - # is contrary to our usage. Disable this feature. - alias -g '\${1+\"\$@\"}'='\"\$@\"' - setopt NO_GLOB_SUBST -else - case \`(set -o) 2>/dev/null\` in #( - *posix*) : - set -o posix ;; #( - *) : - ;; -esac -fi -" - as_required="as_fn_return () { (exit \$1); } -as_fn_success () { as_fn_return 0; } -as_fn_failure () { as_fn_return 1; } -as_fn_ret_success () { return 0; } -as_fn_ret_failure () { return 1; } - -exitcode=0 -as_fn_success || { exitcode=1; echo as_fn_success failed.; } -as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } -as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } -as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } -if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : - -else - exitcode=1; echo positional parameters were not saved. -fi -test x\$exitcode = x0 || exit 1" - as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO - as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO - eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && - test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 - - test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || ( - ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' - ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO - ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO - PATH=/empty FPATH=/empty; export PATH FPATH - test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ - || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1 -test \$(( 1 + 1 )) = 2 || exit 1" - if (eval "$as_required") 2>/dev/null; then : - as_have_required=yes -else - as_have_required=no -fi - if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : - -else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -as_found=false -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - as_found=: - case $as_dir in #( - /*) - for as_base in sh bash ksh sh5; do - # Try only shells that exist, to save several forks. - as_shell=$as_dir/$as_base - if { test -f "$as_shell" || test -f "$as_shell.exe"; } && - { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : - CONFIG_SHELL=$as_shell as_have_required=yes - if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : - break 2 -fi -fi - done;; - esac - as_found=false -done -$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && - { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : - CONFIG_SHELL=$SHELL as_have_required=yes -fi; } -IFS=$as_save_IFS - - - if test "x$CONFIG_SHELL" != x; then : - # We cannot yet assume a decent shell, so we have to provide a - # neutralization value for shells without unset; and this also - # works around shells that cannot unset nonexistent variables. - BASH_ENV=/dev/null - ENV=/dev/null - (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} -fi - - if test x$as_have_required = xno; then : - $as_echo "$0: This script requires a shell more modern than all" - $as_echo "$0: the shells that I found on your system." - if test x${ZSH_VERSION+set} = xset ; then - $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" - $as_echo "$0: be upgraded to zsh 4.3.4 or later." - else - $as_echo "$0: Please tell bug-autoconf@gnu.org and -$0: jimi@temporal-wave.com about your system, including any -$0: error possibly output before this message. Then install -$0: a modern shell, or manually run the script under such a -$0: shell if you do have one." - fi - exit 1 -fi -fi -fi -SHELL=${CONFIG_SHELL-/bin/sh} -export SHELL -# Unset more variables known to interfere with behavior of common tools. -CLICOLOR_FORCE= GREP_OPTIONS= -unset CLICOLOR_FORCE GREP_OPTIONS - -## --------------------- ## -## M4sh Shell Functions. ## -## --------------------- ## -# as_fn_unset VAR -# --------------- -# Portably unset VAR. -as_fn_unset () -{ - { eval $1=; unset $1;} -} -as_unset=as_fn_unset - -# as_fn_set_status STATUS -# ----------------------- -# Set $? to STATUS, without forking. -as_fn_set_status () -{ - return $1 -} # as_fn_set_status - -# as_fn_exit STATUS -# ----------------- -# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. -as_fn_exit () -{ - set +e - as_fn_set_status $1 - exit $1 -} # as_fn_exit - -# as_fn_mkdir_p -# ------------- -# Create "$as_dir" as a directory, including parents if necessary. -as_fn_mkdir_p () -{ - - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || eval $as_mkdir_p || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( - *) as_qdir=$as_dir;; - esac - as_dirs="'$as_qdir' $as_dirs" - as_dir=`$as_dirname -- "$as_dir" || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - test -d "$as_dir" && break - done - test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" - - -} # as_fn_mkdir_p -# as_fn_append VAR VALUE -# ---------------------- -# Append the text in VALUE to the end of the definition contained in VAR. Take -# advantage of any shell optimizations that allow amortized linear growth over -# repeated appends, instead of the typical quadratic growth present in naive -# implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : - eval 'as_fn_append () - { - eval $1+=\$2 - }' -else - as_fn_append () - { - eval $1=\$$1\$2 - } -fi # as_fn_append - -# as_fn_arith ARG... -# ------------------ -# Perform arithmetic evaluation on the ARGs, and store the result in the -# global $as_val. Take advantage of shells that can avoid forks. The arguments -# must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : - eval 'as_fn_arith () - { - as_val=$(( $* )) - }' -else - as_fn_arith () - { - as_val=`expr "$@" || test $? -eq 1` - } -fi # as_fn_arith - - -# as_fn_error STATUS ERROR [LINENO LOG_FD] -# ---------------------------------------- -# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are -# provided, also output the error to LOG_FD, referencing LINENO. Then exit the -# script with STATUS, using 1 if that was 0. -as_fn_error () -{ - as_status=$1; test $as_status -eq 0 && as_status=1 - if test "$4"; then - as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 - fi - $as_echo "$as_me: error: $2" >&2 - as_fn_exit $as_status -} # as_fn_error - -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - - - as_lineno_1=$LINENO as_lineno_1a=$LINENO - as_lineno_2=$LINENO as_lineno_2a=$LINENO - eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && - test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { - # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) - sed -n ' - p - /[$]LINENO/= - ' <$as_myself | - sed ' - s/[$]LINENO.*/&-/ - t lineno - b - :lineno - N - :loop - s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ - t loop - s/-\n.*// - ' >$as_me.lineno && - chmod +x "$as_me.lineno" || - { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } - - # Don't try to exec as it changes $[0], causing all sort of problems - # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensitive to this). - . "./$as_me.lineno" - # Exit status is that of the last command. - exit -} - -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in #((((( --n*) - case `echo 'xy\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - xy) ECHO_C='\c';; - *) echo `echo ksh88 bug on AIX 6.1` > /dev/null - ECHO_T=' ';; - esac;; -*) - ECHO_N='-n';; -esac - -rm -f conf$$ conf$$.exe conf$$.file -if test -d conf$$.dir; then - rm -f conf$$.dir/conf$$.file -else - rm -f conf$$.dir - mkdir conf$$.dir 2>/dev/null -fi -if (echo >conf$$.file) 2>/dev/null; then - if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' - elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln - else - as_ln_s='cp -p' - fi -else - as_ln_s='cp -p' -fi -rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -rmdir conf$$.dir 2>/dev/null - -if mkdir -p . 2>/dev/null; then - as_mkdir_p='mkdir -p "$as_dir"' -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in #( - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - -SHELL=${CONFIG_SHELL-/bin/sh} - - -test -n "$DJDIR" || exec 7<&0 &1 - -# Name of the host. -# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, -# so uname gets run too. -ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` - -# -# Initializations. -# -ac_default_prefix=/usr/local -ac_clean_files= -ac_config_libobj_dir=. -LIBOBJS= -cross_compiling=no -subdirs= -MFLAGS= -MAKEFLAGS= - -# Identity of this package. -PACKAGE_NAME='libantlr3c' -PACKAGE_TARNAME='libantlr3c' -PACKAGE_VERSION='3.4' -PACKAGE_STRING='libantlr3c 3.4' -PACKAGE_BUGREPORT='jimi@temporal-wave.com' -PACKAGE_URL='' - -ac_unique_file="src/antlr3parser.c" -# Factoring default headers for most tests. -ac_includes_default="\ -#include -#ifdef HAVE_SYS_TYPES_H -# include -#endif -#ifdef HAVE_SYS_STAT_H -# include -#endif -#ifdef STDC_HEADERS -# include -# include -#else -# ifdef HAVE_STDLIB_H -# include -# endif -#endif -#ifdef HAVE_STRING_H -# if !defined STDC_HEADERS && defined HAVE_MEMORY_H -# include -# endif -# include -#endif -#ifdef HAVE_STRINGS_H -# include -#endif -#ifdef HAVE_INTTYPES_H -# include -#endif -#ifdef HAVE_STDINT_H -# include -#endif -#ifdef HAVE_UNISTD_H -# include -#endif" - -ac_subst_vars='am__EXEEXT_FALSE -am__EXEEXT_TRUE -LTLIBOBJS -LIBOBJS -OBJECT_MODE -CPP -OTOOL64 -OTOOL -LIPO -NMEDIT -DSYMUTIL -RANLIB -AR -OBJDUMP -LN_S -NM -ac_ct_DUMPBIN -DUMPBIN -LD -FGREP -EGREP -GREP -SED -host_os -host_vendor -host_cpu -host -build_os -build_vendor -build_cpu -build -LIBTOOL -MAINT -MAINTAINER_MODE_FALSE -MAINTAINER_MODE_TRUE -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 -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_URL -PACKAGE_BUGREPORT -PACKAGE_STRING -PACKAGE_VERSION -PACKAGE_TARNAME -PACKAGE_NAME -PATH_SEPARATOR -SHELL' -ac_subst_files='' -ac_user_opts=' -enable_option_checking -enable_debuginfo -enable_64bit -enable_abiflags -enable_antlrdebug -enable_dependency_tracking -enable_maintainer_mode -enable_shared -enable_static -with_pic -enable_fast_install -with_gnu_ld -enable_libtool_lock -' - 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_fn_error $? "invalid feature name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"enable_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval enable_$ac_useropt=no ;; - - -docdir | --docdir | --docdi | --doc | --do) - ac_prev=docdir ;; - -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) - docdir=$ac_optarg ;; - - -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) - ac_prev=dvidir ;; - -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) - dvidir=$ac_optarg ;; - - -enable-* | --enable-*) - ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"enable_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval enable_$ac_useropt=\$ac_optarg ;; - - -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ - | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ - | --exec | --exe | --ex) - ac_prev=exec_prefix ;; - -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ - | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ - | --exec=* | --exe=* | --ex=*) - exec_prefix=$ac_optarg ;; - - -gas | --gas | --ga | --g) - # Obsolete; use --with-gas. - with_gas=yes ;; - - -help | --help | --hel | --he | -h) - ac_init_help=long ;; - -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) - ac_init_help=recursive ;; - -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) - ac_init_help=short ;; - - -host | --host | --hos | --ho) - ac_prev=host_alias ;; - -host=* | --host=* | --hos=* | --ho=*) - host_alias=$ac_optarg ;; - - -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) - ac_prev=htmldir ;; - -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ - | --ht=*) - htmldir=$ac_optarg ;; - - -includedir | --includedir | --includedi | --included | --include \ - | --includ | --inclu | --incl | --inc) - ac_prev=includedir ;; - -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ - | --includ=* | --inclu=* | --incl=* | --inc=*) - includedir=$ac_optarg ;; - - -infodir | --infodir | --infodi | --infod | --info | --inf) - ac_prev=infodir ;; - -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) - infodir=$ac_optarg ;; - - -libdir | --libdir | --libdi | --libd) - ac_prev=libdir ;; - -libdir=* | --libdir=* | --libdi=* | --libd=*) - libdir=$ac_optarg ;; - - -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ - | --libexe | --libex | --libe) - ac_prev=libexecdir ;; - -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ - | --libexe=* | --libex=* | --libe=*) - libexecdir=$ac_optarg ;; - - -localedir | --localedir | --localedi | --localed | --locale) - ac_prev=localedir ;; - -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) - localedir=$ac_optarg ;; - - -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst | --locals) - ac_prev=localstatedir ;; - -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) - localstatedir=$ac_optarg ;; - - -mandir | --mandir | --mandi | --mand | --man | --ma | --m) - ac_prev=mandir ;; - -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) - mandir=$ac_optarg ;; - - -nfp | --nfp | --nf) - # Obsolete; use --without-fp. - with_fp=no ;; - - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c | -n) - no_create=yes ;; - - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) - no_recursion=yes ;; - - -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ - | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ - | --oldin | --oldi | --old | --ol | --o) - ac_prev=oldincludedir ;; - -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ - | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ - | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) - oldincludedir=$ac_optarg ;; - - -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) - ac_prev=prefix ;; - -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) - prefix=$ac_optarg ;; - - -program-prefix | --program-prefix | --program-prefi | --program-pref \ - | --program-pre | --program-pr | --program-p) - ac_prev=program_prefix ;; - -program-prefix=* | --program-prefix=* | --program-prefi=* \ - | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) - program_prefix=$ac_optarg ;; - - -program-suffix | --program-suffix | --program-suffi | --program-suff \ - | --program-suf | --program-su | --program-s) - ac_prev=program_suffix ;; - -program-suffix=* | --program-suffix=* | --program-suffi=* \ - | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) - program_suffix=$ac_optarg ;; - - -program-transform-name | --program-transform-name \ - | --program-transform-nam | --program-transform-na \ - | --program-transform-n | --program-transform- \ - | --program-transform | --program-transfor \ - | --program-transfo | --program-transf \ - | --program-trans | --program-tran \ - | --progr-tra | --program-tr | --program-t) - ac_prev=program_transform_name ;; - -program-transform-name=* | --program-transform-name=* \ - | --program-transform-nam=* | --program-transform-na=* \ - | --program-transform-n=* | --program-transform-=* \ - | --program-transform=* | --program-transfor=* \ - | --program-transfo=* | --program-transf=* \ - | --program-trans=* | --program-tran=* \ - | --progr-tra=* | --program-tr=* | --program-t=*) - program_transform_name=$ac_optarg ;; - - -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) - ac_prev=pdfdir ;; - -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) - pdfdir=$ac_optarg ;; - - -psdir | --psdir | --psdi | --psd | --ps) - ac_prev=psdir ;; - -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) - psdir=$ac_optarg ;; - - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - silent=yes ;; - - -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) - ac_prev=sbindir ;; - -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ - | --sbi=* | --sb=*) - sbindir=$ac_optarg ;; - - -sharedstatedir | --sharedstatedir | --sharedstatedi \ - | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ - | --sharedst | --shareds | --shared | --share | --shar \ - | --sha | --sh) - ac_prev=sharedstatedir ;; - -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ - | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ - | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ - | --sha=* | --sh=*) - sharedstatedir=$ac_optarg ;; - - -site | --site | --sit) - ac_prev=site ;; - -site=* | --site=* | --sit=*) - site=$ac_optarg ;; - - -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) - ac_prev=srcdir ;; - -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) - srcdir=$ac_optarg ;; - - -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ - | --syscon | --sysco | --sysc | --sys | --sy) - ac_prev=sysconfdir ;; - -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ - | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) - sysconfdir=$ac_optarg ;; - - -target | --target | --targe | --targ | --tar | --ta | --t) - ac_prev=target_alias ;; - -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) - target_alias=$ac_optarg ;; - - -v | -verbose | --verbose | --verbos | --verbo | --verb) - verbose=yes ;; - - -version | --version | --versio | --versi | --vers | -V) - ac_init_version=: ;; - - -with-* | --with-*) - ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"with_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval with_$ac_useropt=\$ac_optarg ;; - - -without-* | --without-*) - ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: $ac_useropt" - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"with_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval with_$ac_useropt=no ;; - - --x) - # Obsolete; use --with-x. - with_x=yes ;; - - -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ - | --x-incl | --x-inc | --x-in | --x-i) - ac_prev=x_includes ;; - -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ - | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) - x_includes=$ac_optarg ;; - - -x-libraries | --x-libraries | --x-librarie | --x-librari \ - | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) - ac_prev=x_libraries ;; - -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ - | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) - x_libraries=$ac_optarg ;; - - -*) as_fn_error $? "unrecognized option: \`$ac_option' -Try \`$0 --help' for more information" - ;; - - *=*) - ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` - # Reject names that are not valid shell variable names. - case $ac_envvar in #( - '' | [0-9]* | *[!_$as_cr_alnum]* ) - as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; - esac - eval $ac_envvar=\$ac_optarg - export $ac_envvar ;; - - *) - # FIXME: should be removed in autoconf 3.0. - $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 - expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 - : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} - ;; - - esac -done - -if test -n "$ac_prev"; then - ac_option=--`echo $ac_prev | sed 's/_/-/g'` - as_fn_error $? "missing argument to $ac_option" -fi - -if test -n "$ac_unrecognized_opts"; then - case $enable_option_checking in - no) ;; - fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; - *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; - esac -fi - -# Check all directory arguments for consistency. -for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ - datadir sysconfdir sharedstatedir localstatedir includedir \ - oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir -do - eval ac_val=\$$ac_var - # Remove trailing slashes. - case $ac_val in - */ ) - ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` - eval $ac_var=\$ac_val;; - esac - # Be sure to have absolute directory names. - case $ac_val in - [\\/$]* | ?:[\\/]* ) continue;; - NONE | '' ) case $ac_var in *prefix ) continue;; esac;; - esac - as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" -done - -# There might be people who depend on the old broken behavior: `$host' -# used to hold the argument of --host etc. -# FIXME: To remove some day. -build=$build_alias -host=$host_alias -target=$target_alias - -# FIXME: To remove some day. -if test "x$host_alias" != x; then - if test "x$build_alias" = x; then - cross_compiling=maybe - $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host. - If a cross compiler is detected then cross compile mode will be used" >&2 - elif test "x$build_alias" != "x$host_alias"; then - cross_compiling=yes - fi -fi - -ac_tool_prefix= -test -n "$host_alias" && ac_tool_prefix=$host_alias- - -test "$silent" = yes && exec 6>/dev/null - - -ac_pwd=`pwd` && test -n "$ac_pwd" && -ac_ls_di=`ls -di .` && -ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || - as_fn_error $? "working directory cannot be determined" -test "X$ac_ls_di" = "X$ac_pwd_ls_di" || - as_fn_error $? "pwd does not report name of working directory" - - -# Find the source files, if location was not specified. -if test -z "$srcdir"; then - ac_srcdir_defaulted=yes - # Try the directory containing this script, then the parent directory. - ac_confdir=`$as_dirname -- "$as_myself" || -$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_myself" : 'X\(//\)[^/]' \| \ - X"$as_myself" : 'X\(//\)$' \| \ - X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_myself" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - srcdir=$ac_confdir - if test ! -r "$srcdir/$ac_unique_file"; then - srcdir=.. - fi -else - ac_srcdir_defaulted=no -fi -if test ! -r "$srcdir/$ac_unique_file"; then - test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." - as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" -fi -ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" -ac_abs_confdir=`( - cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" - pwd)` -# When building in place, set srcdir=. -if test "$ac_abs_confdir" = "$ac_pwd"; then - srcdir=. -fi -# Remove unnecessary trailing slashes from srcdir. -# Double slashes in file names in object file debugging info -# mess up M-x gdb in Emacs. -case $srcdir in -*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; -esac -for ac_var in $ac_precious_vars; do - eval ac_env_${ac_var}_set=\${${ac_var}+set} - eval ac_env_${ac_var}_value=\$${ac_var} - eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} - eval ac_cv_env_${ac_var}_value=\$${ac_var} -done - -# -# Report the --help message. -# -if test "$ac_init_help" = "long"; then - # Omit some internal or obsolete options to make the list less imposing. - # This message is too long to be a string in the A/UX 3.1 sh. - cat <<_ACEOF -\`configure' configures libantlr3c 3.4 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/libantlr3c] - --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 libantlr3c 3.4:";; - 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-debuginfo Compiles debug info into the library (default - --disable-debuginfo) - --enable-64bit Turns on flags that produce 64 bit object code if - any are required (default --disable-64bit) - --disable-abiflags Does not add ABI flags -m32 or -m64 for older - versions of gcc, such as itanium 3.x (default - --enable-abiflags=yes) - --disable-antlrdebug Turns off default flags that include the antlr - debugger in the runtime. Specify to remove debugger - and the socket dependancies (default - --enable-antlrdebug) - --disable-dependency-tracking speeds up one-time build - --enable-dependency-tracking do not reject slow dependency extractors - --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-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] - -Some influential environment variables: - CC C compiler command - CFLAGS C compiler flags - LDFLAGS linker flags, e.g. -L if you have libraries in a - nonstandard directory - LIBS libraries to pass to the linker, e.g. -l - CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if - you have headers in a nonstandard directory - CPP C preprocessor - -Use these variables to override the choices made by `configure' or to help -it to find libraries and programs with nonstandard names/locations. - -Report bugs to . -_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 -libantlr3c configure 3.4 -generated by GNU Autoconf 2.66 - -Copyright (C) 2010 Free Software Foundation, Inc. -This configure script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it. - - - (The "BSD licence") - Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC - http://www.temporal-wave.com - http://www.linkedin.com/in/jimidle - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - 3. The name of the author may not be used to endorse or promote products - derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -_ACEOF - exit -fi - -## ------------------------ ## -## Autoconf initialization. ## -## ------------------------ ## - -# ac_fn_c_try_compile LINENO -# -------------------------- -# Try to compile conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_compile () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext - if { { ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compile") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} - as_fn_set_status $ac_retval - -} # ac_fn_c_try_compile - -# ac_fn_c_try_link LINENO -# ----------------------- -# Try to link conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_link () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext conftest$ac_exeext - if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information - # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would - # interfere with the next link command; also delete a directory that is - # left behind by Apple's compiler. We do this before executing the actions. - rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} - as_fn_set_status $ac_retval - -} # ac_fn_c_try_link - -# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES -# ------------------------------------------------------- -# Tests whether HEADER exists and can be compiled using the include files in -# INCLUDES, setting the cache variable VAR accordingly. -ac_fn_c_check_header_compile () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval "test \"\${$3+set}\"" = set; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -#include <$2> -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - eval "$3=yes" -else - eval "$3=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} - -} # ac_fn_c_check_header_compile - -# ac_fn_c_try_cpp LINENO -# ---------------------- -# Try to preprocess conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_cpp () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { { ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} - as_fn_set_status $ac_retval - -} # ac_fn_c_try_cpp - -# ac_fn_c_try_run LINENO -# ---------------------- -# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes -# that executables *can* be run. -ac_fn_c_try_run () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' - { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then : - ac_retval=0 -else - $as_echo "$as_me: program exited with status $ac_status" >&5 - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=$ac_status -fi - rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} - as_fn_set_status $ac_retval - -} # ac_fn_c_try_run - -# ac_fn_c_check_func LINENO FUNC VAR -# ---------------------------------- -# Tests whether FUNC exists, setting the cache variable VAR accordingly -ac_fn_c_check_func () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval "test \"\${$3+set}\"" = set; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -/* Define $2 to an innocuous variant, in case declares $2. - For example, HP-UX 11i declares gettimeofday. */ -#define $2 innocuous_$2 - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $2 (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $2 - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $2 (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$2 || defined __stub___$2 -choke me -#endif - -int -main () -{ -return $2 (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - eval "$3=yes" -else - eval "$3=no" -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} - -} # ac_fn_c_check_func - -# ac_fn_c_check_type LINENO TYPE VAR INCLUDES -# ------------------------------------------- -# Tests whether TYPE exists after having included INCLUDES, setting cache -# variable VAR accordingly. -ac_fn_c_check_type () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval "test \"\${$3+set}\"" = set; then : - $as_echo_n "(cached) " >&6 -else - eval "$3=no" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -if (sizeof ($2)) - return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -if (sizeof (($2))) - return 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -else - eval "$3=yes" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} - -} # ac_fn_c_check_type - -# ac_fn_c_find_intX_t LINENO BITS VAR -# ----------------------------------- -# Finds a signed integer type with width BITS, setting cache variable VAR -# accordingly. -ac_fn_c_find_intX_t () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for int$2_t" >&5 -$as_echo_n "checking for int$2_t... " >&6; } -if eval "test \"\${$3+set}\"" = set; then : - $as_echo_n "(cached) " >&6 -else - eval "$3=no" - # Order is important - never check a type that is potentially smaller - # than half of the expected target width. - for ac_type in int$2_t 'int' 'long int' \ - 'long long int' 'short int' 'signed char'; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_includes_default - enum { N = $2 / 2 - 1 }; -int -main () -{ -static int test_array [1 - 2 * !(0 < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1))]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_includes_default - enum { N = $2 / 2 - 1 }; -int -main () -{ -static int test_array [1 - 2 * !(($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1) - < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 2))]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -else - case $ac_type in #( - int$2_t) : - eval "$3=yes" ;; #( - *) : - eval "$3=\$ac_type" ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - if eval test \"x\$"$3"\" = x"no"; then : - -else - break -fi - done -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} - -} # ac_fn_c_find_intX_t - -# ac_fn_c_find_uintX_t LINENO BITS VAR -# ------------------------------------ -# Finds an unsigned integer type with width BITS, setting cache variable VAR -# accordingly. -ac_fn_c_find_uintX_t () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uint$2_t" >&5 -$as_echo_n "checking for uint$2_t... " >&6; } -if eval "test \"\${$3+set}\"" = set; then : - $as_echo_n "(cached) " >&6 -else - eval "$3=no" - # Order is important - never check a type that is potentially smaller - # than half of the expected target width. - for ac_type in uint$2_t 'unsigned int' 'unsigned long int' \ - 'unsigned long long int' 'unsigned short int' 'unsigned char'; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !((($ac_type) -1 >> ($2 / 2 - 1)) >> ($2 / 2 - 1) == 3)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - case $ac_type in #( - uint$2_t) : - eval "$3=yes" ;; #( - *) : - eval "$3=\$ac_type" ;; -esac -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - if eval test \"x\$"$3"\" = x"no"; then : - -else - break -fi - done -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} - -} # ac_fn_c_find_uintX_t -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 libantlr3c $as_me 3.4, which was -generated by GNU Autoconf 2.66. Invocation command line was - - $ $0 $@ - -_ACEOF -exec 5>>config.log -{ -cat <<_ASUNAME -## --------- ## -## Platform. ## -## --------- ## - -hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` -uname -m = `(uname -m) 2>/dev/null || echo unknown` -uname -r = `(uname -r) 2>/dev/null || echo unknown` -uname -s = `(uname -s) 2>/dev/null || echo unknown` -uname -v = `(uname -v) 2>/dev/null || echo unknown` - -/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` -/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` - -/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` -/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` -/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` -/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` -/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` -/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` -/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` - -_ASUNAME - -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - $as_echo "PATH: $as_dir" - done -IFS=$as_save_IFS - -} >&5 - -cat >&5 <<_ACEOF - - -## ----------- ## -## Core tests. ## -## ----------- ## - -_ACEOF - - -# Keep a trace of the command line. -# Strip out --no-create and --no-recursion so they do not pile up. -# Strip out --silent because we don't want to record it for future runs. -# Also quote any args containing shell meta-characters. -# Make two passes to allow for proper duplicate-argument suppression. -ac_configure_args= -ac_configure_args0= -ac_configure_args1= -ac_must_keep_next=false -for ac_pass in 1 2 -do - for ac_arg - do - case $ac_arg in - -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - continue ;; - *\'*) - ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - case $ac_pass in - 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; - 2) - as_fn_append ac_configure_args1 " '$ac_arg'" - if test $ac_must_keep_next = true; then - ac_must_keep_next=false # Got value, back to normal. - else - case $ac_arg in - *=* | --config-cache | -C | -disable-* | --disable-* \ - | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ - | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ - | -with-* | --with-* | -without-* | --without-* | --x) - case "$ac_configure_args0 " in - "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; - esac - ;; - -* ) ac_must_keep_next=true ;; - esac - fi - as_fn_append ac_configure_args " '$ac_arg'" - ;; - esac - done -done -{ ac_configure_args0=; unset ac_configure_args0;} -{ ac_configure_args1=; unset ac_configure_args1;} - -# When interrupted or exit'd, cleanup temporary files, and complete -# config.log. We remove comments because anyway the quotes in there -# would cause problems or look ugly. -# WARNING: Use '\'' to represent an apostrophe within the trap. -# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. -trap 'exit_status=$? - # Save into config.log some information that might help in debugging. - { - echo - - $as_echo "## ---------------- ## -## Cache variables. ## -## ---------------- ##" - echo - # The following way of writing the cache mishandles newlines in values, -( - for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do - eval ac_val=\$$ac_var - case $ac_val in #( - *${as_nl}*) - case $ac_var in #( - *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( - *) { eval $ac_var=; unset $ac_var;} ;; - esac ;; - esac - done - (set) 2>&1 | - case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( - *${as_nl}ac_space=\ *) - sed -n \ - "s/'\''/'\''\\\\'\'''\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" - ;; #( - *) - sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" - ;; - esac | - sort -) - echo - - $as_echo "## ----------------- ## -## Output variables. ## -## ----------------- ##" - echo - for ac_var in $ac_subst_vars - do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - $as_echo "$ac_var='\''$ac_val'\''" - done | sort - echo - - if test -n "$ac_subst_files"; then - $as_echo "## ------------------- ## -## File substitutions. ## -## ------------------- ##" - echo - for ac_var in $ac_subst_files - do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - $as_echo "$ac_var='\''$ac_val'\''" - done | sort - echo - fi - - if test -s confdefs.h; then - $as_echo "## ----------- ## -## confdefs.h. ## -## ----------- ##" - echo - cat confdefs.h - echo - fi - test "$ac_signal" != 0 && - $as_echo "$as_me: caught signal $ac_signal" - $as_echo "$as_me: exit $exit_status" - } >&5 - rm -f core *.core core.conftest.* && - rm -f -r conftest* confdefs* conf$$* $ac_clean_files && - exit $exit_status -' 0 -for ac_signal in 1 2 13 15; do - trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal -done -ac_signal=0 - -# confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -f -r conftest* confdefs.h - -$as_echo "/* confdefs.h */" > confdefs.h - -# Predefined preprocessor variables. - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_NAME "$PACKAGE_NAME" -_ACEOF - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_TARNAME "$PACKAGE_TARNAME" -_ACEOF - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_VERSION "$PACKAGE_VERSION" -_ACEOF - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_STRING "$PACKAGE_STRING" -_ACEOF - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" -_ACEOF - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_URL "$PACKAGE_URL" -_ACEOF - - -# Let the site file select an alternate cache file if it wants to. -# Prefer an explicitly selected file to automatically selected ones. -ac_site_file1=NONE -ac_site_file2=NONE -if test -n "$CONFIG_SITE"; then - # We do not want a PATH search for config.site. - case $CONFIG_SITE in #(( - -*) ac_site_file1=./$CONFIG_SITE;; - */*) ac_site_file1=$CONFIG_SITE;; - *) ac_site_file1=./$CONFIG_SITE;; - esac -elif test "x$prefix" != xNONE; then - ac_site_file1=$prefix/share/config.site - ac_site_file2=$prefix/etc/config.site -else - ac_site_file1=$ac_default_prefix/share/config.site - ac_site_file2=$ac_default_prefix/etc/config.site -fi -for ac_site_file in "$ac_site_file1" "$ac_site_file2" -do - test "x$ac_site_file" = xNONE && continue - if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 -$as_echo "$as_me: loading site script $ac_site_file" >&6;} - sed 's/^/| /' "$ac_site_file" >&5 - . "$ac_site_file" \ - || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "failed to load site script $ac_site_file -See \`config.log' for more details" "$LINENO" 5; } - fi -done - -if test -r "$cache_file"; then - # Some versions of bash will fail to source /dev/null (special files - # actually), so we avoid doing that. DJGPP emulates it as a regular file. - if test /dev/null != "$cache_file" && test -f "$cache_file"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 -$as_echo "$as_me: loading cache $cache_file" >&6;} - case $cache_file in - [\\/]* | ?:[\\/]* ) . "$cache_file";; - *) . "./$cache_file";; - esac - fi -else - { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 -$as_echo "$as_me: creating cache $cache_file" >&6;} - >$cache_file -fi - -# Check that the precious variables saved in the cache have kept the same -# value. -ac_cache_corrupted=false -for ac_var in $ac_precious_vars; do - eval ac_old_set=\$ac_cv_env_${ac_var}_set - eval ac_new_set=\$ac_env_${ac_var}_set - eval ac_old_val=\$ac_cv_env_${ac_var}_value - eval ac_new_val=\$ac_env_${ac_var}_value - case $ac_old_set,$ac_new_set in - set,) - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,set) - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,);; - *) - if test "x$ac_old_val" != "x$ac_new_val"; then - # differences in whitespace do not lead to failure. - ac_old_val_w=`echo x $ac_old_val` - ac_new_val_w=`echo x $ac_new_val` - if test "$ac_old_val_w" != "$ac_new_val_w"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 -$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - ac_cache_corrupted=: - else - { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 -$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} - eval $ac_var=\$ac_old_val - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 -$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 -$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} - fi;; - esac - # Pass precious variables to config.status. - if test "$ac_new_set" = set; then - case $ac_new_val in - *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; - *) ac_arg=$ac_var=$ac_new_val ;; - esac - case " $ac_configure_args " in - *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. - *) as_fn_append ac_configure_args " '$ac_arg'" ;; - esac - fi -done -if $ac_cache_corrupted; then - { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 -$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} - as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 -fi -## -------------------- ## -## Main body of script. ## -## -------------------- ## - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - - - - - - -# Check whether --enable-debuginfo was given. -if test "${enable_debuginfo+set}" = set; then : - enableval=$enable_debuginfo; -else - enable_debuginfo=no -fi - - -# Check whether --enable-64bit was given. -if test "${enable_64bit+set}" = set; then : - enableval=$enable_64bit; -else - enable_64bit=no -fi - - -# Check whether --enable-abiflags was given. -if test "${enable_abiflags+set}" = set; then : - enableval=$enable_abiflags; -else - enable_abiflags=yes -fi - - -# Check whether --enable-antlrdebug was given. -if test "${enable_antlrdebug+set}" = set; then : - enableval=$enable_antlrdebug; -else - enable_antlrdebug=yes -fi - - -am__api_version='1.11' - -ac_aux_dir= -for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do - if test -f "$ac_dir/install-sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install-sh -c" - break - elif test -f "$ac_dir/install.sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install.sh -c" - break - elif test -f "$ac_dir/shtool"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/shtool install -c" - break - fi -done -if test -z "$ac_aux_dir"; then - as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 -fi - -# These three variables are undocumented and unsupported, -# and are intended to be withdrawn in a future Autoconf release. -# They can cause serious problems if a builder's source tree is in a directory -# whose full name contains unusual characters. -ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. -ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. -ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. - - -# Find a good install program. We prefer a C program (faster), -# so one script is as good as another. But avoid the broken or -# incompatible versions: -# SysV /etc/install, /usr/sbin/install -# SunOS /usr/etc/install -# IRIX /sbin/install -# AIX /bin/install -# AmigaOS /C/install, which installs bootblocks on floppy discs -# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag -# AFS /usr/afsws/bin/install, which mishandles nonexistent args -# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" -# OS/2's system install, which has a completely different semantic -# ./install, which can be erroneously created by make from ./install.sh. -# Reject install programs that cannot install multiple files. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 -$as_echo_n "checking for a BSD-compatible install... " >&6; } -if test -z "$INSTALL"; then -if 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:${as_lineno-$LINENO}: result: $INSTALL" >&5 -$as_echo "$INSTALL" >&6; } - -# Use test -z because SunOS4 sh mishandles braces in ${var-val}. -# It thinks the first close brace ends the variable substitution. -test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' - -test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' - -test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 -$as_echo_n "checking whether build environment is sane... " >&6; } -# Just in case -sleep 1 -echo timestamp > conftest.file -# Reject unsafe characters in $srcdir or the absolute working directory -# name. Accept space and tab only in the latter. -am_lf=' -' -case `pwd` in - *[\\\"\#\$\&\'\`$am_lf]*) - as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; -esac -case $srcdir in - *[\\\"\#\$\&\'\`$am_lf\ \ ]*) - as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;; -esac - -# Do `set' in a subshell so we don't clobber the current shell's -# arguments. Must try -L first in case configure is actually a -# symlink; some systems play weird games with the mod time of symlinks -# (eg FreeBSD returns the mod time of the symlink's containing -# directory). -if ( - set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` - if test "$*" = "X"; then - # -L didn't work. - set X `ls -t "$srcdir/configure" conftest.file` - fi - rm -f conftest.file - if test "$*" != "X $srcdir/configure conftest.file" \ - && test "$*" != "X conftest.file $srcdir/configure"; then - - # If neither matched, then we have a broken ls. This can happen - # if, for instance, CONFIG_SHELL is bash and it inherits a - # broken ls alias from the environment. This has actually - # happened. Such a system could not be considered "sane". - as_fn_error $? "ls -t appears to fail. Make sure there is not a broken -alias in your environment" "$LINENO" 5 - fi - - test "$2" = conftest.file - ) -then - # Ok. - : -else - as_fn_error $? "newly created file is older than distributed files! -Check your system clock" "$LINENO" 5 -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -test "$program_prefix" != NONE && - program_transform_name="s&^&$program_prefix&;$program_transform_name" -# Use a double $ so make ignores it. -test "$program_suffix" != NONE && - program_transform_name="s&\$&$program_suffix&;$program_transform_name" -# Double any \ or $. -# By default was `s,x,x', remove it if useless. -ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' -program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` - -# expand $ac_aux_dir to an absolute path -am_aux_dir=`cd $ac_aux_dir && pwd` - -if test x"${MISSING+set}" != xset; then - case $am_aux_dir in - *\ * | *\ *) - MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; - *) - MISSING="\${SHELL} $am_aux_dir/missing" ;; - esac -fi -# Use eval to expand $SHELL -if eval "$MISSING --run true"; then - am_missing_run="$MISSING --run " -else - am_missing_run= - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5 -$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} -fi - -if test x"${install_sh}" != xset; then - case $am_aux_dir in - *\ * | *\ *) - install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; - *) - install_sh="\${SHELL} $am_aux_dir/install-sh" - esac -fi - -# Installed binaries are usually stripped using `strip' when the user -# run `make install-strip'. However `strip' might not be the right -# tool to use in cross-compilation environments, therefore Automake -# will honor the `STRIP' environment variable to overrule this program. -if test "$cross_compiling" != no; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. -set dummy ${ac_tool_prefix}strip; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if 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:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -STRIP=$ac_cv_prog_STRIP -if test -n "$STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 -$as_echo "$STRIP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_STRIP"; then - ac_ct_STRIP=$STRIP - # Extract the first word of "strip", so it can be a program name with args. -set dummy strip; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if 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:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP -if test -n "$ac_ct_STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 -$as_echo "$ac_ct_STRIP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_STRIP" = x; then - STRIP=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - STRIP=$ac_ct_STRIP - fi -else - STRIP="$ac_cv_prog_STRIP" -fi - -fi -INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 -$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } -if test -z "$MKDIR_P"; then - if 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 - - test -d ./--version && rmdir ./--version - if test "${ac_cv_path_mkdir+set}" = set; then - MKDIR_P="$ac_cv_path_mkdir -p" - else - # As a last resort, use the slow shell script. Don't cache a - # value for MKDIR_P within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the value is a relative name. - MKDIR_P="$ac_install_sh -d" - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 -$as_echo "$MKDIR_P" >&6; } - -mkdir_p="$MKDIR_P" -case $mkdir_p in - [\\/$]* | ?:[\\/]*) ;; - */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; -esac - -for ac_prog in gawk mawk nawk awk -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if 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:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -AWK=$ac_cv_prog_AWK -if test -n "$AWK"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 -$as_echo "$AWK" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$AWK" && break -done - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 -$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } -set x ${MAKE-make} -ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` -if eval "test \"\${ac_cv_prog_make_${ac_make}_set+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:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - SET_MAKE= -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - SET_MAKE="MAKE=${MAKE-make}" -fi - -rm -rf .tst 2>/dev/null -mkdir .tst 2>/dev/null -if test -d .tst; then - am__leading_dot=. -else - am__leading_dot=_ -fi -rmdir .tst 2>/dev/null - -if test "`cd $srcdir && pwd`" != "`pwd`"; then - # Use -I$(srcdir) only when $(srcdir) != ., so that make's output - # is not polluted with repeated "-I." - am__isrc=' -I$(srcdir)' - # test to see if srcdir already configured - if test -f $srcdir/config.status; then - as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 - fi -fi - -# test whether we have cygpath -if test -z "$CYGPATH_W"; then - if (cygpath --version) >/dev/null 2>/dev/null; then - CYGPATH_W='cygpath -w' - else - CYGPATH_W=echo - fi -fi - - -# Define the identity of the package. - PACKAGE='libantlr3c' - VERSION='3.4' - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE "$PACKAGE" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define VERSION "$VERSION" -_ACEOF - -# Some tools Automake needs. - -ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} - - -AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} - - -AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} - - -AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} - - -MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} - -# We need awk for the "check" target. The system "awk" is bad on -# some platforms. -# Always define AMTAR for backward compatibility. - -AMTAR=${AMTAR-"${am_missing_run}tar"} - -am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' - - - - - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -if test -n "$ac_tool_prefix"; then - for ac_prog in xlc aCC gcc cc - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if 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:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$CC" && break - done -fi -if test -z "$CC"; then - ac_ct_CC=$CC - for ac_prog in xlc aCC gcc cc -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if 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:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$ac_ct_CC" && break -done - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -fi - - -test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "no acceptable C compiler found in \$PATH -See \`config.log' for more details" "$LINENO" 5; } - -# Provide some information about the compiler. -$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 -set X $ac_compile -ac_compiler=$2 -for ac_option in --version -v -V -qversion; do - { { ac_try="$ac_compiler $ac_option >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compiler $ac_option >&5") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - sed '10a\ -... rest of stderr output deleted ... - 10q' conftest.err >conftest.er1 - cat conftest.er1 >&5 - fi - rm -f conftest.er1 conftest.err - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } -done - -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" -# Try to create an executable without -o first, disregard a.out. -# It will help us diagnose broken compilers, and finding out an intuition -# of exeext. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 -$as_echo_n "checking whether the C compiler works... " >&6; } -ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` - -# The possible output files: -ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" - -ac_rmfiles= -for ac_file in $ac_files -do - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; - * ) ac_rmfiles="$ac_rmfiles $ac_file";; - esac -done -rm -f $ac_rmfiles - -if { { ac_try="$ac_link_default" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link_default") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : - # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. -# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' -# in a Makefile. We should not override ac_cv_exeext if it was cached, -# so that the user can short-circuit this test for compilers unknown to -# Autoconf. -for ac_file in $ac_files '' -do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) - ;; - [ab].out ) - # We found the default executable, but exeext='' is most - # certainly right. - break;; - *.* ) - if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; - then :; else - ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - fi - # We set ac_cv_exeext here because the later test for it is not - # safe: cross compilers may not add the suffix if given an `-o' - # argument, so we may need to know it at that point already. - # Even if this section looks crufty: it has the advantage of - # actually working. - break;; - * ) - break;; - esac -done -test "$ac_cv_exeext" = no && ac_cv_exeext= - -else - ac_file='' -fi -if test -z "$ac_file"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -$as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 77 "C compiler cannot create executables -See \`config.log' for more details" "$LINENO" 5; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 -$as_echo_n "checking for C compiler default output file name... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 -$as_echo "$ac_file" >&6; } -ac_exeext=$ac_cv_exeext - -rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out -ac_clean_files=$ac_clean_files_save -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 -$as_echo_n "checking for suffix of executables... " >&6; } -if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : - # If both `conftest.exe' and `conftest' are `present' (well, observable) -# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will -# work properly (i.e., refer to `conftest.exe'), while it won't with -# `rm'. -for ac_file in conftest.exe conftest conftest.*; do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; - *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - break;; - * ) break;; - esac -done -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details" "$LINENO" 5; } -fi -rm -f conftest conftest$ac_cv_exeext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 -$as_echo "$ac_cv_exeext" >&6; } - -rm -f conftest.$ac_ext -EXEEXT=$ac_cv_exeext -ac_exeext=$EXEEXT -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main () -{ -FILE *f = fopen ("conftest.out", "w"); - return ferror (f) || fclose (f) != 0; - - ; - return 0; -} -_ACEOF -ac_clean_files="$ac_clean_files conftest.out" -# Check that the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 -$as_echo_n "checking whether we are cross compiling... " >&6; } -if test "$cross_compiling" != yes; then - { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - if { ac_try='./conftest$ac_cv_exeext' - { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then - cross_compiling=no - else - if test "$cross_compiling" = maybe; then - cross_compiling=yes - else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details" "$LINENO" 5; } - fi - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 -$as_echo "$cross_compiling" >&6; } - -rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out -ac_clean_files=$ac_clean_files_save -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 -$as_echo_n "checking for suffix of object files... " >&6; } -if test "${ac_cv_objext+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.o conftest.obj -if { { ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_compile") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : - for ac_file in conftest.o conftest.obj conftest.*; do - test -f "$ac_file" || continue; - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; - *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` - break;; - esac -done -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot compute suffix of object files: cannot compile -See \`config.log' for more details" "$LINENO" 5; } -fi -rm -f conftest.$ac_cv_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 -$as_echo "$ac_cv_objext" >&6; } -OBJEXT=$ac_cv_objext -ac_objext=$OBJEXT -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 -$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } -if test "${ac_cv_c_compiler_gnu+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ -#ifndef __GNUC__ - choke me -#endif - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_compiler_gnu=yes -else - ac_compiler_gnu=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -ac_cv_c_compiler_gnu=$ac_compiler_gnu - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 -$as_echo "$ac_cv_c_compiler_gnu" >&6; } -if test $ac_compiler_gnu = yes; then - GCC=yes -else - GCC= -fi -ac_test_CFLAGS=${CFLAGS+set} -ac_save_CFLAGS=$CFLAGS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 -$as_echo_n "checking whether $CC accepts -g... " >&6; } -if 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 confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_g=yes -else - CFLAGS="" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -else - ac_c_werror_flag=$ac_save_c_werror_flag - CFLAGS="-g" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_g=yes -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_c_werror_flag=$ac_save_c_werror_flag -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 -$as_echo "$ac_cv_prog_cc_g" >&6; } -if test "$ac_test_CFLAGS" = set; then - CFLAGS=$ac_save_CFLAGS -elif test $ac_cv_prog_cc_g = yes; then - if test "$GCC" = yes; then - CFLAGS="-g -O2" - else - CFLAGS="-g" - fi -else - if test "$GCC" = yes; then - CFLAGS="-O2" - else - CFLAGS= - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 -$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } -if 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 confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#include -#include -/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ -struct buf { int x; }; -FILE * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; -{ - return p[i]; -} -static char *f (char * (*g) (char **, int), char **p, ...) -{ - char *s; - va_list v; - va_start (v,p); - s = g (p, va_arg (v,int)); - va_end (v); - return s; -} - -/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has - function prototypes and stuff, but not '\xHH' hex character constants. - These don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std is added to get - proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an - array size at least. It's necessary to write '\x00'==0 to get something - that's true only with -std. */ -int osf4_cc_array ['\x00' == 0 ? 1 : -1]; - -/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters - inside strings and character constants. */ -#define FOO(x) 'x' -int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; - -int test (int i, double x); -struct s1 {int (*f) (int a);}; -struct s2 {int (*f) (double a);}; -int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); -int argc; -char **argv; -int -main () -{ -return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; - ; - return 0; -} -_ACEOF -for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ - -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" -do - CC="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_c89=$ac_arg -fi -rm -f core conftest.err conftest.$ac_objext - test "x$ac_cv_prog_cc_c89" != "xno" && break -done -rm -f conftest.$ac_ext -CC=$ac_save_CC - -fi -# AC_CACHE_VAL -case "x$ac_cv_prog_cc_c89" in - x) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -$as_echo "none needed" >&6; } ;; - xno) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -$as_echo "unsupported" >&6; } ;; - *) - CC="$CC $ac_cv_prog_cc_c89" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 -$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; -esac -if test "x$ac_cv_prog_cc_c89" != xno; then : - -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -DEPDIR="${am__leading_dot}deps" - -ac_config_commands="$ac_config_commands depfiles" - - -am_make=${MAKE-make} -cat > confinc << 'END' -am__doit: - @echo this is the am__doit target -.PHONY: am__doit -END -# If we don't find an include directive, just comment out the code. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 -$as_echo_n "checking for style of include used by $am_make... " >&6; } -am__include="#" -am__quote= -_am_result=none -# First try GNU make style include. -echo "include confinc" > confmf -# Ignore all kinds of additional output from `make'. -case `$am_make -s -f confmf 2> /dev/null` in #( -*the\ am__doit\ target*) - am__include=include - am__quote= - _am_result=GNU - ;; -esac -# Now try BSD make style include. -if test "$am__include" = "#"; then - echo '.include "confinc"' > confmf - case `$am_make -s -f confmf 2> /dev/null` in #( - *the\ am__doit\ target*) - am__include=.include - am__quote="\"" - _am_result=BSD - ;; - esac -fi - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 -$as_echo "$_am_result" >&6; } -rm -f confinc confmf - -# Check whether --enable-dependency-tracking was given. -if test "${enable_dependency_tracking+set}" = set; then : - enableval=$enable_dependency_tracking; -fi - -if test "x$enable_dependency_tracking" != xno; then - am_depcomp="$ac_aux_dir/depcomp" - AMDEPBACKSLASH='\' -fi - if test "x$enable_dependency_tracking" != xno; then - AMDEP_TRUE= - AMDEP_FALSE='#' -else - AMDEP_TRUE='#' - AMDEP_FALSE= -fi - - - -depcc="$CC" am_compiler_list= - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 -$as_echo_n "checking dependency style of $depcc... " >&6; } -if 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 - am__universal=false - case " $depcc " in #( - *\ -arch\ *\ -arch\ *) am__universal=true ;; - esac - - for depmode in $am_compiler_list; do - # Setup a source with many dependencies, because some compilers - # like to wrap large dependency lists on column 80 (with \), and - # we should not choose a depcomp mode which is confused by this. - # - # We need to recreate these files for each test, as the compiler may - # overwrite some of them when testing with obscure command lines. - # This happens at least with the AIX C compiler. - : > sub/conftest.c - for i in 1 2 3 4 5 6; do - echo '#include "conftst'$i'.h"' >> sub/conftest.c - # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with - # Solaris 8's {/usr,}/bin/sh. - touch sub/conftst$i.h - done - echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf - - # We check with `-c' and `-o' for the sake of the "dashmstdout" - # mode. It turns out that the SunPro C++ compiler does not properly - # handle `-M -o', and we need to detect this. Also, some Intel - # versions had trouble with output in subdirs - am__obj=sub/conftest.${OBJEXT-o} - am__minus_obj="-o $am__obj" - case $depmode in - gcc) - # This depmode causes a compiler race in universal mode. - test "$am__universal" = false || continue - ;; - nosideeffect) - # after this tag, mechanisms are not by side-effect, so they'll - # only be used when explicitly requested - if test "x$enable_dependency_tracking" = xyes; then - continue - else - break - fi - ;; - msvisualcpp | msvcmsys) - # This compiler won't grok `-c -o', but also, the minuso test has - # not run yet. These depmodes are late enough in the game, and - # so weak that their functioning should not be impacted. - am__obj=conftest.${OBJEXT-o} - am__minus_obj= - ;; - none) break ;; - esac - if depmode=$depmode \ - source=sub/conftest.c object=$am__obj \ - depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ - $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ - >/dev/null 2>conftest.err && - grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && - grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && - grep $am__obj sub/conftest.Po > /dev/null 2>&1 && - ${MAKE-make} -s -f confmf > /dev/null 2>&1; then - # icc doesn't choke on unknown options, it will just issue warnings - # or remarks (even with -Werror). So we grep stderr for any message - # that says an option was ignored or not supported. - # When given -MP, icc 7.0 and 7.1 complain thusly: - # icc: Command line warning: ignoring option '-M'; no argument required - # The diagnosis changed in icc 8.0: - # icc: Command line remark: option '-MP' not supported - if (grep 'ignoring option' conftest.err || - grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else - am_cv_CC_dependencies_compiler_type=$depmode - break - fi - fi - done - - cd .. - rm -rf conftest.dir -else - am_cv_CC_dependencies_compiler_type=none -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 -$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } -CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type - - if - test "x$enable_dependency_tracking" != xno \ - && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then - am__fastdepCC_TRUE= - am__fastdepCC_FALSE='#' -else - am__fastdepCC_TRUE='#' - am__fastdepCC_FALSE= -fi - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 -$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } - # Check whether --enable-maintainer-mode was given. -if test "${enable_maintainer_mode+set}" = set; then : - enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval -else - USE_MAINTAINER_MODE=no -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 -$as_echo "$USE_MAINTAINER_MODE" >&6; } - if test $USE_MAINTAINER_MODE = yes; then - MAINTAINER_MODE_TRUE= - MAINTAINER_MODE_FALSE='#' -else - MAINTAINER_MODE_TRUE='#' - MAINTAINER_MODE_FALSE= -fi - - MAINT=$MAINTAINER_MODE_TRUE - - -case `pwd` in - *\ * | *\ *) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 -$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; -esac - - - -macro_version='2.2.10' -macro_revision='1.3175' - - - - - - - - - - - - - -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_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 -$as_echo_n "checking build system type... " >&6; } -if 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_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 -ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || - as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 -$as_echo "$ac_cv_build" >&6; } -case $ac_cv_build in -*-*-*) ;; -*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; -esac -build=$ac_cv_build -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_build -shift -build_cpu=$1 -build_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -build_os=$* -IFS=$ac_save_IFS -case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 -$as_echo_n "checking host system type... " >&6; } -if 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_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 -$as_echo "$ac_cv_host" >&6; } -case $ac_cv_host in -*-*-*) ;; -*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; -esac -host=$ac_cv_host -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_host -shift -host_cpu=$1 -host_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -host_os=$* -IFS=$ac_save_IFS -case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac - - -# Backslashify metacharacters that are still active within -# double-quoted strings. -sed_quote_subst='s/\(["`$\\]\)/\\\1/g' - -# Same as above, but do not quote variable references. -double_quote_subst='s/\(["`\\]\)/\\\1/g' - -# Sed substitution to delay expansion of an escaped shell variable in a -# double_quote_subst'ed string. -delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' - -# Sed substitution to delay expansion of an escaped single quote. -delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' - -# Sed substitution to avoid accidental globbing in evaled expressions -no_glob_subst='s/\*/\\\*/g' - -ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO -ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 -$as_echo_n "checking how to print strings... " >&6; } -# Test print first, because it will be a builtin if present. -if test "X`print -r -- -n 2>/dev/null`" = X-n && \ - test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then - ECHO='print -r --' -elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then - ECHO='printf %s\n' -else - # Use this function as a fallback that always works. - func_fallback_echo () - { - eval 'cat <<_LTECHO_EOF -$1 -_LTECHO_EOF' - } - ECHO='func_fallback_echo' -fi - -# func_echo_all arg... -# Invoke $ECHO with all args, space-separated. -func_echo_all () -{ - $ECHO "" -} - -case "$ECHO" in - printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 -$as_echo "printf" >&6; } ;; - print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 -$as_echo "print -r" >&6; } ;; - *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 -$as_echo "cat" >&6; } ;; -esac - - - - - - - - - - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 -$as_echo_n "checking for a sed that does not truncate output... " >&6; } -if 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 - { ac_script=; unset ac_script;} - if test -z "$SED"; then - ac_path_SED_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in sed gsed; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue -# Check for GNU ac_path_SED and select it if it is found. - # Check for GNU $ac_path_SED -case `"$ac_path_SED" --version 2>&1` in -*GNU*) - ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo '' >> "conftest.nl" - "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_SED_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_SED="$ac_path_SED" - ac_path_SED_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_SED_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_SED"; then - as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 - fi -else - ac_cv_path_SED=$SED -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 -$as_echo "$ac_cv_path_SED" >&6; } - SED="$ac_cv_path_SED" - rm -f conftest.sed - -test -z "$SED" && SED=sed -Xsed="$SED -e 1s/^X//" - - - - - - - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for 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 - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_GREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_GREP="$ac_path_GREP" - ac_path_GREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_GREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_GREP"; then - as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_GREP=$GREP -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 -$as_echo "$ac_cv_path_GREP" >&6; } - GREP="$ac_cv_path_GREP" - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 -$as_echo_n "checking for egrep... " >&6; } -if 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 - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_EGREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_EGREP="$ac_path_EGREP" - ac_path_EGREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_EGREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_EGREP"; then - as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_EGREP=$EGREP -fi - - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 -$as_echo "$ac_cv_path_EGREP" >&6; } - EGREP="$ac_cv_path_EGREP" - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for 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 - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_FGREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_FGREP="$ac_path_FGREP" - ac_path_FGREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_FGREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_FGREP"; then - as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_FGREP=$FGREP -fi - - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 -$as_echo "$ac_cv_path_FGREP" >&6; } - FGREP="$ac_cv_path_FGREP" - - -test -z "$GREP" && GREP=grep - - - - - - - - - - - - - - - - - - - -# Check whether --with-gnu-ld was given. -if test "${with_gnu_ld+set}" = set; then : - withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes -else - with_gnu_ld=no -fi - -ac_prog=ld -if test "$GCC" = yes; then - # Check if gcc -print-prog-name=ld gives a path. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 -$as_echo_n "checking for ld used by $CC... " >&6; } - case $host in - *-*-mingw*) - # gcc leaves a trailing carriage return which upsets mingw - ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; - *) - ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; - esac - case $ac_prog in - # Accept absolute paths. - [\\/]* | ?:[\\/]*) - re_direlt='/[^/][^/]*/\.\./' - # Canonicalize the pathname of ld - ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` - while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do - ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` - done - test -z "$LD" && LD="$ac_prog" - ;; - "") - # If it fails, then pretend we aren't using GCC. - ac_prog=ld - ;; - *) - # If it is relative, then search for the first ld in PATH. - with_gnu_ld=unknown - ;; - esac -elif test "$with_gnu_ld" = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 -$as_echo_n "checking for GNU ld... " >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 -$as_echo_n "checking for non-GNU ld... " >&6; } -fi -if 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 &5 -$as_echo "$LD" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi -test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 -$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } -if 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 &5 -$as_echo "$lt_cv_prog_gnu_ld" >&6; } -with_gnu_ld=$lt_cv_prog_gnu_ld - - - - - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 -$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } -if 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:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 -$as_echo "$lt_cv_path_NM" >&6; } -if test "$lt_cv_path_NM" != "no"; then - NM="$lt_cv_path_NM" -else - # Didn't find any BSD compatible name lister, look for dumpbin. - if test -n "$DUMPBIN"; then : - # Let the user override the test. - else - if test -n "$ac_tool_prefix"; then - for ac_prog in dumpbin "link -dump" - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if 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:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -DUMPBIN=$ac_cv_prog_DUMPBIN -if test -n "$DUMPBIN"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 -$as_echo "$DUMPBIN" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$DUMPBIN" && break - done -fi -if test -z "$DUMPBIN"; then - ac_ct_DUMPBIN=$DUMPBIN - for ac_prog in dumpbin "link -dump" -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if 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:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN -if test -n "$ac_ct_DUMPBIN"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 -$as_echo "$ac_ct_DUMPBIN" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - test -n "$ac_ct_DUMPBIN" && break -done - - if test "x$ac_ct_DUMPBIN" = x; then - DUMPBIN=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - DUMPBIN=$ac_ct_DUMPBIN - fi -fi - - case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in - *COFF*) - DUMPBIN="$DUMPBIN -symbols" - ;; - *) - DUMPBIN=: - ;; - esac - fi - - if test "$DUMPBIN" != ":"; then - NM="$DUMPBIN" - fi -fi -test -z "$NM" && NM=nm - - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 -$as_echo_n "checking the name lister ($NM) interface... " >&6; } -if 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:$LINENO: $ac_compile\"" >&5) - (eval "$ac_compile" 2>conftest.err) - cat conftest.err >&5 - (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5) - (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) - cat conftest.err >&5 - (eval echo "\"\$as_me:$LINENO: output\"" >&5) - cat conftest.out >&5 - if $GREP 'External.*some_variable' conftest.out > /dev/null; then - lt_cv_nm_interface="MS dumpbin" - fi - rm -f conftest* -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 -$as_echo "$lt_cv_nm_interface" >&6; } - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 -$as_echo_n "checking whether ln -s works... " >&6; } -LN_S=$as_ln_s -if test "$LN_S" = "ln -s"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 -$as_echo "no, using $LN_S" >&6; } -fi - -# find the maximum length of command line arguments -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 -$as_echo_n "checking the maximum length of command line arguments... " >&6; } -if 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; - ;; - - mint*) - # On MiNT this can take a long time and run out of memory. - lt_cv_sys_max_cmd_len=8192; - ;; - - amigaos*) - # On AmigaOS with pdksh, this test takes hours, literally. - # So we just punt and use a minimum line length of 8192. - lt_cv_sys_max_cmd_len=8192; - ;; - - netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) - # This has been around since 386BSD, at least. Likely further. - if test -x /sbin/sysctl; then - lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` - elif test -x /usr/sbin/sysctl; then - lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` - else - lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs - fi - # And add a safety zone - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` - ;; - - interix*) - # We know the value 262144 and hardcode it with a safety zone (like BSD) - lt_cv_sys_max_cmd_len=196608 - ;; - - 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"`func_fallback_echo "$teststring$teststring" 2>/dev/null` \ - = "X$teststring$teststring"; } >/dev/null 2>&1 && - test $i != 17 # 1/2 MB should be enough - do - i=`expr $i + 1` - teststring=$teststring$teststring - done - # Only check the string length outside the loop. - lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` - teststring= - # Add a significant safety factor because C++ compilers can tack on - # massive amounts of additional arguments before passing them to the - # linker. It appears as though 1/2 is a usable value. - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` - fi - ;; - esac - -fi - -if test -n $lt_cv_sys_max_cmd_len ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 -$as_echo "$lt_cv_sys_max_cmd_len" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 -$as_echo "none" >&6; } -fi -max_cmd_len=$lt_cv_sys_max_cmd_len - - - - - - -: ${CP="cp -f"} -: ${MV="mv -f"} -: ${RM="rm -f"} - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5 -$as_echo_n "checking whether the shell understands some XSI constructs... " >&6; } -# Try some XSI features -xsi_shell=no -( _lt_dummy="a/b/c" - test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \ - = 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:${as_lineno-$LINENO}: result: $xsi_shell" >&5 -$as_echo "$xsi_shell" >&6; } - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5 -$as_echo_n "checking whether the shell understands \"+=\"... " >&6; } -lt_shell_append=no -( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \ - >/dev/null 2>&1 \ - && lt_shell_append=yes -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5 -$as_echo "$lt_shell_append" >&6; } - - -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - lt_unset=unset -else - lt_unset=false -fi - - - - - -# test EBCDIC or ASCII -case `echo X|tr X '\101'` in - A) # ASCII based system - # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr - lt_SP2NL='tr \040 \012' - lt_NL2SP='tr \015\012 \040\040' - ;; - *) # EBCDIC based system - lt_SP2NL='tr \100 \n' - lt_NL2SP='tr \r\n \100\100' - ;; -esac - - - - - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking 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:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 -$as_echo "$lt_cv_ld_reload_flag" >&6; } -reload_flag=$lt_cv_ld_reload_flag -case $reload_flag in -"" | " "*) ;; -*) reload_flag=" $reload_flag" ;; -esac -reload_cmds='$LD$reload_flag -o $output$reload_objs' -case $host_os in - darwin*) - if test "$GCC" = yes; then - reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' - else - reload_cmds='$LD$reload_flag -o $output$reload_objs' - fi - ;; -esac - - - - - - - - - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. -set dummy ${ac_tool_prefix}objdump; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if 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:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -OBJDUMP=$ac_cv_prog_OBJDUMP -if test -n "$OBJDUMP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 -$as_echo "$OBJDUMP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_OBJDUMP"; then - ac_ct_OBJDUMP=$OBJDUMP - # Extract the first word of "objdump", so it can be a program name with args. -set dummy objdump; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if 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:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP -if test -n "$ac_ct_OBJDUMP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 -$as_echo "$ac_ct_OBJDUMP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_OBJDUMP" = x; then - OBJDUMP="false" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - OBJDUMP=$ac_ct_OBJDUMP - fi -else - OBJDUMP="$ac_cv_prog_OBJDUMP" -fi - -test -z "$OBJDUMP" && OBJDUMP=objdump - - - - - - - - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 -$as_echo_n "checking how to recognize dependent libraries... " >&6; } -if 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. - # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin. - if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then - lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' - lt_cv_file_magic_cmd='func_win32_libid' - else - # Keep this pattern in sync with the one in func_win32_libid. - lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' - lt_cv_file_magic_cmd='$OBJDUMP -f' - fi - ;; - -cegcc*) - # use the weaker test based on 'objdump'. See mingw*. - lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' - lt_cv_file_magic_cmd='$OBJDUMP -f' - ;; - -darwin* | rhapsody*) - lt_cv_deplibs_check_method=pass_all - ;; - -freebsd* | dragonfly*) - if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then - case $host_cpu in - i*86 ) - # Not sure whether the presence of OpenBSD here was a mistake. - # Let's accept both of them until this is cleared up. - lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` - ;; - esac - else - lt_cv_deplibs_check_method=pass_all - fi - ;; - -gnu*) - lt_cv_deplibs_check_method=pass_all - ;; - -haiku*) - lt_cv_deplibs_check_method=pass_all - ;; - -hpux10.20* | hpux11*) - lt_cv_file_magic_cmd=/usr/bin/file - case $host_cpu in - ia64*) - lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' - lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so - ;; - hppa*64*) - lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]' - lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl - ;; - *) - lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library' - lt_cv_file_magic_test_file=/usr/lib/libc.sl - ;; - esac - ;; - -interix[3-9]*) - # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here - lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' - ;; - -irix5* | irix6* | nonstopux*) - case $LD in - *-32|*"-32 ") libmagic=32-bit;; - *-n32|*"-n32 ") libmagic=N32;; - *-64|*"-64 ") libmagic=64-bit;; - *) libmagic=never-match;; - esac - lt_cv_deplibs_check_method=pass_all - ;; - -# This must be Linux ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu) - lt_cv_deplibs_check_method=pass_all - ;; - -netbsd*) - if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then - lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' - else - lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' - fi - ;; - -newos6*) - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=/usr/lib/libnls.so - ;; - -*nto* | *qnx*) - lt_cv_deplibs_check_method=pass_all - ;; - -openbsd*) - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' - else - lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' - fi - ;; - -osf3* | osf4* | osf5*) - lt_cv_deplibs_check_method=pass_all - ;; - -rdos*) - lt_cv_deplibs_check_method=pass_all - ;; - -solaris*) - lt_cv_deplibs_check_method=pass_all - ;; - -sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) - lt_cv_deplibs_check_method=pass_all - ;; - -sysv4 | sysv4.3*) - case $host_vendor in - motorola) - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` - ;; - ncr) - lt_cv_deplibs_check_method=pass_all - ;; - sequent) - lt_cv_file_magic_cmd='/bin/file' - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' - ;; - sni) - lt_cv_file_magic_cmd='/bin/file' - lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" - lt_cv_file_magic_test_file=/lib/libc.so - ;; - siemens) - lt_cv_deplibs_check_method=pass_all - ;; - pc) - lt_cv_deplibs_check_method=pass_all - ;; - esac - ;; - -tpf*) - lt_cv_deplibs_check_method=pass_all - ;; -esac - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 -$as_echo "$lt_cv_deplibs_check_method" >&6; } -file_magic_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:${as_lineno-$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:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -AR=$ac_cv_prog_AR -if test -n "$AR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 -$as_echo "$AR" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -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:${as_lineno-$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:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_AR=$ac_cv_prog_ac_ct_AR -if test -n "$ac_ct_AR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 -$as_echo "$ac_ct_AR" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_AR" = x; then - AR="false" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - AR=$ac_ct_AR - fi -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:${as_lineno-$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:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -STRIP=$ac_cv_prog_STRIP -if test -n "$STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 -$as_echo "$STRIP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_STRIP"; then - ac_ct_STRIP=$STRIP - # Extract the first word of "strip", so it can be a program name with args. -set dummy strip; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if 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:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP -if test -n "$ac_ct_STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 -$as_echo "$ac_ct_STRIP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_STRIP" = x; then - STRIP=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - STRIP=$ac_ct_STRIP - fi -else - STRIP="$ac_cv_prog_STRIP" -fi - -test -z "$STRIP" && STRIP=: - - - - - - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. -set dummy ${ac_tool_prefix}ranlib; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if 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:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -RANLIB=$ac_cv_prog_RANLIB -if test -n "$RANLIB"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 -$as_echo "$RANLIB" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_RANLIB"; then - ac_ct_RANLIB=$RANLIB - # Extract the first word of "ranlib", so it can be a program name with args. -set dummy ranlib; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if 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:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB -if test -n "$ac_ct_RANLIB"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 -$as_echo "$ac_ct_RANLIB" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_RANLIB" = x; then - RANLIB=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - RANLIB=$ac_ct_RANLIB - fi -else - RANLIB="$ac_cv_prog_RANLIB" -fi - -test -z "$RANLIB" && RANLIB=: - - - - - - -# Determine commands to create old-style static archives. -old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' -old_postinstall_cmds='chmod 644 $oldlib' -old_postuninstall_cmds= - -if test -n "$RANLIB"; then - case $host_os in - openbsd*) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" - ;; - *) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" - ;; - esac - old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" -fi - -case $host_os in - darwin*) - lock_old_archive_extraction=yes ;; - *) - lock_old_archive_extraction=no ;; -esac - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -# If no C compiler was specified, use CC. -LTCC=${LTCC-"$CC"} - -# If no C compiler flags were specified, use CFLAGS. -LTCFLAGS=${LTCFLAGS-"$CFLAGS"} - -# Allow CC to be a program name with arguments. -compiler=$CC - - -# Check for command to grab the raw symbol name followed by C symbol from nm. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 -$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } -if 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\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - # Now try to grab the symbols. - nlist=conftest.nm - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 - (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && test -s "$nlist"; then - # Try sorting and uniquifying the output. - if sort "$nlist" | uniq > "$nlist"T; then - mv -f "$nlist"T "$nlist" - else - rm -f "$nlist"T - fi - - # Make sure that we snagged all the symbols we need. - if $GREP ' nm_test_var$' "$nlist" >/dev/null; then - if $GREP ' nm_test_func$' "$nlist" >/dev/null; then - cat <<_LT_EOF > conftest.$ac_ext -#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\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 - (eval $ac_link) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && test -s conftest${ac_exeext}; then - pipe_works=yes - fi - LIBS="$lt_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:${as_lineno-$LINENO}: result: failed" >&5 -$as_echo "failed" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 -$as_echo "ok" >&6; } -fi - - - - - - - - - - - - - - - - - - - - - - - -# Check whether --enable-libtool-lock was given. -if test "${enable_libtool_lock+set}" = set; then : - enableval=$enable_libtool_lock; -fi - -test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes - -# Some flags need to be propagated to the compiler or linker for good -# libtool support. -case $host in -ia64-*-hpux*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - case `/usr/bin/file conftest.$ac_objext` in - *ELF-32*) - HPUX_IA64_MODE="32" - ;; - *ELF-64*) - HPUX_IA64_MODE="64" - ;; - esac - fi - rm -rf conftest* - ;; -*-*-irix6*) - # Find out which ABI we are using. - echo '#line '$LINENO' "configure"' > conftest.$ac_ext - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - if test "$lt_cv_prog_gnu_ld" = yes; then - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - LD="${LD-ld} -melf32bsmip" - ;; - *N32*) - LD="${LD-ld} -melf32bmipn32" - ;; - *64-bit*) - LD="${LD-ld} -melf64bmip" - ;; - esac - else - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - LD="${LD-ld} -32" - ;; - *N32*) - LD="${LD-ld} -n32" - ;; - *64-bit*) - LD="${LD-ld} -64" - ;; - esac - fi - fi - rm -rf conftest* - ;; - -x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ -s390*-*linux*|s390*-*tpf*|sparc*-*linux*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - case `/usr/bin/file conftest.o` in - *32-bit*) - case $host in - x86_64-*kfreebsd*-gnu) - LD="${LD-ld} -m elf_i386_fbsd" - ;; - x86_64-*linux*) - LD="${LD-ld} -m elf_i386" - ;; - ppc64-*linux*|powerpc64-*linux*) - LD="${LD-ld} -m elf32ppclinux" - ;; - s390x-*linux*) - LD="${LD-ld} -m elf_s390" - ;; - sparc64-*linux*) - LD="${LD-ld} -m elf32_sparc" - ;; - esac - ;; - *64-bit*) - case $host in - x86_64-*kfreebsd*-gnu) - LD="${LD-ld} -m elf_x86_64_fbsd" - ;; - x86_64-*linux*) - LD="${LD-ld} -m elf_x86_64" - ;; - ppc*-*linux*|powerpc*-*linux*) - LD="${LD-ld} -m elf64ppc" - ;; - s390*-*linux*|s390*-*tpf*) - LD="${LD-ld} -m elf64_s390" - ;; - sparc*-*linux*) - LD="${LD-ld} -m elf64_sparc" - ;; - esac - ;; - esac - fi - rm -rf conftest* - ;; - -*-*-sco3.2v5*) - # On SCO OpenServer 5, we need -belf to get full-featured binaries. - SAVE_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -belf" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 -$as_echo_n "checking whether the C compiler needs -belf... " >&6; } -if 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 confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - lt_cv_cc_needs_belf=yes -else - lt_cv_cc_needs_belf=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 -$as_echo "$lt_cv_cc_needs_belf" >&6; } - if test x"$lt_cv_cc_needs_belf" != x"yes"; then - # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf - CFLAGS="$SAVE_CFLAGS" - fi - ;; -sparc*-*solaris*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - case `/usr/bin/file conftest.o` in - *64-bit*) - case $lt_cv_prog_gnu_ld in - yes*) 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:${as_lineno-$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:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -DSYMUTIL=$ac_cv_prog_DSYMUTIL -if test -n "$DSYMUTIL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 -$as_echo "$DSYMUTIL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_DSYMUTIL"; then - ac_ct_DSYMUTIL=$DSYMUTIL - # Extract the first word of "dsymutil", so it can be a program name with args. -set dummy dsymutil; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if 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:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL -if test -n "$ac_ct_DSYMUTIL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 -$as_echo "$ac_ct_DSYMUTIL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_DSYMUTIL" = x; then - DSYMUTIL=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - DSYMUTIL=$ac_ct_DSYMUTIL - fi -else - DSYMUTIL="$ac_cv_prog_DSYMUTIL" -fi - - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. -set dummy ${ac_tool_prefix}nmedit; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if 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:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -NMEDIT=$ac_cv_prog_NMEDIT -if test -n "$NMEDIT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 -$as_echo "$NMEDIT" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_NMEDIT"; then - ac_ct_NMEDIT=$NMEDIT - # Extract the first word of "nmedit", so it can be a program name with args. -set dummy nmedit; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if 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:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT -if test -n "$ac_ct_NMEDIT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 -$as_echo "$ac_ct_NMEDIT" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_NMEDIT" = x; then - NMEDIT=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - NMEDIT=$ac_ct_NMEDIT - fi -else - NMEDIT="$ac_cv_prog_NMEDIT" -fi - - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. -set dummy ${ac_tool_prefix}lipo; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if 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:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -LIPO=$ac_cv_prog_LIPO -if test -n "$LIPO"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 -$as_echo "$LIPO" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_LIPO"; then - ac_ct_LIPO=$LIPO - # Extract the first word of "lipo", so it can be a program name with args. -set dummy lipo; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if 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:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO -if test -n "$ac_ct_LIPO"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 -$as_echo "$ac_ct_LIPO" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_LIPO" = x; then - LIPO=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - LIPO=$ac_ct_LIPO - fi -else - LIPO="$ac_cv_prog_LIPO" -fi - - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. -set dummy ${ac_tool_prefix}otool; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if 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:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -OTOOL=$ac_cv_prog_OTOOL -if test -n "$OTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 -$as_echo "$OTOOL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_OTOOL"; then - ac_ct_OTOOL=$OTOOL - # Extract the first word of "otool", so it can be a program name with args. -set dummy otool; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if 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:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL -if test -n "$ac_ct_OTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 -$as_echo "$ac_ct_OTOOL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_OTOOL" = x; then - OTOOL=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - OTOOL=$ac_ct_OTOOL - fi -else - OTOOL="$ac_cv_prog_OTOOL" -fi - - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. -set dummy ${ac_tool_prefix}otool64; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if 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:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -OTOOL64=$ac_cv_prog_OTOOL64 -if test -n "$OTOOL64"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 -$as_echo "$OTOOL64" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_OTOOL64"; then - ac_ct_OTOOL64=$OTOOL64 - # Extract the first word of "otool64", so it can be a program name with args. -set dummy otool64; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if 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:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 -if test -n "$ac_ct_OTOOL64"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 -$as_echo "$ac_ct_OTOOL64" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_OTOOL64" = x; then - OTOOL64=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - OTOOL64=$ac_ct_OTOOL64 - fi -else - OTOOL64="$ac_cv_prog_OTOOL64" -fi - - - - - - - - - - - - - - - - - - - - - - - - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 -$as_echo_n "checking for -single_module linker flag... " >&6; } -if 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:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 -$as_echo "$lt_cv_apple_cc_single_mod" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 -$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } -if 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 confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - lt_cv_ld_exported_symbols_list=yes -else - lt_cv_ld_exported_symbols_list=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - LDFLAGS="$save_LDFLAGS" - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 -$as_echo "$lt_cv_ld_exported_symbols_list" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 -$as_echo_n "checking for -force_load linker flag... " >&6; } -if test "${lt_cv_ld_force_load+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_ld_force_load=no - cat > conftest.c << _LT_EOF -int forced_loaded() { return 2;} -_LT_EOF - echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5 - $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5 - echo "$AR cru libconftest.a conftest.o" >&5 - $AR cru libconftest.a conftest.o 2>&5 - echo "$RANLIB libconftest.a" >&5 - $RANLIB libconftest.a 2>&5 - cat > conftest.c << _LT_EOF -int main() { return 0;} -_LT_EOF - echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5 - $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err - _lt_result=$? - if test -f conftest && test ! -s conftest.err && test $_lt_result = 0 && $GREP forced_load conftest 2>&1 >/dev/null; then - lt_cv_ld_force_load=yes - else - cat conftest.err >&5 - fi - rm -f conftest.err libconftest.a conftest conftest.c - rm -rf conftest.dSYM - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 -$as_echo "$lt_cv_ld_force_load" >&6; } - case $host_os in - rhapsody* | darwin1.[012]) - _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; - darwin1.*) - _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; - darwin*) # darwin 5.x on - # if running on 10.5 or later, the deployment target defaults - # to the OS version, if on x86, and 10.4, the deployment - # target defaults to 10.4. Don't you love it? - case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in - 10.0,*86*-darwin8*|10.0,*-darwin[91]*) - _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; - 10.[012]*) - _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; - 10.*) - _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; - esac - ;; - esac - if test "$lt_cv_apple_cc_single_mod" = "yes"; then - _lt_dar_single_mod='$single_module' - fi - if test "$lt_cv_ld_exported_symbols_list" = "yes"; then - _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' - else - _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' - fi - if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then - _lt_dsymutil='~$DSYMUTIL $lib || :' - else - _lt_dsymutil= - fi - ;; - esac - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 -$as_echo_n "checking how to run the C preprocessor... " >&6; } -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= -fi -if test -z "$CPP"; then - if 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 to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - -else - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue -else - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.$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:${as_lineno-$LINENO}: result: $CPP" >&5 -$as_echo "$CPP" >&6; } -ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - -else - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue -else - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.$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:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details" "$LINENO" 5; } -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 -$as_echo_n "checking for ANSI C header files... " >&6; } -if test "${ac_cv_header_stdc+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#include -#include - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_header_stdc=yes -else - ac_cv_header_stdc=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then : - -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then : - -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then : - : -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif - -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int -main () -{ - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - return 2; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - -else - ac_cv_header_stdc=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - -fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 -$as_echo "$ac_cv_header_stdc" >&6; } -if test $ac_cv_header_stdc = yes; then - -$as_echo "#define STDC_HEADERS 1" >>confdefs.h - -fi - -# On IRIX 5.3, sys/types and inttypes.h are conflicting. -for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default -" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - -for ac_header in dlfcn.h -do : - ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default -" -if test "x$ac_cv_header_dlfcn_h" = x""yes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_DLFCN_H 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:${as_lineno-$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:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 -$as_echo "$lt_cv_objdir" >&6; } -objdir=$lt_cv_objdir - - - - - -cat >>confdefs.h <<_ACEOF -#define LT_OBJDIR "$lt_cv_objdir/" -_ACEOF - - - - -case $host_os in -aix3*) - # AIX sometimes has problems with the GCC collect2 program. For some - # reason, if we set the COLLECT_NAMES environment variable, the problems - # vanish in a puff of smoke. - if test "X${COLLECT_NAMES+set}" != Xset; then - COLLECT_NAMES= - export COLLECT_NAMES - fi - ;; -esac - -# Global variables: -ofile=libtool -can_build_shared=yes - -# All known linkers require a `.a' archive for static linking (except MSVC, -# which needs '.lib'). -libext=a - -with_gnu_ld="$lt_cv_prog_gnu_ld" - -old_CC="$CC" -old_CFLAGS="$CFLAGS" - -# Set sane defaults for various variables -test -z "$CC" && CC=cc -test -z "$LTCC" && LTCC=$CC -test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS -test -z "$LD" && LD=ld -test -z "$ac_objext" && ac_objext=o - -for cc_temp in $compiler""; do - case $cc_temp in - compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; - distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` - - -# Only perform the check for file, if the check method requires it -test -z "$MAGIC_CMD" && MAGIC_CMD=file -case $deplibs_check_method in -file_magic*) - if test "$file_magic_cmd" = '$MAGIC_CMD'; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 -$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } -if 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:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 -$as_echo "$MAGIC_CMD" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - - - -if test -z "$lt_cv_path_MAGIC_CMD"; then - if test -n "$ac_tool_prefix"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 -$as_echo_n "checking for file... " >&6; } -if 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:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 -$as_echo "$MAGIC_CMD" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - else - MAGIC_CMD=: - fi -fi - - fi - ;; -esac - -# Use C for the default configuration in the libtool script - -lt_save_CC="$CC" -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - -# Source file extension for C test sources. -ac_ext=c - -# Object file extension for compiled C test sources. -objext=o -objext=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code="int some_variable = 0;" - -# Code to be used in simple link tests -lt_simple_link_test_code='int main(){return(0);}' - - - - - - - -# If no C compiler was specified, use CC. -LTCC=${LTCC-"$CC"} - -# If no C compiler flags were specified, use CFLAGS. -LTCFLAGS=${LTCFLAGS-"$CFLAGS"} - -# Allow CC to be a program name with arguments. -compiler=$CC - -# Save the default compiler, since it gets overwritten when the other -# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. -compiler_DEFAULT=$CC - -# save warnings/boilerplate of simple test code -ac_outfile=conftest.$ac_objext -echo "$lt_simple_compile_test_code" >conftest.$ac_ext -eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err -_lt_compiler_boilerplate=`cat conftest.err` -$RM conftest* - -ac_outfile=conftest.$ac_objext -echo "$lt_simple_link_test_code" >conftest.$ac_ext -eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err -_lt_linker_boilerplate=`cat conftest.err` -$RM -r conftest* - - -## CAVEAT EMPTOR: -## There is no encapsulation within the following macros, do not change -## the running order or otherwise move them around unless you know exactly -## what you are doing... -if test -n "$compiler"; then - -lt_prog_compiler_no_builtin_flag= - -if test "$GCC" = yes; then - case $cc_basename in - nvcc*) - lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;; - *) - lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; - esac - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 -$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } -if 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:$LINENO: $lt_compile\"" >&5) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s "$ac_outfile"; then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings other than the usual output. - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then - lt_cv_prog_compiler_rtti_exceptions=yes - fi - fi - $RM conftest* - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 -$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } - -if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then - lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" -else - : -fi - -fi - - - - - - - lt_prog_compiler_wl= -lt_prog_compiler_pic= -lt_prog_compiler_static= - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 -$as_echo_n "checking for $compiler option to produce PIC... " >&6; } - - if test "$GCC" = yes; then - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_static='-static' - - case $host_os in - aix*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static='-Bstatic' - fi - ;; - - amigaos*) - case $host_cpu in - powerpc) - # see comment about AmigaOS4 .so support - lt_prog_compiler_pic='-fPIC' - ;; - m68k) - # FIXME: we need at least 68020 code to build shared libraries, but - # adding the `-m68020' flag to GCC prevents building anything better, - # like `-m68040'. - lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' - ;; - esac - ;; - - beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - - mingw* | cygwin* | pw32* | os2* | cegcc*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - # Although the cygwin gcc ignores -fPIC, still need this for old-style - # (--disable-auto-import) libraries - lt_prog_compiler_pic='-DDLL_EXPORT' - ;; - - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - lt_prog_compiler_pic='-fno-common' - ;; - - haiku*) - # PIC is the default for Haiku. - # The "-static" flag exists, but is broken. - lt_prog_compiler_static= - ;; - - hpux*) - # PIC is the default for 64-bit PA HP-UX, but not for 32-bit - # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag - # sets the default TLS model and affects inlining. - case $host_cpu in - hppa*64*) - # +Z the default - ;; - *) - lt_prog_compiler_pic='-fPIC' - ;; - esac - ;; - - interix[3-9]*) - # Interix 3.x gcc -fpic/-fPIC options generate broken code. - # Instead, we relocate shared libraries at runtime. - ;; - - msdosdjgpp*) - # Just because we use GCC doesn't mean we suddenly get shared libraries - # on systems that don't support them. - lt_prog_compiler_can_build_shared=no - enable_shared=no - ;; - - *nto* | *qnx*) - # QNX uses GNU C++, but need to define -shared option too, otherwise - # it will coredump. - lt_prog_compiler_pic='-fPIC -shared' - ;; - - sysv4*MP*) - if test -d /usr/nec; then - lt_prog_compiler_pic=-Kconform_pic - fi - ;; - - *) - lt_prog_compiler_pic='-fPIC' - ;; - esac - - case $cc_basename in - nvcc*) # Cuda Compiler Driver 2.2 - lt_prog_compiler_wl='-Xlinker ' - lt_prog_compiler_pic='-Xcompiler -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 | kopensolaris*-gnu) - case $cc_basename in - # old Intel for x86_64 which still supported -KPIC. - ecc*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-static' - ;; - # icc used to be incompatible with GCC. - # ICC 10 doesn't accept -KPIC any more. - icc* | ifort*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-fPIC' - lt_prog_compiler_static='-static' - ;; - # Lahey Fortran 8.1. - lf95*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='--shared' - lt_prog_compiler_static='--static' - ;; - pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) - # Portland Group compilers (*not* the Pentium gcc compiler, - # which looks to be a dead project) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-fpic' - lt_prog_compiler_static='-Bstatic' - ;; - ccc*) - lt_prog_compiler_wl='-Wl,' - # All Alpha code is PIC. - lt_prog_compiler_static='-non_shared' - ;; - xl* | bgxl* | bgf* | mpixl*) - # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-qpic' - lt_prog_compiler_static='-qstaticlink' - ;; - *) - case `$CC -V 2>&1 | sed 5q` in - *Sun\ F* | *Sun*Fortran*) - # Sun Fortran 8.3 passes all unrecognized flags to the linker - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - lt_prog_compiler_wl='' - ;; - *Sun\ C*) - # Sun C 5.9 - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - lt_prog_compiler_wl='-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* | sunf77* | sunf90* | sunf95*) - lt_prog_compiler_wl='-Qoption ld ';; - *) - lt_prog_compiler_wl='-Wl,';; - esac - ;; - - sunos4*) - lt_prog_compiler_wl='-Qoption ld ' - lt_prog_compiler_pic='-PIC' - lt_prog_compiler_static='-Bstatic' - ;; - - sysv4 | sysv4.2uw2* | sysv4.3*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - ;; - - sysv4*MP*) - if test -d /usr/nec ;then - lt_prog_compiler_pic='-Kconform_pic' - lt_prog_compiler_static='-Bstatic' - fi - ;; - - sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - ;; - - unicos*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_can_build_shared=no - ;; - - uts4*) - lt_prog_compiler_pic='-pic' - lt_prog_compiler_static='-Bstatic' - ;; - - *) - lt_prog_compiler_can_build_shared=no - ;; - esac - fi - -case $host_os in - # For platforms which do not support PIC, -DPIC is meaningless: - *djgpp*) - lt_prog_compiler_pic= - ;; - *) - lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" - ;; -esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: 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:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 -$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } -if 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:$LINENO: $lt_compile\"" >&5) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s "$ac_outfile"; then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings other than the usual output. - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then - lt_cv_prog_compiler_pic_works=yes - fi - fi - $RM conftest* - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 -$as_echo "$lt_cv_prog_compiler_pic_works" >&6; } - -if test x"$lt_cv_prog_compiler_pic_works" = xyes; then - case $lt_prog_compiler_pic in - "" | " "*) ;; - *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; - esac -else - lt_prog_compiler_pic= - lt_prog_compiler_can_build_shared=no -fi - -fi - - - - - - -# -# Check to make sure the static flag actually works. -# -wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 -$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } -if 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 "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if diff conftest.exp conftest.er2 >/dev/null; then - lt_cv_prog_compiler_static_works=yes - fi - else - lt_cv_prog_compiler_static_works=yes - fi - fi - $RM -r conftest* - LDFLAGS="$save_LDFLAGS" - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 -$as_echo "$lt_cv_prog_compiler_static_works" >&6; } - -if test x"$lt_cv_prog_compiler_static_works" = xyes; then - : -else - lt_prog_compiler_static= -fi - - - - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 -$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } -if 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:$LINENO: $lt_compile\"" >&5) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s out/conftest2.$ac_objext - then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp - $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 - if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then - lt_cv_prog_compiler_c_o=yes - fi - fi - chmod u+w . 2>&5 - $RM conftest* - # SGI C++ compiler will create directory out/ii_files/ for - # template instantiation - test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files - $RM out/* && rmdir out - cd .. - $RM -r conftest - $RM conftest* - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 -$as_echo "$lt_cv_prog_compiler_c_o" >&6; } - - - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 -$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } -if 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:$LINENO: $lt_compile\"" >&5) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s out/conftest2.$ac_objext - then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp - $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 - if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then - lt_cv_prog_compiler_c_o=yes - fi - fi - chmod u+w . 2>&5 - $RM conftest* - # SGI C++ compiler will create directory out/ii_files/ for - # template instantiation - test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files - $RM out/* && rmdir out - cd .. - $RM -r conftest - $RM conftest* - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 -$as_echo "$lt_cv_prog_compiler_c_o" >&6; } - - - - -hard_links="nottested" -if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then - # do not overwrite the value of need_locks provided by the user - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 -$as_echo_n "checking if we can lock with hard links... " >&6; } - hard_links=yes - $RM conftest* - ln conftest.a conftest.b 2>/dev/null && hard_links=no - touch conftest.a - ln conftest.a conftest.b 2>&5 || hard_links=no - ln conftest.a conftest.b 2>/dev/null && hard_links=no - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 -$as_echo "$hard_links" >&6; } - if test "$hard_links" = no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 -$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} - need_locks=warn - fi -else - need_locks=no -fi - - - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } - - runpath_var= - allow_undefined_flag= - always_export_symbols=no - archive_cmds= - archive_expsym_cmds= - compiler_needs_object=no - enable_shared_with_static_runtimes=no - export_dynamic_flag_spec= - export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - hardcode_automatic=no - hardcode_direct=no - hardcode_direct_absolute=no - hardcode_libdir_flag_spec= - hardcode_libdir_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 - - # On some targets, GNU ld is compatible enough with the native linker - # that we're better off using the native interface for both. - lt_use_gnu_ld_interface=no - if test "$with_gnu_ld" = yes; then - case $host_os in - aix*) - # The AIX port of GNU ld has always aspired to compatibility - # with the native linker. However, as the warning in the GNU ld - # block says, versions before 2.19.5* couldn't really create working - # shared libraries, regardless of the interface used. - case `$LD -v 2>&1` in - *\ \(GNU\ Binutils\)\ 2.19.5*) ;; - *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;; - *\ \(GNU\ Binutils\)\ [3-9]*) ;; - *) - lt_use_gnu_ld_interface=yes - ;; - esac - ;; - *) - lt_use_gnu_ld_interface=yes - ;; - esac - fi - - if test "$lt_use_gnu_ld_interface" = yes; then - # If archive_cmds runs LD, not CC, wlarc should be empty - wlarc='${wl}' - - # Set some defaults for GNU ld with shared library support. These - # are reset later if shared libraries are not supported. Putting them - # here allows them to be overridden if necessary. - runpath_var=LD_RUN_PATH - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - export_dynamic_flag_spec='${wl}--export-dynamic' - # ancient GNU ld didn't support --whole-archive et. al. - if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then - whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - whole_archive_flag_spec= - fi - supports_anon_versioning=no - case `$LD -v 2>&1` in - *GNU\ gold*) supports_anon_versioning=yes ;; - *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 - *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... - *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... - *\ 2.11.*) ;; # other 2.11 versions - *) supports_anon_versioning=yes ;; - esac - - # See if GNU ld supports shared libraries. - case $host_os in - aix[3-9]*) - # On AIX/PPC, the GNU linker is very broken - if test "$host_cpu" != ia64; then - ld_shlibs=no - cat <<_LT_EOF 1>&2 - -*** Warning: the GNU linker, at least up to release 2.19, is reported -*** to be unable to reliably create shared libraries on AIX. -*** Therefore, libtool is disabling shared libraries support. If you -*** really care for shared libraries, you may want to install binutils -*** 2.20 or above, or modify your PATH so that a non-GNU linker is found. -*** You will then need to restart the configuration process. - -_LT_EOF - fi - ;; - - amigaos*) - case $host_cpu in - powerpc) - # see comment about AmigaOS4 .so support - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='' - ;; - m68k) - archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - ;; - esac - ;; - - beos*) - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - allow_undefined_flag=unsupported - # Joseph Beckenbach says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - else - ld_shlibs=no - fi - ;; - - cygwin* | mingw* | pw32* | cegcc*) - # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, - # as there is no search path for DLLs. - hardcode_libdir_flag_spec='-L$libdir' - export_dynamic_flag_spec='${wl}--export-all-symbols' - allow_undefined_flag=unsupported - always_export_symbols=no - enable_shared_with_static_runtimes=yes - export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' | $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 - ;; - - haiku*) - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - link_all_deplibs=yes - ;; - - interix[3-9]*) - hardcode_direct=no - hardcode_shlibpath_var=no - hardcode_libdir_flag_spec='${wl}-rpath,$libdir' - export_dynamic_flag_spec='${wl}-E' - # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. - # Instead, shared libraries are loaded at an image base (0x10000000 by - # default) and relocated if they conflict, which is a slow very memory - # consuming and fragmenting process. To avoid this, we pick a random, - # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link - # time. Moving up from 0x10000000 also allows more sbrk(2) space. - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - ;; - - gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) - tmp_diet=no - if test "$host_os" = linux-dietlibc; then - case $cc_basename in - diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) - esac - fi - if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ - && test "$tmp_diet" = no - then - tmp_addflag= - tmp_sharedflag='-shared' - case $cc_basename,$host_cpu in - pgcc*) # Portland Group C compiler - whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' - tmp_addflag=' $pic_flag' - ;; - pgf77* | pgf90* | pgf95* | pgfortran*) - # Portland Group f77 and f90 compilers - whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' - tmp_addflag=' $pic_flag -Mnomain' ;; - ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 - tmp_addflag=' -i_dynamic' ;; - efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 - tmp_addflag=' -i_dynamic -nofor_main' ;; - ifc* | ifort*) # Intel Fortran compiler - tmp_addflag=' -nofor_main' ;; - lf95*) # Lahey Fortran 8.1 - whole_archive_flag_spec= - tmp_sharedflag='--shared' ;; - xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) - tmp_sharedflag='-qmkshrobj' - tmp_addflag= ;; - nvcc*) # Cuda Compiler Driver 2.2 - whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' - compiler_needs_object=yes - ;; - esac - case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) # Sun C 5.9 - whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' - compiler_needs_object=yes - tmp_sharedflag='-G' ;; - *Sun\ F*) # Sun Fortran 8.3 - tmp_sharedflag='-G' ;; - esac - archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - - if test "x$supports_anon_versioning" = xyes; then - archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' - fi - - case $cc_basename in - xlf* | bgf* | bgxlf* | mpixlf*) - # IBM XL Fortran 10.1 on PPC cannot create shared libs itself - whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' - hardcode_libdir_flag_spec= - hardcode_libdir_flag_spec_ld='-rpath $libdir' - archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' - if test "x$supports_anon_versioning" = xyes; then - archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - echo "local: *; };" >> $output_objdir/$libname.ver~ - $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' - fi - ;; - esac - else - ld_shlibs=no - fi - ;; - - netbsd*) - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' - wlarc= - else - archive_cmds='$CC -shared $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 - # Also, AIX nm treats weak defined symbols like other global - # defined symbols, whereas GNU nm marks them as "W". - if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' - else - export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' - fi - aix_use_runtimelinking=no - - # Test if we are trying to use run time linking or normal - # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # need to do runtime linking. - case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) - for ld_flag in $LDFLAGS; do - if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then - aix_use_runtimelinking=yes - break - fi - done - ;; - esac - - exp_sym_flag='-bexport' - no_entry_flag='-bnoentry' - fi - - # When large executables or shared objects are built, AIX ld can - # have problems creating the table of contents. If linking a library - # or program results in "error TOC overflow" add -mminimal-toc to - # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not - # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. - - archive_cmds='' - hardcode_direct=yes - hardcode_direct_absolute=yes - hardcode_libdir_separator=':' - link_all_deplibs=yes - file_list_spec='${wl}-f,' - - if test "$GCC" = yes; then - case $host_os in aix4.[012]|aix4.[012].*) - # We only want to do this on AIX 4.2 and lower, the check - # below for broken collect2 doesn't work under 4.3+ - collect2name=`${CC} -print-prog-name=collect2` - if test -f "$collect2name" && - strings "$collect2name" | $GREP resolve_lib_name >/dev/null - then - # We have reworked collect2 - : - else - # We have old collect2 - hardcode_direct=unsupported - # It fails to find uninstalled libraries when the uninstalled - # path is not listed in the libpath. Setting hardcode_minus_L - # to unsupported forces relinking - hardcode_minus_L=yes - hardcode_libdir_flag_spec='-L$libdir' - hardcode_libdir_separator= - fi - ;; - esac - shared_flag='-shared' - if test "$aix_use_runtimelinking" = yes; then - shared_flag="$shared_flag "'${wl}-G' - fi - 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 confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - -lt_aix_libpath_sed=' - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\(.*\)$/\1/ - p - } - }' -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 -fi -rm -f core conftest.err conftest.$ac_objext \ - 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 func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" - else - if test "$host_cpu" = ia64; then - hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' - allow_undefined_flag="-z nodefs" - archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" - else - # Determine the default libpath from the value encoded in an - # empty executable. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - -lt_aix_libpath_sed=' - /Import File Strings/,/^$/ { - /^0/ { - s/^0 *\(.*\)$/\1/ - p - } - }' -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 -fi -rm -f core conftest.err conftest.$ac_objext \ - 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' - if test "$with_gnu_ld" = yes; then - # We only use this code for GNU lds that support --whole-archive. - whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive' - else - # Exported symbols can be pulled into shared objects from archives - whole_archive_flag_spec='$convenience' - fi - archive_cmds_need_lc=yes - # This is similar to how AIX traditionally builds its shared libraries. - archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' - fi - fi - ;; - - amigaos*) - case $host_cpu in - powerpc) - # see comment about AmigaOS4 .so support - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='' - ;; - m68k) - archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - ;; - esac - ;; - - bsdi[45]*) - export_dynamic_flag_spec=-rdynamic - ;; - - cygwin* | mingw* | pw32* | cegcc*) - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - # hardcode_libdir_flag_spec is actually meaningless, as there is - # no search path for DLLs. - hardcode_libdir_flag_spec=' ' - allow_undefined_flag=unsupported - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" - # FIXME: Setting linknames here is a bad hack. - archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' - # The linker will automatically build a .lib file if we build a DLL. - old_archive_from_new_cmds='true' - # FIXME: Should let the user specify the lib program. - old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' - 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 - if test "$lt_cv_ld_force_load" = "yes"; then - whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' - else - whole_archive_flag_spec='' - fi - link_all_deplibs=yes - allow_undefined_flag="$_lt_dar_allow_undefined" - case $cc_basename in - ifort*) _lt_dar_can_shared=yes ;; - *) _lt_dar_can_shared=$GCC ;; - esac - if test "$_lt_dar_can_shared" = "yes"; then - output_verbose_link_cmd=func_echo_all - archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" - module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" - archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" - module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" - - else - ld_shlibs=no - fi - - ;; - - dgux*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_shlibpath_var=no - ;; - - 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 && test "$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 && test "$with_gnu_ld" = no; then - case $host_cpu in - hppa*64*) - archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - archive_cmds='$CC -shared -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' - ;; - *) - - # Older versions of the 11.00 compiler do not understand -b yet - # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 -$as_echo_n "checking if $CC understands -b... " >&6; } -if test "${lt_cv_prog_compiler__b+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_prog_compiler__b=no - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS -b" - echo "$lt_simple_link_test_code" > conftest.$ac_ext - if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then - # The linker can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s conftest.err; then - # Append any errors to the config.log. - cat conftest.err 1>&5 - $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if diff conftest.exp conftest.er2 >/dev/null; then - lt_cv_prog_compiler__b=yes - fi - else - lt_cv_prog_compiler__b=yes - fi - fi - $RM -r conftest* - LDFLAGS="$save_LDFLAGS" - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 -$as_echo "$lt_cv_prog_compiler__b" >&6; } - -if test x"$lt_cv_prog_compiler__b" = xyes; then - archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' -else - archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' -fi - - ;; - esac - fi - if test "$with_gnu_ld" = no; then - hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' - hardcode_libdir_separator=: - - case $host_cpu in - hppa*64*|ia64*) - hardcode_direct=no - hardcode_shlibpath_var=no - ;; - *) - hardcode_direct=yes - hardcode_direct_absolute=yes - export_dynamic_flag_spec='${wl}-E' - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L=yes - ;; - esac - fi - ;; - - irix5* | irix6* | nonstopux*) - if test "$GCC" = yes; then - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - # Try to use the -exported_symbol ld option, if it does not - # work, assume that -exports_file does not work either and - # implicitly export all symbols. - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int foo(void) {} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' - -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - LDFLAGS="$save_LDFLAGS" - else - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' - fi - archive_cmds_need_lc='no' - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - inherit_rpath=yes - link_all_deplibs=yes - ;; - - netbsd*) - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out - else - archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF - fi - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - newsos6) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=yes - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - hardcode_shlibpath_var=no - ;; - - *nto* | *qnx*) - ;; - - openbsd*) - if test -f /usr/libexec/ld.so; then - hardcode_direct=yes - hardcode_shlibpath_var=no - hardcode_direct_absolute=yes - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' - hardcode_libdir_flag_spec='${wl}-rpath,$libdir' - export_dynamic_flag_spec='${wl}-E' - else - case $host_os in - openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='-R$libdir' - ;; - *) - archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec='${wl}-rpath,$libdir' - ;; - esac - fi - else - ld_shlibs=no - fi - ;; - - os2*) - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - allow_undefined_flag=unsupported - archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' - old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' - ;; - - osf3*) - if test "$GCC" = yes; then - allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - allow_undefined_flag=' -expect_unresolved \*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' - fi - archive_cmds_need_lc='no' - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - ;; - - osf4* | osf5*) # as osf3* with the addition of -msym flag - if test "$GCC" = yes; then - allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - else - allow_undefined_flag=' -expect_unresolved \*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' - archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ - $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' - - # Both c and cxx compiler support -rpath directly - hardcode_libdir_flag_spec='-rpath $libdir' - fi - archive_cmds_need_lc='no' - hardcode_libdir_separator=: - ;; - - solaris*) - no_undefined_flag=' -z defs' - if test "$GCC" = yes; then - wlarc='${wl}' - archive_cmds='$CC -shared ${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:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 -$as_echo "$ld_shlibs" >&6; } -test "$ld_shlibs" = no && can_build_shared=no - -with_gnu_ld=$with_gnu_ld - - - - - - - - - - - - - - - -# -# Do we need to explicitly link libc? -# -case "x$archive_cmds_need_lc" in -x|xyes) - # Assume -lc should be added - archive_cmds_need_lc=yes - - if test "$enable_shared" = yes && test "$GCC" = yes; then - case $archive_cmds in - *'~'*) - # FIXME: we may have to deal with multi-command sequences. - ;; - '$CC '*) - # Test whether the compiler implicitly links with -lc since on some - # systems, -lgcc has to come before -lc. If gcc already passes -lc - # to ld, don't add -lc before -lgcc. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 -$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } -if test "${lt_cv_archive_cmds_need_lc+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - $RM conftest* - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$lt_prog_compiler_wl - pic_flag=$lt_prog_compiler_pic - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$allow_undefined_flag - allow_undefined_flag= - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 - (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } - then - lt_cv_archive_cmds_need_lc=no - else - lt_cv_archive_cmds_need_lc=yes - fi - allow_undefined_flag=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $RM conftest* - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 -$as_echo "$lt_cv_archive_cmds_need_lc" >&6; } - archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc - ;; - esac - fi - ;; -esac - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 -$as_echo_n "checking dynamic linker characteristics... " >&6; } - -if test "$GCC" = yes; then - case $host_os in - darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; - *) lt_awk_arg="/^libraries:/" ;; - esac - case $host_os in - mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;; - *) lt_sed_strip_eq="s,=/,/,g" ;; - esac - lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` - case $lt_search_path_spec in - *\;*) - # if the path contains ";" then we assume it to be the separator - # otherwise default to the standard path separator (i.e. ":") - it is - # assumed that no part of a normal pathname contains ";" but that should - # okay in the real world where ";" in dirpaths is itself problematic. - lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` - ;; - *) - lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` - ;; - esac - # Ok, now we have the path, separated by spaces, we can step through it - # and add multilib dir if necessary. - lt_tmp_lt_search_path_spec= - lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` - for lt_sys_path in $lt_search_path_spec; do - if test -d "$lt_sys_path/$lt_multi_os_dir"; then - lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" - else - test -d "$lt_sys_path" && \ - lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" - fi - done - lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' -BEGIN {RS=" "; FS="/|\n";} { - lt_foo=""; - lt_count=0; - for (lt_i = NF; lt_i > 0; lt_i--) { - if ($lt_i != "" && $lt_i != ".") { - if ($lt_i == "..") { - lt_count++; - } else { - if (lt_count == 0) { - lt_foo="/" $lt_i lt_foo; - } else { - lt_count--; - } - } - } - } - if (lt_foo != "") { lt_freq[lt_foo]++; } - if (lt_freq[lt_foo] == 1) { print lt_foo; } -}'` - # AWK program above erroneously prepends '/' to C:/dos/paths - # for these hosts. - case $host_os in - mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ - $SED 's,/\([A-Za-z]:\),\1,g'` ;; - esac - sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` -else - sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" -fi -library_names_spec= -libname_spec='lib$name' -soname_spec= -shrext_cmds=".so" -postinstall_cmds= -postuninstall_cmds= -finish_cmds= -finish_eval= -shlibpath_var= -shlibpath_overrides_runpath=unknown -version_type=none -dynamic_linker="$host_os ld.so" -sys_lib_dlsearch_path_spec="/lib /usr/lib" -need_lib_prefix=unknown -hardcode_into_libs=no - -# when you set need_version to no, make sure it does not cause -set_version -# flags to be left without arguments -need_version=unknown - -case $host_os in -aix3*) - version_type=linux - 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.so - # instead of lib.a to let people know that these are not - # typical AIX shared libraries. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - else - # We preserve .a as extension for shared libraries through AIX4.2 - # and later when we are not doing run time linking. - library_names_spec='${libname}${release}.a $libname.a' - soname_spec='${libname}${release}${shared_ext}$major' - fi - shlibpath_var=LIBPATH - fi - ;; - -amigaos*) - case $host_cpu in - powerpc) - # Since July 2007 AmigaOS4 officially supports .so libraries. - # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - ;; - m68k) - library_names_spec='$libname.ixlibrary $libname.a' - # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' - ;; - esac - ;; - -beos*) - library_names_spec='${libname}${shared_ext}' - dynamic_linker="$host_os ld.so" - shlibpath_var=LIBRARY_PATH - ;; - -bsdi[45]*) - version_type=linux - 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="$sys_lib_search_path_spec /usr/lib/w32api" - ;; - mingw* | cegcc*) - # MinGW DLLs use traditional 'lib' prefix - soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - ;; - pw32*) - # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - ;; - esac - ;; - - *) - 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 - ;; - -haiku*) - version_type=linux - need_lib_prefix=no - need_version=no - dynamic_linker="$host_os runtime_loader" - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=yes - sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' - hardcode_into_libs=yes - ;; - -hpux9* | hpux10* | hpux11*) - # Give a soname corresponding to the major version so that dld.sl refuses to - # link against other versions. - version_type=sunos - need_lib_prefix=no - need_version=no - case $host_cpu in - ia64*) - shrext_cmds='.so' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.so" - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - if test "X$HPUX_IA64_MODE" = X32; then - sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" - else - sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" - fi - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - hppa*64*) - shrext_cmds='.sl' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.sl" - shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - *) - shrext_cmds='.sl' - dynamic_linker="$host_os dld.sl" - shlibpath_var=SHLIB_PATH - shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - ;; - esac - # HP-UX runs *really* slowly unless shared libraries are mode 555, ... - postinstall_cmds='chmod 555 $lib' - # or fails outright, so override atomically: - install_override_mode=555 - ;; - -interix[3-9]*) - version_type=linux - 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 | kopensolaris*-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 - if test "${lt_cv_shlibpath_overrides_runpath+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - lt_cv_shlibpath_overrides_runpath=no - save_LDFLAGS=$LDFLAGS - save_libdir=$libdir - eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ - LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : - lt_cv_shlibpath_overrides_runpath=yes -fi -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - LDFLAGS=$save_LDFLAGS - libdir=$save_libdir - -fi - - shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath - - # This implies no fast_install, which is unacceptable. - # Some rework will be needed to allow for fast_install - # before this can be enabled. - hardcode_into_libs=yes - - # Add ABI-specific directories to the system library path. - sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib" - - # Append ld.so.conf contents to the search path - if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` - sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" - - fi - - # We used to test for /lib/ld.so.1 and disable shared libraries on - # powerpc, because MkLinux only supported shared libraries with the - # GNU dynamic linker. Since this was broken with cross compilers, - # most powerpc-linux boxes support dynamic linking these days and - # people can always --disable-shared, the test was removed, and we - # assume the GNU/Linux dynamic linker is in use. - dynamic_linker='GNU/Linux ld.so' - ;; - -netbsd*) - version_type=sunos - need_lib_prefix=no - need_version=no - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - dynamic_linker='NetBSD (a.out) ld.so' - else - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - dynamic_linker='NetBSD ld.elf_so' - fi - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - -newsos6) - version_type=linux - 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:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 -$as_echo "$dynamic_linker" >&6; } -test "$dynamic_linker" = no && can_build_shared=no - -variables_saved_for_relink="PATH $shlibpath_var $runpath_var" -if test "$GCC" = yes; then - variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" -fi - -if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then - sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" -fi -if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then - sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" -fi - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 -$as_echo_n "checking how to hardcode library paths into programs... " >&6; } -hardcode_action= -if test -n "$hardcode_libdir_flag_spec" || - test -n "$runpath_var" || - test "X$hardcode_automatic" = "Xyes" ; then - - # We can hardcode non-existent directories. - if test "$hardcode_direct" != no && - # If the only mechanism to avoid hardcoding is shlibpath_var, we - # have to relink, otherwise we might link with an installed library - # when we should be linking with a yet-to-be-installed one - ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no && - test "$hardcode_minus_L" != no; then - # Linking always hardcodes the temporary library directory. - hardcode_action=relink - else - # We can link without hardcoding, and we can hardcode nonexisting dirs. - hardcode_action=immediate - fi -else - # We cannot hardcode anything, or else we can only hardcode existing - # directories. - hardcode_action=unsupported -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 -$as_echo "$hardcode_action" >&6; } - -if test "$hardcode_action" = relink || - test "$inherit_rpath" = yes; then - # Fast installation is not supported - enable_fast_install=no -elif test "$shlibpath_overrides_runpath" = yes || - test "$enable_shared" = no; then - # Fast installation is not necessary - enable_fast_install=needless -fi - - - - - - - if test "x$enable_dlopen" != xyes; then - enable_dlopen=unknown - enable_dlopen_self=unknown - enable_dlopen_self_static=unknown -else - lt_cv_dlopen=no - lt_cv_dlopen_libs= - - case $host_os in - beos*) - lt_cv_dlopen="load_add_on" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes - ;; - - mingw* | pw32* | cegcc*) - lt_cv_dlopen="LoadLibrary" - lt_cv_dlopen_libs= - ;; - - cygwin*) - lt_cv_dlopen="dlopen" - lt_cv_dlopen_libs= - ;; - - darwin*) - # if libdl is installed we need to link against it - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 -$as_echo_n "checking for dlopen in -ldl... " >&6; } -if 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 confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dlopen (); -int -main () -{ -return dlopen (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_dl_dlopen=yes -else - ac_cv_lib_dl_dlopen=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 -$as_echo "$ac_cv_lib_dl_dlopen" >&6; } -if test "x$ac_cv_lib_dl_dlopen" = 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 - - ;; - - *) - ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" -if test "x$ac_cv_func_shl_load" = x""yes; then : - lt_cv_dlopen="shl_load" -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 -$as_echo_n "checking for shl_load in -ldld... " >&6; } -if 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 confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char shl_load (); -int -main () -{ -return shl_load (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_dld_shl_load=yes -else - ac_cv_lib_dld_shl_load=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 -$as_echo "$ac_cv_lib_dld_shl_load" >&6; } -if test "x$ac_cv_lib_dld_shl_load" = x""yes; then : - lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" -else - ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" -if test "x$ac_cv_func_dlopen" = x""yes; then : - lt_cv_dlopen="dlopen" -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 -$as_echo_n "checking for dlopen in -ldl... " >&6; } -if 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 confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dlopen (); -int -main () -{ -return dlopen (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_dl_dlopen=yes -else - ac_cv_lib_dl_dlopen=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 -$as_echo "$ac_cv_lib_dl_dlopen" >&6; } -if test "x$ac_cv_lib_dl_dlopen" = x""yes; then : - lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 -$as_echo_n "checking for dlopen in -lsvld... " >&6; } -if 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 confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dlopen (); -int -main () -{ -return dlopen (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_svld_dlopen=yes -else - ac_cv_lib_svld_dlopen=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 -$as_echo "$ac_cv_lib_svld_dlopen" >&6; } -if test "x$ac_cv_lib_svld_dlopen" = x""yes; then : - lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 -$as_echo_n "checking for dld_link in -ldld... " >&6; } -if 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 confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char dld_link (); -int -main () -{ -return dld_link (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_dld_dld_link=yes -else - ac_cv_lib_dld_dld_link=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 -$as_echo "$ac_cv_lib_dld_dld_link" >&6; } -if test "x$ac_cv_lib_dld_dld_link" = 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:${as_lineno-$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 $LINENO "configure" -#include "confdefs.h" - -#if HAVE_DLFCN_H -#include -#endif - -#include - -#ifdef RTLD_GLOBAL -# define LT_DLGLOBAL RTLD_GLOBAL -#else -# ifdef DL_GLOBAL -# define LT_DLGLOBAL DL_GLOBAL -# else -# define LT_DLGLOBAL 0 -# endif -#endif - -/* We may have to define LT_DLLAZY_OR_NOW in the command line if we - find out it does not work in some platform. */ -#ifndef LT_DLLAZY_OR_NOW -# ifdef RTLD_LAZY -# define LT_DLLAZY_OR_NOW RTLD_LAZY -# else -# ifdef DL_LAZY -# define LT_DLLAZY_OR_NOW DL_LAZY -# else -# ifdef RTLD_NOW -# define LT_DLLAZY_OR_NOW RTLD_NOW -# else -# ifdef DL_NOW -# define LT_DLLAZY_OR_NOW DL_NOW -# else -# define LT_DLLAZY_OR_NOW 0 -# endif -# endif -# endif -# endif -#endif - -/* When -fvisbility=hidden is used, assume the code has been annotated - correspondingly for the symbols needed. */ -#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) -void fnord () __attribute__((visibility("default"))); -#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; - else puts (dlerror ()); - } - /* dlclose (self); */ - } - else - puts (dlerror ()); - - return status; -} -_LT_EOF - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 - (eval $ac_link) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then - (./conftest; exit; ) >&5 2>/dev/null - lt_status=$? - case x$lt_status in - x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; - x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; - x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; - esac - else : - # compilation failed - lt_cv_dlopen_self=no - fi -fi -rm -fr conftest* - - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 -$as_echo "$lt_cv_dlopen_self" >&6; } - - if test "x$lt_cv_dlopen_self" = xyes; then - wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 -$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } -if 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 $LINENO "configure" -#include "confdefs.h" - -#if HAVE_DLFCN_H -#include -#endif - -#include - -#ifdef RTLD_GLOBAL -# define LT_DLGLOBAL RTLD_GLOBAL -#else -# ifdef DL_GLOBAL -# define LT_DLGLOBAL DL_GLOBAL -# else -# define LT_DLGLOBAL 0 -# endif -#endif - -/* We may have to define LT_DLLAZY_OR_NOW in the command line if we - find out it does not work in some platform. */ -#ifndef LT_DLLAZY_OR_NOW -# ifdef RTLD_LAZY -# define LT_DLLAZY_OR_NOW RTLD_LAZY -# else -# ifdef DL_LAZY -# define LT_DLLAZY_OR_NOW DL_LAZY -# else -# ifdef RTLD_NOW -# define LT_DLLAZY_OR_NOW RTLD_NOW -# else -# ifdef DL_NOW -# define LT_DLLAZY_OR_NOW DL_NOW -# else -# define LT_DLLAZY_OR_NOW 0 -# endif -# endif -# endif -# endif -#endif - -/* When -fvisbility=hidden is used, assume the code has been annotated - correspondingly for the symbols needed. */ -#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) -void fnord () __attribute__((visibility("default"))); -#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; - else puts (dlerror ()); - } - /* dlclose (self); */ - } - else - puts (dlerror ()); - - return status; -} -_LT_EOF - if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 - (eval $ac_link) 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then - (./conftest; exit; ) >&5 2>/dev/null - lt_status=$? - case x$lt_status in - x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; - x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; - x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; - esac - else : - # compilation failed - lt_cv_dlopen_self_static=no - fi -fi -rm -fr conftest* - - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 -$as_echo "$lt_cv_dlopen_self_static" >&6; } - fi - - CPPFLAGS="$save_CPPFLAGS" - LDFLAGS="$save_LDFLAGS" - LIBS="$save_LIBS" - ;; - esac - - case $lt_cv_dlopen_self in - yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; - *) enable_dlopen_self=unknown ;; - esac - - case $lt_cv_dlopen_self_static in - yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; - *) enable_dlopen_self_static=unknown ;; - esac -fi - - - - - - - - - - - - - - - - - -striplib= -old_striplib= -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 -$as_echo_n "checking whether stripping libraries is possible... " >&6; } -if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then - test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" - test -z "$striplib" && striplib="$STRIP --strip-unneeded" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else -# FIXME - insert some real tests, host_os isn't really good enough - case $host_os in - darwin*) - if test -n "$STRIP" ; then - striplib="$STRIP -x" - old_striplib="$STRIP -S" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - fi - ;; - *) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - ;; - esac -fi - - - - - - - - - - - - - # Report which library types will actually be built - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 -$as_echo_n "checking if libtool supports shared libraries... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 -$as_echo "$can_build_shared" >&6; } - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 -$as_echo_n "checking whether to build shared libraries... " >&6; } - test "$can_build_shared" = "no" && enable_shared=no - - # On AIX, shared libraries and static libraries use the same namespace, and - # are all built from PIC. - case $host_os in - aix3*) - test "$enable_shared" = yes && enable_static=no - if test -n "$RANLIB"; then - archive_cmds="$archive_cmds~\$RANLIB \$lib" - postinstall_cmds='$RANLIB $lib' - fi - ;; - - aix[4-9]*) - if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then - test "$enable_shared" = yes && enable_static=no - fi - ;; - esac - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 -$as_echo "$enable_shared" >&6; } - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 -$as_echo_n "checking whether to build static libraries... " >&6; } - # Make sure either enable_shared or enable_static is yes. - test "$enable_shared" = yes || enable_static=yes - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 -$as_echo "$enable_static" >&6; } - - - - -fi -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -CC="$lt_save_CC" - - - - - - - - - - - - - - ac_config_commands="$ac_config_commands libtool" - - - - -# Only expand once: - - - - - - -OBJECT_MODE= -# Checks for programs. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking compiler flags required for compiling ANTLR with $CC C compiler on host $host" >&5 -$as_echo_n "checking compiler flags required for compiling ANTLR with $CC C compiler on host $host... " >&6; } -WARNFLAGS= -case $CC in -xlc*) - CPPCMNTFLAGS="-qcpluscmt" - if test x"$enable_64bit" = xyes; then - CCFLAGS64="-q64 -Wl,-b64" - OBJECT_MODE="64" - else - OBJECT_MODE="32" - fi - OPTIMFLAGS="-O2" - if test x"$enable_debuginfo" = xyes; then - DEBUGFLAGS="-g" - fi - ;; - -aCC*) - CPPCMNTFLAGS= - if test x"$enable_64bit" = xyes; then - CCFLAGS64="+DD64" - fi - OPTIMFLAGS="-O" - if test $DEBUGINF = 1; then - DEBUGFLAGS="-g" - fi - ;; - -gcc*) - CPPCMNTFLAGS= - if test x"$enable_64bit" = xyes; then - GCCABIFLAGS="-m64" - else - GCCABIFLAGS="-m32" - fi - if test x"$enable_abiflags" = xyes; then - CCFLAGS64=$GCCABIFLAGS - fi - OPTIMFLAGS="-O2" - if test x"$enable_debuginfo" = xyes; then - DEBUGFLAGS="-g" - fi - WARNFLAGS=-Wall - ;; - -*) - -case $host in -sparc*-*solaris*) - CPPCMNTFLAGS= - if test x"$enable_64bit" = xyes; then - CCFLAGS64="-fast -xtarget=ultra4 -m64 -xarch=sparcvis" - fi - OPTIMFLAGS="-O" - if test x"$enable_debuginfo" = xyes; then - DEBUGFLAGS='-g' - fi - ;; - -*) - CPPCMNTFLAGS= - CCFLAGS64= - OPTIMFLAGS="-O" - if test x"$enable_debuginfo" = xyes; then - DEBUGFLAGS='-g' - fi - ;; -esac - - ;; -esac - -CFLAGS="$CCFLAGS64 $CPPCMNTFLAGS $OPTIMFLAGS $DEBUGFLAGS $WARNFLAGS" -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CFLAGS" >&5 -$as_echo "$CFLAGS" >&6; } - - -if test "x$enable_antlrdebug" = xno; then : - -$as_echo "#define ANTLR3_NODEBUGGER 1" >>confdefs.h - -fi -if test x"$enable_64bit" = xyes; then : - -$as_echo "#define ANTLR3_USE_64BIT 1" >>confdefs.h - -fi - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 -$as_echo_n "checking whether ln -s works... " >&6; } -LN_S=$as_ln_s -if test "$LN_S" = "ln -s"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 -$as_echo "no, using $LN_S" >&6; } -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 -$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } -set x ${MAKE-make} -ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` -if eval "test \"\${ac_cv_prog_make_${ac_make}_set+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:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - SET_MAKE= -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - SET_MAKE="MAKE=${MAKE-make}" -fi - - -# Checks for libraries. - -# Checks for header files. -$ac_includes_default -for ac_header in sys/types.h netinet/in.h arpa/nameser.h netdb.h resolv.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "#ifdef HAVE_SYS_TYPES_H -# include -#endif -#ifdef HAVE_NETINET_IN_H -# include /* inet_ functions / structs */ -#endif -#ifdef HAVE_ARPA_NAMESER_H -# include /* DNS HEADER struct */ -#endif -#ifdef HAVE_NETDB_H -# include -#endif -" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - -for ac_header in sys/malloc.h malloc.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "#ifdef HAVE_SYS_MALLOC_H -#include -#endif -#ifdef HAVE_MALLOC_H -#include -#endif - -" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - -for ac_header in stdarg.h -do : - ac_fn_c_check_header_compile "$LINENO" "stdarg.h" "ac_cv_header_stdarg_h" "#ifdef HAVE_STDARG_H -#include -#endif - -" -if test "x$ac_cv_header_stdarg_h" = x""yes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_STDARG_H 1 -_ACEOF - -fi - -done - - -for ac_header in sys/stat.h -do : - ac_fn_c_check_header_compile "$LINENO" "sys/stat.h" "ac_cv_header_sys_stat_h" "#ifdef HAVE_SYS_STAT_H -#include -#endif - -" -if test "x$ac_cv_header_sys_stat_h" = x""yes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_SYS_STAT_H 1 -_ACEOF - -fi - -done - - -for ac_header in ctype.h -do : - ac_fn_c_check_header_compile "$LINENO" "ctype.h" "ac_cv_header_ctype_h" "#ifdef HAVE_CTYPE_H -#include -#endif - -" -if test "x$ac_cv_header_ctype_h" = x""yes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_CTYPE_H 1 -_ACEOF - -fi - -done - - -for ac_header in netinet/tcp.h -do : - ac_fn_c_check_header_compile "$LINENO" "netinet/tcp.h" "ac_cv_header_netinet_tcp_h" "#ifdef HAVE_NETINET_TCP_H -#include -#endif - -" -if test "x$ac_cv_header_netinet_tcp_h" = x""yes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_NETINET_TCP_H 1 -_ACEOF - -fi - -done - - -for ac_header in sys/socket.h socket.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#ifdef HAVE_SOCKET_H -#include -#endif - -" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - -# Checks for typedefs, structures, and compiler characteristics. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 -$as_echo_n "checking for an ANSI C-conforming const... " >&6; } -if test "${ac_cv_c_const+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ -/* FIXME: Include the comments suggested by Paul. */ -#ifndef __cplusplus - /* Ultrix mips cc rejects this. */ - typedef int charset[2]; - const charset cs; - /* SunOS 4.1.1 cc rejects this. */ - char const *const *pcpcc; - char **ppc; - /* NEC SVR4.0.2 mips cc rejects this. */ - struct point {int x, y;}; - static struct point const zero = {0,0}; - /* 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"; - pcpcc = &g + (g ? g-g : 0); - /* HPUX 7.0 cc rejects these. */ - ++pcpcc; - ppc = (char**) pcpcc; - pcpcc = (char const *const *) ppc; - { /* SCO 3.2v4 cc rejects this. */ - char *t; - char const *s = 0 ? (char *) 0 : (char const *) 0; - - *t++ = 0; - if (s) return 0; - } - { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ - int x[] = {25, 17}; - const int *foo = &x[0]; - ++foo; - } - { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ - typedef const int *iptr; - iptr p = 0; - ++p; - } - { /* 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; - if (!foo) return 0; - } - return !cs[0] && !zero.x; -#endif - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_c_const=yes -else - ac_cv_c_const=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 -$as_echo "$ac_cv_c_const" >&6; } -if test $ac_cv_c_const = no; then - -$as_echo "#define const /**/" >>confdefs.h - -fi - -ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" -if test "x$ac_cv_type_size_t" = x""yes; then : - -else - -cat >>confdefs.h <<_ACEOF -#define size_t unsigned int -_ACEOF - -fi - -ac_fn_c_find_intX_t "$LINENO" "8" "ac_cv_c_int8_t" -case $ac_cv_c_int8_t in #( - no|yes) ;; #( - *) - -cat >>confdefs.h <<_ACEOF -#define int8_t $ac_cv_c_int8_t -_ACEOF -;; -esac - -ac_fn_c_find_intX_t "$LINENO" "16" "ac_cv_c_int16_t" -case $ac_cv_c_int16_t in #( - no|yes) ;; #( - *) - -cat >>confdefs.h <<_ACEOF -#define int16_t $ac_cv_c_int16_t -_ACEOF -;; -esac - -ac_fn_c_find_intX_t "$LINENO" "32" "ac_cv_c_int32_t" -case $ac_cv_c_int32_t in #( - no|yes) ;; #( - *) - -cat >>confdefs.h <<_ACEOF -#define int32_t $ac_cv_c_int32_t -_ACEOF -;; -esac - -ac_fn_c_find_intX_t "$LINENO" "64" "ac_cv_c_int64_t" -case $ac_cv_c_int64_t in #( - no|yes) ;; #( - *) - -cat >>confdefs.h <<_ACEOF -#define int64_t $ac_cv_c_int64_t -_ACEOF -;; -esac - - - ac_fn_c_check_type "$LINENO" "intptr_t" "ac_cv_type_intptr_t" "$ac_includes_default" -if test "x$ac_cv_type_intptr_t" = x""yes; then : - -$as_echo "#define HAVE_INTPTR_T 1" >>confdefs.h - -else - for ac_type in 'int' 'long int' 'long long int'; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(sizeof (void *) <= sizeof ($ac_type))]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -cat >>confdefs.h <<_ACEOF -#define intptr_t $ac_type -_ACEOF - - ac_type= -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - test -z "$ac_type" && break - done -fi - - -ac_fn_c_find_uintX_t "$LINENO" "8" "ac_cv_c_uint8_t" -case $ac_cv_c_uint8_t in #( - no|yes) ;; #( - *) - -$as_echo "#define _UINT8_T 1" >>confdefs.h - - -cat >>confdefs.h <<_ACEOF -#define uint8_t $ac_cv_c_uint8_t -_ACEOF -;; - esac - -ac_fn_c_find_uintX_t "$LINENO" "16" "ac_cv_c_uint16_t" -case $ac_cv_c_uint16_t in #( - no|yes) ;; #( - *) - - -cat >>confdefs.h <<_ACEOF -#define uint16_t $ac_cv_c_uint16_t -_ACEOF -;; - esac - -ac_fn_c_find_uintX_t "$LINENO" "32" "ac_cv_c_uint32_t" -case $ac_cv_c_uint32_t in #( - no|yes) ;; #( - *) - -$as_echo "#define _UINT32_T 1" >>confdefs.h - - -cat >>confdefs.h <<_ACEOF -#define uint32_t $ac_cv_c_uint32_t -_ACEOF -;; - esac - -ac_fn_c_find_uintX_t "$LINENO" "64" "ac_cv_c_uint64_t" -case $ac_cv_c_uint64_t in #( - no|yes) ;; #( - *) - -$as_echo "#define _UINT64_T 1" >>confdefs.h - - -cat >>confdefs.h <<_ACEOF -#define uint64_t $ac_cv_c_uint64_t -_ACEOF -;; - esac - - - ac_fn_c_check_type "$LINENO" "uintptr_t" "ac_cv_type_uintptr_t" "$ac_includes_default" -if test "x$ac_cv_type_uintptr_t" = x""yes; then : - -$as_echo "#define HAVE_UINTPTR_T 1" >>confdefs.h - -else - for ac_type in 'unsigned int' 'unsigned long int' \ - 'unsigned long long int'; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -static int test_array [1 - 2 * !(sizeof (void *) <= sizeof ($ac_type))]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -cat >>confdefs.h <<_ACEOF -#define uintptr_t $ac_type -_ACEOF - - ac_type= -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - test -z "$ac_type" && break - done -fi - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 -$as_echo_n "checking for inline... " >&6; } -if test "${ac_cv_c_inline+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_c_inline=no -for ac_kw in inline __inline__ __inline; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifndef __cplusplus -typedef int foo_t; -static $ac_kw foo_t static_foo () {return 0; } -$ac_kw foo_t foo () {return 0; } -#endif - -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_c_inline=$ac_kw -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - test "$ac_cv_c_inline" != no && break -done - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 -$as_echo "$ac_cv_c_inline" >&6; } - -case $ac_cv_c_inline in - inline | yes) ;; - *) - case $ac_cv_c_inline in - no) ac_val=;; - *) ac_val=$ac_cv_c_inline;; - esac - cat >>confdefs.h <<_ACEOF -#ifndef __cplusplus -#define inline $ac_val -#endif -_ACEOF - ;; -esac - - - -# Checks for library functions. -for ac_func in memmove memset strdup accept -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - - - - -ac_config_headers="$ac_config_headers antlr3config.h" - -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:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( - *) { eval $ac_var=; unset $ac_var;} ;; - esac ;; - esac - done - - (set) 2>&1 | - case $as_nl`(ac_space=' '; set) 2>&1` in #( - *${as_nl}ac_space=\ *) - # `set' does not quote correctly, so add quotes: double-quote - # substitution turns \\\\ into \\, and sed turns \\ into \. - sed -n \ - "s/'/'\\\\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" - ;; #( - *) - # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" - ;; - esac | - sort -) | - sed ' - /^ac_cv_env_/b end - t clear - :clear - s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ - t end - s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ - :end' >>confcache -if diff "$cache_file" confcache >/dev/null 2>&1; then :; else - if test -w "$cache_file"; then - test "x$cache_file" != "x/dev/null" && - { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 -$as_echo "$as_me: updating cache $cache_file" >&6;} - cat confcache >$cache_file - else - { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 -$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} - fi -fi -rm -f confcache - -test "x$prefix" = xNONE && prefix=$ac_default_prefix -# Let make expand exec_prefix. -test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' - -DEFS=-DHAVE_CONFIG_H - -ac_libobjs= -ac_ltlibobjs= -U= -for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue - # 1. Remove the extension, and $U if already installed. - ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' - ac_i=`$as_echo "$ac_i" | sed "$ac_script"` - # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR - # will be set to the directory where LIBOBJS objects are built. - as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" - as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' -done -LIBOBJS=$ac_libobjs - -LTLIBOBJS=$ac_ltlibobjs - - - if test -n "$EXEEXT"; then - am__EXEEXT_TRUE= - am__EXEEXT_FALSE='#' -else - am__EXEEXT_TRUE='#' - am__EXEEXT_FALSE= -fi - -if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then - as_fn_error $? "conditional \"AMDEP\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then - as_fn_error $? "conditional \"am__fastdepCC\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi -if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then - as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi - -: ${CONFIG_STATUS=./config.status} -ac_write_fail=0 -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 -$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} -as_write_fail=0 -cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 -#! $SHELL -# Generated by $as_me. -# Run this file to recreate the current configuration. -# Compiler output produced by configure, useful for debugging -# configure, is in config.log if it exists. - -debug=false -ac_cs_recheck=false -ac_cs_silent=false - -SHELL=\${CONFIG_SHELL-$SHELL} -export SHELL -_ASEOF -cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 -## -------------------- ## -## M4sh Initialization. ## -## -------------------- ## - -# Be more Bourne compatible -DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in #( - *posix*) : - set -o posix ;; #( - *) : - ;; -esac -fi - - -as_nl=' -' -export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -# Prefer a ksh shell builtin over an external printf program on Solaris, -# but without wasting forks for bash or zsh. -if test -z "$BASH_VERSION$ZSH_VERSION" \ - && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='print -r --' - as_echo_n='print -rn --' -elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in #( - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' -fi - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - PATH_SEPARATOR=: - (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { - (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || - PATH_SEPARATOR=';' - } -fi - - -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -IFS=" "" $as_nl" - -# Find who we are. Look in the path if we contain no directory separator. -case $0 in #(( - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break - done -IFS=$as_save_IFS - - ;; -esac -# We did not find ourselves, most probably we were run as `sh COMMAND' -# in which case we are not to be found in the path. -if test "x$as_myself" = x; then - as_myself=$0 -fi -if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - exit 1 -fi - -# Unset variables that we do not need and which cause bugs (e.g. in -# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" -# suppresses any "Segmentation fault" message there. '((' could -# trigger a bug in pdksh 5.2.14. -for as_var in BASH_ENV ENV MAIL MAILPATH -do eval test x\${$as_var+set} = xset \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - - -# as_fn_error STATUS ERROR [LINENO LOG_FD] -# ---------------------------------------- -# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are -# provided, also output the error to LOG_FD, referencing LINENO. Then exit the -# script with STATUS, using 1 if that was 0. -as_fn_error () -{ - as_status=$1; test $as_status -eq 0 && as_status=1 - if test "$4"; then - as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 - fi - $as_echo "$as_me: error: $2" >&2 - as_fn_exit $as_status -} # as_fn_error - - -# as_fn_set_status STATUS -# ----------------------- -# Set $? to STATUS, without forking. -as_fn_set_status () -{ - return $1 -} # as_fn_set_status - -# as_fn_exit STATUS -# ----------------- -# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. -as_fn_exit () -{ - set +e - as_fn_set_status $1 - exit $1 -} # as_fn_exit - -# as_fn_unset VAR -# --------------- -# Portably unset VAR. -as_fn_unset () -{ - { eval $1=; unset $1;} -} -as_unset=as_fn_unset -# as_fn_append VAR VALUE -# ---------------------- -# Append the text in VALUE to the end of the definition contained in VAR. Take -# advantage of any shell optimizations that allow amortized linear growth over -# repeated appends, instead of the typical quadratic growth present in naive -# implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : - eval 'as_fn_append () - { - eval $1+=\$2 - }' -else - as_fn_append () - { - eval $1=\$$1\$2 - } -fi # as_fn_append - -# as_fn_arith ARG... -# ------------------ -# Perform arithmetic evaluation on the ARGs, and store the result in the -# global $as_val. Take advantage of shells that can avoid forks. The arguments -# must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : - eval 'as_fn_arith () - { - as_val=$(( $* )) - }' -else - as_fn_arith () - { - as_val=`expr "$@" || test $? -eq 1` - } -fi # as_fn_arith - - -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in #((((( --n*) - case `echo 'xy\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - xy) ECHO_C='\c';; - *) echo `echo ksh88 bug on AIX 6.1` > /dev/null - ECHO_T=' ';; - esac;; -*) - ECHO_N='-n';; -esac - -rm -f conf$$ conf$$.exe conf$$.file -if test -d conf$$.dir; then - rm -f conf$$.dir/conf$$.file -else - rm -f conf$$.dir - mkdir conf$$.dir 2>/dev/null -fi -if (echo >conf$$.file) 2>/dev/null; then - if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' - elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln - else - as_ln_s='cp -p' - fi -else - as_ln_s='cp -p' -fi -rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -rmdir conf$$.dir 2>/dev/null - - -# as_fn_mkdir_p -# ------------- -# Create "$as_dir" as a directory, including parents if necessary. -as_fn_mkdir_p () -{ - - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || eval $as_mkdir_p || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( - *) as_qdir=$as_dir;; - esac - as_dirs="'$as_qdir' $as_dirs" - as_dir=`$as_dirname -- "$as_dir" || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - test -d "$as_dir" && break - done - test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" - - -} # as_fn_mkdir_p -if mkdir -p . 2>/dev/null; then - as_mkdir_p='mkdir -p "$as_dir"' -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in #( - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - - -exec 6>&1 -## ----------------------------------- ## -## Main body of $CONFIG_STATUS script. ## -## ----------------------------------- ## -_ASEOF -test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# Save the log message, to keep $0 and so on meaningful, and to -# report actual input values of CONFIG_FILES etc. instead of their -# values after options handling. -ac_log=" -This file was extended by libantlr3c $as_me 3.4, which was -generated by GNU Autoconf 2.66. Invocation command line was - - CONFIG_FILES = $CONFIG_FILES - CONFIG_HEADERS = $CONFIG_HEADERS - CONFIG_LINKS = $CONFIG_LINKS - CONFIG_COMMANDS = $CONFIG_COMMANDS - $ $0 $@ - -on `(hostname || uname -n) 2>/dev/null | sed 1q` -" - -_ACEOF - -case $ac_config_files in *" -"*) set x $ac_config_files; shift; ac_config_files=$*;; -esac - -case $ac_config_headers in *" -"*) set x $ac_config_headers; shift; ac_config_headers=$*;; -esac - - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -# Files that config.status was made for. -config_files="$ac_config_files" -config_headers="$ac_config_headers" -config_commands="$ac_config_commands" - -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -ac_cs_usage="\ -\`$as_me' instantiates files and other configuration actions -from templates according to the current configuration. Unless the files -and actions are specified as TAGs, all are instantiated by default. - -Usage: $0 [OPTION]... [TAG]... - - -h, --help print this help, then exit - -V, --version print version number and configuration settings, then exit - --config print configuration, then exit - -q, --quiet, --silent - do not print progress messages - -d, --debug don't remove temporary files - --recheck update $as_me by reconfiguring in the same conditions - --file=FILE[:TEMPLATE] - instantiate the configuration file FILE - --header=FILE[:TEMPLATE] - instantiate the configuration header FILE - -Configuration files: -$config_files - -Configuration headers: -$config_headers - -Configuration commands: -$config_commands - -Report bugs to ." - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" -ac_cs_version="\\ -libantlr3c config.status 3.4 -configured by $0, generated by GNU Autoconf 2.66, - with options \\"\$ac_cs_config\\" - -Copyright (C) 2010 Free Software Foundation, Inc. -This config.status script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it." - -ac_pwd='$ac_pwd' -srcdir='$srcdir' -INSTALL='$INSTALL' -MKDIR_P='$MKDIR_P' -AWK='$AWK' -test -n "\$AWK" || AWK=awk -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# The default lists apply if the user does not specify any file. -ac_need_defaults=: -while test $# != 0 -do - case $1 in - --*=*) - ac_option=`expr "X$1" : 'X\([^=]*\)='` - ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` - ac_shift=: - ;; - *) - ac_option=$1 - ac_optarg=$2 - ac_shift=shift - ;; - esac - - case $ac_option in - # Handling of the options. - -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - ac_cs_recheck=: ;; - --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) - $as_echo "$ac_cs_version"; exit ;; - --config | --confi | --conf | --con | --co | --c ) - $as_echo "$ac_cs_config"; exit ;; - --debug | --debu | --deb | --de | --d | -d ) - debug=: ;; - --file | --fil | --fi | --f ) - $ac_shift - case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - as_fn_append CONFIG_FILES " '$ac_optarg'" - ac_need_defaults=false;; - --header | --heade | --head | --hea ) - $ac_shift - case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - as_fn_append CONFIG_HEADERS " '$ac_optarg'" - ac_need_defaults=false;; - --he | --h) - # Conflict between --help and --header - as_fn_error $? "ambiguous option: \`$1' -Try \`$0 --help' for more information.";; - --help | --hel | -h ) - $as_echo "$ac_cs_usage"; exit ;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil | --si | --s) - ac_cs_silent=: ;; - - # This is an error. - -*) as_fn_error $? "unrecognized option: \`$1' -Try \`$0 --help' for more information." ;; - - *) as_fn_append ac_config_targets " $1" - ac_need_defaults=false ;; - - esac - shift -done - -ac_configure_extra_args= - -if $ac_cs_silent; then - exec 6>/dev/null - ac_configure_extra_args="$ac_configure_extra_args --silent" -fi - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -if \$ac_cs_recheck; then - set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion - shift - \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 - CONFIG_SHELL='$SHELL' - export CONFIG_SHELL - exec "\$@" -fi - -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -exec 5>>config.log -{ - echo - sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX -## Running $as_me. ## -_ASBOX - $as_echo "$ac_log" -} >&5 - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -# -# INIT-COMMANDS -# -AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" - - -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -sed_quote_subst='$sed_quote_subst' -double_quote_subst='$double_quote_subst' -delay_variable_subst='$delay_variable_subst' -macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`' -macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`' -enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`' -enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`' -pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`' -enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`' -SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`' -ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`' -host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`' -host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`' -host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`' -build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`' -build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`' -build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`' -SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`' -Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`' -GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`' -EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`' -FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`' -LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`' -NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`' -LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`' -max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`' -ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`' -exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`' -lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`' -lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`' -lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`' -reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`' -reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`' -OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`' -deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`' -file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`' -AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`' -AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`' -STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`' -RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`' -old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`' -old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`' -old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`' -lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`' -CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`' -CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`' -compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`' -GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`' -lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`' -lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`' -lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`' -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`' -objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`' -MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`' -lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`' -lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`' -lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`' -lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`' -lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`' -need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`' -DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`' -NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`' -LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`' -OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`' -OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`' -libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`' -shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`' -extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`' -archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`' -enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`' -export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`' -whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`' -compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`' -old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`' -old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`' -archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`' -archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`' -module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`' -module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`' -with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`' -allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`' -no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`' -hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`' -hardcode_libdir_flag_spec_ld='`$ECHO "$hardcode_libdir_flag_spec_ld" | $SED "$delay_single_quote_subst"`' -hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`' -hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`' -hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`' -hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`' -hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`' -hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`' -inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`' -link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`' -fix_srcfile_path='`$ECHO "$fix_srcfile_path" | $SED "$delay_single_quote_subst"`' -always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`' -export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`' -exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`' -include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`' -prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`' -file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`' -variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`' -need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`' -need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`' -version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`' -runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`' -shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`' -shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`' -libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`' -library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`' -soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`' -install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`' -postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`' -postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`' -finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`' -finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`' -hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`' -sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`' -sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`' -hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`' -enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`' -enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`' -enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' -old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' -striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' - -LTCC='$LTCC' -LTCFLAGS='$LTCFLAGS' -compiler='$compiler_DEFAULT' - -# A function that is used when there is no print builtin or printf. -func_fallback_echo () -{ - eval 'cat <<_LTECHO_EOF -\$1 -_LTECHO_EOF' -} - -# Quote evaled strings. -for var in SHELL \ -ECHO \ -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 \ -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 \ -install_override_mode \ -finish_eval \ -old_striplib \ -striplib; do - case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in - *[\\\\\\\`\\"\\\$]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" - ;; - *) - eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" - ;; - esac -done - -# Double-quote double-evaled strings. -for var in reload_cmds \ -old_postinstall_cmds \ -old_postuninstall_cmds \ -old_archive_cmds \ -extract_expsyms_cmds \ -old_archive_from_new_cmds \ -old_archive_from_expsyms_cmds \ -archive_cmds \ -archive_expsym_cmds \ -module_cmds \ -module_expsym_cmds \ -export_symbols_cmds \ -prelink_cmds \ -postinstall_cmds \ -postuninstall_cmds \ -finish_cmds \ -sys_lib_search_path_spec \ -sys_lib_dlsearch_path_spec; do - case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in - *[\\\\\\\`\\"\\\$]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" - ;; - *) - eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" - ;; - esac -done - -ac_aux_dir='$ac_aux_dir' -xsi_shell='$xsi_shell' -lt_shell_append='$lt_shell_append' - -# See if we are running on zsh, and set the options which allow our -# commands through without removal of \ escapes INIT. -if test -n "\${ZSH_VERSION+set}" ; then - setopt NO_GLOB_SUBST -fi - - - PACKAGE='$PACKAGE' - VERSION='$VERSION' - TIMESTAMP='$TIMESTAMP' - RM='$RM' - ofile='$ofile' - - - - -_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" ;; - "antlr3config.h") CONFIG_HEADERS="$CONFIG_HEADERS antlr3config.h" ;; - "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; - - *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; - esac -done - - -# If the user did not use the arguments to specify the items to instantiate, -# then the envvar interface is used. Set only those that are not. -# We use the long form for the default assignment because of an extremely -# bizarre bug on SunOS 4.1.3. -if $ac_need_defaults; then - test "${CONFIG_FILES+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 'as_fn_exit 1' 1 2 13 15 -} -# Create a (secure) tmp directory for tmp files. - -{ - tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && - test -n "$tmp" && test -d "$tmp" -} || -{ - tmp=./conf$$-$RANDOM - (umask 077 && mkdir "$tmp") -} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 - -# Set up the scripts for CONFIG_FILES section. -# No need to generate them if there are no CONFIG_FILES. -# This happens for instance with `./config.status config.h'. -if test -n "$CONFIG_FILES"; then - - -ac_cr=`echo X | tr X '\015'` -# On cygwin, bash can eat \r inside `` if the user requested igncr. -# But we know of no other shell where ac_cr would be empty at this -# point, so we can use a bashism as a fallback. -if test "x$ac_cr" = x; then - eval ac_cr=\$\'\\r\' -fi -ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` -if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then - ac_cs_awk_cr='\\r' -else - ac_cs_awk_cr=$ac_cr -fi - -echo 'BEGIN {' >"$tmp/subs1.awk" && -_ACEOF - - -{ - echo "cat >conf$$subs.awk <<_ACEOF" && - echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && - echo "_ACEOF" -} >conf$$subs.sh || - as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 -ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` -ac_delim='%!_!# ' -for ac_last_try in false false false false false :; do - . ./conf$$subs.sh || - as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 - - ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` - if test $ac_delim_n = $ac_delim_num; then - break - elif $ac_last_try; then - as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " - fi -done -rm -f conf$$subs.sh - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -cat >>"\$tmp/subs1.awk" <<\\_ACAWK && -_ACEOF -sed -n ' -h -s/^/S["/; s/!.*/"]=/ -p -g -s/^[^!]*!// -:repl -t repl -s/'"$ac_delim"'$// -t delim -:nl -h -s/\(.\{148\}\)..*/\1/ -t more1 -s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ -p -n -b repl -:more1 -s/["\\]/\\&/g; s/^/"/; s/$/"\\/ -p -g -s/.\{148\}// -t nl -:delim -h -s/\(.\{148\}\)..*/\1/ -t more2 -s/["\\]/\\&/g; s/^/"/; s/$/"/ -p -b -:more2 -s/["\\]/\\&/g; s/^/"/; s/$/"\\/ -p -g -s/.\{148\}// -t delim -' >$CONFIG_STATUS || ac_write_fail=1 -rm -f conf$$subs.awk -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -_ACAWK -cat >>"\$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_fn_error $? "could not setup config files machinery" "$LINENO" 5 -_ACEOF - -# VPATH may cause trouble with some makes, so we remove sole $(srcdir), -# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and -# trailing colons and then remove the whole line if VPATH becomes empty -# (actually we leave an empty line to preserve line numbers). -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ -h -s/// -s/^/:/ -s/[ ]*$/:/ -s/:\$(srcdir):/:/g -s/:\${srcdir}:/:/g -s/:@srcdir@:/:/g -s/^:*// -s/:*$// -x -s/\(=[ ]*\).*/\1/ -G -s/\n// -s/^[^=]*=[ ]*$// -}' -fi - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -fi # test -n "$CONFIG_FILES" - -# Set up the scripts for CONFIG_HEADERS section. -# No need to generate them if there are no CONFIG_HEADERS. -# This happens for instance with `./config.status Makefile'. -if test -n "$CONFIG_HEADERS"; then -cat >"$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_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " - fi -done - -# For the awk script, D is an array of macro values keyed by name, -# likewise P contains macro parameters if any. Preserve backslash -# newline sequences. - -ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* -sed -n ' -s/.\{148\}/&'"$ac_delim"'/g -t rset -:rset -s/^[ ]*#[ ]*define[ ][ ]*/ / -t def -d -:def -s/\\$// -t bsnl -s/["\\]/\\&/g -s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ -D["\1"]=" \3"/p -s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p -d -:bsnl -s/["\\]/\\&/g -s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ -D["\1"]=" \3\\\\\\n"\\/p -t cont -s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p -t cont -d -:cont -n -s/.\{148\}/&'"$ac_delim"'/g -t clear -:clear -s/\\$// -t bsnlc -s/["\\]/\\&/g; s/^/"/; s/$/"/p -d -:bsnlc -s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p -b cont -' >$CONFIG_STATUS || ac_write_fail=1 - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 - for (key in D) D_is_set[key] = 1 - FS = "" -} -/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { - line = \$ 0 - split(line, arg, " ") - if (arg[1] == "#") { - defundef = arg[2] - mac1 = arg[3] - } else { - defundef = substr(arg[1], 2) - mac1 = arg[2] - } - split(mac1, mac2, "(") #) - macro = mac2[1] - prefix = substr(line, 1, index(line, defundef) - 1) - if (D_is_set[macro]) { - # Preserve the white space surrounding the "#". - print prefix "define", macro P[macro] D[macro] - next - } else { - # Replace #undef with comments. This is necessary, for example, - # in the case of _POSIX_SOURCE, which is predefined and required - # on some systems where configure will not decide to define it. - if (defundef == "undef") { - print "/*", prefix defundef, macro, "*/" - next - } - } -} -{ print } -_ACAWK -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 - as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 -fi # test -n "$CONFIG_HEADERS" - - -eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" -shift -for ac_tag -do - case $ac_tag in - :[FHLC]) ac_mode=$ac_tag; continue;; - esac - case $ac_mode$ac_tag in - :[FHL]*:*);; - :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; - :[FH]-) ac_tag=-:-;; - :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; - esac - ac_save_IFS=$IFS - IFS=: - set x $ac_tag - IFS=$ac_save_IFS - shift - ac_file=$1 - shift - - case $ac_mode in - :L) ac_source=$1;; - :[FH]) - ac_file_inputs= - for ac_f - do - case $ac_f in - -) ac_f="$tmp/stdin";; - *) # Look for the file first in the build tree, then in the source tree - # (if the path is not absolute). The absolute path cannot be DOS-style, - # because $ac_f cannot contain `:'. - test -f "$ac_f" || - case $ac_f in - [\\/$]*) false;; - *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; - esac || - as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; - esac - case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac - as_fn_append ac_file_inputs " '$ac_f'" - done - - # Let's still pretend it is `configure' which instantiates (i.e., don't - # use $as_me), people would be surprised to read: - # /* config.h. Generated by config.status. */ - configure_input='Generated from '` - $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' - `' by configure.' - if test x"$ac_file" != x-; then - configure_input="$ac_file. $configure_input" - { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 -$as_echo "$as_me: creating $ac_file" >&6;} - fi - # Neutralize special characters interpreted by sed in replacement strings. - case $configure_input in #( - *\&* | *\|* | *\\* ) - ac_sed_conf_input=`$as_echo "$configure_input" | - sed 's/[\\\\&|]/\\\\&/g'`;; #( - *) ac_sed_conf_input=$configure_input;; - esac - - case $ac_tag in - *:-:* | *:-) cat >"$tmp/stdin" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; - esac - ;; - esac - - ac_dir=`$as_dirname -- "$ac_file" || -$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_file" : 'X\(//\)[^/]' \| \ - X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - as_dir="$ac_dir"; as_fn_mkdir_p - ac_builddir=. - -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` - case $ac_top_builddir_sub in - "") ac_top_builddir_sub=. ac_top_build_prefix= ;; - *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; - esac ;; -esac -ac_abs_top_builddir=$ac_pwd -ac_abs_builddir=$ac_pwd$ac_dir_suffix -# for backward compatibility: -ac_top_builddir=$ac_top_build_prefix - -case $srcdir in - .) # We are building in place. - ac_srcdir=. - ac_top_srcdir=$ac_top_builddir_sub - ac_abs_top_srcdir=$ac_pwd ;; - [\\/]* | ?:[\\/]* ) # Absolute name. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir - ac_abs_top_srcdir=$srcdir ;; - *) # Relative name. - ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_build_prefix$srcdir - ac_abs_top_srcdir=$ac_pwd/$srcdir ;; -esac -ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix - - - case $ac_mode in - :F) - # - # CONFIG_FILE - # - - case $INSTALL in - [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; - *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; - esac - ac_MKDIR_P=$MKDIR_P - case $MKDIR_P in - [\\/$]* | ?:[\\/]* ) ;; - */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; - esac -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# If the template does not know about datarootdir, expand it. -# FIXME: This hack should be removed a few years after 2.60. -ac_datarootdir_hack=; ac_datarootdir_seen= -ac_sed_dataroot=' -/datarootdir/ { - p - q -} -/@datadir@/p -/@docdir@/p -/@infodir@/p -/@localedir@/p -/@mandir@/p' -case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in -*datarootdir*) ac_datarootdir_seen=yes;; -*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 -$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 - ac_datarootdir_hack=' - s&@datadir@&$datadir&g - s&@docdir@&$docdir&g - s&@infodir@&$infodir&g - s&@localedir@&$localedir&g - s&@mandir@&$mandir&g - s&\\\${datarootdir}&$datarootdir&g' ;; -esac -_ACEOF - -# Neutralize VPATH when `$srcdir' = `.'. -# Shell code in configure.ac might set extrasub. -# FIXME: do we really want to maintain this feature? -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -ac_sed_extra="$ac_vpsub -$extrasub -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -:t -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s|@configure_input@|$ac_sed_conf_input|;t t -s&@top_builddir@&$ac_top_builddir_sub&;t t -s&@top_build_prefix@&$ac_top_build_prefix&;t t -s&@srcdir@&$ac_srcdir&;t t -s&@abs_srcdir@&$ac_abs_srcdir&;t t -s&@top_srcdir@&$ac_top_srcdir&;t t -s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t -s&@builddir@&$ac_builddir&;t t -s&@abs_builddir@&$ac_abs_builddir&;t t -s&@abs_top_builddir@&$ac_abs_top_builddir&;t t -s&@INSTALL@&$ac_INSTALL&;t t -s&@MKDIR_P@&$ac_MKDIR_P&;t t -$ac_datarootdir_hack -" -eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - -test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && - { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && - { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined" >&5 -$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined" >&2;} - - rm -f "$tmp/stdin" - case $ac_file in - -) cat "$tmp/out" && rm -f "$tmp/out";; - *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; - esac \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - ;; - :H) - # - # CONFIG_HEADER - # - if test x"$ac_file" != x-; then - { - $as_echo "/* $configure_input */" \ - && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" - } >"$tmp/config.h" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then - { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 -$as_echo "$as_me: $ac_file is unchanged" >&6;} - else - rm -f "$ac_file" - mv "$tmp/config.h" "$ac_file" \ - || as_fn_error $? "could not create $ac_file" "$LINENO" 5 - fi - else - $as_echo "/* $configure_input */" \ - && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \ - || as_fn_error $? "could not create -" "$LINENO" 5 - fi -# Compute "$ac_file"'s index in $config_headers. -_am_arg="$ac_file" -_am_stamp_count=1 -for _am_header in $config_headers :; do - case $_am_header in - $_am_arg | $_am_arg:* ) - break ;; - * ) - _am_stamp_count=`expr $_am_stamp_count + 1` ;; - esac -done -echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || -$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$_am_arg" : 'X\(//\)[^/]' \| \ - X"$_am_arg" : 'X\(//\)$' \| \ - X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$_am_arg" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'`/stamp-h$_am_stamp_count - ;; - - :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 -$as_echo "$as_me: executing $ac_file commands" >&6;} - ;; - esac - - - case $ac_file$ac_mode in - "depfiles":C) test x"$AMDEP_TRUE" != x"" || { - # Autoconf 2.62 quotes --file arguments for eval, but not when files - # are listed without --file. Let's play safe and only enable the eval - # if we detect the quoting. - case $CONFIG_FILES in - *\'*) eval set x "$CONFIG_FILES" ;; - *) set x $CONFIG_FILES ;; - esac - shift - for mf - do - # Strip MF so we end up with the name of the file. - mf=`echo "$mf" | sed -e 's/:.*$//'` - # Check whether this is an Automake generated Makefile or not. - # We used to match only the files named `Makefile.in', but - # some people rename them; so instead we look at the file content. - # Grep'ing the first line is not enough: some people post-process - # each Makefile.in and add a new line on top of each file to say so. - # Grep'ing the whole file is not good either: AIX grep has a line - # limit of 2048, but all sed's we know have understand at least 4000. - if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then - dirpart=`$as_dirname -- "$mf" || -$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$mf" : 'X\(//\)[^/]' \| \ - X"$mf" : 'X\(//\)$' \| \ - X"$mf" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$mf" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - else - continue - fi - # Extract the definition of DEPDIR, am__include, and am__quote - # from the Makefile without running `make'. - DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` - test -z "$DEPDIR" && continue - am__include=`sed -n 's/^am__include = //p' < "$mf"` - test -z "am__include" && continue - am__quote=`sed -n 's/^am__quote = //p' < "$mf"` - # When using ansi2knr, U may be empty or an underscore; expand it - U=`sed -n 's/^U = //p' < "$mf"` - # Find all dependency output files, they are included files with - # $(DEPDIR) in their names. We invoke sed twice because it is the - # simplest approach to changing $(DEPDIR) to its actual value in the - # expansion. - for file in `sed -n " - s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ - sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do - # Make sure the directory exists. - test -f "$dirpart/$file" && continue - fdir=`$as_dirname -- "$file" || -$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$file" : 'X\(//\)[^/]' \| \ - X"$file" : 'X\(//\)$' \| \ - X"$file" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - as_dir=$dirpart/$fdir; as_fn_mkdir_p - # echo "creating $dirpart/$file" - echo '# dummy' > "$dirpart/$file" - done - done -} - ;; - "libtool":C) - - # See if we are running on zsh, and set the options which allow our - # commands through without removal of \ escapes. - if test -n "${ZSH_VERSION+set}" ; then - setopt NO_GLOB_SUBST - fi - - cfgfile="${ofile}T" - trap "$RM \"$cfgfile\"; exit 1" 1 2 15 - $RM "$cfgfile" - - cat <<_LT_EOF >> "$cfgfile" -#! $SHELL - -# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. -# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION -# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: -# NOTE: Changes made to this file will be lost: look at ltmain.sh. -# -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, -# 2006, 2007, 2008, 2009, 2010 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 - -# Shell to use when invoking shell scripts. -SHELL=$lt_SHELL - -# An echo program that protects backslashes. -ECHO=$lt_ECHO - -# 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 - -# 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 - -# Whether to use a lock for old archive extraction. -lock_old_archive_extraction=$lock_old_archive_extraction - -# A C compiler. -LTCC=$lt_CC - -# LTCC compiler flags. -LTCFLAGS=$lt_CFLAGS - -# Take the output of nm and produce a listing of raw symbols and C names. -global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe - -# Transform the output of nm in a proper C declaration. -global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl - -# Transform the output of nm in a C name address pair. -global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address - -# Transform the output of nm in a C name address pair when lib prefix is needed. -global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix - -# The name of the directory that contains temporary libtool files. -objdir=$objdir - -# Used to examine libraries when file_magic_cmd begins with "file". -MAGIC_CMD=$MAGIC_CMD - -# Must we lock files when doing compilation? -need_locks=$lt_need_locks - -# Tool to manipulate archived DWARF debug symbol files on Mac OS X. -DSYMUTIL=$lt_DSYMUTIL - -# Tool to change global to local symbols on Mac OS X. -NMEDIT=$lt_NMEDIT - -# Tool to manipulate fat objects and archives on Mac OS X. -LIPO=$lt_LIPO - -# ldd/readelf like tool for Mach-O binaries on Mac OS X. -OTOOL=$lt_OTOOL - -# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. -OTOOL64=$lt_OTOOL64 - -# Old archive suffix (normally "a"). -libext=$libext - -# Shared library suffix (normally ".so"). -shrext_cmds=$lt_shrext_cmds - -# The commands to extract the exported symbol list from a shared archive. -extract_expsyms_cmds=$lt_extract_expsyms_cmds - -# Variables whose values should be saved in libtool wrapper scripts and -# restored at link time. -variables_saved_for_relink=$lt_variables_saved_for_relink - -# Do we need the "lib" prefix for modules? -need_lib_prefix=$need_lib_prefix - -# Do we need a version for libraries? -need_version=$need_version - -# Library versioning type. -version_type=$version_type - -# Shared library runtime path variable. -runpath_var=$runpath_var - -# Shared library path variable. -shlibpath_var=$shlibpath_var - -# Is shlibpath searched before the hard-coded library search path? -shlibpath_overrides_runpath=$shlibpath_overrides_runpath - -# Format of library name prefix. -libname_spec=$lt_libname_spec - -# List of archive names. First name is the real one, the rest are links. -# The last name is the one that the linker finds with -lNAME -library_names_spec=$lt_library_names_spec - -# The coded name of the library, if different from the real name. -soname_spec=$lt_soname_spec - -# Permission mode override for installation of shared libraries. -install_override_mode=$lt_install_override_mode - -# Command to use after installation of a shared archive. -postinstall_cmds=$lt_postinstall_cmds - -# Command to use after uninstallation of a shared archive. -postuninstall_cmds=$lt_postuninstall_cmds - -# Commands used to finish a libtool library installation in a directory. -finish_cmds=$lt_finish_cmds - -# As "finish_cmds", except a single script fragment to be evaled but -# not shown. -finish_eval=$lt_finish_eval - -# Whether we should hardcode library paths into libraries. -hardcode_into_libs=$hardcode_into_libs - -# Compile-time system search path for libraries. -sys_lib_search_path_spec=$lt_sys_lib_search_path_spec - -# Run-time system search path for libraries. -sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec - -# Whether dlopen is supported. -dlopen_support=$enable_dlopen - -# Whether dlopen of programs is supported. -dlopen_self=$enable_dlopen_self - -# Whether dlopen of statically linked programs is supported. -dlopen_self_static=$enable_dlopen_self_static - -# Commands to strip libraries. -old_striplib=$lt_old_striplib -striplib=$lt_striplib - - -# The linker used to build libraries. -LD=$lt_LD - -# How to create reloadable object files. -reload_flag=$lt_reload_flag -reload_cmds=$lt_reload_cmds - -# Commands used to build an old-style archive. -old_archive_cmds=$lt_old_archive_cmds - -# A language specific compiler. -CC=$lt_compiler - -# Is the compiler the GNU compiler? -with_gcc=$GCC - -# Compiler flag to turn off builtin functions. -no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag - -# 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 "${1}" | $SED "$dirname"` - if test "X$func_dirname_result" = "X${1}"; then - func_dirname_result="${3}" - else - func_dirname_result="$func_dirname_result${2}" - fi -} - -# func_basename file -func_basename () -{ - func_basename_result=`$ECHO "${1}" | $SED "$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 "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; - *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; 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 "${1}" | $SED "$my_sed_long_opt"` - func_opt_split_arg=`$ECHO "${1}" | $SED "$my_sed_long_arg"` -} - -# func_lo2o object -func_lo2o () -{ - func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` -} - -# func_xform libobj-or-source -func_xform () -{ - func_xform_result=`$ECHO "${1}" | $SED '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 - - -as_fn_exit 0 -_ACEOF -ac_clean_files=$ac_clean_files_save - -test $ac_write_fail = 0 || - as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 - - -# configure is writing to config.log, and then calls config.status. -# config.status does its own redirection, appending to config.log. -# Unfortunately, on DOS this fails, as config.log is still kept open -# by configure, so config.status won't be able to write to it; its -# output is simply discarded. So we exec the FD to /dev/null, -# effectively closing config.log, so it can be properly (re)opened and -# appended to by config.status. When coming back to configure, we -# need to make the FD available again. -if test "$no_create" != yes; then - ac_cs_success=: - ac_config_status_args= - test "$silent" = yes && - ac_config_status_args="$ac_config_status_args --quiet" - exec 5>/dev/null - $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false - exec 5>>config.log - # Use ||, not &&, to avoid exiting from the if with $? = 1, which - # would make configure fail if this is the last instruction. - $ac_cs_success || as_fn_exit 1 -fi -if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 -$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} -fi - diff --git a/impl/antlr/libantlr3c-3.4/configure.ac b/impl/antlr/libantlr3c-3.4/configure.ac deleted file mode 100644 index b3d9c3a..0000000 --- a/impl/antlr/libantlr3c-3.4/configure.ac +++ /dev/null @@ -1,217 +0,0 @@ -# -*- Autoconf -*- -# Process this file with autoconf to produce a configure script. - -AC_INIT(libantlr3c, 3.4, jimi@temporal-wave.com) -AC_PREREQ(2.60) -AC_COPYRIGHT([ - (The "BSD licence") - Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC - http://www.temporal-wave.com - http://www.linkedin.com/in/jimidle - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - 3. The name of the author may not be used to endorse or promote products - derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -]) -AC_CONFIG_SRCDIR(src/antlr3parser.c) - - -AC_ARG_ENABLE([debuginfo], - [AS_HELP_STRING([--enable-debuginfo], [Compiles debug info into the library (default --disable-debuginfo)])], - [], [enable_debuginfo=no]) - -AC_ARG_ENABLE([64bit], - [AS_HELP_STRING([--enable-64bit], [Turns on flags that produce 64 bit object code if any are required (default --disable-64bit)])], - [], [enable_64bit=no]) - -AC_ARG_ENABLE([abiflags], - [AS_HELP_STRING([--disable-abiflags], [Does not add ABI flags -m32 or -m64 for older versions of gcc, such as itanium 3.x (default --enable-abiflags=yes)])], - [], [enable_abiflags=yes]) - -AC_ARG_ENABLE([antlrdebug], - [AS_HELP_STRING([--disable-antlrdebug], [Turns off default flags that include the antlr debugger in the runtime. Specify to remove debugger and the socket dependancies (default --enable-antlrdebug)])], - [], [enable_antlrdebug=yes]) - -AM_INIT_AUTOMAKE(foreign) -AC_LANG(C) -AC_PROG_CC([xlc aCC gcc cc]) -AM_MAINTAINER_MODE -AM_PROG_LIBTOOL - -AC_CANONICAL_BUILD -AC_CANONICAL_HOST - -OBJECT_MODE= -# Checks for programs. -AC_MSG_CHECKING([compiler flags required for compiling ANTLR with $CC C compiler on host $host]) -WARNFLAGS= -case $CC in -xlc*) - CPPCMNTFLAGS="-qcpluscmt" - if test x"$enable_64bit" = xyes; then - CCFLAGS64="-q64 -Wl,-b64" - OBJECT_MODE="64" - else - OBJECT_MODE="32" - fi - OPTIMFLAGS="-O2" - if test x"$enable_debuginfo" = xyes; then - DEBUGFLAGS="-g" - fi - ;; - -aCC*) - CPPCMNTFLAGS= - if test x"$enable_64bit" = xyes; then - CCFLAGS64="+DD64" - fi - OPTIMFLAGS="-O" - if test $DEBUGINF = 1; then - DEBUGFLAGS="-g" - fi - ;; - -gcc*) - CPPCMNTFLAGS= - if test x"$enable_64bit" = xyes; then - GCCABIFLAGS="-m64" - else - GCCABIFLAGS="-m32" - fi - if test x"$enable_abiflags" = xyes; then - CCFLAGS64=$GCCABIFLAGS - fi - OPTIMFLAGS="-O2" - if test x"$enable_debuginfo" = xyes; then - DEBUGFLAGS="-g" - fi - WARNFLAGS=-Wall - ;; - -*) - -case $host in -sparc*-*solaris*) - CPPCMNTFLAGS= - if test x"$enable_64bit" = xyes; then - CCFLAGS64="-fast -xtarget=ultra4 -m64 -xarch=sparcvis" - fi - OPTIMFLAGS="-O" - if test x"$enable_debuginfo" = xyes; then - DEBUGFLAGS='-g' - fi - ;; - -*) - CPPCMNTFLAGS= - CCFLAGS64= - OPTIMFLAGS="-O" - if test x"$enable_debuginfo" = xyes; then - DEBUGFLAGS='-g' - fi - ;; -esac - - ;; -esac - -CFLAGS="$CCFLAGS64 $CPPCMNTFLAGS $OPTIMFLAGS $DEBUGFLAGS $WARNFLAGS" -AC_MSG_RESULT([$CFLAGS]) -AC_SUBST([OBJECT_MODE]) - -AS_IF([test "x$enable_antlrdebug" = xno], [AC_DEFINE([ANTLR3_NODEBUGGER], [1], [Define if ANTLR debugger not required])], []) -AS_IF([test x"$enable_64bit" = xyes], [AC_DEFINE([ANTLR3_USE_64BIT], [1], [Define if 64 bit mode required])], []) - -AC_PROG_INSTALL -AC_PROG_LN_S -AC_PROG_MAKE_SET - -# Checks for libraries. - -# Checks for header files. -AC_INCLUDES_DEFAULT() -AC_HEADER_RESOLV -AC_CHECK_HEADERS([sys/malloc.h malloc.h], [], [], -[[#ifdef HAVE_SYS_MALLOC_H -#include -#endif -#ifdef HAVE_MALLOC_H -#include -#endif -]]) -AC_CHECK_HEADERS([stdarg.h], [], [], -[[#ifdef HAVE_STDARG_H -#include -#endif -]]) - -AC_CHECK_HEADERS([sys/stat.h], [], [], -[[#ifdef HAVE_SYS_STAT_H -#include -#endif -]]) - -AC_CHECK_HEADERS([ctype.h], [], [], -[[#ifdef HAVE_CTYPE_H -#include -#endif -]]) - -AC_CHECK_HEADERS([netinet/tcp.h], [], [], -[[#ifdef HAVE_NETINET_TCP_H -#include -#endif -]]) - -AC_CHECK_HEADERS([sys/socket.h socket.h], [], [], -[[#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#ifdef HAVE_SOCKET_H -#include -#endif -]]) - -# Checks for typedefs, structures, and compiler characteristics. -AC_C_CONST -AC_TYPE_SIZE_T -AC_TYPE_INT8_T -AC_TYPE_INT16_T -AC_TYPE_INT32_T -AC_TYPE_INT64_T -AC_TYPE_INTPTR_T -AC_TYPE_UINT8_T -AC_TYPE_UINT16_T -AC_TYPE_UINT32_T -AC_TYPE_UINT64_T -AC_TYPE_UINTPTR_T -AC_C_INLINE - - -# Checks for library functions. -AC_CHECK_FUNCS([memmove memset strdup accept]) - -AC_CONFIG_MACRO_DIR([m4]) - -AC_CONFIG_HEADERS(antlr3config.h) -AC_CONFIG_FILES([Makefile]) -AC_OUTPUT diff --git a/impl/antlr/libantlr3c-3.4/depcomp b/impl/antlr/libantlr3c-3.4/depcomp deleted file mode 100755 index df8eea7..0000000 --- a/impl/antlr/libantlr3c-3.4/depcomp +++ /dev/null @@ -1,630 +0,0 @@ -#! /bin/sh -# depcomp - compile a program generating dependencies as side-effects - -scriptversion=2009-04-28.21; # UTC - -# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 Free -# Software Foundation, Inc. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# Originally written by Alexandre Oliva . - -case $1 in - '') - echo "$0: No command. Try \`$0 --help' for more information." 1>&2 - exit 1; - ;; - -h | --h*) - cat <<\EOF -Usage: depcomp [--help] [--version] PROGRAM [ARGS] - -Run PROGRAMS ARGS to compile a file, generating dependencies -as side-effects. - -Environment variables: - depmode Dependency tracking mode. - source Source file read by `PROGRAMS ARGS'. - object Object file output by `PROGRAMS ARGS'. - DEPDIR directory where to store dependencies. - depfile Dependency file to output. - tmpdepfile Temporary file to use when outputing dependencies. - libtool Whether libtool is used (yes/no). - -Report bugs to . -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 - -cygpath_u="cygpath -u -f -" -if test "$depmode" = msvcmsys; then - # This is just like msvisualcpp but w/o cygpath translation. - # Just convert the backslash-escaped backslashes to single forward - # slashes to satisfy depend.m4 - cygpath_u="sed s,\\\\\\\\,/,g" - depmode=msvisualcpp -fi - -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 "X$1" != 'X--mode=compile'; do - shift - done - shift - fi - - # Remove `-o $object'. - IFS=" " - for arg - do - case $arg in - -o) - shift - ;; - $object) - shift - ;; - *) - set fnord "$@" "$arg" - shift # fnord - shift # $arg - ;; - esac - done - - test -z "$dashmflag" && dashmflag=-M - # Require at least two characters before searching for `:' - # in the target name. This is to cope with DOS-style filenames: - # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. - "$@" $dashmflag | - sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$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 "X$1" != 'X--mode=compile'; do - shift - done - shift - fi - # X makedepend - shift - cleared=no eat=no - for arg - do - case $cleared in - no) - set ""; shift - cleared=yes ;; - esac - if test $eat = yes; then - eat=no - continue - fi - case "$arg" in - -D*|-I*) - set fnord "$@" "$arg"; shift ;; - # Strip any option that makedepend may not understand. Remove - # the object too, otherwise makedepend will parse it as a source file. - -arch) - eat=yes ;; - -*|$object) - ;; - *) - set fnord "$@" "$arg"; shift ;; - esac - done - obj_suffix=`echo "$object" | sed 's/^.*\././'` - touch "$tmpdepfile" - ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" - rm -f "$depfile" - 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 "X$1" != 'X--mode=compile'; do - shift - done - shift - fi - - # Remove `-o $object'. - IFS=" " - for arg - do - case $arg in - -o) - shift - ;; - $object) - shift - ;; - *) - set fnord "$@" "$arg" - shift # fnord - shift # $arg - ;; - esac - done - - "$@" -E | - sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ - -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | - sed '$ s: \\$::' > "$tmpdepfile" - rm -f "$depfile" - echo "$object : \\" > "$depfile" - cat < "$tmpdepfile" >> "$depfile" - sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -msvisualcpp) - # Important note: in order to support this mode, a compiler *must* - # always write the preprocessed file to stdout. - "$@" || exit $? - - # Remove the call to Libtool. - if test "$libtool" = yes; then - while test "X$1" != 'X--mode=compile'; do - shift - done - shift - fi - - IFS=" " - for arg - do - case "$arg" in - -o) - shift - ;; - $object) - shift - ;; - "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") - set fnord "$@" - shift - shift - ;; - *) - set fnord "$@" "$arg" - shift - shift - ;; - esac - done - "$@" -E 2>/dev/null | - sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" - rm -f "$depfile" - echo "$object : \\" > "$depfile" - sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" - echo " " >> "$depfile" - sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" - rm -f "$tmpdepfile" - ;; - -msvcmsys) - # This case exists only to let depend.m4 do its work. It works by - # looking at the text of this script. This case will never be run, - # since it is checked for above. - exit 1 - ;; - -none) - exec "$@" - ;; - -*) - echo "Unknown depmode $depmode" 1>&2 - exit 1 - ;; -esac - -exit 0 - -# Local Variables: -# mode: shell-script -# sh-indentation: 2 -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" -# time-stamp-end: "; # UTC" -# End: diff --git a/impl/antlr/libantlr3c-3.4/doxyfile b/impl/antlr/libantlr3c-3.4/doxyfile deleted file mode 100644 index 859f6df..0000000 --- a/impl/antlr/libantlr3c-3.4/doxyfile +++ /dev/null @@ -1,1659 +0,0 @@ -# Doxyfile 1.7.1 - -# This file describes the settings to be used by the documentation system -# doxygen (www.doxygen.org) for a project -# -# All text after a hash (#) is considered a comment and will be ignored -# The format is: -# TAG = value [value, ...] -# For lists items can also be appended using: -# TAG += value [value, ...] -# Values that contain spaces should be placed between quotes (" ") - -#--------------------------------------------------------------------------- -# Project related configuration options -#--------------------------------------------------------------------------- - -# This tag specifies the encoding used for all characters in the config file -# that follow. The default is UTF-8 which is also the encoding used for all -# text before the first occurrence of this tag. Doxygen uses libiconv (or the -# iconv built into libc) for the transcoding. See -# http://www.gnu.org/software/libiconv for the list of possible encodings. - -DOXYFILE_ENCODING = UTF-8 - -# The PROJECT_NAME tag is a single word (or a sequence of words surrounded -# by quotes) that should identify the project. - -PROJECT_NAME = ANTLR3C - -# The PROJECT_NUMBER tag can be used to enter a project or revision number. -# This could be handy for archiving the generated documentation or -# if some version control system is used. - -PROJECT_NUMBER = 3.3.1 - -# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) -# base path where the generated documentation will be put. -# If a relative path is entered, it will be relative to the location -# where doxygen was started. If left blank the current directory will be used. - -OUTPUT_DIRECTORY = api - -# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create -# 4096 sub-directories (in 2 levels) under the output directory of each output -# format and will distribute the generated files over these directories. -# Enabling this option can be useful when feeding doxygen a huge amount of -# source files, where putting all generated files in the same directory would -# otherwise cause performance problems for the file system. - -CREATE_SUBDIRS = NO - -# The OUTPUT_LANGUAGE tag is used to specify the language in which all -# documentation generated by doxygen is written. Doxygen will use this -# information to generate all constant output in the proper language. -# The default language is English, other supported languages are: -# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, -# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German, -# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English -# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, -# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak, -# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese. - -OUTPUT_LANGUAGE = English - -# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will -# include brief member descriptions after the members that are listed in -# the file and class documentation (similar to JavaDoc). -# Set to NO to disable this. - -BRIEF_MEMBER_DESC = YES - -# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend -# the brief description of a member or function before the detailed description. -# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the -# brief descriptions will be completely suppressed. - -REPEAT_BRIEF = YES - -# This tag implements a quasi-intelligent brief description abbreviator -# that is used to form the text in various listings. Each string -# in this list, if found as the leading text of the brief description, will be -# stripped from the text and the result after processing the whole list, is -# used as the annotated text. Otherwise, the brief description is used as-is. -# If left blank, the following values are used ("$name" is automatically -# replaced with the name of the entity): "The $name class" "The $name widget" -# "The $name file" "is" "provides" "specifies" "contains" -# "represents" "a" "an" "the" - -ABBREVIATE_BRIEF = "The $name class" \ - "The $name widget" \ - "The $name file" \ - is \ - provides \ - specifies \ - contains \ - represents \ - a \ - an \ - the - -# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then -# Doxygen will generate a detailed section even if there is only a brief -# description. - -ALWAYS_DETAILED_SEC = NO - -# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all -# inherited members of a class in the documentation of that class as if those -# members were ordinary class members. Constructors, destructors and assignment -# operators of the base classes will not be shown. - -INLINE_INHERITED_MEMB = NO - -# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full -# path before files name in the file list and in the header files. If set -# to NO the shortest path that makes the file name unique will be used. - -FULL_PATH_NAMES = YES - -# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag -# can be used to strip a user-defined part of the path. Stripping is -# only done if one of the specified strings matches the left-hand part of -# the path. The tag can be used to show relative paths in the file list. -# If left blank the directory from which doxygen is run is used as the -# path to strip. - -STRIP_FROM_PATH = - -# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of -# the path mentioned in the documentation of a class, which tells -# the reader which header file to include in order to use a class. -# If left blank only the name of the header file containing the class -# definition is used. Otherwise one should specify the include paths that -# are normally passed to the compiler using the -I flag. - -STRIP_FROM_INC_PATH = - -# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter -# (but less readable) file names. This can be useful is your file systems -# doesn't support long names like on DOS, Mac, or CD-ROM. - -SHORT_NAMES = NO - -# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen -# will interpret the first line (until the first dot) of a JavaDoc-style -# comment as the brief description. If set to NO, the JavaDoc -# comments will behave just like regular Qt-style comments -# (thus requiring an explicit @brief command for a brief description.) - -JAVADOC_AUTOBRIEF = YES - -# If the QT_AUTOBRIEF tag is set to YES then Doxygen will -# interpret the first line (until the first dot) of a Qt-style -# comment as the brief description. If set to NO, the comments -# will behave just like regular Qt-style comments (thus requiring -# an explicit \brief command for a brief description.) - -QT_AUTOBRIEF = NO - -# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen -# treat a multi-line C++ special comment block (i.e. a block of //! or /// -# comments) as a brief description. This used to be the default behaviour. -# The new default is to treat a multi-line C++ comment block as a detailed -# description. Set this tag to YES if you prefer the old behaviour instead. - -MULTILINE_CPP_IS_BRIEF = NO - -# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented -# member inherits the documentation from any documented member that it -# re-implements. - -INHERIT_DOCS = YES - -# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce -# a new page for each member. If set to NO, the documentation of a member will -# be part of the file/class/namespace that contains it. - -SEPARATE_MEMBER_PAGES = NO - -# The TAB_SIZE tag can be used to set the number of spaces in a tab. -# Doxygen uses this value to replace tabs by spaces in code fragments. - -TAB_SIZE = 4 - -# This tag can be used to specify a number of aliases that acts -# as commands in the documentation. An alias has the form "name=value". -# For example adding "sideeffect=\par Side Effects:\n" will allow you to -# put the command \sideeffect (or @sideeffect) in the documentation, which -# will result in a user-defined paragraph with heading "Side Effects:". -# You can put \n's in the value part of an alias to insert newlines. - -ALIASES = - -# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C -# sources only. Doxygen will then generate output that is more tailored for C. -# For instance, some of the names that are used will be different. The list -# of all members will be omitted, etc. - -OPTIMIZE_OUTPUT_FOR_C = YES - -# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java -# sources only. Doxygen will then generate output that is more tailored for -# Java. For instance, namespaces will be presented as packages, qualified -# scopes will look different, etc. - -OPTIMIZE_OUTPUT_JAVA = NO - -# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran -# sources only. Doxygen will then generate output that is more tailored for -# Fortran. - -OPTIMIZE_FOR_FORTRAN = NO - -# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL -# sources. Doxygen will then generate output that is tailored for -# VHDL. - -OPTIMIZE_OUTPUT_VHDL = NO - -# Doxygen selects the parser to use depending on the extension of the files it -# parses. With this tag you can assign which parser to use for a given extension. -# Doxygen has a built-in mapping, but you can override or extend it using this -# tag. The format is ext=language, where ext is a file extension, and language -# is one of the parsers supported by doxygen: IDL, Java, Javascript, CSharp, C, -# C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, C++. For instance to make -# doxygen treat .inc files as Fortran files (default is PHP), and .f files as C -# (default is Fortran), use: inc=Fortran f=C. Note that for custom extensions -# you also need to set FILE_PATTERNS otherwise the files are not read by doxygen. - -EXTENSION_MAPPING = - -# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want -# to include (a tag file for) the STL sources as input, then you should -# set this tag to YES in order to let doxygen match functions declarations and -# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. -# func(std::string) {}). This also make the inheritance and collaboration -# diagrams that involve STL classes more complete and accurate. - -BUILTIN_STL_SUPPORT = NO - -# If you use Microsoft's C++/CLI language, you should set this option to YES to -# enable parsing support. - -CPP_CLI_SUPPORT = NO - -# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. -# Doxygen will parse them like normal C++ but will assume all classes use public -# instead of private inheritance when no explicit protection keyword is present. - -SIP_SUPPORT = NO - -# For Microsoft's IDL there are propget and propput attributes to indicate getter -# and setter methods for a property. Setting this option to YES (the default) -# will make doxygen to replace the get and set methods by a property in the -# documentation. This will only work if the methods are indeed getting or -# setting a simple type. If this is not the case, or you want to show the -# methods anyway, you should set this option to NO. - -IDL_PROPERTY_SUPPORT = YES - -# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC -# tag is set to YES, then doxygen will reuse the documentation of the first -# member in the group (if any) for the other members of the group. By default -# all members of a group must be documented explicitly. - -DISTRIBUTE_GROUP_DOC = NO - -# Set the SUBGROUPING tag to YES (the default) to allow class member groups of -# the same type (for instance a group of public functions) to be put as a -# subgroup of that type (e.g. under the Public Functions section). Set it to -# NO to prevent subgrouping. Alternatively, this can be done per class using -# the \nosubgrouping command. - -SUBGROUPING = YES - -# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum -# is documented as struct, union, or enum with the name of the typedef. So -# typedef struct TypeS {} TypeT, will appear in the documentation as a struct -# with name TypeT. When disabled the typedef will appear as a member of a file, -# namespace, or class. And the struct will be named TypeS. This can typically -# be useful for C code in case the coding convention dictates that all compound -# types are typedef'ed and only the typedef is referenced, never the tag name. - -TYPEDEF_HIDES_STRUCT = NO - -# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to -# determine which symbols to keep in memory and which to flush to disk. -# When the cache is full, less often used symbols will be written to disk. -# For small to medium size projects (<1000 input files) the default value is -# probably good enough. For larger projects a too small cache size can cause -# doxygen to be busy swapping symbols to and from disk most of the time -# causing a significant performance penality. -# If the system has enough physical memory increasing the cache will improve the -# performance by keeping more symbols in memory. Note that the value works on -# a logarithmic scale so increasing the size by one will rougly double the -# memory usage. The cache size is given by this formula: -# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, -# corresponding to a cache size of 2^16 = 65536 symbols - -SYMBOL_CACHE_SIZE = 0 - -#--------------------------------------------------------------------------- -# Build related configuration options -#--------------------------------------------------------------------------- - -# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in -# documentation are documented, even if no documentation was available. -# Private class members and static file members will be hidden unless -# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES - -EXTRACT_ALL = YES - -# If the EXTRACT_PRIVATE tag is set to YES all private members of a class -# will be included in the documentation. - -EXTRACT_PRIVATE = YES - -# If the EXTRACT_STATIC tag is set to YES all static members of a file -# will be included in the documentation. - -EXTRACT_STATIC = YES - -# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) -# defined locally in source files will be included in the documentation. -# If set to NO only classes defined in header files are included. - -EXTRACT_LOCAL_CLASSES = YES - -# This flag is only useful for Objective-C code. When set to YES local -# methods, which are defined in the implementation section but not in -# the interface are included in the documentation. -# If set to NO (the default) only methods in the interface are included. - -EXTRACT_LOCAL_METHODS = NO - -# If this flag is set to YES, the members of anonymous namespaces will be -# extracted and appear in the documentation as a namespace called -# 'anonymous_namespace{file}', where file will be replaced with the base -# name of the file that contains the anonymous namespace. By default -# anonymous namespace are hidden. - -EXTRACT_ANON_NSPACES = NO - -# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all -# undocumented members of documented classes, files or namespaces. -# If set to NO (the default) these members will be included in the -# various overviews, but no documentation section is generated. -# This option has no effect if EXTRACT_ALL is enabled. - -HIDE_UNDOC_MEMBERS = NO - -# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all -# undocumented classes that are normally visible in the class hierarchy. -# If set to NO (the default) these classes will be included in the various -# overviews. This option has no effect if EXTRACT_ALL is enabled. - -HIDE_UNDOC_CLASSES = NO - -# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all -# friend (class|struct|union) declarations. -# If set to NO (the default) these declarations will be included in the -# documentation. - -HIDE_FRIEND_COMPOUNDS = NO - -# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any -# documentation blocks found inside the body of a function. -# If set to NO (the default) these blocks will be appended to the -# function's detailed documentation block. - -HIDE_IN_BODY_DOCS = NO - -# The INTERNAL_DOCS tag determines if documentation -# that is typed after a \internal command is included. If the tag is set -# to NO (the default) then the documentation will be excluded. -# Set it to YES to include the internal documentation. - -INTERNAL_DOCS = NO - -# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate -# file names in lower-case letters. If set to YES upper-case letters are also -# allowed. This is useful if you have classes or files whose names only differ -# in case and if your file system supports case sensitive file names. Windows -# and Mac users are advised to set this option to NO. - -CASE_SENSE_NAMES = NO - -# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen -# will show members with their full class and namespace scopes in the -# documentation. If set to YES the scope will be hidden. - -HIDE_SCOPE_NAMES = NO - -# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen -# will put a list of the files that are included by a file in the documentation -# of that file. - -SHOW_INCLUDE_FILES = YES - -# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen -# will list include files with double quotes in the documentation -# rather than with sharp brackets. - -FORCE_LOCAL_INCLUDES = NO - -# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] -# is inserted in the documentation for inline members. - -INLINE_INFO = YES - -# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen -# will sort the (detailed) documentation of file and class members -# alphabetically by member name. If set to NO the members will appear in -# declaration order. - -SORT_MEMBER_DOCS = YES - -# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the -# brief documentation of file, namespace and class members alphabetically -# by member name. If set to NO (the default) the members will appear in -# declaration order. - -SORT_BRIEF_DOCS = YES - -# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen -# will sort the (brief and detailed) documentation of class members so that -# constructors and destructors are listed first. If set to NO (the default) -# the constructors will appear in the respective orders defined by -# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. -# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO -# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO. - -SORT_MEMBERS_CTORS_1ST = NO - -# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the -# hierarchy of group names into alphabetical order. If set to NO (the default) -# the group names will appear in their defined order. - -SORT_GROUP_NAMES = NO - -# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be -# sorted by fully-qualified names, including namespaces. If set to -# NO (the default), the class list will be sorted only by class name, -# not including the namespace part. -# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. -# Note: This option applies only to the class list, not to the -# alphabetical list. - -SORT_BY_SCOPE_NAME = NO - -# The GENERATE_TODOLIST tag can be used to enable (YES) or -# disable (NO) the todo list. This list is created by putting \todo -# commands in the documentation. - -GENERATE_TODOLIST = YES - -# The GENERATE_TESTLIST tag can be used to enable (YES) or -# disable (NO) the test list. This list is created by putting \test -# commands in the documentation. - -GENERATE_TESTLIST = YES - -# The GENERATE_BUGLIST tag can be used to enable (YES) or -# disable (NO) the bug list. This list is created by putting \bug -# commands in the documentation. - -GENERATE_BUGLIST = YES - -# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or -# disable (NO) the deprecated list. This list is created by putting -# \deprecated commands in the documentation. - -GENERATE_DEPRECATEDLIST= YES - -# The ENABLED_SECTIONS tag can be used to enable conditional -# documentation sections, marked by \if sectionname ... \endif. - -ENABLED_SECTIONS = - -# The MAX_INITIALIZER_LINES tag determines the maximum number of lines -# the initial value of a variable or define consists of for it to appear in -# the documentation. If the initializer consists of more lines than specified -# here it will be hidden. Use a value of 0 to hide initializers completely. -# The appearance of the initializer of individual variables and defines in the -# documentation can be controlled using \showinitializer or \hideinitializer -# command in the documentation regardless of this setting. - -MAX_INITIALIZER_LINES = 30 - -# Set the SHOW_USED_FILES tag to NO to disable the list of files generated -# at the bottom of the documentation of classes and structs. If set to YES the -# list will mention the files that were used to generate the documentation. - -SHOW_USED_FILES = YES - -# If the sources in your project are distributed over multiple directories -# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy -# in the documentation. The default is NO. - -SHOW_DIRECTORIES = YES - -# Set the SHOW_FILES tag to NO to disable the generation of the Files page. -# This will remove the Files entry from the Quick Index and from the -# Folder Tree View (if specified). The default is YES. - -SHOW_FILES = YES - -# Set the SHOW_NAMESPACES tag to NO to disable the generation of the -# Namespaces page. This will remove the Namespaces entry from the Quick Index -# and from the Folder Tree View (if specified). The default is YES. - -SHOW_NAMESPACES = YES - -# The FILE_VERSION_FILTER tag can be used to specify a program or script that -# doxygen should invoke to get the current version for each file (typically from -# the version control system). Doxygen will invoke the program by executing (via -# popen()) the command , where is the value of -# the FILE_VERSION_FILTER tag, and is the name of an input file -# provided by doxygen. Whatever the program writes to standard output -# is used as the file version. See the manual for examples. - -FILE_VERSION_FILTER = - -# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed -# by doxygen. The layout file controls the global structure of the generated -# output files in an output format independent way. The create the layout file -# that represents doxygen's defaults, run doxygen with the -l option. -# You can optionally specify a file name after the option, if omitted -# DoxygenLayout.xml will be used as the name of the layout file. - -LAYOUT_FILE = - -#--------------------------------------------------------------------------- -# configuration options related to warning and progress messages -#--------------------------------------------------------------------------- - -# The QUIET tag can be used to turn on/off the messages that are generated -# by doxygen. Possible values are YES and NO. If left blank NO is used. - -QUIET = NO - -# The WARNINGS tag can be used to turn on/off the warning messages that are -# generated by doxygen. Possible values are YES and NO. If left blank -# NO is used. - -WARNINGS = YES - -# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings -# for undocumented members. If EXTRACT_ALL is set to YES then this flag will -# automatically be disabled. - -WARN_IF_UNDOCUMENTED = YES - -# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for -# potential errors in the documentation, such as not documenting some -# parameters in a documented function, or documenting parameters that -# don't exist or using markup commands wrongly. - -WARN_IF_DOC_ERROR = YES - -# This WARN_NO_PARAMDOC option can be abled to get warnings for -# functions that are documented, but have no documentation for their parameters -# or return value. If set to NO (the default) doxygen will only warn about -# wrong or incomplete parameter documentation, but not about the absence of -# documentation. - -WARN_NO_PARAMDOC = YES - -# The WARN_FORMAT tag determines the format of the warning messages that -# doxygen can produce. The string should contain the $file, $line, and $text -# tags, which will be replaced by the file and line number from which the -# warning originated and the warning text. Optionally the format may contain -# $version, which will be replaced by the version of the file (if it could -# be obtained via FILE_VERSION_FILTER) - -WARN_FORMAT = "$file:$line: $text" - -# The WARN_LOGFILE tag can be used to specify a file to which warning -# and error messages should be written. If left blank the output is written -# to stderr. - -WARN_LOGFILE = docwarn.txt - -#--------------------------------------------------------------------------- -# configuration options related to the input files -#--------------------------------------------------------------------------- - -# The INPUT tag can be used to specify the files and/or directories that contain -# documented source files. You may enter file names like "myfile.cpp" or -# directories like "/usr/src/myproject". Separate the files or directories -# with spaces. - -INPUT = src \ - include \ - doxygen - -# This tag can be used to specify the character encoding of the source files -# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is -# also the default input encoding. Doxygen uses libiconv (or the iconv built -# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for -# the list of possible encodings. - -INPUT_ENCODING = UTF-8 - -# If the value of the INPUT tag contains directories, you can use the -# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -# and *.h) to filter out the source-files in the directories. If left -# blank the following patterns are tested: -# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx -# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90 - -FILE_PATTERNS = *.c \ - *.cc \ - *.cxx \ - *.cpp \ - *.c++ \ - *.d \ - *.java \ - *.ii \ - *.ixx \ - *.ipp \ - *.i++ \ - *.inl \ - *.h \ - *.hh \ - *.hxx \ - *.hpp \ - *.h++ \ - *.idl \ - *.odl \ - *.cs \ - *.php \ - *.php3 \ - *.inc \ - *.m \ - *.mm \ - *.dox \ - *.py - -# The RECURSIVE tag can be used to turn specify whether or not subdirectories -# should be searched for input files as well. Possible values are YES and NO. -# If left blank NO is used. - -RECURSIVE = YES - -# The EXCLUDE tag can be used to specify files and/or directories that should -# excluded from the INPUT source files. This way you can easily exclude a -# subdirectory from a directory tree whose root is specified with the INPUT tag. - -EXCLUDE = - -# The EXCLUDE_SYMLINKS tag can be used select whether or not files or -# directories that are symbolic links (a Unix filesystem feature) are excluded -# from the input. - -EXCLUDE_SYMLINKS = NO - -# If the value of the INPUT tag contains directories, you can use the -# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude -# certain files from those directories. Note that the wildcards are matched -# against the file with absolute path, so to exclude all test directories -# for example use the pattern */test/* - -EXCLUDE_PATTERNS = - -# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names -# (namespaces, classes, functions, etc.) that should be excluded from the -# output. The symbol name can be a fully qualified name, a word, or if the -# wildcard * is used, a substring. Examples: ANamespace, AClass, -# AClass::ANamespace, ANamespace::*Test - -EXCLUDE_SYMBOLS = - -# The EXAMPLE_PATH tag can be used to specify one or more files or -# directories that contain example code fragments that are included (see -# the \include command). - -EXAMPLE_PATH = - -# If the value of the EXAMPLE_PATH tag contains directories, you can use the -# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -# and *.h) to filter out the source-files in the directories. If left -# blank all files are included. - -EXAMPLE_PATTERNS = * - -# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be -# searched for input files to be used with the \include or \dontinclude -# commands irrespective of the value of the RECURSIVE tag. -# Possible values are YES and NO. If left blank NO is used. - -EXAMPLE_RECURSIVE = NO - -# The IMAGE_PATH tag can be used to specify one or more files or -# directories that contain image that are included in the documentation (see -# the \image command). - -IMAGE_PATH = - -# The INPUT_FILTER tag can be used to specify a program that doxygen should -# invoke to filter for each input file. Doxygen will invoke the filter program -# by executing (via popen()) the command , where -# is the value of the INPUT_FILTER tag, and is the name of an -# input file. Doxygen will then use the output that the filter program writes -# to standard output. If FILTER_PATTERNS is specified, this tag will be -# ignored. - -INPUT_FILTER = - -# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern -# basis. Doxygen will compare the file name with each pattern and apply the -# filter if there is a match. The filters are a list of the form: -# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further -# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER -# is applied to all files. - -FILTER_PATTERNS = - -# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using -# INPUT_FILTER) will be used to filter the input files when producing source -# files to browse (i.e. when SOURCE_BROWSER is set to YES). - -FILTER_SOURCE_FILES = NO - -#--------------------------------------------------------------------------- -# configuration options related to source browsing -#--------------------------------------------------------------------------- - -# If the SOURCE_BROWSER tag is set to YES then a list of source files will -# be generated. Documented entities will be cross-referenced with these sources. -# Note: To get rid of all source code in the generated output, make sure also -# VERBATIM_HEADERS is set to NO. - -SOURCE_BROWSER = NO - -# Setting the INLINE_SOURCES tag to YES will include the body -# of functions and classes directly in the documentation. - -INLINE_SOURCES = NO - -# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct -# doxygen to hide any special comment blocks from generated source code -# fragments. Normal C and C++ comments will always remain visible. - -STRIP_CODE_COMMENTS = YES - -# If the REFERENCED_BY_RELATION tag is set to YES -# then for each documented function all documented -# functions referencing it will be listed. - -REFERENCED_BY_RELATION = YES - -# If the REFERENCES_RELATION tag is set to YES -# then for each documented function all documented entities -# called/used by that function will be listed. - -REFERENCES_RELATION = YES - -# If the REFERENCES_LINK_SOURCE tag is set to YES (the default) -# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from -# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will -# link to the source code. Otherwise they will link to the documentation. - -REFERENCES_LINK_SOURCE = YES - -# If the USE_HTAGS tag is set to YES then the references to source code -# will point to the HTML generated by the htags(1) tool instead of doxygen -# built-in source browser. The htags tool is part of GNU's global source -# tagging system (see http://www.gnu.org/software/global/global.html). You -# will need version 4.8.6 or higher. - -USE_HTAGS = NO - -# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen -# will generate a verbatim copy of the header file for each class for -# which an include is specified. Set to NO to disable this. - -VERBATIM_HEADERS = NO - -#--------------------------------------------------------------------------- -# configuration options related to the alphabetical class index -#--------------------------------------------------------------------------- - -# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index -# of all compounds will be generated. Enable this if the project -# contains a lot of classes, structs, unions or interfaces. - -ALPHABETICAL_INDEX = YES - -# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then -# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns -# in which this list will be split (can be a number in the range [1..20]) - -COLS_IN_ALPHA_INDEX = 5 - -# In case all classes in a project start with a common prefix, all -# classes will be put under the same header in the alphabetical index. -# The IGNORE_PREFIX tag can be used to specify one or more prefixes that -# should be ignored while generating the index headers. - -IGNORE_PREFIX = - -#--------------------------------------------------------------------------- -# configuration options related to the HTML output -#--------------------------------------------------------------------------- - -# If the GENERATE_HTML tag is set to YES (the default) Doxygen will -# generate HTML output. - -GENERATE_HTML = YES - -# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `html' will be used as the default path. - -HTML_OUTPUT = . - -# The HTML_FILE_EXTENSION tag can be used to specify the file extension for -# each generated HTML page (for example: .htm,.php,.asp). If it is left blank -# doxygen will generate files with .html extension. - -HTML_FILE_EXTENSION = .html - -# The HTML_HEADER tag can be used to specify a personal HTML header for -# each generated HTML page. If it is left blank doxygen will generate a -# standard header. - -HTML_HEADER = - -# The HTML_FOOTER tag can be used to specify a personal HTML footer for -# each generated HTML page. If it is left blank doxygen will generate a -# standard footer. - -HTML_FOOTER = - -# The HTML_STYLESHEET tag can be used to specify a user-defined cascading -# style sheet that is used by each HTML page. It can be used to -# fine-tune the look of the HTML output. If the tag is left blank doxygen -# will generate a default style sheet. Note that doxygen will try to copy -# the style sheet file to the HTML output directory, so don't put your own -# stylesheet in the HTML output directory as well, or it will be erased! - -HTML_STYLESHEET = - -# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. -# Doxygen will adjust the colors in the stylesheet and background images -# according to this color. Hue is specified as an angle on a colorwheel, -# see http://en.wikipedia.org/wiki/Hue for more information. -# For instance the value 0 represents red, 60 is yellow, 120 is green, -# 180 is cyan, 240 is blue, 300 purple, and 360 is red again. -# The allowed range is 0 to 359. - -HTML_COLORSTYLE_HUE = 220 - -# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of -# the colors in the HTML output. For a value of 0 the output will use -# grayscales only. A value of 255 will produce the most vivid colors. - -HTML_COLORSTYLE_SAT = 100 - -# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to -# the luminance component of the colors in the HTML output. Values below -# 100 gradually make the output lighter, whereas values above 100 make -# the output darker. The value divided by 100 is the actual gamma applied, -# so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2, -# and 100 does not change the gamma. - -HTML_COLORSTYLE_GAMMA = 80 - -# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML -# page will contain the date and time when the page was generated. Setting -# this to NO can help when comparing the output of multiple runs. - -HTML_TIMESTAMP = YES - -# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, -# files or namespaces will be aligned in HTML using tables. If set to -# NO a bullet list will be used. - -HTML_ALIGN_MEMBERS = YES - -# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML -# documentation will contain sections that can be hidden and shown after the -# page has loaded. For this to work a browser that supports -# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox -# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). - -HTML_DYNAMIC_SECTIONS = NO - -# If the GENERATE_DOCSET tag is set to YES, additional index files -# will be generated that can be used as input for Apple's Xcode 3 -# integrated development environment, introduced with OSX 10.5 (Leopard). -# To create a documentation set, doxygen will generate a Makefile in the -# HTML output directory. Running make will produce the docset in that -# directory and running "make install" will install the docset in -# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find -# it at startup. -# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html -# for more information. - -GENERATE_DOCSET = NO - -# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the -# feed. A documentation feed provides an umbrella under which multiple -# documentation sets from a single provider (such as a company or product suite) -# can be grouped. - -DOCSET_FEEDNAME = "Doxygen generated docs" - -# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that -# should uniquely identify the documentation set bundle. This should be a -# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen -# will append .docset to the name. - -DOCSET_BUNDLE_ID = org.doxygen.Project - -# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely identify -# the documentation publisher. This should be a reverse domain-name style -# string, e.g. com.mycompany.MyDocSet.documentation. - -DOCSET_PUBLISHER_ID = org.doxygen.Publisher - -# The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher. - -DOCSET_PUBLISHER_NAME = Publisher - -# If the GENERATE_HTMLHELP tag is set to YES, additional index files -# will be generated that can be used as input for tools like the -# Microsoft HTML help workshop to generate a compiled HTML help file (.chm) -# of the generated HTML documentation. - -GENERATE_HTMLHELP = NO - -# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can -# be used to specify the file name of the resulting .chm file. You -# can add a path in front of the file if the result should not be -# written to the html output directory. - -CHM_FILE = - -# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can -# be used to specify the location (absolute path including file name) of -# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run -# the HTML help compiler on the generated index.hhp. - -HHC_LOCATION = - -# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag -# controls if a separate .chi index file is generated (YES) or that -# it should be included in the master .chm file (NO). - -GENERATE_CHI = NO - -# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING -# is used to encode HtmlHelp index (hhk), content (hhc) and project file -# content. - -CHM_INDEX_ENCODING = - -# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag -# controls whether a binary table of contents is generated (YES) or a -# normal table of contents (NO) in the .chm file. - -BINARY_TOC = NO - -# The TOC_EXPAND flag can be set to YES to add extra items for group members -# to the contents of the HTML help documentation and to the tree view. - -TOC_EXPAND = NO - -# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and -# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated -# that can be used as input for Qt's qhelpgenerator to generate a -# Qt Compressed Help (.qch) of the generated HTML documentation. - -GENERATE_QHP = NO - -# If the QHG_LOCATION tag is specified, the QCH_FILE tag can -# be used to specify the file name of the resulting .qch file. -# The path specified is relative to the HTML output folder. - -QCH_FILE = - -# The QHP_NAMESPACE tag specifies the namespace to use when generating -# Qt Help Project output. For more information please see -# http://doc.trolltech.com/qthelpproject.html#namespace - -QHP_NAMESPACE = org.doxygen.Project - -# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating -# Qt Help Project output. For more information please see -# http://doc.trolltech.com/qthelpproject.html#virtual-folders - -QHP_VIRTUAL_FOLDER = doc - -# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to -# add. For more information please see -# http://doc.trolltech.com/qthelpproject.html#custom-filters - -QHP_CUST_FILTER_NAME = - -# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the -# custom filter to add. For more information please see -# -# Qt Help Project / Custom Filters. - -QHP_CUST_FILTER_ATTRS = - -# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this -# project's -# filter section matches. -# -# Qt Help Project / Filter Attributes. - -QHP_SECT_FILTER_ATTRS = - -# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can -# be used to specify the location of Qt's qhelpgenerator. -# If non-empty doxygen will try to run qhelpgenerator on the generated -# .qhp file. - -QHG_LOCATION = - -# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files -# will be generated, which together with the HTML files, form an Eclipse help -# plugin. To install this plugin and make it available under the help contents -# menu in Eclipse, the contents of the directory containing the HTML and XML -# files needs to be copied into the plugins directory of eclipse. The name of -# the directory within the plugins directory should be the same as -# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before -# the help appears. - -GENERATE_ECLIPSEHELP = NO - -# A unique identifier for the eclipse help plugin. When installing the plugin -# the directory name containing the HTML and XML files should also have -# this name. - -ECLIPSE_DOC_ID = org.doxygen.Project - -# The DISABLE_INDEX tag can be used to turn on/off the condensed index at -# top of each HTML page. The value NO (the default) enables the index and -# the value YES disables it. - -DISABLE_INDEX = NO - -# This tag can be used to set the number of enum values (range [1..20]) -# that doxygen will group on one line in the generated HTML documentation. - -ENUM_VALUES_PER_LINE = 4 - -# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index -# structure should be generated to display hierarchical information. -# If the tag value is set to YES, a side panel will be generated -# containing a tree-like index structure (just like the one that -# is generated for HTML Help). For this to work a browser that supports -# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser). -# Windows users are probably better off using the HTML help feature. - -GENERATE_TREEVIEW = YES - -# By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories, -# and Class Hierarchy pages using a tree view instead of an ordered list. - -USE_INLINE_TREES = NO - -# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be -# used to set the initial width (in pixels) of the frame in which the tree -# is shown. - -TREEVIEW_WIDTH = 300 - -# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open -# links to external symbols imported via tag files in a separate window. - -EXT_LINKS_IN_WINDOW = NO - -# Use this tag to change the font size of Latex formulas included -# as images in the HTML documentation. The default is 10. Note that -# when you change the font size after a successful doxygen run you need -# to manually remove any form_*.png images from the HTML output directory -# to force them to be regenerated. - -FORMULA_FONTSIZE = 10 - -# Use the FORMULA_TRANPARENT tag to determine whether or not the images -# generated for formulas are transparent PNGs. Transparent PNGs are -# not supported properly for IE 6.0, but are supported on all modern browsers. -# Note that when changing this option you need to delete any form_*.png files -# in the HTML output before the changes have effect. - -FORMULA_TRANSPARENT = YES - -# When the SEARCHENGINE tag is enabled doxygen will generate a search box -# for the HTML output. The underlying search engine uses javascript -# and DHTML and should work on any modern browser. Note that when using -# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets -# (GENERATE_DOCSET) there is already a search function so this one should -# typically be disabled. For large projects the javascript based search engine -# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution. - -SEARCHENGINE = NO - -# When the SERVER_BASED_SEARCH tag is enabled the search engine will be -# implemented using a PHP enabled web server instead of at the web client -# using Javascript. Doxygen will generate the search PHP script and index -# file to put on the web server. The advantage of the server -# based approach is that it scales better to large projects and allows -# full text search. The disadvances is that it is more difficult to setup -# and does not have live searching capabilities. - -SERVER_BASED_SEARCH = NO - -#--------------------------------------------------------------------------- -# configuration options related to the LaTeX output -#--------------------------------------------------------------------------- - -# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will -# generate Latex output. - -GENERATE_LATEX = NO - -# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `latex' will be used as the default path. - -LATEX_OUTPUT = latex - -# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be -# invoked. If left blank `latex' will be used as the default command name. -# Note that when enabling USE_PDFLATEX this option is only used for -# generating bitmaps for formulas in the HTML output, but not in the -# Makefile that is written to the output directory. - -LATEX_CMD_NAME = latex - -# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to -# generate index for LaTeX. If left blank `makeindex' will be used as the -# default command name. - -MAKEINDEX_CMD_NAME = makeindex - -# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact -# LaTeX documents. This may be useful for small projects and may help to -# save some trees in general. - -COMPACT_LATEX = NO - -# The PAPER_TYPE tag can be used to set the paper type that is used -# by the printer. Possible values are: a4, a4wide, letter, legal and -# executive. If left blank a4wide will be used. - -PAPER_TYPE = a4wide - -# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX -# packages that should be included in the LaTeX output. - -EXTRA_PACKAGES = - -# The LATEX_HEADER tag can be used to specify a personal LaTeX header for -# the generated latex document. The header should contain everything until -# the first chapter. If it is left blank doxygen will generate a -# standard header. Notice: only use this tag if you know what you are doing! - -LATEX_HEADER = - -# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated -# is prepared for conversion to pdf (using ps2pdf). The pdf file will -# contain links (just like the HTML output) instead of page references -# This makes the output suitable for online browsing using a pdf viewer. - -PDF_HYPERLINKS = NO - -# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of -# plain latex in the generated Makefile. Set this option to YES to get a -# higher quality PDF documentation. - -USE_PDFLATEX = NO - -# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. -# command to the generated LaTeX files. This will instruct LaTeX to keep -# running if errors occur, instead of asking the user for help. -# This option is also used when generating formulas in HTML. - -LATEX_BATCHMODE = NO - -# If LATEX_HIDE_INDICES is set to YES then doxygen will not -# include the index chapters (such as File Index, Compound Index, etc.) -# in the output. - -LATEX_HIDE_INDICES = NO - -# If LATEX_SOURCE_CODE is set to YES then doxygen will include -# source code with syntax highlighting in the LaTeX output. -# Note that which sources are shown also depends on other settings -# such as SOURCE_BROWSER. - -LATEX_SOURCE_CODE = NO - -#--------------------------------------------------------------------------- -# configuration options related to the RTF output -#--------------------------------------------------------------------------- - -# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output -# The RTF output is optimized for Word 97 and may not look very pretty with -# other RTF readers or editors. - -GENERATE_RTF = NO - -# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `rtf' will be used as the default path. - -RTF_OUTPUT = rtf - -# If the COMPACT_RTF tag is set to YES Doxygen generates more compact -# RTF documents. This may be useful for small projects and may help to -# save some trees in general. - -COMPACT_RTF = NO - -# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated -# will contain hyperlink fields. The RTF file will -# contain links (just like the HTML output) instead of page references. -# This makes the output suitable for online browsing using WORD or other -# programs which support those fields. -# Note: wordpad (write) and others do not support links. - -RTF_HYPERLINKS = NO - -# Load stylesheet definitions from file. Syntax is similar to doxygen's -# config file, i.e. a series of assignments. You only have to provide -# replacements, missing definitions are set to their default value. - -RTF_STYLESHEET_FILE = - -# Set optional variables used in the generation of an rtf document. -# Syntax is similar to doxygen's config file. - -RTF_EXTENSIONS_FILE = - -#--------------------------------------------------------------------------- -# configuration options related to the man page output -#--------------------------------------------------------------------------- - -# If the GENERATE_MAN tag is set to YES (the default) Doxygen will -# generate man pages - -GENERATE_MAN = YES - -# The MAN_OUTPUT tag is used to specify where the man pages will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `man' will be used as the default path. - -MAN_OUTPUT = man - -# The MAN_EXTENSION tag determines the extension that is added to -# the generated man pages (default is the subroutine's section .3) - -MAN_EXTENSION = .3 - -# If the MAN_LINKS tag is set to YES and Doxygen generates man output, -# then it will generate one additional man file for each entity -# documented in the real man page(s). These additional files -# only source the real man page, but without them the man command -# would be unable to find the correct page. The default is NO. - -MAN_LINKS = YES - -#--------------------------------------------------------------------------- -# configuration options related to the XML output -#--------------------------------------------------------------------------- - -# If the GENERATE_XML tag is set to YES Doxygen will -# generate an XML file that captures the structure of -# the code including all documentation. - -GENERATE_XML = NO - -# The XML_OUTPUT tag is used to specify where the XML pages will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `xml' will be used as the default path. - -XML_OUTPUT = xml - -# The XML_SCHEMA tag can be used to specify an XML schema, -# which can be used by a validating XML parser to check the -# syntax of the XML files. - -XML_SCHEMA = - -# The XML_DTD tag can be used to specify an XML DTD, -# which can be used by a validating XML parser to check the -# syntax of the XML files. - -XML_DTD = - -# If the XML_PROGRAMLISTING tag is set to YES Doxygen will -# dump the program listings (including syntax highlighting -# and cross-referencing information) to the XML output. Note that -# enabling this will significantly increase the size of the XML output. - -XML_PROGRAMLISTING = YES - -#--------------------------------------------------------------------------- -# configuration options for the AutoGen Definitions output -#--------------------------------------------------------------------------- - -# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will -# generate an AutoGen Definitions (see autogen.sf.net) file -# that captures the structure of the code including all -# documentation. Note that this feature is still experimental -# and incomplete at the moment. - -GENERATE_AUTOGEN_DEF = NO - -#--------------------------------------------------------------------------- -# configuration options related to the Perl module output -#--------------------------------------------------------------------------- - -# If the GENERATE_PERLMOD tag is set to YES Doxygen will -# generate a Perl module file that captures the structure of -# the code including all documentation. Note that this -# feature is still experimental and incomplete at the -# moment. - -GENERATE_PERLMOD = NO - -# If the PERLMOD_LATEX tag is set to YES Doxygen will generate -# the necessary Makefile rules, Perl scripts and LaTeX code to be able -# to generate PDF and DVI output from the Perl module output. - -PERLMOD_LATEX = NO - -# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be -# nicely formatted so it can be parsed by a human reader. This is useful -# if you want to understand what is going on. On the other hand, if this -# tag is set to NO the size of the Perl module output will be much smaller -# and Perl will parse it just the same. - -PERLMOD_PRETTY = YES - -# The names of the make variables in the generated doxyrules.make file -# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. -# This is useful so different doxyrules.make files included by the same -# Makefile don't overwrite each other's variables. - -PERLMOD_MAKEVAR_PREFIX = - -#--------------------------------------------------------------------------- -# Configuration options related to the preprocessor -#--------------------------------------------------------------------------- - -# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will -# evaluate all C-preprocessor directives found in the sources and include -# files. - -ENABLE_PREPROCESSING = YES - -# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro -# names in the source code. If set to NO (the default) only conditional -# compilation will be performed. Macro expansion can be done in a controlled -# way by setting EXPAND_ONLY_PREDEF to YES. - -MACRO_EXPANSION = NO - -# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES -# then the macro expansion is limited to the macros specified with the -# PREDEFINED and EXPAND_AS_DEFINED tags. - -EXPAND_ONLY_PREDEF = NO - -# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files -# in the INCLUDE_PATH (see below) will be search if a #include is found. - -SEARCH_INCLUDES = YES - -# The INCLUDE_PATH tag can be used to specify one or more directories that -# contain include files that are not input files but should be processed by -# the preprocessor. - -INCLUDE_PATH = - -# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard -# patterns (like *.h and *.hpp) to filter out the header-files in the -# directories. If left blank, the patterns specified with FILE_PATTERNS will -# be used. - -INCLUDE_FILE_PATTERNS = - -# The PREDEFINED tag can be used to specify one or more macro names that -# are defined before the preprocessor is started (similar to the -D option of -# gcc). The argument of the tag is a list of macros of the form: name -# or name=definition (no spaces). If the definition and the = are -# omitted =1 is assumed. To prevent a macro definition from being -# undefined via #undef or recursively expanded use the := operator -# instead of the = operator. - -PREDEFINED = - -# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then -# this tag can be used to specify a list of macro names that should be expanded. -# The macro definition that is found in the sources will be used. -# Use the PREDEFINED tag if you want to use a different macro definition. - -EXPAND_AS_DEFINED = - -# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then -# doxygen's preprocessor will remove all function-like macros that are alone -# on a line, have an all uppercase name, and do not end with a semicolon. Such -# function macros are typically used for boiler-plate code, and will confuse -# the parser if not removed. - -SKIP_FUNCTION_MACROS = YES - -#--------------------------------------------------------------------------- -# Configuration::additions related to external references -#--------------------------------------------------------------------------- - -# The TAGFILES option can be used to specify one or more tagfiles. -# Optionally an initial location of the external documentation -# can be added for each tagfile. The format of a tag file without -# this location is as follows: -# TAGFILES = file1 file2 ... -# Adding location for the tag files is done as follows: -# TAGFILES = file1=loc1 "file2 = loc2" ... -# where "loc1" and "loc2" can be relative or absolute paths or -# URLs. If a location is present for each tag, the installdox tool -# does not have to be run to correct the links. -# Note that each tag file must have a unique name -# (where the name does NOT include the path) -# If a tag file is not located in the directory in which doxygen -# is run, you must also specify the path to the tagfile here. - -TAGFILES = - -# When a file name is specified after GENERATE_TAGFILE, doxygen will create -# a tag file that is based on the input files it reads. - -GENERATE_TAGFILE = - -# If the ALLEXTERNALS tag is set to YES all external classes will be listed -# in the class index. If set to NO only the inherited external classes -# will be listed. - -ALLEXTERNALS = NO - -# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed -# in the modules index. If set to NO, only the current project's groups will -# be listed. - -EXTERNAL_GROUPS = YES - -# The PERL_PATH should be the absolute path and name of the perl script -# interpreter (i.e. the result of `which perl'). - -PERL_PATH = /usr/bin/perl - -#--------------------------------------------------------------------------- -# Configuration options related to the dot tool -#--------------------------------------------------------------------------- - -# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will -# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base -# or super classes. Setting the tag to NO turns the diagrams off. Note that -# this option is superseded by the HAVE_DOT option below. This is only a -# fallback. It is recommended to install and use dot, since it yields more -# powerful graphs. - -CLASS_DIAGRAMS = YES - -# You can define message sequence charts within doxygen comments using the \msc -# command. Doxygen will then run the mscgen tool (see -# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the -# documentation. The MSCGEN_PATH tag allows you to specify the directory where -# the mscgen tool resides. If left empty the tool is assumed to be found in the -# default search path. - -MSCGEN_PATH = - -# If set to YES, the inheritance and collaboration graphs will hide -# inheritance and usage relations if the target is undocumented -# or is not a class. - -HIDE_UNDOC_RELATIONS = YES - -# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is -# available from the path. This tool is part of Graphviz, a graph visualization -# toolkit from AT&T and Lucent Bell Labs. The other options in this section -# have no effect if this option is set to NO (the default) - -HAVE_DOT = YES - -# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is -# allowed to run in parallel. When set to 0 (the default) doxygen will -# base this on the number of processors available in the system. You can set it -# explicitly to a value larger than 0 to get control over the balance -# between CPU load and processing speed. - -DOT_NUM_THREADS = 0 - -# By default doxygen will write a font called FreeSans.ttf to the output -# directory and reference it in all dot files that doxygen generates. This -# font does not include all possible unicode characters however, so when you need -# these (or just want a differently looking font) you can specify the font name -# using DOT_FONTNAME. You need need to make sure dot is able to find the font, -# which can be done by putting it in a standard location or by setting the -# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory -# containing the font. - -DOT_FONTNAME = FreeSans.ttf - -# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. -# The default size is 10pt. - -DOT_FONTSIZE = 10 - -# By default doxygen will tell dot to use the output directory to look for the -# FreeSans.ttf font (which doxygen will put there itself). If you specify a -# different font using DOT_FONTNAME you can set the path where dot -# can find it using this tag. - -DOT_FONTPATH = - -# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for each documented class showing the direct and -# indirect inheritance relations. Setting this tag to YES will force the -# the CLASS_DIAGRAMS tag to NO. - -CLASS_GRAPH = YES - -# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for each documented class showing the direct and -# indirect implementation dependencies (inheritance, containment, and -# class references variables) of the class with other documented classes. - -COLLABORATION_GRAPH = YES - -# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for groups, showing the direct groups dependencies - -GROUP_GRAPHS = YES - -# If the UML_LOOK tag is set to YES doxygen will generate inheritance and -# collaboration diagrams in a style similar to the OMG's Unified Modeling -# Language. - -UML_LOOK = NO - -# If set to YES, the inheritance and collaboration graphs will show the -# relations between templates and their instances. - -TEMPLATE_RELATIONS = NO - -# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT -# tags are set to YES then doxygen will generate a graph for each documented -# file showing the direct and indirect include dependencies of the file with -# other documented files. - -INCLUDE_GRAPH = YES - -# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and -# HAVE_DOT tags are set to YES then doxygen will generate a graph for each -# documented header file showing the documented files that directly or -# indirectly include this file. - -INCLUDED_BY_GRAPH = YES - -# If the CALL_GRAPH and HAVE_DOT options are set to YES then -# doxygen will generate a call dependency graph for every global function -# or class method. Note that enabling this option will significantly increase -# the time of a run. So in most cases it will be better to enable call graphs -# for selected functions only using the \callgraph command. - -CALL_GRAPH = YES - -# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then -# doxygen will generate a caller dependency graph for every global function -# or class method. Note that enabling this option will significantly increase -# the time of a run. So in most cases it will be better to enable caller -# graphs for selected functions only using the \callergraph command. - -CALLER_GRAPH = YES - -# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen -# will graphical hierarchy of all classes instead of a textual one. - -GRAPHICAL_HIERARCHY = YES - -# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES -# then doxygen will show the dependencies a directory has on other directories -# in a graphical way. The dependency relations are determined by the #include -# relations between the files in the directories. - -DIRECTORY_GRAPH = YES - -# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images -# generated by dot. Possible values are png, jpg, or gif -# If left blank png will be used. - -DOT_IMAGE_FORMAT = png - -# The tag DOT_PATH can be used to specify the path where the dot tool can be -# found. If left blank, it is assumed the dot tool can be found in the path. - -DOT_PATH = - -# The DOTFILE_DIRS tag can be used to specify one or more directories that -# contain dot files that are included in the documentation (see the -# \dotfile command). - -DOTFILE_DIRS = - -# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of -# nodes that will be shown in the graph. If the number of nodes in a graph -# becomes larger than this value, doxygen will truncate the graph, which is -# visualized by representing a node as a red box. Note that doxygen if the -# number of direct children of the root node in a graph is already larger than -# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note -# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. - -DOT_GRAPH_MAX_NODES = 50 - -# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the -# graphs generated by dot. A depth value of 3 means that only nodes reachable -# from the root by following a path via at most 3 edges will be shown. Nodes -# that lay further from the root node will be omitted. Note that setting this -# option to 1 or 2 may greatly reduce the computation time needed for large -# code bases. Also note that the size of a graph can be further restricted by -# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. - -MAX_DOT_GRAPH_DEPTH = 0 - -# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent -# background. This is disabled by default, because dot on Windows does not -# seem to support this out of the box. Warning: Depending on the platform used, -# enabling this option may lead to badly anti-aliased labels on the edges of -# a graph (i.e. they become hard to read). - -DOT_TRANSPARENT = NO - -# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output -# files in one run (i.e. multiple -o and -T options on the command line). This -# makes dot run faster, but since only newer versions of dot (>1.8.10) -# support this, this feature is disabled by default. - -DOT_MULTI_TARGETS = YES - -# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will -# generate a legend page explaining the meaning of the various boxes and -# arrows in the dot generated graphs. - -GENERATE_LEGEND = YES - -# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will -# remove the intermediate dot files that are used to generate -# the various graphs. - -DOT_CLEANUP = YES diff --git a/impl/antlr/libantlr3c-3.4/doxygen/atsections.dox b/impl/antlr/libantlr3c-3.4/doxygen/atsections.dox deleted file mode 100644 index bd4ea12..0000000 --- a/impl/antlr/libantlr3c-3.4/doxygen/atsections.dox +++ /dev/null @@ -1,143 +0,0 @@ -/// \page atsections Using Sections Within Grammar Files -/// -/// \section intro Introduction -/// -/// A C targeted grammar can make use of special annotations within a grammar -/// file, which are prefixed with the \@ character. These sections cause the -/// the placement of their contents within the generated code at defined points -/// such as within the generated C header file. -/// -/// The general form of these annotations is: -/// -/// \code -/// section -/// : '@' (( 'parser' | 'lexer' ) '::')? SECTIONNAME '{' yourcode '}' -/// ; -/// \endcode -/// -/// If the 'parser' or lexer keywords are left out of the specification, then the -/// ANTLR tool assumes a lexer target for a lexer grammar, a parser target for a parser -/// or tree parser grammar, and a parser target for a combined lexer/parser grammar. You -/// are advised as a matter of course to include the parser or lexer target keyword. -/// -/// Documentation regarding the \@sections available for a grammar targeted at C now -/// follows. -/// -/// \subsection psrinit Sections \@init and \@declarations -/// -/// Java targeted grammars allow the special section \@init to be placed after the declaration -/// of a rule (lexer, parser and tree parser rules). This allows you to both declare and initialize -/// variables that are local to the code generated for that rule. You can then reference them within -/// your rule action code. -/// -/// With the C target, the generated code is subject to the restrictions of C semantics and this -/// means that you must declare any local variables, then assign to them afterwards. As well as the -/// \@init section, which C programmers should use to initialize their local variables, the C -/// target provides the \@declarations section, which is also a rule based section. This section -/// is where the C programmer should declare the local variables, thus separating their declaration -/// from their initialization. Here is an example: -/// -/// \code -/// translation_unit -/// @declarations -/// { -/// pANTLR3_BOOLEAN hasUsing; -/// } -/// @init -/// { -/// -/// // Assume no Using directives -/// // -/// hasUsing = ANTLR3_FALSE; -/// -/// } -/// : rulea ruleb ... -/// -/// \endcode -/// -/// Using the \@declarations and \@init sections guarantees that your generated code will -/// compile correctly on any standard C compiler (assuming, of course, that you type in valid C code.) -/// -/// \subsection psrheader \@header section. -/// -/// The \@parser::header or \@lexer::header annotations cause the code they encapsulate -/// to be placed at the start of each generated file, regardless of whether it is a .c or .h file. This can -/// be useful for inserting copyright information and so on in all your generated files. -/// -/// \bNOTE: Be careful not to confuse this concept with placing code in the generated .h header file. The name choice is -/// unfortunate, but was already used in the Java target to allow the placement of \c imports statements -/// in generated java classes. We have therefore kept the intent of this section the same. -/// -/// Here is an example: -//// -/// \code -/// @lexer::header -/// { -/// // Copyright (c) Jim Idle 2007 - All your grammar are belong to us. -/// } -/// -/// @parser::header -/// { -/// // Copyright (c) Jim Idle 2007 - All your grammar are belong to us. -/// } -/// \endcode -/// -/// -/// \subsection hdrinclude \@includes section -/// -/// The \@parser::includes or \@lexer::includes annotations cause -/// the code they encapsulate to be placed in the generated .h file, \b after the standard -/// includes required by the ANTLR generated code. -/// -/// Here you could for instance place a \#include -/// statement to cause your grammar code to include some standard definitions. Because you -/// may use multiple parsers and lexers in your solution, you should probably not place -/// #define statements here, but in the \@postinclude section. Then you -/// may create different \#defines for different recognizers. -/// -/// Here is an example: -//// -/// \code -/// @lexer::includes -/// { -/// #include "myprojectcommondefs.h" -/// } -/// -/// @parser::includes -/// { -/// #include "myprojectcommondefs.h" -/// } -/// \endcode -/// -/// -/// \subsection hdrpreinclude \@preincludes section -/// -/// The \@parser::preincludes or \@lexer::preincludes annotations cause -/// the code they encapsulate to be placed in the generated .h file, \b before the standard -/// includes required by the ANTLR generated code. -/// -/// You should use this section when you wish to place #defines and other definitions -/// in the code before the standard ANTLR runtime includes defined them. This allows you -/// to override any predefined symbols and options that the includes otherwise take -/// defaults for. For instance, if you have built a version of the runtime with a -/// special version of malloc, you can \#define #ANTLR3_MALLOC to match the definition -/// you used for the ANTLR runtime library. -/// -/// \subsection hdrpostinclude \@postinclude section -/// -/// The \@parser::postinclude or \@lexer::postinclude annotations cause -/// the code they encapsulate to be placed in the generated .C file, after the generated include -/// file (which includes the standard ANTLR3C library includes. -/// -/// Code you place here then will be subject to any macros defined by your own includes, by the -/// generated include and by the standard ANTLR3 includes. This is a good place to \#undef -/// anything that you don;t like the default values of, but cannot override before the includes -/// define them. -/// -/// This is also a good place to #define any macros you may wish to use in the generated -/// .c file. As you can include multiple parsers in your projects, you will need to include the -/// generated .h file of each of them, possibly globally, but almost certainly in a context where you -/// are including more than one .h file simultaneously. Hence if you commonly use the same macro -/// names for accessing structures and so on, and they change from grammar to grammar, you should -/// define them here to avoid creating conflicting definitions in the header files. -/// \ No newline at end of file diff --git a/impl/antlr/libantlr3c-3.4/doxygen/build.dox b/impl/antlr/libantlr3c-3.4/doxygen/build.dox deleted file mode 100644 index 05c3c66..0000000 --- a/impl/antlr/libantlr3c-3.4/doxygen/build.dox +++ /dev/null @@ -1,207 +0,0 @@ -/// \page build Building From Source -/// -/// The C runtime is provided in source code form only as there are too many binary -/// versions to sensibly maintain binaries on www.antlr.org. -/// -/// The runtime code is provided with .sln and .vcproj files for Visual Studio 2005 and 2008, -/// and \b configure files for building and installation on UNIX or other systems that support this tool. If your -/// system is neither Windows nor \b configure compatible, then you should find it -/// reasonable to build the code manually (see section "Building Manually".) -/// -/// \section src Source Code Organization -/// -/// The source code expands from a tar/zip file to give you the following -/// directories: -/// -/// - ./ The location of the configure script and the antlr3config.h file -/// generated by the running the configure script.This directory also -/// contains the solution and project files for visual studio 2005 and -/// 2008. -/// - ./src The location of all the C files in the project. -/// - ./include The location of all the header files for the project -/// - ./doxygen The location of documentation files such as the one that generates this page -/// - Other ancillary directories used by the build or documentation process. -/// -/// \section winbuild Building for Windows -/// -/// If you are building for Cygwin, or a similar UNIX on Windows System, follow the "Building With Configure" instructions below. -/// -/// Note that the runtime is no longer compatible with the VC6 Microsoft compiler. If you absolutely need to build with -/// this compiler, you can probably hack the source code to deall with the pieces that VC6 cannot handle such as the -/// ULL suffix for constants. -/// -/// If you wish to build the binaries for Windows using Visual Studio 2005, or 2008 you may build using the IDE: -/// -# Open the C.sln file -/// -# Select batch Build from the Build menu -/// -# Select all configurations and press the build button. -/// -/// If you wish or need to build the libraries from the command line, then you must -/// use a Windows command shell configured for access to VS2005/VS2008 compilers, such as the one that is -/// started from: -/// -/// Start->Microsoft Visual Studio 2005->Visual Studio Tools->Visual Studio 2005 Command Prompt -/// -/// There appears to be no way to build all targets at once in a batch mode from the command line, -/// so you may build one or all of the following: -/// \verbatim - C:\antlrsrc\code\antlr\main\runtime\C> DEVENV C.sln /Build ReleaseDLL - C:\antlrsrc\code\antlr\main\runtime\C> DEVENV C.sln /Build Release - C:\antlrsrc\code\antlr\main\runtime\C> DEVENV C.sln /Build DebugDLL - C:\antlrsrc\code\antlr\main\runtime\C> DEVENV C.sln /Build Debug -\endverbatim -/// -/// After the build is complete you will find the \c.\cDLL and \c.\cLIB files under the directory containing C.sln, -/// in a subdirectory named after the /Build target. In the Release and Debug targets, you will find that there is only a \c.\cLIB archive file, -/// which you can link directly into your own projects if you wish to avoid the DLL. In \c ReleaseDLL and \c DebugDLL you will find both a -/// \c .LIB file which you should link your projects with and a DLL. The library and names on Windows are as follows: -/// -/// \verbatim - - ReleaseDLL : ANTLR3C.DLL and ANTLR3C_DLL.LIB - - DebugDLL : ANTLR3CD.DLL and ANTLR3CD_DLL.LIB - - Release : ANTLR3C.LIB - - Debug : ANTLR3CD.LIB -\endverbatim -/// -/// There currently no .msi modules or other installs built for Windows, so you must place the DLLs in a directory referenced -/// by the PATH environment variable and make the include directory available to your project configurations. -/// -/// -/// \section configure Building with configure -/// -/// Before starting, make sure that you are using a source code distribution and not the source code directly from the -/// Perforce repository. If you use the source from the perforce tree directly, you will find that there is no configure -/// script as this is generated as part of the distribution build by the maintainers. If you feel the need to build from -/// the distribution tree then you must have all the autobuild packages available on your system and can generate the -/// configure script using autoreconf. If you are not familiar with these tools, then please use the tgz files in the -/// dist subdirectory (or downloaded from the ANTLR web site). -/// -/// The source code file should be expanded in a directory of your choice (probably your working directory) using the command: -/// -/// \verbatim -gzip -dc antlrtgzname.tar.gz | tar xvf - -\endverbatim -/// -/// Where: antlrtgzname.tar.gz is of course the name of the tar when you downloaded it. You should find a \b configure script in the sub directory thus created. -/// -/// The configure script accepts the usual options, such as --prefix= but the default is to build in the source directory and to place libraries in -/// /usr/local/lib and include files (for building your recognizers) in /usr/local/include. There are also a number of antlr specific options, which you may wish to utilize. The command: -/// \verbatim -./configure --help -\endverbatim -/// -/// Will document the latest incarnations of these options in case this documentation is ever out of date. At this time the options are: -/// -/// \verbatim - --enable-debuginfo Compiles debug info into the library (default no) - --enable-64bit Turns on flags that produce 64 bit object code if - any are required (default no) -\endverbatim -/// -/// Unless you need 64 bit builds, or a change in library types, you will generally use the configure command without options: -/// -/// Here is a sample configure output: -/// -/// \verbatim -[jimi@localhost dist]$ tar zvxf libantlr3c-3.0.0-rc8.tar.gz - -libantlr3c-3.0.0-rc8/ -libantlr3c-3.0.0-rc8/antlr3config.h -libantlr3c-3.0.0-rc8/src/ -libantlr3c-3.0.0-rc8/src/antlr3stringstream.c -... -libantlr3c-3.0.0-rc8/antlr3config.h.in -\endverbatim -/// \verbatim -[jimi@localhost dist]$ cd libantlr3c-3.0.0-rc -\endverbatim -/// \verbatim -[jimi@localhost libantlr3c-3.0.0-rc8]$ ./configure - -checking for a BSD-compatible install... /usr/bin/install -c -checking whether build environment is sane... yes -checking for a thread-safe mkdir -p... /bin/mkdir -p -checking for gawk... gawk -checking whether make sets $(MAKE)... yes -checking for xlc... no -checking for aCC... no -checking for gcc... gcc -... -checking for strdup... yes -configure: creating ./config.status -config.status: creating Makefile -config.status: creating antlr3config.h -config.status: antlr3config.h is unchanged -config.status: executing depfiles commands -\endverbatim -/// -/// Having configured the library successfully, you need only make it, and install it: -/// -/// \verbatim -[jimi@localhost libantlr3c-3.0.0-rc8]$ make -\endverbatim -/// \verbatim -make all-am -make[1]: Entering directory `/home/jimi/antlrsrc/code/antlr/main/runtime/C/dist/libantlr3c-3.0.0-rc8' -/bin/sh ./libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -Iinclude -Iinclude -O2 -MT antlr3baserecognizer.lo -MD -MP -MF .deps/antlr3baserecognizer.Tpo -c -o antlr3baserecognizer.lo `test -f 'src/antlr3baserecognizer.c' || echo './'`src/antlr3baserecognizer.c -... -gcc -shared .libs/antlr3baserecognizer.o .libs/antlr3basetree.o .libs/antlr3basetreeadaptor.o .libs/antlr3bitset.o .libs/antlr3collections.o .libs/antlr3commontoken.o .libs/antlr3commontree.o .libs/antlr3commontreeadaptor.o .libs/antlr3commontreenodestream.o .libs/antlr3cyclicdfa.o .libs/antlr3encodings.o .libs/antlr3exception.o .libs/antlr3filestream.o .libs/antlr3inputstream.o .libs/antlr3intstream.o .libs/antlr3lexer.o .libs/antlr3parser.o .libs/antlr3string.o .libs/antlr3stringstream.o .libs/antlr3tokenstream.o .libs/antlr3treeparser.o .libs/antlr3rewritestreams.o .libs/antlr3ucs2inputstream.o -Wl,-soname -Wl,libantlr3c.so -o .libs/libantlr3c.so -ar cru .libs/libantlr3c.a antlr3baserecognizer.o antlr3basetree.o antlr3basetreeadaptor.o antlr3bitset.o antlr3collections.o antlr3commontoken.o antlr3commontree.o antlr3commontreeadaptor.o antlr3commontreenodestream.o antlr3cyclicdfa.o antlr3encodings.o antlr3exception.o antlr3filestream.o antlr3inputstream.o antlr3intstream.o antlr3lexer.o antlr3parser.o antlr3string.o antlr3stringstream.o antlr3tokenstream.o antlr3treeparser.o antlr3rewritestreams.o antlr3ucs2inputstream.o -ranlib .libs/libantlr3c.a -creating libantlr3c.la - -(cd .libs && rm -f libantlr3c.la && ln -s ../libantlr3c.la libantlr3c.la) -make[1]: Leaving directory `/home/jimi/antlrsrc/code/antlr/main/runtime/C/dist/libantlr3c-3.0.0-rc8' -\endverbatim -/// \verbatim -[jimi@localhost libantlr3c-3.0.0-rc8]$ sudo make install -\endverbatim -/// \verbatim -make[1]: Entering directory `/home/jimi/antlrsrc/code/antlr/main/runtime/C/dist/libantlr3c-3.0.0-rc8' -test -z "/usr/local/lib" || /bin/mkdir -p "/usr/local/lib" - /bin/sh ./libtool --mode=install /usr/bin/install -c 'libantlr3c.la' '/usr/local/lib/libantlr3c.la' -/usr/bin/install -c .libs/libantlr3c.so /usr/local/lib/libantlr3c.so -/usr/bin/install -c .libs/libantlr3c.lai /usr/local/lib/libantlr3c.la -/usr/bin/install -c .libs/libantlr3c.a /usr/local/lib/libantlr3c.a -... - /usr/bin/install -c -m 644 'include/antlr3stringstream.h' '/usr/local/include/antlr3stringstream.h' -... - /usr/bin/install -c -m 644 'antlr3config.h' '/usr/local/include/antlr3config.h' -make[1]: Leaving directory `/home/jimi/antlrsrc/code/antlr/main/runtime/C/dist/libantlr3c-3.0.0-rc8' - -[jimi@localhost libantlr3c-3.0.0-rc8]$ -\endverbatim -/// -/// You are now ready to generate C recognizers and compile and link them with the ANTLR 3 C Runtime. -/// -/// -/// \section buildman Building Manually -/// -/// The only step that configure performs that cannot be done -/// manually (without effort) is to produce the header file -/// \c antlr3config.h, which contains typedefs of the fundamental types -/// that your local C compiler supports. The easiest way to produce -/// this file for your system, if you cannot port \b automake and \b configure -/// to the system is: -/// -/// -# Run configure on a system that does support configure -/// -# Copy the generated \c antlr3config.h file to the target system -/// -# Edit the file locally and change any types that differ on this -/// system to the target systems. There are only a few types and you should -/// find this relatively easy. -/// -/// Having produced a compatible antlr3config.h file, then you should be able to -/// compile the source files in the \c ./src subdirectory, providing an include path -/// to the location of \c antlr3config.h and the \c ./include subdirectory. Something akin -/// to: -/// \verbatim - -~/C/src: cc -c -O -I.. -I../include *.c - -\endverbatim -/// -/// Having produced the .o (or equivalent) files for the local system you can then -/// build an archive or shared library for the C runtime. -/// -/// When you wish to build and link with the C runtime, specify the path to the -/// supplied header files, and the path to the library that you built. -/// \ No newline at end of file diff --git a/impl/antlr/libantlr3c-3.4/doxygen/buildrec.dox b/impl/antlr/libantlr3c-3.4/doxygen/buildrec.dox deleted file mode 100644 index 816a845..0000000 --- a/impl/antlr/libantlr3c-3.4/doxygen/buildrec.dox +++ /dev/null @@ -1,269 +0,0 @@ -/// \page buildrec How to build Generated C Code -/// -/// \section generated Generated Files -/// -/// The antlr tool jar, run against a grammar file that targets the C language, will generate the following files -/// according to whether your grammar file contains a lexer, parser, combined or treeparser specification. -/// Your grammar file name and the subject of the grammar line in your file are expected to match. Here the generic name G is used: -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -///
Suffix Generated files
lexer grammar (G.g3l) GLexer.c GLexer.h
parser grammar (G.g3p) GParser.c GParser.h
grammar G (G.g3pl) GParser.c GParser.h GLexer.c GLexer.h
tree grammar G; (G.g3t) G.c G.h
-/// -/// The generated .c files reference the .h files using , so you must use -I. on your compiler command line -/// (or include the current directory in your include paths in Visual Studio). Additionally, the generated .h files reference -/// antlr3.h, so you must use -I/path/to/antlr/include (E.g. -I /usr/local/include) to reference the standard ANTLR include files. -/// -/// In order to reference the library file at compile time (you can/should only reference one) you need to use the -/// -L/path/to/antlr/lib (E.g. -L /usr/local/lib) on Unix, or add the path to your "Additional Library Path" in -/// Visual Studio. You also need to specify the library using -L on Unix (E.g. -L /usr/local/lib -l antlr3c) or add antlr3c_dll.lib -/// to your Additional Library Dependencies in Visual Studio. -/// -/// In case it isn't obvious, the generated files may be used to produce either a library or an executable (.EXE on Windows) file. -/// -/// If you use the shared version of the libraries, DLL or .so/.so/.a then you must ship the library with your -/// application must run in an environment whereby the library can be found by the runtime linker/loader. -/// This usually involves specifying the directory in which the library lives to an environment variable. -/// On Windows, X:{yourwininstalldir}\system32 will be searched automatically. -/// -/// \section invoke Invoking Your Generated Recognizer -/// -/// In order to run your lexer/parser/tree parser combination, you will need a small function (or main) -/// function that controls the sequence of events, from reading the input file or string, through to -/// invoking the tree parser(s) and retrieving the results. See "Using the ANTLR3C C Target" for more -/// detailed instructions, but if you just want to get going as fast as possible, study the following -/// code example. -/// -/// \code -/// -/// // You may adopt your own practices by all means, but in general it is best -/// // to create a single include for your project, that will include the ANTLR3 C -/// // runtime header files, the generated header files (all of which are safe to include -/// // multiple times) and your own project related header files. Use <> to include and -/// // -I on the compile line (which vs2005 now handles, where vs2003 did not). -/// // -/// #include -/// -/// // Main entry point for this example -/// // -/// int ANTLR3_CDECL -/// main (int argc, char *argv[]) -/// { -/// // Now we declare the ANTLR related local variables we need. -/// // Note that unless you are convinced you will never need thread safe -/// // versions for your project, then you should always create such things -/// // as instance variables for each invocation. -/// // ------------------- -/// -/// // Name of the input file. Note that we always use the abstract type pANTLR3_UINT8 -/// // for ASCII/8 bit strings - the runtime library guarantees that this will be -/// // good on all platforms. This is a general rule - always use the ANTLR3 supplied -/// // typedefs for pointers/types/etc. -/// // -/// pANTLR3_UINT8 fName; -/// -/// // The ANTLR3 character input stream, which abstracts the input source such that -/// // it is easy to privide inpput from different sources such as files, or -/// // memory strings. -/// // -/// // For an 8Bit/latin-1/etc memory string use: -/// // input = antlr3New8BitStringInPlaceStream (stringtouse, (ANTLR3_UINT32) length, NULL); -/// // -/// // For a UTF16 memory string use: -/// // input = antlr3NewUTF16StringInPlaceStream (stringtouse, (ANTLR3_UINT32) length, NULL); -/// // -/// // For input from a file, see code below -/// // -/// // Note that this is essentially a pointer to a structure containing pointers to functions. -/// // You can create your own input stream type (copy one of the existing ones) and override any -/// // individual function by installing your own pointer after you have created the standard -/// // version. -/// // -/// pANTLR3_INPUT_STREAM input; -/// -/// // The lexer is of course generated by ANTLR, and so the lexer type is not upper case. -/// // The lexer is supplied with a pANTLR3_INPUT_STREAM from whence it consumes its -/// // input and generates a token stream as output. This is the ctx (CTX macro) pointer -/// // for your lexer. -/// // -/// pLangLexer lxr; -/// -/// // The token stream is produced by the ANTLR3 generated lexer. Again it is a structure based -/// // API/Object, which you can customise and override methods of as you wish. a Token stream is -/// // supplied to the generated parser, and you can write your own token stream and pass this in -/// // if you wish. -/// // -/// pANTLR3_COMMON_TOKEN_STREAM tstream; -/// -/// // The Lang parser is also generated by ANTLR and accepts a token stream as explained -/// // above. The token stream can be any source in fact, so long as it implements the -/// // ANTLR3_TOKEN_SOURCE interface. In this case the parser does not return anything -/// // but it can of course specify any kind of return type from the rule you invoke -/// // when calling it. This is the ctx (CTX macro) pointer for your parser. -/// // -/// pLangParser psr; -/// -/// // The parser produces an AST, which is returned as a member of the return type of -/// // the starting rule (any rule can start first of course). This is a generated type -/// // based upon the rule we start with. -/// // -/// LangParser_decl_return langAST; -/// -/// -/// // The tree nodes are managed by a tree adaptor, which doles -/// // out the nodes upon request. You can make your own tree types and adaptors -/// // and override the built in versions. See runtime source for details and -/// // eventually the wiki entry for the C target. -/// // -/// pANTLR3_COMMON_TREE_NODE_STREAM nodes; -/// -/// // Finally, when the parser runs, it will produce an AST that can be traversed by the -/// // the tree parser: c.f. LangDumpDecl.g3t This is the ctx (CTX macro) pointer for your -/// // tree parser. -/// // -/// pLangDumpDecl treePsr; -/// -/// // Create the input stream based upon the argument supplied to us on the command line -/// // for this example, the input will always default to ./input if there is no explicit -/// // argument. -/// // -/// if (argc < 2 || argv[1] == NULL) -/// { -/// fName =(pANTLR3_UINT8)"./input"; // Note in VS2005 debug, working directory must be configured -/// } -/// else -/// { -/// fName = (pANTLR3_UINT8)argv[1]; -/// } -/// -/// // Create the input stream using the supplied file name -/// // (Use antlr38BitFileStreamNew for UTF16 input). -/// // -/// input = antlr38BitFileStreamNew(fName); -/// -/// // The input will be created successfully, providing that there is enough -/// // memory and the file exists etc -/// // -/// if ( input == NULL ) -/// { -/// ANTLR3_FPRINTF(stderr, "Unable to open file %s due to malloc() failure1\n", (char *)fName); -/// } -/// -/// // Our input stream is now open and all set to go, so we can create a new instance of our -/// // lexer and set the lexer input to our input stream: -/// // (file | memory | ?) --> inputstream -> lexer --> tokenstream --> parser ( --> treeparser )? -/// // -/// lxr = LangLexerNew(input); // CLexerNew is generated by ANTLR -/// -/// // Need to check for errors -/// // -/// if ( lxr == NULL ) -/// { -/// ANTLR3_FPRINTF(stderr, "Unable to create the lexer due to malloc() failure1\n"); -/// exit(ANTLR3_ERR_NOMEM); -/// } -/// -/// // Our lexer is in place, so we can create the token stream from it -/// // NB: Nothing happens yet other than the file has been read. We are just -/// // connecting all these things together and they will be invoked when we -/// // call the parser rule. ANTLR3_SIZE_HINT can be left at the default usually -/// // unless you have a very large token stream/input. Each generated lexer -/// // provides a token source interface, which is the second argument to the -/// // token stream creator. -/// // Note tha even if you implement your own token structure, it will always -/// // contain a standard common token within it and this is the pointer that -/// // you pass around to everything else. A common token as a pointer within -/// // it that should point to your own outer token structure. -/// // -/// tstream = antlr3CommonTokenStreamSourceNew(ANTLR3_SIZE_HINT, lxr->pLexer->tokSource); -/// -/// if (tstream == NULL) -/// { -/// ANTLR3_FPRINTF(stderr, "Out of memory trying to allocate token stream\n"); -/// exit(ANTLR3_ERR_NOMEM); -/// } -/// -/// // Finally, now that we have our lexer constructed, we can create the parser -/// // -/// psr = LangParserNew(tstream); // CParserNew is generated by ANTLR3 -/// -/// if (psr == NULL) -/// { -/// ANTLR3_FPRINTF(stderr, "Out of memory trying to allocate parser\n"); -/// exit(ANTLR3_ERR_NOMEM); -/// } -/// -/// // We are all ready to go. Though that looked complicated at first glance, -/// // I am sure, you will see that in fact most of the code above is dealing -/// // with errors and there isn;t really that much to do (isn;t this always the -/// // case in C? ;-). -/// // -/// // So, we now invoke the parser. All elements of ANTLR3 generated C components -/// // as well as the ANTLR C runtime library itself are pseudo objects. This means -/// // that they are represented as pointers to structures, which contain any -/// // instance data they need, and a set of pointers to other interfaces or -/// // 'methods'. Note that in general, these few pointers we have created here are -/// // the only things you will ever explicitly free() as everything else is created -/// // via factories, that allocate memory efficiently and free() everything they use -/// // automatically when you close the parser/lexer/etc. -/// // -/// // Note that this means only that the methods are always called via the object -/// // pointer and the first argument to any method, is a pointer to the structure itself. -/// // It also has the side advantage, if you are using an IDE such as VS2005 that can do it -/// // that when you type ->, you will see a list of all the methods the object supports. -/// // -/// langAST = psr->decl(psr); -/// -/// // If the parser ran correctly, we will have a tree to parse. In general I recommend -/// // keeping your own flags as part of the error trapping, but here is how you can -/// // work out if there were errors if you are using the generic error messages -/// // -/// if (psr->pParser->rec->errorCount > 0) -/// { -/// ANTLR3_FPRINTF(stderr, "The parser returned %d errors, tree walking aborted.\n", psr->pParser->rec->errorCount); -/// -/// } -/// else -/// { -/// nodes = antlr3CommonTreeNodeStreamNewTree(langAST.tree, ANTLR3_SIZE_HINT); // sIZE HINT WILL SOON BE DEPRECATED!! -/// -/// // Tree parsers are given a common tree node stream (or your override) -/// // -/// treePsr = LangDumpDeclNew(nodes); -/// -/// treePsr->decl(treePsr); -/// nodes ->free (nodes); nodes = NULL; -/// treePsr ->free (treePsr); treePsr = NULL; -/// } -/// -/// // We did not return anything from this parser rule, so we can finish. It only remains -/// // to close down our open objects, in the reverse order we created them -/// // -/// psr ->free (psr); psr = NULL; -/// tstream ->free (tstream); tstream = NULL; -/// lxr ->free (lxr); lxr = NULL; -/// input ->close (input); input = NULL; -/// -/// return 0; -/// } -/// \endcode -/// diff --git a/impl/antlr/libantlr3c-3.4/doxygen/changes31.dox b/impl/antlr/libantlr3c-3.4/doxygen/changes31.dox deleted file mode 100644 index d1793db..0000000 --- a/impl/antlr/libantlr3c-3.4/doxygen/changes31.dox +++ /dev/null @@ -1,56 +0,0 @@ -/// \page changes31 Changes in 3.1 from 3.0 -/// -/// The following changes have taken place from 3.0 to 3.1. Some of -/// them may require minor changes to your grammar files or the -/// programs that invoke your grammar. Please take the time to read -/// through this list as it may save you time later. -/// -/// \section returns Constructor Return Values -/// -/// In previous releases the return value from both the generated constructors and -/// built in constructor functions would return a value of -1 or -2 if a problem -/// occurred. However, the only problem that can really occur is lack of memory, -/// hence to avoid the remote change that some memory allocation scheme would return -/// an address of -1 for a pointer, the return address is now NULL if there was -/// no memory available. The old macros for this mechanism have been removed which -/// will force you to read this information. You now need only check the return -/// address for NULL, or you could not bother doing that and join with 95% of the world's -/// C code. -/// -/// \section trees Tree Parser Rewrites -/// -/// The 3.1 runtime now supports tree rewrites from tree parsers. See the main ANTLR -/// documentation for more details. This beta version contains \subpage knownissues regarding -/// the release of mmeory allocated to tree nodes when they are rewritten in some combinations -/// of re-writing tree parsers. These issues will be corrected before release. -/// -/// \section debugger ANTLRWorks Debugger -/// -/// The ANTLRWorks debugger is now fully supported by this version of the runtime. It -/// supports remote debugging only (you cannot generate C, compile and debug it from the -/// ANTLRWorks IDE.) However both parser and tree parser debugging is supported providing -/// you are using a version of ANTLRWorks that supports tree parser debugging. Generate -/// the C code with the -debug option of the ANTLR tool, as per any other target. -/// -/// Note that when you invoke your debugging version of the parser, it will appear to hang -/// but is in fact waiting on a local TCP socket connection from the ANTLRWorks debugger. As the -/// target environment is unknown, it is not prudent to generate notification status messages -/// using something like printf, as the target environment may not have a console or implement -/// printf. -/// -/// \section macros Macro Changes -/// -/// Prior to the 3.1 release, accessing the token source of a lexer required knowledge of where -/// the token source pointer was located wihtin the lexer. In 3.1, the token source was burried -/// further in the innards of the C runtime and such knowledge is considerd irreleavant and confusing. -/// Hence, when creating a token stream from a token source, it is now mandatory to use the new -/// C macro TOKENSOURCE(lxr), which will expand to point at the token source interface. This MACRO -/// will be maintained across future versions. You can see how to use it in the downloadable -/// examples, avaiable from the downloads page of the ANTLR web site. Here is the relevant code -/// for creating a token stream, extracted from those examples: -/// -/// \code -/// tstream = antlr3CommonTokenStreamSourceNew(ANTLR3_SIZE_HINT, TOKENSOURCE(lxr)); -/// \endcode -/// - diff --git a/impl/antlr/libantlr3c-3.4/doxygen/doxygengroups.dox b/impl/antlr/libantlr3c-3.4/doxygen/doxygengroups.dox deleted file mode 100644 index de259f3..0000000 --- a/impl/antlr/libantlr3c-3.4/doxygen/doxygengroups.dox +++ /dev/null @@ -1,243 +0,0 @@ -// Definitions of documentation groups so we can organize the API and -// usage documentation nicely. - -/// \defgroup apiclasses API Classes -/// -/// The API classes are divided into the typdefs (and their underlying structs) -/// that are the containers for each 'object' within the ANTLR3C runtime, and -/// their implementations (the functions that are installed by default in to -/// these structures when you create them.) -/// -/// The typedefs contain data and function pointers, which together define -/// the object. The implementation functions are the default implementations -/// of the 'methds' encapsulated by the typdef structures.You may override -/// any of the methods once their objects are created by installing a pointer to -/// your own function. Some of these methods create other 'objects' (instances of -/// typedef structures), which allows you install your own method and create your -/// own implementation of these. -/// - - /// \defgroup apistructures API Typedefs and Structs - /// \ingroup apiclasses - /// - /// These structures (and the typedefs that you use to reference them - /// and their pointers) are the C equivalent of objects. They correspond - /// (roughly) to the Java runtime system classes and contain all the - /// data elements for a particular interface as well as all the pointers - /// to functions that implement these interfaces. - /// - /// There are constructor functions exported from the C runtime, which you - /// use to create a default implementation of one of these 'classes'. You can - /// then override any part of the implementation by installing your own - /// function pointers, before using the interface 'object' you have created. - /// - /// For instance, you can override the default error message reporting function - /// by replacing the standard (example) implementation of this function with - /// your own. In your grammar, you would place the following - /// - /// \code - /// @parser::apifuncs - /// { - /// // Install custom error message display - /// // - /// RECOGNIZER->displayRecognitionError = produceError; - /// } - /// \endcode - /// - /// The special section @parser::apiFuncs is guaranteed to be generated after - /// the RECONGIZER 'object' has already be created and initialized, so you may - /// install your own implementations of the #ANTLR3_BASE_RECOGNIZER interface - /// functions. The error display function is likely to be the only one you are - /// interested in replacing. - /// - /// Some typedef structures contain either pointers to 'inherited' objects (usual) - /// or embedded structures/typedefs (unusual). In some cases, the pointers passed - /// around by the paresr or tree parser are actually the pointers to these embedded - /// structures (such as #pANTLR3_BASE_TREE), and these embedded 'objects' contain - /// pointers to their encapsulating objects. This is the equivalent of passing - /// interface objects around in object oriented languages. - /// - - /// \defgroup ANTLR3_BASE_RECOGNIZER ANTLR3_BASE_RECOGNIZER - Base Recognizer Class Definition - /// \ingroup apistructures - /// - /// This is the definition of the base recognizer interface, instantiations - /// of which are referred to via #pANTLR3_BASE_RECOGNIZER. - /// - /// In general you will not refer to one of these structures directly as a - /// a #pANTLR3_BASE_RECOGNIZER will be embedded within a higher level - /// object such as #pANTLR3_PARSER - /// - /// \defgroup ANTLR3_RECOGNIZER_SHARED_STATE ANTLR3_RECOGNIZER_SHARED_STATE Recognizer Shared State Class Definition - /// \ingroup apistructures - /// \defgroup ANTLR3_BITSET ANTLR3_BITSET - Bitset Class Definition - /// \ingroup apistructures - /// \defgroup ANTLR3_TOKEN_FACTORY ANTLR3_TOKEN_FACTORY - Token Factory Class Definition - /// \ingroup apistructures - /// \defgroup ANTLR3_COMMON_TOKEN ANTLR3_COMMON_TOKEN - Common Token Class Definition - /// \ingroup apistructures - /// \defgroup ANTLR3_EXCEPTION ANTLR3_EXCEPTION - Exception Class Definition - /// \ingroup apistructures - /// \defgroup ANTLR3_HASH_BUCKET ANTLR3_HASH_BUCKET - Hash Table Bucket Class Definition - /// \ingroup apistructures - /// \defgroup ANTLR3_HASH_ENTRY ANTLR3_HASH_ENTRY - Hash Table Entry Class Definition - /// \ingroup apistructures - /// \defgroup ANTLR3_HASH_ENUM ANTLR3_HASH_ENUM - Hash Table Enumerator Class Definition - /// \ingroup apistructures - /// \defgroup ANTLR3_HASH_TABLE ANTLR3_HASH_TABLE - Hash Table Class Definition - /// \ingroup apistructures - /// \defgroup ANTLR3_LIST ANTLR3_LIST - List Class Definition - /// \ingroup apistructures - /// \defgroup ANTLR3_VECTOR_FACTORY ANTLR3_VECTOR_FACTORY - Vector Factory Class Definition - /// \ingroup apistructures - /// \defgroup ANTLR3_VECTOR ANTLR3_VECTOR - Vector Class Definition - /// \ingroup apistructures - /// \defgroup ANTLR3_STACK ANTLR3_STACK - Stack Class Definition - /// \ingroup apistructures - /// \defgroup ANTLR3_INPUT_STREAM ANTLR3_INPUT_STREAM - Input Stream Class Definition - /// \ingroup apistructures - /// \defgroup ANTLR3_LEX_STATE ANTLR3_LEX_STATE - Lexer State Class Definition - /// \ingroup apistructures - /// \defgroup ANTLR3_STRING_FACTORY ANTLR3_STRING_FACTORY - String Factory Class Definition - /// \ingroup apistructures - /// \defgroup ANTLR3_STRING ANTLR3_STRING - String Class Definition - /// \ingroup apistructures - /// \defgroup ANTLR3_TOKEN_SOURCE ANTLR3_TOKEN_SOURCE - Token Source Class Definition - /// \ingroup apistructures - /// \defgroup ANTLR3_TOKEN_STREAM ANTLR3_TOKEN_STREAM - Token Stream Class Definition - /// \ingroup apistructures - /// \defgroup ANTLR3_COMMON_TOKEN_STREAM ANTLR3_COMMON_TOKEN_STREAM - Common Token Stream Class Definition - /// \ingroup apistructures - /// \defgroup ANTLR3_CYCLIC_DFA ANTLR3_CYCLIC_DFA - Cyclic DFA Class Definition - /// \ingroup apistructures - /// \defgroup ANTLR3_LEXER ANTLR3_LEXER - Lexer Class Definition - /// \ingroup apistructures - /// \defgroup ANTLR3_PARSER ANTLR3_PARSER - Parser Class Definition - /// \ingroup apistructures - /// \defgroup ANTLR3_BASE_TREE ANTLR3_BASE_TREE - Base Tree Class Definition - /// \ingroup apistructures - /// \defgroup ANTLR3_COMMON_TREE ANTLR3_COMMON_TREE - Common Tree Class Definition - /// \ingroup apistructures - /// \defgroup ANTLR3_ARBORETUM ANTLR3_ARBORETUM - Tree Factory Class Definition - /// \ingroup apistructures - /// \defgroup ANTLR3_PARSE_TREE ANTLR3_PARSE_TREE - Parse Tree Class Definition - /// \ingroup apistructures - /// \defgroup ANTLR3_TREE_NODE_STREAM ANTLR3_TREE_NODE_STREAM - Tree Node Class Definition - /// \ingroup apistructures - /// \defgroup ANTLR3_COMMON_TREE_NODE_STREAM ANTLR3_COMMON_TREE_NODE_STREAM - Common Tree Node Class Definition - /// \ingroup apistructures - /// \defgroup ANTLR3_TREE_WALK_STATE ANTLR3_TREE_WALK_STATE - Tree Walk State Class Definition - /// \ingroup apistructures - /// \defgroup ANTLR3_BASE_TREE_ADAPTOR ANTLR3_BASE_TREE_ADAPTOR - Base Tree Class Definition - /// \ingroup apistructures - /// \defgroup ANTLR3_COMMON_TREE_ADAPTOR ANTLR3_COMMON_TREE_ADAPTOR - Common Tree Adaptor Class Definition - /// \ingroup apistructures - /// \defgroup ANTLR3_TREE_PARSER ANTLR3_TREE_PARSER - Tree Parser Class Definition - /// \ingroup apistructures - /// \defgroup ANTLR3_INT_TRIE ANTLR3_INT_TRIE - Trie Class Definition - /// \ingroup apistructures - /// \defgroup ANTLR3_REWRITE_RULE_ELEMENT_STREAM ANTLR3_REWRITE_RULE_ELEMENT_STREAM - Token Rewrite Stream Class Definition - /// \ingroup apistructures - /// \defgroup ANTLR3_DEBUG_EVENT_LISTENER ANTLR3_DEBUG_EVENT_LISTENER - Debugger Class Definition - /// \ingroup apistructures - - /// \defgroup apiimplementations API Implementation functions - /// \ingroup apiclasses - /// - /// API implementation functions are the default implementation of each of the - /// methods in a particular typedef structure. - /// - /// They are generally grouped together in the same source code file. - /// For instance the default implementations of the - /// methods contained by a #pANTLR3_BASE_RECOGNIZER will be found in the file - /// antlr3baserecognizer.c - /// - /// A source file that provides the default implementations of functions will usually - /// also supply the public (exported from the .DLL or code library) 'constructor' functions - /// that create and initialize the typedef structure that they implement. For instance, - /// in the antlr3baserecognizer.c file, you will find the function antlr3BaseRecognizerNew() - /// - - /// \defgroup pANTLR3_BASE_RECOGNIZER pANTLR3_BASE_RECOGNIZER Base Recognizer Implementation - /// \ingroup apiimplementations - /// - /// The base recognizer interface is implemented by all higher level recognizers - /// such as #pANTLR3_PARSER and provides methods common to all recognizers. - /// - /// \defgroup pANTLR3_RECOGNIZER_SHARED_STATE pANTLR3_RECOGNIZER_SHARED_STATE - Recognizer Shared State Implementation - /// \ingroup apiimplementations - /// - /// The recognizer shared state class does not have an implementation because it contains only - /// data fields, documented at #ANTLR3_RECOGNIZER_SHARED_STATE - /// - /// \defgroup pANTLR3_BITSET pANTLR3_BITSET - Bitset Implementation - /// \ingroup apiimplementations - /// \defgroup pANTLR3_TOKEN_FACTORY pANTLR3_TOKEN_FACTORY - Token Factory Implementation - /// \ingroup apiimplementations - /// \defgroup pANTLR3_COMMON_TOKEN pANTLR3_COMMON_TOKEN - Common Token Implementation - /// \ingroup apiimplementations - /// \defgroup pANTLR3_EXCEPTION pANTLR3_EXCEPTION - Exception Implementation - /// \ingroup apiimplementations - /// \defgroup pANTLR3_HASH_BUCKET pANTLR3_HASH_BUCKET - Hash Table Bucket Implementation - /// \ingroup apiimplementations - /// \defgroup pANTLR3_HASH_ENTRY pANTLR3_HASH_ENTRY - Hash Table Entry Implementation - /// \ingroup apiimplementations - /// \defgroup pANTLR3_HASH_ENUM pANTLR3_HASH_ENUM - Hash Table Enumerator Implementation - /// \ingroup apiimplementations - /// \defgroup pANTLR3_HASH_TABLE pANTLR3_HASH_TABLE - Hash Table Implementation - /// \ingroup apiimplementations - /// \defgroup pANTLR3_LIST pANTLR3_LIST - List Implementation - /// \ingroup apiimplementations - /// \defgroup pANTLR3_VECTOR_FACTORY pANTLR3_VECTOR_FACTORY - Vector Factory Implementation - /// \ingroup apiimplementations - /// \defgroup pANTLR3_VECTOR pANTLR3_VECTOR - Vector Implementation - /// \ingroup apiimplementations - /// \defgroup pANTLR3_STACK pANTLR3_STACK - Stack Implementation - /// \ingroup apiimplementations - /// \defgroup pANTLR3_INPUT_STREAM pANTLR3_INPUT_STREAM - Input Stream Implementation - /// \ingroup apiimplementations - /// \defgroup pANTLR3_LEX_STATE pANTLR3_LEX_STATE - Lexer State Implementation - /// \ingroup apiimplementations - /// \defgroup pANTLR3_STRING_FACTORY pANTLR3_STRING_FACTORY - String Factory Implementation - /// \ingroup apiimplementations - /// \defgroup pANTLR3_STRING pANTLR3_STRING - String Implementation - /// \ingroup apiimplementations - /// \defgroup pANTLR3_TOKEN_SOURCE pANTLR3_TOKEN_SOURCE - Token Source Implementation - /// \ingroup apiimplementations - /// \defgroup pANTLR3_TOKEN_STREAM pANTLR3_TOKEN_STREAM - Token Stream Implementation - /// \ingroup apiimplementations - /// \defgroup pANTLR3_COMMON_TOKEN_STREAM pANTLR3_COMMON_TOKEN_STREAM - Common Token Implementation - /// \ingroup apiimplementations - /// \defgroup pANTLR3_CYCLIC_DFA pANTLR3_CYCLIC_DFA - Cyclic DFA Implementation - /// \ingroup apiimplementations - /// \defgroup pANTLR3_LEXER pANTLR3_LEXER - Lexer Implementation - /// \ingroup apiimplementations - /// \defgroup pANTLR3_PARSER pANTLR3_PARSER - Parser Implementation - /// \ingroup apiimplementations - /// \defgroup pANTLR3_BASE_TREE pANTLR3_BASE_TREE - Base Tree Implementation - /// \ingroup apiimplementations - /// \defgroup pANTLR3_COMMON_TREE pANTLR3_COMMON_TREE - Common Tree Implementation - /// \ingroup apiimplementations - /// \defgroup pANTLR3_ARBORETUM pANTLR3_ARBORETUM - Tree Factory Implementation - /// \ingroup apiimplementations - /// \defgroup pANTLR3_PARSE_TREE pANTLR3_PARSE_TREE - Parse Tree Implementation - /// \ingroup apiimplementations - /// \defgroup pANTLR3_TREE_NODE_STREAM pANTLR3_TREE_NODE_STREAM - Tree Node Stream Implementation - /// \ingroup apiimplementations - /// \defgroup pANTLR3_COMMON_TREE_NODE_STREAM pANTLR3_COMMON_TREE_NODE_STREAM - Common Tree Node Stream Implementation - /// \ingroup apiimplementations - /// \defgroup pANTLR3_TREE_WALK_STATE pANTLR3_TREE_WALK_STATE - Tree Walk State Implementation - /// \ingroup apiimplementations - /// \defgroup pANTLR3_BASE_TREE_ADAPTOR pANTLR3_BASE_TREE_ADAPTOR - Base Tree Adaptor Implementation - /// \ingroup apiimplementations - /// \defgroup pANTLR3_COMMON_TREE_ADAPTOR pANTLR3_COMMON_TREE_ADAPTOR - Common Tree Adaptor Implementation - /// \ingroup apiimplementations - /// \defgroup pANTLR3_TREE_PARSER pANTLR3_TREE_PARSER - Tree ParserImplementation - /// \ingroup apiimplementations - /// \defgroup pANTLR3_INT_TRIE pANTLR3_INT_TRIE - Trie Implementation - /// \ingroup apiimplementations - /// \defgroup pANTLR3_REWRITE_RULE_ELEMENT_STREAM pANTLR3_REWRITE_RULE_ELEMENT_STREAM - Token Rewrite Stream Implementation - /// \ingroup apiimplementations - /// \defgroup pANTLR3_DEBUG_EVENT_LISTENER pANTLR3_DEBUG_EVENT_LISTENER - Debugger Implementation - /// \ingroup apiimplementations - \ No newline at end of file diff --git a/impl/antlr/libantlr3c-3.4/doxygen/generate.dox b/impl/antlr/libantlr3c-3.4/doxygen/generate.dox deleted file mode 100644 index 0173d78..0000000 --- a/impl/antlr/libantlr3c-3.4/doxygen/generate.dox +++ /dev/null @@ -1,57 +0,0 @@ -/// \page generate Generating Code for the C Target -/// -/// \section generate Generating C -/// -/// Before discussing how we compile or call the generated C code, we need to know how to invoke the C code generator. -/// This is achieved within the grammar file itself, using the language option: -/// -/// \verbatim -options { language = C;} -\endverbatim -/// -/// The code generator consists of a single .java file within the standard ANTLR tool jar, and a code generation template, -/// used by the StringTemplate engine, which drives code generation for all language targets. In fact you can make copies of the C.stg -/// and AST.stg templates and make changes to them (though you are encouraged not to, as it is better to provide bug fixes or -/// enhancements which we are happy to receive requests for and will do out best to incorporate. -/// -/// If you are working in the Windows environment, with Visual Studio 2005 or later, you may wish to utilize the custom rulefile -/// provided in the C source code distribution under the ./vs2005 directory for this purpose. If you are using a pre-built -/// library then you can also download this rule file directly from the FishEye source code browser for ANTLR3. -/// -/// In order to use the rulefile, you must adopt the following suffixes for your grammar files, though they are otherwise optional: -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -/// -///
Suffix Grammar should contain...
.g3l A lexer grammar specification only.
.g3p A parser grammar specification only.
.g3pl A combined lexer and parser specification.
.g3t A tree grammar specification.
-/// -/// You may also wish to use these suffixes if you are building your projects using Makefiles, as this makes the output deterministic. -/// However in this case a much better solution is probably to utilize the -depend option of the Antlr tool, which should tell your -/// Makefile what the grammar files generates, irrespective of its suffix. ANTLR does not care about the actual suffix you use for -/// your grammar file, so building for multiple platforms is relatively easy. -/// -/// NOTE: Your grammar source, regardless of suffix must be named the same as the grammar statement within it. Grammar xyz -/// must be contained within a file called xyz.anything -/// -/// - diff --git a/impl/antlr/libantlr3c-3.4/doxygen/interop.dox b/impl/antlr/libantlr3c-3.4/doxygen/interop.dox deleted file mode 100644 index 3401539..0000000 --- a/impl/antlr/libantlr3c-3.4/doxygen/interop.dox +++ /dev/null @@ -1,327 +0,0 @@ -/// \page interop Interacting with the Generated Code -/// -/// \section intro Introduction -/// -/// The main way to interact with the generated code is via action code placed within { and -/// } characters in your rules. In general, you are advised to keep the code you embed within -/// these actions, and the grammar itself to an absolute minimum. Rather than embed code directly in your -/// grammar, you should construct an API, that is called from the actions within your grammar. This way -/// you will keep the grammar clean and maintainable and separate the code generators or other code -/// from the definition of the grammar itself. -/// -/// However, when you wish to call your API functions, or insert small pieces of code that do not -/// warrant external functions, you will need to access elements of tokens, return elements from -/// parser rules and perhaps the internals of the recognizer itself. The C runtime provides a number -/// of MACROs that you can use within your action code. It also provides a number of performant -/// structures that you may find useful for building symbol tables, lists, tries, stacks, arrays and so on (all -/// of which are managed so that your memory allocation problems are minimized.) -/// -/// \section rules Parameters and Returns from Parser Rules -/// -/// The C target does not differ from the Java target in any major ways here, and you should consult -/// the standard documentation for the use of parameters on rules and the returns clause. You should -/// be aware though, that the rules generate C function calls and therefore the input and returns -/// clauses are subject to the constraints of C scoping. -/// -/// You should note that if your parser rule returns more than a single entity, then the return -/// type of the generated rule function is a struct, which is returned by value. This is also the case -/// if your rule is part of a tree building grammar (uses the output=AST; option. -/// -/// Other than the notes above, you can use any pre-declared type as an input or output parameter -/// for your rule. -/// -/// \section memory Memory Management -/// -/// You are responsible for allocating and freeing any memory used by your own -/// constructs, ANTLR will track and release any memory allocated internally for tokens, trees, stacks, scopes -/// and so on. This memory is returned to the malloc pool when you call the free method of any -/// ANTLR3 produced structure. -/// -/// For performance reasons, and to avoid thrashing the malloc allocation system, memory for amy elements -/// of your generated parser is allocated in chunks and parcelled out by factories. For instance memory -/// for tokens is created as an array of tokens, and a token factory hands out the next available slot -/// to the lexer. When you free the lexer, the allocated memory is returned to the pool. The same applies -/// to 'strings' that contain the token text and various other text elements accessed within the lexer. -/// -/// The only side effect of this is that after your parse and analysis is complete, if you wish to retain -/// anything generated automatically, you must copy it before freeing the recognizer structures. In practice -/// it is usually practical to retain the recognizer context objects until your processing is complete or -/// to use your own allocation scheme for generating output etc. -/// -/// The advantage of using object factories is of course that memory leaks and accessing de-allocated -/// memory are bugs that rarely occur within the ANTLR3 C runtime. Further, allocating memory for -/// tokens, trees and so on is very fast. -/// -/// \section ctx The CTX Macro -/// -/// The CTX macro is a fundamental parameter that is passed as the first parameter to any generated function -/// concerned with your lexer, parser, or tree parser. The is is the context pointer for your generated -/// recognizer and is how you invoke the generated functions, and access the data embedded within your generated -/// recognizer. While you can use it to directly access stacks, scopes and so on, this is not really recommended -/// as you should use the $xxx references that are available generically within ANTLR grammars. -/// -/// The context pointer is used because this removes the need for any global/static variables at all, either -/// within the generated code, or the C runtime. This is of course fundamental to creating free threading -/// recognizers. Wherever a function call or rule call required the ctx parameter, you either reference it -/// via the CTX macro, or the ctx parameter is in fact the return type from calling the 'constructor' -/// function for your parser/lexer/tree parser (see code example in "How to build Generated Code" .) -/// -/// \section macros Pre-Defined convenience MACROs -/// -/// While the author is not fond of using C MACROs to hide code or structure access, in the case of generated -/// code, they serve two useful purposes. The first is to simplify the references to internal constructs, -/// the second is to facilitate the change of any internal interface without requiring you to port grammars -/// from earlier versions (just regenerate and recompile). As of release 3.1, these macros are stable and -/// will only change their usage interface in the event of bugs being discovered. You are encouraged to -/// use these macros in your code, rather than access the raw interface. -/// -/// \bNB: Macros that act like statements must be terminated with a ';'. The macro body does not -/// supply this, nor should it. Macros that call functions are declared with () even if they -/// have no parameters, macros that reference fields do not have a () declaration. -/// -/// \section lexermacros Lexer Macros -/// -/// There are a number of macros that are useful exclusively within lexer rules. There are additional -/// macros, common to all recognizer, and these are documented in the section Common Macros. -/// -/// \subsection lexer LEXER -/// -/// The LEXER macro returns a pointer to the base lexer object, which is of type #pANTLR3_LEXER. This is -/// not the pointer to your generated lexer, which is supplied by the CTX macro, -/// but to the common implementation of a lexer interface, -/// which is supplied to all generated lexers. -/// -/// \subsection lexstate LEXSTATE -/// -/// Provides a pointer to the lexer shared state structure, which is where the tokens for a -/// rule are constructed and the status elements of the lexer are kept. This pointer is of type -/// #pANTLR3_RECOGNIZER_SHARED_STATE.In general you should only access elements of this structure -/// if there is not already another MACRO or standard $xxxx antlr reference that refers to it. -/// -/// \subsection la LA(n) -/// -/// The LA macro returns the character at index n from the current input stream index. The return -/// type is #ANTLR3_UINT32. Hence LA(1) returns the character at the current input position (the -/// character that will be consumed next), LA(-1) returns the character that has just been consumed -/// and so on. The LA(n) macro is useful for constructing semantic predicates in lexer rules. The -/// reference LA(0) is undefined and will cause an error in your lexer. -/// -/// \subsection getcharindex GETCHARINDEX() -/// -/// The GETCHARINDEX macro returns the index of the current character position as a 0 based -/// offset from the start of the input stream. It returns a value type of #ANTLR3_UINT32. -/// -/// \subsection getline GETLINE() -/// -/// The GETLINE macro returns the line number of current character (LA(1) in the input -/// stream. It returns a value type of #ANTLR3_UINT32. Note that the line number is incremented -/// automatically by an input stream when it sees the input character '\n'. The character that causes -/// the line number to increment can be changed by calling the SetNewLineChar() method on the input -/// stream before invoking the lexer and after creating the input stream. -/// -/// \subsection gettext GETTEXT() -/// -/// The GETTEXT macro returns the text currently matched by the lexer rule. In general you should use the -/// generic $text reference in ANTLR to retrieve this. The return type is a reference type of #pANTLR3_STRING -/// which allows you to manipulate the text you have retrieved (\b NB this does not change the input stream -/// only the text you copy from the input stream when you use this MACRO or $text). -/// -/// The reference $text->chars or GETTEXT()->chars will reference a pointer to the '\\0' terminated character -/// string that the ANTLR3 #pANTLR3_STRING represents. String space is allocated automatically as well as -/// the structure that holds the string. The #pANTLR3_STRING_FACTORY associated with the lexer handles this -/// and when you close the lexer, it will automatically free any space allocated for strings and their structures. -/// -/// \subsection getcharpositioninline GETCHARPOSITIONINLINE() -/// -/// The GETCHARPOSITIONINLINE returns the zero based offset of character LA(1) -/// from the start of the current input line. See the macro GETLINE for details on what the -/// line number means. -/// -/// \subsection emit EMIT() -/// -/// The macro EMIT causes the text range currently matched to the lexer rule to be emitted -/// immediately as the token for the rule. Subsequent text is matched but ignored. The type used for the -/// the token is the name of the lexer rule or, if you have change this by using $type = XXX;, the type -/// XXX is used. -/// -/// \subsection emitnew EMITNEW(t) -/// -/// The macro EMITNEW causes the supplied token reference t to be used as the -/// token emitted by the rule. The parameter t must be of type #pANTLR3_COMMON_TOKEN. -/// -/// \subsection index INDEX() -/// -/// The INDEX macro returns the current input position according to the input stream. It is not -/// guaranteed to be the character offset in the input stream but is instead used as a value -/// for marking and rewinding to specific points in the input stream. Use the macro GETCHARINDEX() -/// to find out the position of the LA(1) in the input stream. -/// -/// \subsection pushstream PUSHSTREAM(str) -/// -/// The PUSHSTREAM macro, in conjunction with the POPSTREAM macro (called internally in the runtime usually) -/// can be used to stack many input streams to the lexer, and implement constructs such as the C pre-processor -/// \#include directive. -/// -/// An input stream that is pushed on to the stack becomes the current input stream for the lexer and -/// the state of the previous stream is automatically saved. The input stream will be automatically -/// popped from the stack when it is exhausted by the lexer. You may use the macro POPSTREAM -/// to return to the previous input stream prior to exhausting the currently stacked input stream. -/// -/// Here is an example of using the macro in a lexer to implement the C \#include pre-processor directive: -/// -/// \code -/// fragment -/// STRING_GUTS : (~('\\'|'"') )* ; -/// -/// LINE_COMMAND -/// : '#' (' ' | '\t')* -/// ( -/// 'include' (' ' | '\t')+ '"' file = STRING_GUTS '"' (' ' | '\t')* '\r'? '\n' -/// { -/// pANTLR3_STRING fName; -/// pANTLR3_INPUT_STREAM in; -/// -/// // Create an initial string, then take a substring -/// // We can do this by messing with the start and end -/// // pointers of tokens and so on. This shows a reasonable way to -/// // manipulate strings. -/// // -/// fName = $file.text; -/// printf("Including file '\%s'\n", fName->chars); -/// -/// // Create a new input stream and take advantage of built in stream stacking -/// // in C target runtime. -/// // -/// in = antlr38BitFileStreamNew(fName->chars); -/// PUSHSTREAM(in); -/// -/// // Note that the input stream is not closed when it EOFs, I don't bother -/// // to do it here, but it is up to you to track streams created like this -/// // and destroy them when the whole parse session is complete. Remember that you -/// // don't want to do this until all tokens have been manipulated all the way through -/// // your tree parsers etc as the token does not store the text it just refers -/// // back to the input stream and trying to get the text for it will abort if you -/// // close the input stream too early. -/// // -/// -/// } -/// | (('0'..'9')=>('0'..'9'))+ ~('\n'|'\r')* '\r'? '\n' -/// ) -/// {$channel=HIDDEN;} -/// ; -/// \endcode -/// -/// \subsection popstream POPSTREAM() -/// -/// Assuming that you have stacked an input stream using the PUSHSTREAM macro, you can -/// remove it from the stream stack and revert to the previous input stream. You should be careful -/// to pop the stream at an appropriate point in your lexer action, so you do not match characters -/// from one stream with those from another in the same rule (unless this is what you want to do) -/// -/// \subsection settext SETTEXT(str) -/// -/// A token manufactured by the lexer does not actually physically store the text from the -/// input stream to which it matches. The token string is instead created only if you ask for -/// the text. However if you wish to change the text that the token represents you can use -/// this macro to set it explicitly. Note that this does not change the input stream text -/// but associates the supplied #pANTLR3_STRING with the token. This string is then returned -/// when parser and tree parser reference the tokens via the $xxx.text reference. -/// -/// \subsection user1 USER1 USER2 USER3 and CUSTOM -/// -/// While you can create your own custom token class and have the lexer deal with this, this -/// is a lot of work compared to the trivial inheritance that can be achieved in the Java target. -/// In many cases though, all that is needed is the addition of a few data items such as an -/// integer or a pointer. Rather than require C programmers to create complicated structures -/// just to add a few data items, the C target provides a few custom fields in the standard -/// token, which will fulfil the needs of most lexers and parsers. -/// -/// The token fields user1, user2, and user3 are all value types of #ANTLR_UINT32. In the -/// parser you can reference these fields directly from the token: x=TOKNAME { $x->user1 ... -/// but when you are building the token in the lexer, you must assign to the fields using the -/// macros USER1, USER2, or USER3. As in: -/// -/// \code -/// LEXTOK: 'AAAAA' { USER1 = 99; } ; -/// \endcode -/// -/// -/// \section parsermacros Parser and Tree Parser Macros -/// -/// \subsection parser PARSER -/// -/// The PARSER macro returns a pointer to the base parser or tree parser object, which is of type #pANTLR3_PARSER -/// or #pANTLR3_TREE_PARSER . This is not the pointer to your generated parser, which is supplied by the CTX macro, -/// but to the common implementation of a parser or tree parser interface, which is supplied to all generated parsers. -/// -/// \subsection index INDEX() -/// -/// When used in the parser, the INDEX macro returns the position of the current -/// token ( LT(1) ) in the input token stream. It can be used for MARK and REWIND -/// operations. -/// -/// \subsection lt LT(n) and LA(n) -/// -/// In the parser, the macro LT(n) returns the #pANTLR3_COMMON_TOKEN at offset n from -/// the current token stream input position. The macro LA(n) returns the token type of the token -/// at position n. The value n cannot be zero, and such a reference will return -/// NULL and possibly cause an error. LA(1) is the token that is about to be -/// recognized and LA(-1) is the token that has just been recognized. Values of n that exceed the -/// limits of the token stream boundaries will return NULL. -/// -/// \subsection psrstate PSRSTATE -/// -/// Returns the shared state pointer of type #pANTLR3_RECOGNIZER_SHARED_STATE. This is not generally -/// useful to the grammar programmer as the useful elements have generic $xxx references built in to -/// ANTLR. -/// -/// \subsection adaptor ADAPTOR -/// -/// When building an AST via a parser, the work of constructing and manipulating trees is done -/// by a supplied adaptor class. The default class is usually fine for most tree operations but -/// if you wish to build your own specialized linked/tree structure, then you may need to reference -/// the adaptor you supply directly. The ADAPTOR macro returns the reference to the tree adaptor -/// which is always of type #pANTLR3_BASE_TREE_ADAPTOR, even if it is your custom adapter. -/// -/// \section commonmacros Macros Common to All Recognizers -/// -/// \subsection recognizer RECOGNIZER -/// -/// Returns a reference type of #pANTRL3_BASE_RECOGNIZER, which is the base functionality supplied -/// to all recognizers, whether lexers, parsers or tree parsers. You can override methods in this -/// interface by installing your own function pointers (once you know what you are doing). -/// -/// \subsection input INPUT -/// -/// Returns a reference to the input stream of the appropriate type for the recognizer. In a lexer -/// this macro returns a reference type of #pANTLR3_INPUT_STREAM, in a parser this is type -/// #pANTLR3_TOKEN_STREAM and in a tree parser this is type #pANTLR3_COMMON_TREE_NODE_STREAM. -/// You can of course provide your own implementations of any of these interfaces. -/// -/// \subsection mark MARK() -/// -/// This macro will cause the input stream for the current recognizer to be marked with a -/// checkpoint. It will return a value type of #ANTLR3_MARKER which you can use as the -/// parameter to a REWIND macro to return to the marked point in the input. -/// -/// If you know you will only ever rewind to the last MARK, then you can ignore the return -/// value of this macro and just use the REWINDLAST macro to return to the last MARK that -/// was set in the input stream. -/// -/// \subsection rewind REWIND(m) -/// -/// Rewinds the appropriate input stream back to the marked checkpoint returned from a prior -/// MARK macro call and supplied as the parameter m to the REWIND(m) -/// macro. -/// -/// \subsection rewindlast REWINDLAST() -/// -/// Rewinds the current input stream (character, tokens, tree nodes) back to the last checkpoint -/// marker created by a MARK macro call. Fails silently if there was no prior -/// MARK call. -/// -/// \subsection seek SEEK(n) -/// -/// Causes the input stream to position itself directly at offset n in the stream. Works for all -/// input stream types, both lexer, parser and tree parser. -/// diff --git a/impl/antlr/libantlr3c-3.4/doxygen/knownissues.dox b/impl/antlr/libantlr3c-3.4/doxygen/knownissues.dox deleted file mode 100644 index 733c405..0000000 --- a/impl/antlr/libantlr3c-3.4/doxygen/knownissues.dox +++ /dev/null @@ -1,3 +0,0 @@ -/// \page knownissues Known Issues -/// -/// The following issues \ No newline at end of file diff --git a/impl/antlr/libantlr3c-3.4/doxygen/mainpage.dox b/impl/antlr/libantlr3c-3.4/doxygen/mainpage.dox deleted file mode 100644 index ed52b5e..0000000 --- a/impl/antlr/libantlr3c-3.4/doxygen/mainpage.dox +++ /dev/null @@ -1,104 +0,0 @@ -// Main page documentation for ANTLR3C runtime. Contains -// doxygen things only. -// - -/// \mainpage ANTLR3 C Runtime API and Usage Guide. -/// -/// \section version Version 3.3.1 -/// -/// This documentation is specifically for the C rutime version 3.1.x.x, which is -/// specifically for use with version 3.1.x.x of the ANTLR recognizer generation -/// tool. While some of the documentation may well apply to prior or future versions -/// you should consult the manuals for the correct version whenever possible. -/// -/// \section chchchchangeesss Changes from 3.2 to 3.3.1 -/// -/// Some changes in 3.3.1 may require small changes in your invoking programs or -/// in the grammar itself. Please read about them here before emailing the user group, -/// where you will be told to come and read about them here, unless they were missed -/// from this list. -/// -/// - \subpage changes331 Check here for API changes -/// -/// \section intro Introduction -/// -/// The ANTLR3 recognizer generation tool is written in Java, but allows the generation -/// of code targeted for a number of other languages. Each target language provides a code -/// generation template for the tool and a runtime library for use by generated recognizers. -/// The C runtime tracks the Java runtime releases and in general when a new version of the -/// tool is released, a new version of the C runtime will be released at the same time. -/// -/// The documentation here is in three parts: -/// -/// - \subpage build Building the runtime itself from source code; -/// - \subpage generate How to tell ANTLR to generate code for the C target; -/// - \subpage buildrec How to build the generated code -/// - \subpage using Using the runtime and the libraries and so on; -/// - \subpage runtime The documentation of the runtime code and functions; -/// -/// \section background Background Information -/// -/// The ANTLR 3 C runtime and code generation templates were written by Jim Idle -/// (jimi|at|temporal-wave|dott/com) of Temporal Wave LLC. -/// -/// The C runtime and therefore the code generated to utilize the runtime reflects the object model of the -/// Java version of the runtime as closely as a language without class structures and inheritance can. -/// Compromises have only been made where performance would be adversely affected such as minimizing the -/// number of pointer to pointer to pointer to function type structures that could ensue through trying to -/// model inheritance too exactly. Other differences include the use of token and string factories to minimize -/// the number of calls to system functions such as calloc().This model was adopted so that overriding any -/// default implementation of a function is relatively simple for the grammar programmer. -/// -/// The generated code is free threading (subject to the systems calls used on any particular platform -/// being likewise free threading.) -/// -/// \subsection model Runtime Model -/// -/// As there is no such thing as an object reference in C, the runtime defines a number of typedef structs that reflect -/// the calling interface chosen by Terence Parr for the Java version of the same. The initialization of a parser, -/// lexer, input stream or other internal structure therefore consists of allocating the memory required for -/// an instance of the typedef struct that represents the interface, initializing any counters, and buffers etc, -/// then populating a number of pointers to functions that implement the equivalent of the methods in the Java class. -/// -/// The use and initialization of the C versions of a parser is therefore similar to the examples given for Java, -/// but with a bent towards C of course. You may need to be aware of memory allocation and freeing operations -/// in certain environments such as Windows, where you cannot allocate memory in one DLL and free it in another. -/// -/// The runtime provides a number of structures and interfaces that the author has found useful when writing action and -/// processing code within java parsers, and furthermore were required by the C runtime code if it was not to -/// depart too far from the logical layout of the Java model. These include the C equivalents of String, List, -/// Hashtable, Vector and Trie, implemented by pointers to structures. These are freely available for your own programming needs. -/// -/// A goal of the generated code was to minimize the tracking, allocation and freeing of memory for reasons of both -/// performance and reliability. In essence any memory used by a lexer, parser or tree parser is automatically tracked and -/// freed when the instance of it is released. There are therefore factory functions for tokens and so on such that they -/// can be allocated in blocks and parceled out as they are required. They are all then freed in one go, minimizing the -/// risk of memory leaks and alloc/free thrashing. This has only one side effect, being that if you wish to preserve some structure generated by -/// the lexer, parser or tree parser, then you must make a copy of it before freeing those structures, and track it yourself -/// after that. In practice, it is easy enough just not to release the antlr generated components until you are -/// finished with their results. -/// -/// \section targets Target Platforms -/// -/// The C project is constructed such that it will compile on any reasonable ANSI C compiler in either 64 or 32 bit mode, -/// with all warnings turned on. This is true of both the runtime code and the generated code and has been summarily tested -/// with Visual Studio .Net (2003, 2005 and 2008) and later versions of gcc on Redhat Linux, as well as on AIX 5.2/5.3, Solaris 9/10, -/// HPUX 11.xx, OSX (PowerPC and Intel) and Cygwin. -/// -/// \b Notes -/// - The C runtime is constructed such that the library can be integrated as an archive library, or a shared library/DLL. -/// - The C language target code generation templates are distributed with the source code for the ANTLR tool itself. -/// -/// \section performance Performance -/// -/// It is C :-). Basic testing of performance against the Java runtime, -/// using the JDK1.6 java source code, and the Java parser provided in the examples (which is a tough test as it includes -/// backtracking and memoization) show that the C runtime uses about half the memory and is between 2 and 3 times the speed. -/// Tests of non-backtracking, non-memoizing parsers, indicate results significantly better than this. -/// -/// \section examples Downloading Examples -/// -/// The downloads page of the ANTLR web site contains a downloadable -/// zip/tar of examples projects for use with the C runtime model. It contains .sln files and source code for a -/// number of example grammars and helps to see how to invoke and call the generated recognizers. -/// \ No newline at end of file diff --git a/impl/antlr/libantlr3c-3.4/doxygen/runtime.dox b/impl/antlr/libantlr3c-3.4/doxygen/runtime.dox deleted file mode 100644 index 2d23403..0000000 --- a/impl/antlr/libantlr3c-3.4/doxygen/runtime.dox +++ /dev/null @@ -1,35 +0,0 @@ -/// \page runtime Navigating the C Runtime Documentation -/// -/// If you are familiar with Doxygen generated documentation, then the layout of the files, typedefs -/// and so on will be familiar to you. However there is also additional structure applied that helps -/// the programmer to see how the runtime is made up. -/// -/// \section modules Modules -/// -/// Under the Modules menu tree you will find the entry API Classes. This section is further -/// divided into typedefs and structs and the standard runtime supplied interface implementation -/// methods. -/// -/// The typedefs are the types that you declare in your code and which are returned by the -/// 'constructors' such as antlr38BitFileStreamNew(). The underlying structures document -/// the data elements of the type and what a function pointer installed in any particular -/// slot should do. -/// -/// The default implementations are the static methods within the default implementation file -/// for a 'class', which are installed by the runtime when a default instance of one the -/// typedefs (classes) is created. -/// -/// When navigating the source code, find the typedef you want to consult and inspect the documentation -/// for its function pointers, then look at the documentation for the default methods that implement -/// that 'method'. -/// -/// For example, under "API Typedefs and Structs" you will find "Base Recognizer Definition", which tells -/// you all the methods that belong to this interface. Under "API Implementation Functions", you will -/// find "Base Recognizer Implementation", which documents the actual functions that are installed -/// to implement the class methods. -/// -/// From here, the documentation should be obvious. If it is not, then you could try reading -/// the actual source code, but please don't email the author directly, use the ANTLR Interest -/// email group, which you should probably have signed up for if you have read this far into the -/// C runtime documentation. -/// \ No newline at end of file diff --git a/impl/antlr/libantlr3c-3.4/doxygen/using.dox b/impl/antlr/libantlr3c-3.4/doxygen/using.dox deleted file mode 100644 index fb8424a..0000000 --- a/impl/antlr/libantlr3c-3.4/doxygen/using.dox +++ /dev/null @@ -1,62 +0,0 @@ -/// \page using Using the ANTLR3 C Target -/// -/// \section intro Introduction -/// -/// Using the ANTLR target involves gaining knowledge of a number of elements: -/// -/// -# Writing ANTLR grammars (not covered in this manual); -/// -# How ANTLR works (not covered in this manual); -/// -# How to use the \@sections with the C target -/// -# Interoperation with the runtime within rule actions; -/// -# Implementing custom versions of the standard library methods; -/// -/// If you are as yet unfamiliar with how ANTLR works in general, then -/// it is suggested that you read the various wiki pages concerned with -/// getting started. However there are a few things that you should note: -/// -/// - The lexer is independent of the parser. You \b cannot control the lexer from within the parser; -/// - The tree parser is independent of the parser. You \b cannot control the parser from within the tree parser(s); -/// - Each tree parser is independent of other tree parsers. -/// -/// This means that your lexer runs first and consumes all the input stream until -/// you stop it programmatically, or it reaches the end of the input stream. It produces -/// a complete stream of tokens, which the parser then consumes. -/// -/// \section Using \@sections in a C Targeted Grammar -/// -/// Within a grammar file there are a number of special sections you can add that cause the -/// code within them to be placed at strategic points in the generated code such as -/// before or after the #include statements in the .c file, within the generated header file -/// or within the constructor for the recognizer. -/// -/// Many of the \@sections used within a Java targeted grammar have some equivalent function within a -/// C targeted grammar, but their use may well be subtly different. There are also additional sections -/// that have meaning only within a grammar targeted for the C runtime. -/// -/// Detailed documentation of these sections is given here: \subpage atsections -/// -/// \section interop Interoperation Within Rule Actions -/// -/// Rule actions have a limited number of elements they can access by name, independently of the -/// target language generated. These are elements such as $line, $pos, $text and so on. Where the -/// $xxx returns a basic type such as \c int, then you can use these in C as you would in the Java -/// target, but where a reference returns a string, you will get a pointer to the C runtime -/// string implementation #pANTLR3_STRING. This will give you access to things like token text -/// but also provides some convenience methods such as #pANTLR3_STRING->substring() and #pANTLR3_STRING->toUTF8(). -/// -/// The generated code provides a number of C MACROs, which make it easier to access runtime -/// components. Always use these macros when available, to protect your action code from changes -/// to the underlying implementation. -/// -/// Detailed documentation of macros and rule action interoperation is given here: \subpage interop -/// -/// \section Custom Implementing Customized Methods -/// -/// Unless you wish to create your own tree structures using the built in ANTLR AST rewriting -/// notation, you will rarely need to override the default implementation of runtime methods. The -/// exception to this will be the syntax err reporting method, which is essentially a stub function -/// that you will usually want to provide your own implementation for. You should consider the built in function -/// displayRecognitionError() as an example of where to start as there can be no really useful -/// generic error message display. -/// -/// \ No newline at end of file diff --git a/impl/antlr/libantlr3c-3.4/include/antlr3.h b/impl/antlr/libantlr3c-3.4/include/antlr3.h deleted file mode 100644 index 2ead975..0000000 --- a/impl/antlr/libantlr3c-3.4/include/antlr3.h +++ /dev/null @@ -1,56 +0,0 @@ -#ifndef _ANTLR3_H -#define _ANTLR3_H - -// [The "BSD licence"] -// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC -// http://www.temporal-wave.com -// http://www.linkedin.com/in/jimidle -// -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions -// are met: -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// 3. The name of the author may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#endif diff --git a/impl/antlr/libantlr3c-3.4/include/antlr3baserecognizer.h b/impl/antlr/libantlr3c-3.4/include/antlr3baserecognizer.h deleted file mode 100644 index 0a269d4..0000000 --- a/impl/antlr/libantlr3c-3.4/include/antlr3baserecognizer.h +++ /dev/null @@ -1,371 +0,0 @@ -/** \file - * Defines the basic structure to support recognizing by either a lexer, - * parser, or tree parser. - * \addtogroup ANTLR3_BASE_RECOGNIZER - * @{ - */ -#ifndef _ANTLR3_BASERECOGNIZER_H -#define _ANTLR3_BASERECOGNIZER_H - -// [The "BSD licence"] -// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC -// http://www.temporal-wave.com -// http://www.linkedin.com/in/jimidle -// -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions -// are met: -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// 3. The name of the author may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include -#include -#include -#include -#include -#include -#include -#include - -/** Type indicator for a lexer recognizer - */ -#define ANTLR3_TYPE_LEXER 0x0001 - -/** Type indicator for a parser recognizer - */ -#define ANTLR3_TYPE_PARSER 0x0002 - -/** Type indicator for a tree parser recognizer - */ -#define ANTLR3_TYPE_TREE_PARSER 0x0004 - -#ifdef __cplusplus -extern "C" { -#endif - -/** \brief Base tracking context structure for all types of - * recognizers. - */ -typedef struct ANTLR3_BASE_RECOGNIZER_struct -{ - /// Whatever super structure is providing this interface needs a pointer to itself - /// so that this can be passed back to it whenever the api functions - /// are called back from here. - /// - void * super; - - /// Indicates the type of recognizer that we are an instance of. - /// The programmer may set this to anything of course, but the default - /// implementations of the interface only really understand the built in - /// types, so new error handlers etc would probably be required to as well. - /// - /// Valid types are: - /// - /// - #ANTLR3_TYPE_LEXER - /// - #ANTLR3_TYPE_PARSER - /// - #ANTLR3_TYPE_TREE_PARSER - /// - ANTLR3_UINT32 type; - - /// A pointer to the shared recognizer state, such that multiple - /// recognizers can use the same inputs streams and so on (in - /// the case of grammar inheritance for instance. - /// - pANTLR3_RECOGNIZER_SHARED_STATE state; - - /// If set to something other than NULL, then this structure is - /// points to an instance of the debugger interface. In general, the - /// debugger is only referenced internally in recovery/error operations - /// so that it does not cause overhead by having to check this pointer - /// in every function/method - /// - pANTLR3_DEBUG_EVENT_LISTENER debugger; - - - /// Pointer to a function that matches the current input symbol - /// against the supplied type. the function causes an error if a - /// match is not found and the default implementation will also - /// attempt to perform one token insertion or deletion if that is - /// possible with the input stream. You can override the default - /// implementation by installing a pointer to your own function - /// in this interface after the recognizer has initialized. This can - /// perform different recovery options or not recover at all and so on. - /// To ignore recovery altogether, see the comments in the default - /// implementation of this function in antlr3baserecognizer.c - /// - /// Note that errors are signalled by setting the error flag below - /// and creating a new exception structure and installing it in the - /// exception pointer below (you can chain these if you like and handle them - /// in some customized way). - /// - void * (*match) (struct ANTLR3_BASE_RECOGNIZER_struct * recognizer, - ANTLR3_UINT32 ttype, pANTLR3_BITSET_LIST follow); - - /// Pointer to a function that matches the next token/char in the input stream - /// regardless of what it actually is. - /// - void (*matchAny) (struct ANTLR3_BASE_RECOGNIZER_struct * recognizer); - - /// Pointer to a function that decides if the token ahead of the current one is the - /// one we were loking for, in which case the curernt one is very likely extraneous - /// and can be reported that way. - /// - ANTLR3_BOOLEAN - (*mismatchIsUnwantedToken) (struct ANTLR3_BASE_RECOGNIZER_struct * recognizer, pANTLR3_INT_STREAM input, ANTLR3_UINT32 ttype); - - /// Pointer to a function that decides if the current token is one that can logically - /// follow the one we were looking for, in which case the one we were looking for is - /// probably missing from the input. - /// - ANTLR3_BOOLEAN - (*mismatchIsMissingToken) (struct ANTLR3_BASE_RECOGNIZER_struct * recognizer, pANTLR3_INT_STREAM input, pANTLR3_BITSET_LIST follow); - - /** Pointer to a function that works out what to do when a token mismatch - * occurs, so that Tree parsers can behave differently to other recognizers. - */ - void (*mismatch) (struct ANTLR3_BASE_RECOGNIZER_struct * recognizer, - ANTLR3_UINT32 ttype, pANTLR3_BITSET_LIST follow); - - /** Pointer to a function to call to report a recognition problem. You may override - * this function with your own function, but refer to the standard implementation - * in antlr3baserecognizer.c for guidance. The function should recognize whether - * error recovery is in force, so that it does not print out more than one error messages - * for the same error. From the java comments in BaseRecognizer.java: - * - * This method sets errorRecovery to indicate the parser is recovering - * not parsing. Once in recovery mode, no errors are generated. - * To get out of recovery mode, the parser must successfully match - * a token (after a resync). So it will go: - * - * 1. error occurs - * 2. enter recovery mode, report error - * 3. consume until token found in resynch set - * 4. try to resume parsing - * 5. next match() will reset errorRecovery mode - */ - void (*reportError) (struct ANTLR3_BASE_RECOGNIZER_struct * recognizer); - - /** Pointer to a function that is called to display a recognition error message. You may - * override this function independently of (*reportError)() above as that function calls - * this one to do the actual exception printing. - */ - void (*displayRecognitionError) (struct ANTLR3_BASE_RECOGNIZER_struct * recognizer, pANTLR3_UINT8 * tokenNames); - - /// Get number of recognition errors (lexer, parser, tree parser). Each - /// recognizer tracks its own number. So parser and lexer each have - /// separate count. Does not count the spurious errors found between - /// an error and next valid token match - /// - /// \see reportError() - /// - ANTLR3_UINT32 - (*getNumberOfSyntaxErrors) (struct ANTLR3_BASE_RECOGNIZER_struct * recognizer); - - /** Pointer to a function that recovers from an error found in the input stream. - * Generally, this will be a #ANTLR3_EXCEPTION_NOVIABLE_ALT but it could also - * be from a mismatched token that the (*match)() could not recover from. - */ - void (*recover) (struct ANTLR3_BASE_RECOGNIZER_struct * recognizer); - - /** Pointer to a function that is a hook to listen to token consumption during error recovery. - * This is mainly used by the debug parser to send events to the listener. - */ - void (*beginResync) (struct ANTLR3_BASE_RECOGNIZER_struct * recognizer); - - /** Pointer to a function that is a hook to listen to token consumption during error recovery. - * This is mainly used by the debug parser to send events to the listener. - */ - void (*endResync) (struct ANTLR3_BASE_RECOGNIZER_struct * recognizer); - - /** Pointer to a function that is a hook to listen to token consumption during error recovery. - * This is mainly used by the debug parser to send events to the listener. - */ - void (*beginBacktrack) (struct ANTLR3_BASE_RECOGNIZER_struct * recognizer, ANTLR3_UINT32 level); - - /** Pointer to a function that is a hook to listen to token consumption during error recovery. - * This is mainly used by the debug parser to send events to the listener. - */ - void (*endBacktrack) (struct ANTLR3_BASE_RECOGNIZER_struct * recognizer, ANTLR3_UINT32 level, ANTLR3_BOOLEAN successful); - - /** Pointer to a function to computer the error recovery set for the current rule. - * \see antlr3ComputeErrorRecoverySet() for details. - */ - pANTLR3_BITSET (*computeErrorRecoverySet) (struct ANTLR3_BASE_RECOGNIZER_struct * recognizer); - - /** Pointer to a function that computes the context-sensitive FOLLOW set for the - * current rule. - * \see antlr3ComputeCSRuleFollow() for details. - */ - pANTLR3_BITSET (*computeCSRuleFollow) (struct ANTLR3_BASE_RECOGNIZER_struct * recognizer); - - /** Pointer to a function to combine follow bitsets. - * \see antlr3CombineFollows() for details. - */ - pANTLR3_BITSET (*combineFollows) (struct ANTLR3_BASE_RECOGNIZER_struct * recognizer, - ANTLR3_BOOLEAN exact); - - /** Pointer to a function that recovers from a mismatched token in the input stream. - * \see antlr3RecoverMismatch() for details. - */ - void * (*recoverFromMismatchedToken) - (struct ANTLR3_BASE_RECOGNIZER_struct * recognizer, - ANTLR3_UINT32 ttype, - pANTLR3_BITSET_LIST follow); - - /** Pointer to a function that recovers from a mismatched set in the token stream, in a similar manner - * to (*recoverFromMismatchedToken) - */ - void * (*recoverFromMismatchedSet) (struct ANTLR3_BASE_RECOGNIZER_struct * recognizer, - pANTLR3_BITSET_LIST follow); - - /** Pointer to common routine to handle single token insertion for recovery functions. - */ - ANTLR3_BOOLEAN (*recoverFromMismatchedElement) - (struct ANTLR3_BASE_RECOGNIZER_struct * recognizer, - pANTLR3_BITSET_LIST follow); - - /** Pointer to function that consumes input until the next token matches - * the given token. - */ - void (*consumeUntil) (struct ANTLR3_BASE_RECOGNIZER_struct * recognizer, - ANTLR3_UINT32 tokenType); - - /** Pointer to function that consumes input until the next token matches - * one in the given set. - */ - void (*consumeUntilSet) (struct ANTLR3_BASE_RECOGNIZER_struct * recognizer, - pANTLR3_BITSET set); - - /** Pointer to function that returns an ANTLR3_LIST of the strings that identify - * the rules in the parser that got you to this point. Can be overridden by installing your - * own function set. - * - * \todo Document how to override invocation stack functions. - */ - pANTLR3_STACK (*getRuleInvocationStack) (struct ANTLR3_BASE_RECOGNIZER_struct * recognizer); - pANTLR3_STACK (*getRuleInvocationStackNamed) (struct ANTLR3_BASE_RECOGNIZER_struct * recognizer, - pANTLR3_UINT8 name); - - /** Pointer to a function that converts an ANLR3_LIST of tokens to an ANTLR3_LIST of - * string token names. As this is mostly used in string template processing it may not be useful - * in the C runtime. - */ - pANTLR3_HASH_TABLE (*toStrings) (struct ANTLR3_BASE_RECOGNIZER_struct * recognizer, - pANTLR3_HASH_TABLE); - - /** Pointer to a function to return whether the rule has parsed input starting at the supplied - * start index before. If the rule has not parsed input starting from the supplied start index, - * then it will return ANTLR3_MEMO_RULE_UNKNOWN. If it has parsed from the suppled start point - * then it will return the point where it last stopped parsing after that start point. - */ - ANTLR3_MARKER (*getRuleMemoization) (struct ANTLR3_BASE_RECOGNIZER_struct * recognizer, - ANTLR3_INTKEY ruleIndex, - ANTLR3_MARKER ruleParseStart); - - /** Pointer to function that determines whether the rule has parsed input at the current index - * in the input stream - */ - ANTLR3_BOOLEAN (*alreadyParsedRule) (struct ANTLR3_BASE_RECOGNIZER_struct * recognizer, - ANTLR3_MARKER ruleIndex); - - /** Pointer to function that records whether the rule has parsed the input at a - * current position successfully or not. - */ - void (*memoize) (struct ANTLR3_BASE_RECOGNIZER_struct * recognizer, - ANTLR3_MARKER ruleIndex, - ANTLR3_MARKER ruleParseStart); - - /// Pointer to a function that returns the current input symbol. - /// The is placed into any label for the associated token ref; e.g., x=ID. Token - /// and tree parsers need to return different objects. Rather than test - /// for input stream type or change the IntStream interface, I use - /// a simple method to ask the recognizer to tell me what the current - /// input symbol is. - /// - /// This is ignored for lexers and the lexer implementation of this - /// function should return NULL. - /// - void * (*getCurrentInputSymbol) ( struct ANTLR3_BASE_RECOGNIZER_struct * recognizer, - pANTLR3_INT_STREAM istream); - - /// Conjure up a missing token during error recovery. - /// - /// The recognizer attempts to recover from single missing - /// symbols. But, actions might refer to that missing symbol. - /// For example, x=ID {f($x);}. The action clearly assumes - /// that there has been an identifier matched previously and that - /// $x points at that token. If that token is missing, but - /// the next token in the stream is what we want we assume that - /// this token is missing and we keep going. Because we - /// have to return some token to replace the missing token, - /// we have to conjure one up. This method gives the user control - /// over the tokens returned for missing tokens. Mostly, - /// you will want to create something special for identifier - /// tokens. For literals such as '{' and ',', the default - /// action in the parser or tree parser works. It simply creates - /// a CommonToken of the appropriate type. The text will be the token. - /// If you change what tokens must be created by the lexer, - /// override this method to create the appropriate tokens. - /// - void * (*getMissingSymbol) ( struct ANTLR3_BASE_RECOGNIZER_struct * recognizer, - pANTLR3_INT_STREAM istream, - pANTLR3_EXCEPTION e, - ANTLR3_UINT32 expectedTokenType, - pANTLR3_BITSET_LIST follow); - - /** Pointer to a function that returns whether the supplied grammar function - * will parse the current input stream or not. This is the way that syntactic - * predicates are evaluated. Unlike java, C is perfectly happy to invoke code - * via a pointer to a function (hence that's what all the ANTLR3 C interfaces - * do. - */ - ANTLR3_BOOLEAN (*synpred) ( struct ANTLR3_BASE_RECOGNIZER_struct * recognizer, void * ctx, - void (*predicate)(void * ctx)); - - /** Pointer to a function that can construct a generic exception structure - * with such information as the input stream can provide. - */ - void (*exConstruct) (struct ANTLR3_BASE_RECOGNIZER_struct * recognizer); - - /** Reset the recognizer - */ - void (*reset) (struct ANTLR3_BASE_RECOGNIZER_struct * recognizer); - - /** Pointer to a function that knows how to free the resources of a base recognizer. - */ - void (*free) (struct ANTLR3_BASE_RECOGNIZER_struct * recognizer); - -} - ANTLR3_BASE_RECOGNIZER; - -#ifdef __cplusplus -} -#endif - -#include -#include -#include - -/// @} -/// - -#endif /* _ANTLR3_BASERECOGNIZER_H */ - diff --git a/impl/antlr/libantlr3c-3.4/include/antlr3basetree.h b/impl/antlr/libantlr3c-3.4/include/antlr3basetree.h deleted file mode 100644 index 023c4c2..0000000 --- a/impl/antlr/libantlr3c-3.4/include/antlr3basetree.h +++ /dev/null @@ -1,143 +0,0 @@ -/// \file -/// Definition of the ANTLR3 base tree. -/// - -#ifndef _ANTLR3_BASE_TREE_H -#define _ANTLR3_BASE_TREE_H - -// [The "BSD licence"] -// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC -// http://www.temporal-wave.com -// http://www.linkedin.com/in/jimidle -// -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions -// are met: -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// 3. The name of the author may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/// A generic tree implementation with no payload. You must subclass to -/// actually have any user data. ANTLR v3 uses a list of children approach -/// instead of the child-sibling approach in v2. A flat tree (a list) is -/// an empty node whose children represent the list. An empty (as in it does not -/// have payload itself), but non-null node is called "nil". -/// -typedef struct ANTLR3_BASE_TREE_struct -{ - - /// Implementers of this interface sometimes require a pointer to their selves. - /// - void * super; - - /// Generic void pointer allows the grammar programmer to attach any structure they - /// like to a tree node, in many cases saving the need to create their own tree - /// and tree adaptors. ANTLR does not use this pointer, but will copy it for you and so on. - /// - void * u; - - /// The list of all the children that belong to this node. They are not part of the node - /// as they belong to the common tree node that implements this. - /// - pANTLR3_VECTOR children; - - /// This is used to store the current child index position while descending - /// and ascending trees as the tree walk progresses. - /// - ANTLR3_MARKER savedIndex; - - /// A string factory to produce strings for toString etc - /// - pANTLR3_STRING_FACTORY strFactory; - - /// A pointer to a function that returns the common token pointer - /// for the payload in the supplied tree. - /// - pANTLR3_COMMON_TOKEN (*getToken) (struct ANTLR3_BASE_TREE_struct * tree); - - void (*addChild) (struct ANTLR3_BASE_TREE_struct * tree, void * child); - - void (*addChildren) (struct ANTLR3_BASE_TREE_struct * tree, pANTLR3_LIST kids); - - void (*createChildrenList) (struct ANTLR3_BASE_TREE_struct * tree); - - void * (*deleteChild) (struct ANTLR3_BASE_TREE_struct * tree, ANTLR3_UINT32 i); - - void (*replaceChildren) (struct ANTLR3_BASE_TREE_struct * parent, ANTLR3_INT32 startChildIndex, ANTLR3_INT32 stopChildIndex, struct ANTLR3_BASE_TREE_struct * t); - - void * (*dupNode) (struct ANTLR3_BASE_TREE_struct * dupNode); - - void * (*dupTree) (struct ANTLR3_BASE_TREE_struct * tree); - - ANTLR3_UINT32 (*getCharPositionInLine) (struct ANTLR3_BASE_TREE_struct * tree); - - void * (*getChild) (struct ANTLR3_BASE_TREE_struct * tree, ANTLR3_UINT32 i); - - void (*setChildIndex) (struct ANTLR3_BASE_TREE_struct * tree, ANTLR3_INT32 ); - - ANTLR3_INT32 (*getChildIndex) (struct ANTLR3_BASE_TREE_struct * tree ); - - ANTLR3_UINT32 (*getChildCount) (struct ANTLR3_BASE_TREE_struct * tree); - - struct ANTLR3_BASE_TREE_struct * (*getParent) (struct ANTLR3_BASE_TREE_struct * tree); - - void (*setParent) (struct ANTLR3_BASE_TREE_struct * tree, struct ANTLR3_BASE_TREE_struct * parent); - - ANTLR3_UINT32 (*getType) (struct ANTLR3_BASE_TREE_struct * tree); - - void * (*getFirstChildWithType) (struct ANTLR3_BASE_TREE_struct * tree, ANTLR3_UINT32 type); - - ANTLR3_UINT32 (*getLine) (struct ANTLR3_BASE_TREE_struct * tree); - - pANTLR3_STRING (*getText) (struct ANTLR3_BASE_TREE_struct * tree); - - ANTLR3_BOOLEAN (*isNilNode) (struct ANTLR3_BASE_TREE_struct * tree); - - void (*setChild) (struct ANTLR3_BASE_TREE_struct * tree, ANTLR3_UINT32 i, void * child); - - pANTLR3_STRING (*toStringTree) (struct ANTLR3_BASE_TREE_struct * tree); - - pANTLR3_STRING (*toString) (struct ANTLR3_BASE_TREE_struct * tree); - - void (*freshenPACIndexesAll) (struct ANTLR3_BASE_TREE_struct * tree); - - void (*freshenPACIndexes) (struct ANTLR3_BASE_TREE_struct * tree, ANTLR3_UINT32 offset); - - void (*reuse) (struct ANTLR3_BASE_TREE_struct * tree); - - void (*free) (struct ANTLR3_BASE_TREE_struct * tree); - -} - ANTLR3_BASE_TREE; - -#ifdef __cplusplus -} -#endif - - -#endif diff --git a/impl/antlr/libantlr3c-3.4/include/antlr3basetreeadaptor.h b/impl/antlr/libantlr3c-3.4/include/antlr3basetreeadaptor.h deleted file mode 100644 index bf9a72a..0000000 --- a/impl/antlr/libantlr3c-3.4/include/antlr3basetreeadaptor.h +++ /dev/null @@ -1,152 +0,0 @@ -/** \file - * Definition of the ANTLR3 base tree adaptor. - */ - -#ifndef _ANTLR3_BASE_TREE_ADAPTOR_H -#define _ANTLR3_BASE_TREE_ADAPTOR_H - -// [The "BSD licence"] -// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC -// http://www.temporal-wave.com -// http://www.linkedin.com/in/jimidle -// -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions -// are met: -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// 3. The name of the author may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include -#include -#include -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct ANTLR3_BASE_TREE_ADAPTOR_struct -{ - /** Pointer to any enclosing structure/interface that - * contains this structure. - */ - void * super; - - /** We need a string factory for creating imaginary tokens, we take this - * from the stream we are supplied to walk. - */ - pANTLR3_STRING_FACTORY strFactory; - - /* And we also need a token factory for creating imaginary tokens - * this is also taken from the input source. - */ - pANTLR3_TOKEN_FACTORY tokenFactory; - - /// If set to something other than NULL, then this structure is - /// points to an instance of the debugger interface. In general, the - /// debugger is only referenced internally in recovery/error operations - /// so that it does not cause overhead by having to check this pointer - /// in every function/method - /// - pANTLR3_DEBUG_EVENT_LISTENER debugger; - - void * (*nilNode) (struct ANTLR3_BASE_TREE_ADAPTOR_struct * adaptor); - - - void * (*dupTree) (struct ANTLR3_BASE_TREE_ADAPTOR_struct * adaptor, void * tree); - void * (*dupTreeTT) (struct ANTLR3_BASE_TREE_ADAPTOR_struct * adaptor, void * t, void * tree); - - void (*addChild) (struct ANTLR3_BASE_TREE_ADAPTOR_struct * adaptor, void * t, void * child); - void (*addChildToken) (struct ANTLR3_BASE_TREE_ADAPTOR_struct * adaptor, void * t, pANTLR3_COMMON_TOKEN child); - void (*setParent) (struct ANTLR3_BASE_TREE_ADAPTOR_struct * adaptor, void * child, void * parent); - void * (*getParent) (struct ANTLR3_BASE_TREE_ADAPTOR_struct * adaptor, void * child); - - void * (*errorNode) (struct ANTLR3_BASE_TREE_ADAPTOR_struct * adaptor, pANTLR3_TOKEN_STREAM tnstream, pANTLR3_COMMON_TOKEN startToken, pANTLR3_COMMON_TOKEN stopToken, pANTLR3_EXCEPTION e); - ANTLR3_BOOLEAN (*isNilNode) (struct ANTLR3_BASE_TREE_ADAPTOR_struct * adaptor, void * t); - - void * (*becomeRoot) (struct ANTLR3_BASE_TREE_ADAPTOR_struct * adaptor, void * newRoot, void * oldRoot); - - void * (*rulePostProcessing) (struct ANTLR3_BASE_TREE_ADAPTOR_struct * adaptor, void * root); - - void * (*becomeRootToken) (struct ANTLR3_BASE_TREE_ADAPTOR_struct * adaptor, void * newRoot, void * oldRoot); - - void * (*create) (struct ANTLR3_BASE_TREE_ADAPTOR_struct * adaptor, pANTLR3_COMMON_TOKEN payload); - void * (*createTypeToken) (struct ANTLR3_BASE_TREE_ADAPTOR_struct * adaptor, ANTLR3_UINT32 tokenType, pANTLR3_COMMON_TOKEN fromToken); - void * (*createTypeTokenText) (struct ANTLR3_BASE_TREE_ADAPTOR_struct * adaptor, ANTLR3_UINT32 tokenType, pANTLR3_COMMON_TOKEN fromToken, pANTLR3_UINT8 text); - void * (*createTypeText) (struct ANTLR3_BASE_TREE_ADAPTOR_struct * adaptor, ANTLR3_UINT32 tokenType, pANTLR3_UINT8 text); - - void * (*dupNode) (struct ANTLR3_BASE_TREE_ADAPTOR_struct * adaptor, void * treeNode); - - ANTLR3_UINT32 (*getType) (struct ANTLR3_BASE_TREE_ADAPTOR_struct * adaptor, void * t); - - void (*setType) (struct ANTLR3_BASE_TREE_ADAPTOR_struct * adaptor, void * t, ANTLR3_UINT32 type); - - pANTLR3_STRING (*getText) (struct ANTLR3_BASE_TREE_ADAPTOR_struct * adaptor, void * t); - - void (*setText) (struct ANTLR3_BASE_TREE_ADAPTOR_struct * adaptor, pANTLR3_STRING t); - void (*setText8) (struct ANTLR3_BASE_TREE_ADAPTOR_struct * adaptor, pANTLR3_UINT8 t); - - void * (*getChild) (struct ANTLR3_BASE_TREE_ADAPTOR_struct * adaptor, void * t, ANTLR3_UINT32 i); - void (*setChild) (struct ANTLR3_BASE_TREE_ADAPTOR_struct * adaptor, void * t, ANTLR3_UINT32 i, void * child); - void (*deleteChild) (struct ANTLR3_BASE_TREE_ADAPTOR_struct * adaptor, void * t, ANTLR3_UINT32 i); - void (*setChildIndex) (struct ANTLR3_BASE_TREE_ADAPTOR_struct * adaptor, void * t, ANTLR3_UINT32 i); - ANTLR3_INT32 (*getChildIndex) (struct ANTLR3_BASE_TREE_ADAPTOR_struct * adaptor, void * t); - - ANTLR3_UINT32 (*getChildCount) (struct ANTLR3_BASE_TREE_ADAPTOR_struct * adaptor, void *); - - ANTLR3_UINT32 (*getUniqueID) (struct ANTLR3_BASE_TREE_ADAPTOR_struct * adaptor, void *); - - pANTLR3_COMMON_TOKEN (*createToken) (struct ANTLR3_BASE_TREE_ADAPTOR_struct * adaptor, ANTLR3_UINT32 tokenType, pANTLR3_UINT8 text); - pANTLR3_COMMON_TOKEN (*createTokenFromToken) (struct ANTLR3_BASE_TREE_ADAPTOR_struct * adaptor, pANTLR3_COMMON_TOKEN fromToken); - pANTLR3_COMMON_TOKEN (*getToken) (struct ANTLR3_BASE_TREE_ADAPTOR_struct * adaptor, void * t); - - void (*setTokenBoundaries) (struct ANTLR3_BASE_TREE_ADAPTOR_struct * adaptor, void * t, pANTLR3_COMMON_TOKEN startToken, pANTLR3_COMMON_TOKEN stopToken); - - ANTLR3_MARKER (*getTokenStartIndex) (struct ANTLR3_BASE_TREE_ADAPTOR_struct * adaptor, void * t); - - ANTLR3_MARKER (*getTokenStopIndex) (struct ANTLR3_BASE_TREE_ADAPTOR_struct * adaptor, void * t); - - void (*setDebugEventListener)(struct ANTLR3_BASE_TREE_ADAPTOR_struct * adaptor, pANTLR3_DEBUG_EVENT_LISTENER debugger); - - /// Produce a DOT (see graphviz freeware suite) from a base tree - /// - pANTLR3_STRING (*makeDot) (struct ANTLR3_BASE_TREE_ADAPTOR_struct * adaptor, void * theTree); - - /// Replace from start to stop child index of parent with t, which might - /// be a list. Number of children may be different - /// after this call. - /// - /// If parent is null, don't do anything; must be at root of overall tree. - /// Can't replace whatever points to the parent externally. Do nothing. - /// - void (*replaceChildren) (struct ANTLR3_BASE_TREE_ADAPTOR_struct * adaptor, void * parent, ANTLR3_INT32 startChildIndex, ANTLR3_INT32 stopChildIndex, void * t); - - void (*free) (struct ANTLR3_BASE_TREE_ADAPTOR_struct * adaptor); - -} - ANTLR3_TREE_ADAPTOR, *pANTLR3_TREE_ADAPTOR; -#ifdef __cplusplus -} -#endif - -#endif diff --git a/impl/antlr/libantlr3c-3.4/include/antlr3bitset.h b/impl/antlr/libantlr3c-3.4/include/antlr3bitset.h deleted file mode 100644 index 7d816ab..0000000 --- a/impl/antlr/libantlr3c-3.4/include/antlr3bitset.h +++ /dev/null @@ -1,119 +0,0 @@ -/** - * \file - * Defines the basic structures of an ANTLR3 bitset. this is a C version of the - * cut down Bitset class provided with the java version of antlr 3. - * - * - */ -#ifndef _ANTLR3_BITSET_H -#define _ANTLR3_BITSET_H - -// [The "BSD licence"] -// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC -// http://www.temporal-wave.com -// http://www.linkedin.com/in/jimidle -// -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions -// are met: -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// 3. The name of the author may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include -#include - -/** How many bits in the elements - */ -#define ANTLR3_BITSET_BITS 64 - -/** How many bits in a nible of bits - */ -#define ANTLR3_BITSET_NIBBLE 4 - -/** log2 of ANTLR3_BITSET_BITS 2^ANTLR3_BITSET_LOG_BITS = ANTLR3_BITSET_BITS - */ -#define ANTLR3_BITSET_LOG_BITS 6 - -/** We will often need to do a mod operator (i mod nbits). - * For powers of two, this mod operation is the - * same as: - * - (i & (nbits-1)). - * - * Since mod is relatively slow, we use an easily - * precomputed mod mask to do the mod instead. - */ -#define ANTLR3_BITSET_MOD_MASK ANTLR3_BITSET_BITS - 1 - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct ANTLR3_BITSET_LIST_struct -{ - /// Pointer to the allocated array of bits for this bit set, which - /// is an array of 64 bit elements (of the architecture). If we find a - /// machine/C compiler that does not know anything about 64 bit values - /// then it should be easy enough to produce a 32 bit (or less) version - /// of the bitset code. Note that the pointer here may be static if laid down - /// by the code generation, and it must be copied if it is to be manipulated - /// to perform followset calculations. - /// - pANTLR3_BITWORD bits; - - /// Length of the current bit set in ANTLR3_UINT64 units. - /// - ANTLR3_UINT32 length; -} - ANTLR3_BITSET_LIST; - -typedef struct ANTLR3_BITSET_struct -{ - /// The actual bits themselves - /// - ANTLR3_BITSET_LIST blist; - - pANTLR3_BITSET (*clone) (struct ANTLR3_BITSET_struct * inSet); - pANTLR3_BITSET (*bor) (struct ANTLR3_BITSET_struct * bitset1, struct ANTLR3_BITSET_struct * bitset2); - void (*borInPlace) (struct ANTLR3_BITSET_struct * bitset, struct ANTLR3_BITSET_struct * bitset2); - ANTLR3_UINT32 (*size) (struct ANTLR3_BITSET_struct * bitset); - void (*add) (struct ANTLR3_BITSET_struct * bitset, ANTLR3_INT32 bit); - void (*grow) (struct ANTLR3_BITSET_struct * bitset, ANTLR3_INT32 newSize); - ANTLR3_BOOLEAN (*equals) (struct ANTLR3_BITSET_struct * bitset1, struct ANTLR3_BITSET_struct * bitset2); - ANTLR3_BOOLEAN (*isMember) (struct ANTLR3_BITSET_struct * bitset, ANTLR3_UINT32 bit); - ANTLR3_UINT32 (*numBits) (struct ANTLR3_BITSET_struct * bitset); - void (*remove) (struct ANTLR3_BITSET_struct * bitset, ANTLR3_UINT32 bit); - ANTLR3_BOOLEAN (*isNilNode) (struct ANTLR3_BITSET_struct * bitset); - pANTLR3_INT32 (*toIntList) (struct ANTLR3_BITSET_struct * bitset); - - void (*free) (struct ANTLR3_BITSET_struct * bitset); - - -} - ANTLR3_BITSET; - -#ifdef __cplusplus -} -#endif - - - -#endif - diff --git a/impl/antlr/libantlr3c-3.4/include/antlr3collections.h b/impl/antlr/libantlr3c-3.4/include/antlr3collections.h deleted file mode 100644 index 7c73e36..0000000 --- a/impl/antlr/libantlr3c-3.4/include/antlr3collections.h +++ /dev/null @@ -1,513 +0,0 @@ -#ifndef ANTLR3COLLECTIONS_H -#define ANTLR3COLLECTIONS_H - -// [The "BSD licence"] -// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC -// http://www.temporal-wave.com -// http://www.linkedin.com/in/jimidle -// -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions -// are met: -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// 3. The name of the author may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include -#include - -#define ANTLR3_HASH_TYPE_INT 0 /**< Indicates the hashed file has integer keys */ -#define ANTLR3_HASH_TYPE_STR 1 /**< Indicates the hashed file has numeric keys */ - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct ANTLR3_HASH_KEY_struct -{ - ANTLR3_UINT8 type; /**< One of ##ANTLR3_HASH_TYPE_INT or ##ANTLR3_HASH_TYPE_STR */ - - union - { - pANTLR3_UINT8 sKey; /**< Used if type is ANTLR3_HASH_TYPE_STR */ - ANTLR3_INTKEY iKey; /**< used if type is ANTLR3_HASH_TYPE_INT */ - } - key; - -} ANTLR3_HASH_KEY, *pANTLR3_HASH_KEY; - -/** Internal structure representing an element in a hash bucket. - * Stores the original key so that duplicate keys can be rejected - * if necessary, and contains function can be supported. If the hash key - * could be unique I would have invented the perfect compression algorithm ;-) - */ -typedef struct ANTLR3_HASH_ENTRY_struct -{ - /** Key that created this particular entry - */ - ANTLR3_HASH_KEY keybase; - - /** Pointer to the data for this particular entry - */ - void * data; - - /** Pointer to routine that knows how to release the memory - * structure pointed at by data. If this is NULL then we assume - * that the data pointer does not need to be freed when the entry - * is deleted from the table. - */ - void (ANTLR3_CDECL *free)(void * data); - - /** Pointer to the next entry in this bucket if there - * is one. Sometimes different keys will hash to the same bucket (especially - * if the number of buckets is small). We could implement dual hashing algorithms - * to minimize this, but that seems over the top for what this is needed for. - */ - struct ANTLR3_HASH_ENTRY_struct * nextEntry; -} - ANTLR3_HASH_ENTRY; - -/** Internal structure of a hash table bucket, which tracks - * all keys that hash to the same bucket. - */ -typedef struct ANTLR3_HASH_BUCKET_struct -{ - /** Pointer to the first entry in the bucket (if any, it - * may be NULL). Duplicate entries are chained from - * here. - */ - pANTLR3_HASH_ENTRY entries; - -} - ANTLR3_HASH_BUCKET; - -/** Structure that tracks a hash table - */ -typedef struct ANTLR3_HASH_TABLE_struct -{ - /** Indicates whether the table allows duplicate keys - */ - int allowDups; - - /** Number of buckets available in this table - */ - ANTLR3_UINT32 modulo; - - /** Points to the memory where the array of buckets - * starts. - */ - pANTLR3_HASH_BUCKET buckets; - - /** How many elements currently exist in the table. - */ - ANTLR3_UINT32 count; - - /** Whether the hash table should strdup the keys it is given or not. - */ - ANTLR3_BOOLEAN doStrdup; - - /** Pointer to function to completely delete this table - */ - void (*free) (struct ANTLR3_HASH_TABLE_struct * table); - - /* String keyed hashtable functions */ - void (*del) (struct ANTLR3_HASH_TABLE_struct * table, void * key); - pANTLR3_HASH_ENTRY (*remove) (struct ANTLR3_HASH_TABLE_struct * table, void * key); - void * (*get) (struct ANTLR3_HASH_TABLE_struct * table, void * key); - ANTLR3_INT32 (*put) (struct ANTLR3_HASH_TABLE_struct * table, void * key, void * element, void (ANTLR3_CDECL *freeptr)(void *)); - - /* Integer based hash functions */ - void (*delI) (struct ANTLR3_HASH_TABLE_struct * table, ANTLR3_INTKEY key); - pANTLR3_HASH_ENTRY (*removeI) (struct ANTLR3_HASH_TABLE_struct * table, ANTLR3_INTKEY key); - void * (*getI) (struct ANTLR3_HASH_TABLE_struct * table, ANTLR3_INTKEY key); - ANTLR3_INT32 (*putI) (struct ANTLR3_HASH_TABLE_struct * table, ANTLR3_INTKEY key, void * element, void (ANTLR3_CDECL *freeptr)(void *)); - - ANTLR3_UINT32 (*size) (struct ANTLR3_HASH_TABLE_struct * table); -} - ANTLR3_HASH_TABLE; - - -/** Internal structure representing an enumeration of a table. - * This is returned by antlr3Enumeration() - * Allows the programmer to traverse the table in hash order without - * knowing what is in the actual table. - * - * Note that it is up to the caller to ensure that the table - * structure does not change in the hash bucket that is currently being - * enumerated as this structure just tracks the next pointers in the - * bucket series. - */ -typedef struct ANTLR3_HASH_ENUM_struct -{ - /* Pointer to the table we are enumerating - */ - pANTLR3_HASH_TABLE table; - - /* Bucket we are currently enumerating (if NULL then we are done) - */ - ANTLR3_UINT32 bucket; - - /* Next entry to return, if NULL, then move to next bucket if any - */ - pANTLR3_HASH_ENTRY entry; - - /* Interface - */ - int (*next) (struct ANTLR3_HASH_ENUM_struct * en, pANTLR3_HASH_KEY *key, void ** data); - void (*free) (struct ANTLR3_HASH_ENUM_struct * table); -} - ANTLR3_HASH_ENUM; - -/** Structure that represents a LIST collection - */ -typedef struct ANTLR3_LIST_struct -{ - /** Hash table that is storing the list elements - */ - pANTLR3_HASH_TABLE table; - - void (*free) (struct ANTLR3_LIST_struct * list); - void (*del) (struct ANTLR3_LIST_struct * list, ANTLR3_INTKEY key); - void * (*get) (struct ANTLR3_LIST_struct * list, ANTLR3_INTKEY key); - void * (*remove) (struct ANTLR3_LIST_struct * list, ANTLR3_INTKEY key); - ANTLR3_INT32 (*add) (struct ANTLR3_LIST_struct * list, void * element, void (ANTLR3_CDECL *freeptr)(void *)); - ANTLR3_INT32 (*put) (struct ANTLR3_LIST_struct * list, ANTLR3_INTKEY key, void * element, void (ANTLR3_CDECL *freeptr)(void *)); - ANTLR3_UINT32 (*size) (struct ANTLR3_LIST_struct * list); - -} - ANTLR3_LIST; - -/** Structure that represents a Stack collection - */ -typedef struct ANTLR3_STACK_struct -{ - /** List that supports the stack structure - */ - pANTLR3_VECTOR vector; - - /** Used for quick access to the top of the stack - */ - void * top; - void (*free) (struct ANTLR3_STACK_struct * stack); - void * (*pop) (struct ANTLR3_STACK_struct * stack); - void * (*get) (struct ANTLR3_STACK_struct * stack, ANTLR3_INTKEY key); - ANTLR3_BOOLEAN (*push) (struct ANTLR3_STACK_struct * stack, void * element, void (ANTLR3_CDECL *freeptr)(void *)); - ANTLR3_UINT32 (*size) (struct ANTLR3_STACK_struct * stack); - void * (*peek) (struct ANTLR3_STACK_struct * stack); - -} - ANTLR3_STACK; - -/* Structure that represents a vector element - */ -typedef struct ANTLR3_VECTOR_ELEMENT_struct -{ - void * element; - void (ANTLR3_CDECL *freeptr)(void *); -} - ANTLR3_VECTOR_ELEMENT, *pANTLR3_VECTOR_ELEMENT; - -#define ANTLR3_VECTOR_INTERNAL_SIZE 16 -/* Structure that represents a vector collection. A vector is a simple list - * that contains a pointer to the element and a pointer to a function that - * that can free the element if it is removed. It auto resizes but does not - * use hash techniques as it is referenced by a simple numeric index. It is not a - * sparse list, so if any element is deleted, then the ones following are moved - * down in memory and the count is adjusted. - */ -typedef struct ANTLR3_VECTOR_struct -{ - /** Array of pointers to vector elements - */ - pANTLR3_VECTOR_ELEMENT elements; - - /** Number of entries currently in the list; - */ - ANTLR3_UINT32 count; - - /** Many times, a vector holds just a few nodes in an AST and it - * is too much overhead to malloc the space for elements so - * at the expense of a few bytes of memory, we hold the first - * few elements internally. It means we must copy them when - * we grow beyond this initial size, but that is less overhead than - * the malloc/free callas we would otherwise require. - */ - ANTLR3_VECTOR_ELEMENT internal[ANTLR3_VECTOR_INTERNAL_SIZE]; - - /** Indicates if the structure was made by a factory, in which - * case only the factory can free the memory for the actual vector, - * though the vector free function is called and will recurse through its - * entries calling any free pointers for each entry. - */ - ANTLR3_BOOLEAN factoryMade; - - /** Total number of entries in elements at any point in time - */ - ANTLR3_UINT32 elementsSize; - - void (ANTLR3_CDECL *free) (struct ANTLR3_VECTOR_struct * vector); - void (*del) (struct ANTLR3_VECTOR_struct * vector, ANTLR3_UINT32 entry); - void * (*get) (struct ANTLR3_VECTOR_struct * vector, ANTLR3_UINT32 entry); - void * (*remove) (struct ANTLR3_VECTOR_struct * vector, ANTLR3_UINT32 entry); - void (*clear) (struct ANTLR3_VECTOR_struct * vector); - ANTLR3_BOOLEAN (*swap) (struct ANTLR3_VECTOR_struct *, ANTLR3_UINT32 entry1, ANTLR3_UINT32 entry2); - ANTLR3_UINT32 (*add) (struct ANTLR3_VECTOR_struct * vector, void * element, void (ANTLR3_CDECL *freeptr)(void *)); - ANTLR3_UINT32 (*set) (struct ANTLR3_VECTOR_struct * vector, ANTLR3_UINT32 entry, void * element, void (ANTLR3_CDECL *freeptr)(void *), ANTLR3_BOOLEAN freeExisting); - ANTLR3_UINT32 (*size) (struct ANTLR3_VECTOR_struct * vector); -} - ANTLR3_VECTOR; - -/** Default vector pool size if otherwise unspecified - */ -#define ANTLR3_FACTORY_VPOOL_SIZE 256 - -/** Structure that tracks vectors in a vector and auto deletes the vectors - * in the vector factory when closed. - */ -typedef struct ANTLR3_VECTOR_FACTORY_struct -{ - - /** List of all vector pools allocated so far - */ - pANTLR3_VECTOR *pools; - - /** Count of the vector pools allocated so far (current active pool) - */ - ANTLR3_INT32 thisPool; - - /** The next vector available in the pool - */ - ANTLR3_UINT32 nextVector; - - /** Trick to quickly initialize a new vector via memcpy and not a function call - */ - ANTLR3_VECTOR unTruc; - - /** Consumers from the factory can release a factory produced vector - * back to the factory so that it may be reused (and thus conserve memory) - * by another caller. The available vectors are stored here. Note that - * the only vectors avaible in the free chain are produced by this factory, so they - * need not be explicitly freed when the factory is closed. - */ - pANTLR3_STACK freeStack; - - /** Function to close the vector factory - */ - void (*close) (struct ANTLR3_VECTOR_FACTORY_struct * factory); - - /** Function to supply a new vector - */ - pANTLR3_VECTOR (*newVector) (struct ANTLR3_VECTOR_FACTORY_struct * factory); - - /// Function to return a vector to the factory for reuse - /// - void (*returnVector) (struct ANTLR3_VECTOR_FACTORY_struct * factory, pANTLR3_VECTOR vector); - -} -ANTLR3_VECTOR_FACTORY; - - -/* -------------- TRIE Interfaces ---------------- */ - - -/** Structure that holds the payload entry in an ANTLR3_INT_TRIE or ANTLR3_STRING_TRIE - */ -typedef struct ANTLR3_TRIE_ENTRY_struct -{ - ANTLR3_UINT32 type; - void (ANTLR3_CDECL *freeptr)(void *); - union - { - ANTLR3_INTKEY intVal; - void * ptr; - } data; - - struct ANTLR3_TRIE_ENTRY_struct * next; /* Allows duplicate entries for same key in insertion order */ -} -ANTLR3_TRIE_ENTRY, * pANTLR3_TRIE_ENTRY; - - -/** Structure that defines an element/node in an ANTLR3_INT_TRIE - */ -typedef struct ANTLR3_INT_TRIE_NODE_struct -{ - ANTLR3_UINT32 bitNum; /**< This is the left/right bit index for traversal along the nodes */ - ANTLR3_INTKEY key; /**< This is the actual key that the entry represents if it is a terminal node */ - pANTLR3_TRIE_ENTRY buckets; /**< This is the data bucket(s) that the key indexes, which may be NULL */ - struct ANTLR3_INT_TRIE_NODE_struct * leftN; /**< Pointer to the left node from here when sKey & bitNum = 0 */ - struct ANTLR3_INT_TRIE_NODE_struct * rightN; /**< Pointer to the right node from here when sKey & bitNum, = 1 */ -} - ANTLR3_INT_TRIE_NODE, * pANTLR3_INT_TRIE_NODE; - -/** Structure that defines an ANTLR3_INT_TRIE. For this particular implementation, - * as you might expect, the key is turned into a "string" by looking at bit(key, depth) - * of the integer key. Using 64 bit keys gives us a depth limit of 64 (or bit 0..63) - * and potentially a huge trie. This is the algorithm for a Patricia Trie. - * Note also that this trie [can] accept multiple entries for the same key and is - * therefore a kind of elastic bucket patricia trie. - * - * If you find this code useful, please feel free to 'steal' it for any purpose - * as covered by the BSD license under which ANTLR is issued. You can cut the code - * but as the ANTLR library is only about 50K (Windows Vista), you might find it - * easier to just link the library. Please keep all comments and licenses and so on - * in any version of this you create of course. - * - * Jim Idle. - * - */ -typedef struct ANTLR3_INT_TRIE_struct -{ - pANTLR3_INT_TRIE_NODE root; /* Root node of this integer trie */ - pANTLR3_INT_TRIE_NODE current; /* Used to traverse the TRIE with the next() method */ - ANTLR3_UINT32 count; /* Current entry count */ - ANTLR3_BOOLEAN allowDups; /* Whether this trie accepts duplicate keys */ - - - pANTLR3_TRIE_ENTRY (*get) (struct ANTLR3_INT_TRIE_struct * trie, ANTLR3_INTKEY key); - ANTLR3_BOOLEAN (*del) (struct ANTLR3_INT_TRIE_struct * trie, ANTLR3_INTKEY key); - ANTLR3_BOOLEAN (*add) (struct ANTLR3_INT_TRIE_struct * trie, ANTLR3_INTKEY key, ANTLR3_UINT32 type, ANTLR3_INTKEY intVal, void * data, void (ANTLR3_CDECL *freeptr)(void *)); - void (*free) (struct ANTLR3_INT_TRIE_struct * trie); - -} - ANTLR3_INT_TRIE; - -/** - * A topological sort system that given a set of dependencies of a node m on node n, - * can sort them in dependency order. This is a generally useful utility object - * that does not care what the things are it is sorting. Generally the set - * to be sorted will be numeric indexes into some other structure such as an ANTLR3_VECTOR. - * I have provided a sort method that given ANTLR3_VECTOR as an input will sort - * the vector entries in place, as well as a sort method that just returns an - * array of the sorted noded indexes, in case you are not sorting ANTLR3_VECTORS but - * some set of your own device. - * - * Of the two main algorithms that could be used, I chose to use the depth first - * search for unvisited nodes as a) This runs in linear time, and b) it is what - * we used in the ANTLR Tool to perform a topological sort of the input grammar files - * based on their dependencies. - */ -typedef struct ANTLR3_TOPO_struct -{ - /** - * A vector of vectors of edges, built by calling the addEdge method() - * to indicate that node number n depends on node number m. Each entry in the vector - * contains a bitset, which has a bit index set for each node upon which the - * entry node depends. - */ - pANTLR3_BITSET * edges; - - /** - * A vector used to build up the sorted output order. Note that - * as the vector contains UINT32 then the maximum node index is - * 'limited' to 2^32, as nodes should be zero based. - */ - pANTLR3_UINT32 sorted; - - /** - * A vector used to detect cycles in the edge dependecies. It is used - * as a stack and each time we descend a node to one of its edges we - * add the node into this stack. If we find a node that we have already - * visited in the stack, then it means there wasa cycle such as 9->8->1->9 - * as the only way a node can be on the stack is if we are currently - * descnding from it as we remove it from the stack as we exit from - * descending its dependencies - */ - pANTLR3_UINT32 cycle; - - /** - * A flag that indicates the algorithm found a cycle in the edges - * such as 9->8->1->9 - * If this flag is set after you have called one of the sort routines - * then the detected cycle will be contained in the cycle array and - * cycleLimit will point to the one after the last entry in the cycle. - */ - ANTLR3_BOOLEAN hasCycle; - - /** - * A watermark used to accumulate potential cycles in the cycle array. - * This should be zero when we are done. Check hasCycle after calling one - * of the sort methods and if it is ANTLR3_TRUE then you can find the cycle - * in cycle[0]...cycle[cycleMark-1] - */ - ANTLR3_UINT32 cycleMark; - - /** - * One more than the largest node index that is contained in edges/sorted. - */ - ANTLR3_UINT32 limit; - - /** - * The set of visited nodes as determined by a set entry in - * the bitmap. - */ - pANTLR3_BITSET visited; - - /** - * A method that adds an edge from one node to another. An edge - * of n -> m indicates that node n is dependent on node m. Note that - * while building these edges, it is perfectly OK to add nodes out of - * sequence. So, if you have edges: - * - * 3 -> 0 - * 2 -> 1 - * 1 -> 3 - * - * The you can add them in that order and so add node 3 before nodes 2 and 1 - * - */ - void (*addEdge) (struct ANTLR3_TOPO_struct * topo, ANTLR3_UINT32 edge, ANTLR3_UINT32 dependency); - - - /** - * A method that returns a pointer to an array of sorted node indexes. - * The array is sorted in topological sorted order. Note that the array - * is only as large as the largest node index you created an edge for. This means - * that if you had an input of 32 nodes, but that largest node with an edge - * was 16, then the returned array will be the sorted order of the first 16 - * nodes and the last 16 nodes of your array are basically fine as they are - * as they had no dependencies and do not need any particular sort order. - * - * NB: If the structure that contains the array is freed, then the sorted - * array will be freed too so you should use the value of limit to - * make a long term copy of this array if you do not want to keep the topo - * structure around as well. - */ - pANTLR3_UINT32 (*sortToArray) (struct ANTLR3_TOPO_struct * topo); - - /** - * A method that sorts the supplied ANTLR3_VECTOR in place based - * on the previously supplied edge data. - */ - void (*sortVector) (struct ANTLR3_TOPO_struct * topo, pANTLR3_VECTOR v); - - /** - * A method to free this structure and any associated memory. - */ - void (*free) (struct ANTLR3_TOPO_struct * topo); -} - ANTLR3_TOPO; - -#ifdef __cplusplus -} -#endif - -#endif - - diff --git a/impl/antlr/libantlr3c-3.4/include/antlr3commontoken.h b/impl/antlr/libantlr3c-3.4/include/antlr3commontoken.h deleted file mode 100644 index c48068e..0000000 --- a/impl/antlr/libantlr3c-3.4/include/antlr3commontoken.h +++ /dev/null @@ -1,367 +0,0 @@ -/** \file - * \brief Defines the interface for a common token. - * - * All token streams should provide their tokens using an instance - * of this common token. A custom pointer is provided, wher you may attach - * a further structure to enhance the common token if you feel the need - * to do so. The C runtime will assume that a token provides implementations - * of the interface functions, but all of them may be rplaced by your own - * implementation if you require it. - */ -#ifndef _ANTLR3_COMMON_TOKEN_H -#define _ANTLR3_COMMON_TOKEN_H - -// [The "BSD licence"] -// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC -// http://www.temporal-wave.com -// http://www.linkedin.com/in/jimidle -// -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions -// are met: -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// 3. The name of the author may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include - -/** How many tokens to allocate at once in the token factory - */ -#define ANTLR3_FACTORY_POOL_SIZE 1024 - -/* Base token types, which all lexer/parser tokens come after in sequence. - */ - -/** Indicator of an invalid token - */ -#define ANTLR3_TOKEN_INVALID 0 - -#define ANTLR3_EOR_TOKEN_TYPE 1 - -/** Imaginary token type to cause a traversal of child nodes in a tree parser - */ -#define ANTLR3_TOKEN_DOWN 2 - -/** Imaginary token type to signal the end of a stream of child nodes. - */ -#define ANTLR3_TOKEN_UP 3 - -/** First token that can be used by users/generated code - */ - -#define ANTLR3_MIN_TOKEN_TYPE ANTLR3_TOKEN_UP + 1 - -/** End of file token - */ -#define ANTLR3_TOKEN_EOF (ANTLR3_CHARSTREAM_EOF & 0xFFFFFFFF) - -/** Default channel for a token - */ -#define ANTLR3_TOKEN_DEFAULT_CHANNEL 0 - -/** Reserved channel number for a HIDDEN token - a token that - * is hidden from the parser. - */ -#define HIDDEN 99 - -#ifdef __cplusplus -extern "C" { -#endif - -// Indicates whether this token is carrying: -// -// State | Meaning -// ------+-------------------------------------- -// 0 | Nothing (neither rewrite text, nor setText) -// 1 | char * to user supplied rewrite text -// 2 | pANTLR3_STRING because of setText or similar action -// -#define ANTLR3_TEXT_NONE 0 -#define ANTLR3_TEXT_CHARP 1 -#define ANTLR3_TEXT_STRING 2 - -/** The definition of an ANTLR3 common token structure, which all implementations - * of a token stream should provide, installing any further structures in the - * custom pointer element of this structure. - * - * \remark - * Token streams are in essence provided by lexers or other programs that serve - * as lexers. - */ -typedef struct ANTLR3_COMMON_TOKEN_struct -{ - /** The actual type of this token - */ - ANTLR3_UINT32 type; - - /** Indicates that a token was produced from the token factory and therefore - * the the freeToken() method should not do anything itself because - * token factory is responsible for deleting it. - */ - ANTLR3_BOOLEAN factoryMade; - - /// A string factory that we can use if we ever need the text of a token - /// and need to manufacture a pANTLR3_STRING - /// - pANTLR3_STRING_FACTORY strFactory; - - /** The line number in the input stream where this token was derived from - */ - ANTLR3_UINT32 line; - - /** The offset into the input stream that the line in which this - * token resides starts. - */ - void * lineStart; - - /** The character position in the line that this token was derived from - */ - ANTLR3_INT32 charPosition; - - /** The virtual channel that this token exists in. - */ - ANTLR3_UINT32 channel; - - /** Pointer to the input stream that this token originated in. - */ - pANTLR3_INPUT_STREAM input; - - /** What the index of this token is, 0, 1, .., n-2, n-1 tokens - */ - ANTLR3_MARKER index; - - /** The character offset in the input stream where the text for this token - * starts. - */ - ANTLR3_MARKER start; - - /** The character offset in the input stream where the text for this token - * stops. - */ - ANTLR3_MARKER stop; - - /// Indicates whether this token is carrying: - /// - /// State | Meaning - /// ------+-------------------------------------- - /// 0 | Nothing (neither rewrite text, nor setText) - /// 1 | char * to user supplied rewrite text - /// 2 | pANTLR3_STRING because of setText or similar action - /// - /// Affects the union structure tokText below - /// (uses 32 bit so alignment is always good) - /// - ANTLR3_UINT32 textState; - - union - { - /// Pointer that is used when the token just has a pointer to - /// a char *, such as when a rewrite of an imaginary token supplies - /// a string in the grammar. No sense in constructing a pANTLR3_STRING just - /// for that, as mostly the text will not be accessed - if it is, then - /// we will build a pANTLR3_STRING for it a that point. - /// - pANTLR3_UCHAR chars; - - /// Some token types actually do carry around their associated text, hence - /// (*getText)() will return this pointer if it is not NULL - /// - pANTLR3_STRING text; - } - tokText; - - /** Because it is a bit more of a hassle to override an ANTLR3_COMMON_TOKEN - * as the standard structure for a token, a number of user programmable - * elements are allowed in a token. This is one of them. - */ - ANTLR3_UINT32 user1; - - /** Because it is a bit more of a hassle to override an ANTLR3_COMMON_TOKEN - * as the standard structure for a token, a number of user programmable - * elements are allowed in a token. This is one of them. - */ - ANTLR3_UINT32 user2; - - /** Because it is a bit more of a hassle to override an ANTLR3_COMMON_TOKEN - * as the standard structure for a token, a number of user programmable - * elements are allowed in a token. This is one of them. - */ - ANTLR3_UINT32 user3; - - /** Pointer to a custom element that the ANTLR3 programmer may define and install - */ - void * custom; - - /** Pointer to a function that knows how to free the custom structure when the - * token is destroyed. - */ - void (*freeCustom)(void * custom); - - /* ============================== - * API - */ - - /** Pointer to function that returns the text pointer of a token, use - * toString() if you want a pANTLR3_STRING version of the token. - */ - pANTLR3_STRING (*getText)(struct ANTLR3_COMMON_TOKEN_struct * token); - - /** Pointer to a function that 'might' be able to set the text associated - * with a token. Imaginary tokens such as an ANTLR3_CLASSIC_TOKEN may actually - * do this, however many tokens such as ANTLR3_COMMON_TOKEN do not actaully have - * strings associated with them but just point into the current input stream. These - * tokens will implement this function with a function that errors out (probably - * drastically. - */ - void (*setText)(struct ANTLR3_COMMON_TOKEN_struct * token, pANTLR3_STRING text); - - /** Pointer to a function that 'might' be able to set the text associated - * with a token. Imaginary tokens such as an ANTLR3_CLASSIC_TOKEN may actually - * do this, however many tokens such as ANTLR3_COMMON_TOKEN do not actully have - * strings associated with them but just point into the current input stream. These - * tokens will implement this function with a function that errors out (probably - * drastically. - */ - void (*setText8)(struct ANTLR3_COMMON_TOKEN_struct * token, pANTLR3_UINT8 text); - - /** Pointer to a function that returns the token type of this token - */ - ANTLR3_UINT32 (*getType)(struct ANTLR3_COMMON_TOKEN_struct * token); - - /** Pointer to a function that sets the type of this token - */ - void (*setType)(struct ANTLR3_COMMON_TOKEN_struct * token, ANTLR3_UINT32 ttype); - - /** Pointer to a function that gets the 'line' number where this token resides - */ - ANTLR3_UINT32 (*getLine)(struct ANTLR3_COMMON_TOKEN_struct * token); - - /** Pointer to a function that sets the 'line' number where this token reside - */ - void (*setLine)(struct ANTLR3_COMMON_TOKEN_struct * token, ANTLR3_UINT32 line); - - /** Pointer to a function that gets the offset in the line where this token exists - */ - ANTLR3_INT32 (*getCharPositionInLine) (struct ANTLR3_COMMON_TOKEN_struct * token); - - /** Pointer to a function that sets the offset in the line where this token exists - */ - void (*setCharPositionInLine) (struct ANTLR3_COMMON_TOKEN_struct * token, ANTLR3_INT32 pos); - - /** Pointer to a function that gets the channel that this token was placed in (parsers - * can 'tune' to these channels. - */ - ANTLR3_UINT32 (*getChannel) (struct ANTLR3_COMMON_TOKEN_struct * token); - - /** Pointer to a function that sets the channel that this token should belong to - */ - void (*setChannel) (struct ANTLR3_COMMON_TOKEN_struct * token, ANTLR3_UINT32 channel); - - /** Pointer to a function that returns an index 0...n-1 of the token in the token - * input stream. - */ - ANTLR3_MARKER (*getTokenIndex) (struct ANTLR3_COMMON_TOKEN_struct * token); - - /** Pointer to a function that can set the token index of this token in the token - * input stream. - */ - void (*setTokenIndex) (struct ANTLR3_COMMON_TOKEN_struct * token, ANTLR3_MARKER); - - /** Pointer to a function that gets the start index in the input stream for this token. - */ - ANTLR3_MARKER (*getStartIndex) (struct ANTLR3_COMMON_TOKEN_struct * token); - - /** Pointer to a function that sets the start index in the input stream for this token. - */ - void (*setStartIndex) (struct ANTLR3_COMMON_TOKEN_struct * token, ANTLR3_MARKER index); - - /** Pointer to a function that gets the stop index in the input stream for this token. - */ - ANTLR3_MARKER (*getStopIndex) (struct ANTLR3_COMMON_TOKEN_struct * token); - - /** Pointer to a function that sets the stop index in the input stream for this token. - */ - void (*setStopIndex) (struct ANTLR3_COMMON_TOKEN_struct * token, ANTLR3_MARKER index); - - /** Pointer to a function that returns this token as a text representation that can be - * printed with embedded control codes such as \n replaced with the printable sequence "\\n" - * This also yields a string structure that can be used more easily than the pointer to - * the input stream in certain situations. - */ - pANTLR3_STRING (*toString) (struct ANTLR3_COMMON_TOKEN_struct * token); -} - ANTLR3_COMMON_TOKEN; - -/** \brief ANTLR3 Token factory interface to create lots of tokens efficiently - * rather than creating and freeing lots of little bits of memory. - */ -typedef struct ANTLR3_TOKEN_FACTORY_struct -{ - /** Pointers to the array of tokens that this factory has produced so far - */ - pANTLR3_COMMON_TOKEN *pools; - - /** Current pool tokens we are allocating from - */ - ANTLR3_INT32 thisPool; - - /** Maximum pool count we have available - */ - ANTLR3_INT32 maxPool; - - /** The next token to throw out from the pool, will cause a new pool allocation - * if this exceeds the available tokenCount - */ - ANTLR3_UINT32 nextToken; - - /** Trick to initialize tokens and their API quickly, we set up this token when the - * factory is created, then just copy the memory it uses into the new token. - */ - ANTLR3_COMMON_TOKEN unTruc; - - /** Pointer to an input stream that is using this token factory (may be NULL) - * which will be assigned to the tokens automatically. - */ - pANTLR3_INPUT_STREAM input; - - /** Pointer to a function that returns a new token - */ - pANTLR3_COMMON_TOKEN (*newToken) (struct ANTLR3_TOKEN_FACTORY_struct * factory); - - /** Pointer to a function that resets the factory so you can reuse the pools it - * has laready allocated - */ - void (*reset) (struct ANTLR3_TOKEN_FACTORY_struct * factory); - - /** Pointer to a function that changes teh curent inptu stream so that - * new tokens are created with reference to their originating text. - */ - void (*setInputStream) (struct ANTLR3_TOKEN_FACTORY_struct * factory, pANTLR3_INPUT_STREAM input); - /** Pointer to a function the destroys the factory - */ - void (*close) (struct ANTLR3_TOKEN_FACTORY_struct * factory); -} - ANTLR3_TOKEN_FACTORY; - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/impl/antlr/libantlr3c-3.4/include/antlr3commontree.h b/impl/antlr/libantlr3c-3.4/include/antlr3commontree.h deleted file mode 100644 index 1516ecc..0000000 --- a/impl/antlr/libantlr3c-3.4/include/antlr3commontree.h +++ /dev/null @@ -1,167 +0,0 @@ -/** Interface for an ANTLR3 common tree which is what gets - * passed around by the AST producing parser. - */ - -#ifndef _ANTLR3_COMMON_TREE_H -#define _ANTLR3_COMMON_TREE_H - -// [The "BSD licence"] -// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC -// http://www.temporal-wave.com -// http://www.linkedin.com/in/jimidle -// -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions -// are met: -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// 3. The name of the author may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct ANTLR3_COMMON_TREE_struct -{ - - /// Not used by ANTLR, but if a super structure is created above - /// this structure, it can be used to point to the start of the super - /// structure, where additional data and function pointers can be stored. - /// - void * super; - - /// Start token index that encases this tree - /// - ANTLR3_MARKER startIndex; - - /// End token that encases this tree - /// - ANTLR3_MARKER stopIndex; - - /// A single token, this is the payload for the tree - /// - pANTLR3_COMMON_TOKEN token; - - /// Points to the node that has this node as a child. - /// If this is NULL, then this is the root node. - /// - pANTLR3_COMMON_TREE parent; - - /// What index is this particular node in the child list it - /// belongs to? - /// - ANTLR3_INT32 childIndex; - - /// Pointer to the tree factory that manufactured this - /// token. This can be used by duplication methods and so on - /// to manufacture another auto-tracked common tree structure - /// - pANTLR3_ARBORETUM factory; - - /// An encapsulated BASE TREE structure (NOT a pointer) - /// that performs a lot of the dirty work of node management - /// To this we add just a few functions that are specific to the - /// payload. You can further abstract common tree so long - /// as you always have a baseTree pointer in the top structure - /// and copy it from the next one down. - /// So, lets say we have a structure JIMS_TREE. - /// It needs an ANTLR3_BASE_TREE that will support all the - /// general tree duplication stuff. - /// It needs a ANTLR3_COMMON_TREE structure embedded or completely - /// provides the equivalent interface. - /// It provides it's own methods and data. - /// To create a new one of these, the function provided to - /// the tree adaptor (see comments there) should allocate the - /// memory for a new JIMS_TREE structure, then call - /// antlr3InitCommonTree() - /// antlr3BaseTreeNew() - /// The interfaces for BASE_TREE and COMMON_TREE will then - /// be initialized. You then call and you can override them or just init - /// JIMS_TREE (note that the base tree in common tree will be ignored) - /// just the top level base tree is used). Codegen will take care of the rest. - /// - ANTLR3_BASE_TREE baseTree; - -} - ANTLR3_COMMON_TREE; - -/// \brief ANTLR3 Tree factory interface to create lots of trees efficiently -/// rather than creating and freeing lots of little bits of memory. -/// -typedef struct ANTLR3_ARBORETUM_struct -{ - /// Pointers to the array of tokens that this factory has produced so far - /// - pANTLR3_COMMON_TREE *pools; - - /// Current pool tokens we are allocating from - /// - ANTLR3_INT32 thisPool; - - /// The next token to throw out from the pool, will cause a new pool allocation - /// if this exceeds the available tokenCount - /// - ANTLR3_UINT32 nextTree; - - /// Trick to initialize tokens and their API quickly, we set up this token when the - /// factory is created, then just copy the memory it uses into the new token. - /// - ANTLR3_COMMON_TREE unTruc; - - /// Pointer to a vector factory that is used to create child list vectors - /// for any child nodes that need them. This means that we auto track the - /// vectors and auto free them when we close the factory. It also means - /// that all rewriting trees can use the same tree factory and the same - /// vector factory and we do not dup any nodes unless we must do so - /// explicitly because of context such as an empty rewrite stream and - /// ->IMAGINARY[ID] so on. This makes memory tracking much simpler and - /// tempts no errors. - /// - pANTLR3_VECTOR_FACTORY vFactory; - - /// A resuse stack for reclaiming Nil nodes that were used in rewrites - /// and are now dead. The nilNode() method will eat one of these before - /// creating a new node. - /// - pANTLR3_STACK nilStack; - - /// Pointer to a function that returns a new tree - /// - pANTLR3_BASE_TREE (*newTree) (struct ANTLR3_ARBORETUM_struct * factory); - pANTLR3_BASE_TREE (*newFromTree) (struct ANTLR3_ARBORETUM_struct * factory, pANTLR3_COMMON_TREE tree); - pANTLR3_BASE_TREE (*newFromToken) (struct ANTLR3_ARBORETUM_struct * factory, pANTLR3_COMMON_TOKEN token); - - /// Pointer to a function the destroys the factory - /// - void (*close) (struct ANTLR3_ARBORETUM_struct * factory); -} - ANTLR3_ARBORETUM; - -#ifdef __cplusplus -} -#endif - -#endif - - diff --git a/impl/antlr/libantlr3c-3.4/include/antlr3commontreeadaptor.h b/impl/antlr/libantlr3c-3.4/include/antlr3commontreeadaptor.h deleted file mode 100644 index 4827997..0000000 --- a/impl/antlr/libantlr3c-3.4/include/antlr3commontreeadaptor.h +++ /dev/null @@ -1,70 +0,0 @@ -/** \file - * Definition of the ANTLR3 common tree adaptor. - */ - -#ifndef _ANTLR3_COMMON_TREE_ADAPTOR_H -#define _ANTLR3_COMMON_TREE_ADAPTOR_H - -// [The "BSD licence"] -// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC -// http://www.temporal-wave.com -// http://www.linkedin.com/in/jimidle -// -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions -// are met: -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// 3. The name of the author may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include -#include -#include -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct ANTLR3_COMMON_TREE_ADAPTOR_struct -{ - /** Any enclosing structure/class can use this pointer to point to its own interface. - */ - void * super; - - /** Base interface implementation, embedded structure - */ - ANTLR3_TREE_ADAPTOR baseAdaptor; - - /** Tree factory for producing new nodes as required without needing to track - * memory allocation per node. - */ - pANTLR3_ARBORETUM arboretum; - -} - ANTLR3_COMMON_TREE_ADAPTOR; - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/impl/antlr/libantlr3c-3.4/include/antlr3commontreenodestream.h b/impl/antlr/libantlr3c-3.4/include/antlr3commontreenodestream.h deleted file mode 100644 index beb0534..0000000 --- a/impl/antlr/libantlr3c-3.4/include/antlr3commontreenodestream.h +++ /dev/null @@ -1,336 +0,0 @@ -/// \file -/// Definition of the ANTLR3 common tree node stream. -/// - -#ifndef _ANTLR3_COMMON_TREE_NODE_STREAM__H -#define _ANTLR3_COMMON_TREE_NODE_STREAM__H - -// [The "BSD licence"] -// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC -// http://www.temporal-wave.com -// http://www.linkedin.com/in/jimidle -// -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions -// are met: -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// 3. The name of the author may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include -#include -#include -#include -#include -#include - -/// Token buffer initial size settings ( will auto increase) -/// -#define DEFAULT_INITIAL_BUFFER_SIZE 100 -#define INITIAL_CALL_STACK_SIZE 10 - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct ANTLR3_TREE_NODE_STREAM_struct -{ - /// Any interface that implements this interface (is a - /// super structure containing this structure), may store the pointer - /// to itself here in the super pointer, which is not used by - /// the tree node stream. This will point to an implementation - /// of ANTLR3_COMMON_TREE_NODE_STREAM in this case. - /// - pANTLR3_COMMON_TREE_NODE_STREAM ctns; - - /// All input streams implement the ANTLR3_INT_STREAM interface... - /// - pANTLR3_INT_STREAM istream; - - /// Get tree node at current input pointer + i ahead where i=1 is next node. - /// i<0 indicates nodes in the past. So LT(-1) is previous node, but - /// implementations are not required to provide results for k < -1. - /// LT(0) is undefined. For i>=n, return null. - /// Return NULL for LT(0) and any index that results in an absolute address - /// that is negative (beyond the start of the list). - /// - /// This is analogous to the LT() method of the TokenStream, but this - /// returns a tree node instead of a token. Makes code gen identical - /// for both parser and tree grammars. :) - /// - pANTLR3_BASE_TREE (*_LT) (struct ANTLR3_TREE_NODE_STREAM_struct * tns, ANTLR3_INT32 k); - - /// Where is this stream pulling nodes from? This is not the name, but - /// the object that provides node objects. - /// - pANTLR3_BASE_TREE (*getTreeSource) (struct ANTLR3_TREE_NODE_STREAM_struct * tns); - - /// What adaptor can tell me how to interpret/navigate nodes and - /// trees. E.g., get text of a node. - /// - pANTLR3_BASE_TREE_ADAPTOR (*getTreeAdaptor) (struct ANTLR3_TREE_NODE_STREAM_struct * tns); - - /// As we flatten the tree, we use UP, DOWN nodes to represent - /// the tree structure. When debugging we need unique nodes - /// so we have to instantiate new ones. When doing normal tree - /// parsing, it's slow and a waste of memory to create unique - /// navigation nodes. Default should be false; - /// - void (*setUniqueNavigationNodes) (struct ANTLR3_TREE_NODE_STREAM_struct * tns, ANTLR3_BOOLEAN uniqueNavigationNodes); - - pANTLR3_STRING (*toString) (struct ANTLR3_TREE_NODE_STREAM_struct * tns); - - /// Return the text of all nodes from start to stop, inclusive. - /// If the stream does not buffer all the nodes then it can still - /// walk recursively from start until stop. You can always return - /// null or "" too, but users should not access $ruleLabel.text in - /// an action of course in that case. - /// - pANTLR3_STRING (*toStringSS) (struct ANTLR3_TREE_NODE_STREAM_struct * tns, pANTLR3_BASE_TREE start, pANTLR3_BASE_TREE stop); - - /// Return the text of all nodes from start to stop, inclusive, into the - /// supplied buffer. - /// If the stream does not buffer all the nodes then it can still - /// walk recursively from start until stop. You can always return - /// null or "" too, but users should not access $ruleLabel.text in - /// an action of course in that case. - /// - void (*toStringWork) (struct ANTLR3_TREE_NODE_STREAM_struct * tns, pANTLR3_BASE_TREE start, pANTLR3_BASE_TREE stop, pANTLR3_STRING buf); - - /// Release up any and all space the the interface allocate, including for this structure. - /// - void (*free) (struct ANTLR3_TREE_NODE_STREAM_struct * tns); - - /// Get a tree node at an absolute index i; 0..n-1. - /// If you don't want to buffer up nodes, then this method makes no - /// sense for you. - /// - pANTLR3_BASE_TREE (*get) (struct ANTLR3_TREE_NODE_STREAM_struct * tns, ANTLR3_INT32 i); - - // REWRITING TREES (used by tree parser) - - /// Replace from start to stop child index of parent with t, which might - /// be a list. Number of children may be different - /// after this call. The stream is notified because it is walking the - /// tree and might need to know you are monkeying with the underlying - /// tree. Also, it might be able to modify the node stream to avoid - /// restreaming for future phases. - /// - /// If parent is null, don't do anything; must be at root of overall tree. - /// Can't replace whatever points to the parent externally. Do nothing. - /// - void (*replaceChildren) (struct ANTLR3_TREE_NODE_STREAM_struct * tns, pANTLR3_BASE_TREE parent, ANTLR3_INT32 startChildIndex, ANTLR3_INT32 stopChildIndex, pANTLR3_BASE_TREE t); - -} - ANTLR3_TREE_NODE_STREAM; - -typedef struct ANTLR3_COMMON_TREE_NODE_STREAM_struct -{ - /// Any interface that implements this interface (is a - /// super structure containing this structure), may store the pointer - /// to itself here in the super pointer, which is not used by - /// the common tree node stream. - /// - void * super; - - /// Pointer to the tree node stream interface - /// - pANTLR3_TREE_NODE_STREAM tnstream; - - /// String factory for use by anything that wishes to create strings - /// such as a tree representation or some copy of the text etc. - /// - pANTLR3_STRING_FACTORY stringFactory; - - /// Dummy tree node that indicates a descent into a child - /// tree. Initialized by a call to create a new interface. - /// - ANTLR3_COMMON_TREE DOWN; - - /// Dummy tree node that indicates a descent up to a parent - /// tree. Initialized by a call to create a new interface. - /// - ANTLR3_COMMON_TREE UP; - - /// Dummy tree node that indicates the termination point of the - /// tree. Initialized by a call to create a new interface. - /// - ANTLR3_COMMON_TREE EOF_NODE; - - /// Dummy node that is returned if we need to indicate an invalid node - /// for any reason. - /// - ANTLR3_COMMON_TREE INVALID_NODE; - - /// The complete mapping from stream index to tree node. - /// This buffer includes pointers to DOWN, UP, and EOF nodes. - /// It is built upon ctor invocation. The elements are type - /// Object as we don't what the trees look like. - /// - /// Load upon first need of the buffer so we can set token types - /// of interest for reverseIndexing. Slows us down a wee bit to - /// do all of the if p==-1 testing everywhere though, though in C - /// you won't really be able to measure this. - /// - /// Must be freed when the tree node stream is torn down. - /// - pANTLR3_VECTOR nodes; - - /// If set to ANTLR3_TRUE then the navigation nodes UP, DOWN are - /// duplicated rather than reused within the tree. - /// - ANTLR3_BOOLEAN uniqueNavigationNodes; - - /// Which tree are we navigating ? - /// - pANTLR3_BASE_TREE root; - - /// Pointer to tree adaptor interface that manipulates/builds - /// the tree. - /// - pANTLR3_BASE_TREE_ADAPTOR adaptor; - - /// As we walk down the nodes, we must track parent nodes so we know - /// where to go after walking the last child of a node. When visiting - /// a child, push current node and current index (current index - /// is first stored in the tree node structure to avoid two stacks. - /// - pANTLR3_STACK nodeStack; - - /// The current index into the nodes vector of the current tree - /// we are parsing and possibly rewriting. - /// - ANTLR3_INT32 p; - - /// Which node are we currently visiting? - /// - pANTLR3_BASE_TREE currentNode; - - /// Which node did we last visit? Used for LT(-1) - /// - pANTLR3_BASE_TREE previousNode; - - /// Which child are we currently visiting? If -1 we have not visited - /// this node yet; next consume() request will set currentIndex to 0. - /// - ANTLR3_INT32 currentChildIndex; - - /// What node index did we just consume? i=0..n-1 for n node trees. - /// IntStream.next is hence 1 + this value. Size will be same. - /// - ANTLR3_MARKER absoluteNodeIndex; - - /// Buffer tree node stream for use with LT(i). This list grows - /// to fit new lookahead depths, but consume() wraps like a circular - /// buffer. - /// - pANTLR3_BASE_TREE * lookAhead; - - /// Number of elements available in the lookahead buffer at any point in - /// time. This is the current size of the array. - /// - ANTLR3_UINT32 lookAheadLength; - - /// lookAhead[head] is the first symbol of lookahead, LT(1). - /// - ANTLR3_UINT32 head; - - /// Add new lookahead at lookahead[tail]. tail wraps around at the - /// end of the lookahead buffer so tail could be less than head. - /// - ANTLR3_UINT32 tail; - - /// Calls to mark() may be nested so we have to track a stack of - /// them. The marker is an index into this stack. Index 0 is - /// the first marker. This is a List - /// - pANTLR3_VECTOR markers; - - // INTERFACE - // - void (*fill) (struct ANTLR3_COMMON_TREE_NODE_STREAM_struct * ctns, ANTLR3_INT32 k); - - void (*addLookahead) (struct ANTLR3_COMMON_TREE_NODE_STREAM_struct * ctns, pANTLR3_BASE_TREE node); - - ANTLR3_BOOLEAN (*hasNext) (struct ANTLR3_COMMON_TREE_NODE_STREAM_struct * ctns); - - pANTLR3_BASE_TREE (*next) (struct ANTLR3_COMMON_TREE_NODE_STREAM_struct * ctns); - - pANTLR3_BASE_TREE (*handleRootnode) (struct ANTLR3_COMMON_TREE_NODE_STREAM_struct * ctns); - - pANTLR3_BASE_TREE (*visitChild) (struct ANTLR3_COMMON_TREE_NODE_STREAM_struct * ctns, ANTLR3_UINT32 child); - - void (*addNavigationNode) (struct ANTLR3_COMMON_TREE_NODE_STREAM_struct * ctns, ANTLR3_UINT32 ttype); - - pANTLR3_BASE_TREE (*newDownNode) (struct ANTLR3_COMMON_TREE_NODE_STREAM_struct * ctns); - - pANTLR3_BASE_TREE (*newUpNode) (struct ANTLR3_COMMON_TREE_NODE_STREAM_struct * ctns); - - void (*walkBackToMostRecentNodeWithUnvisitedChildren) - (struct ANTLR3_COMMON_TREE_NODE_STREAM_struct * ctns); - - ANTLR3_BOOLEAN (*hasUniqueNavigationNodes) (struct ANTLR3_COMMON_TREE_NODE_STREAM_struct * ctns); - - ANTLR3_UINT32 (*getLookaheadSize) (struct ANTLR3_COMMON_TREE_NODE_STREAM_struct * ctns); - - void (*push) (struct ANTLR3_COMMON_TREE_NODE_STREAM_struct * ctns, ANTLR3_INT32 index); - - ANTLR3_INT32 (*pop) (struct ANTLR3_COMMON_TREE_NODE_STREAM_struct * ctns); - - void (*reset) (struct ANTLR3_COMMON_TREE_NODE_STREAM_struct * ctns); - - void (*free) (struct ANTLR3_COMMON_TREE_NODE_STREAM_struct * ctns); - - /// Indicates whether this node stream was derived from a prior - /// node stream to be used by a rewriting tree parser for instance. - /// If this flag is set to ANTLR3_TRUE, then when this stream is - /// closed it will not free the root tree as this tree always - /// belongs to the origniating node stream. - /// - ANTLR3_BOOLEAN isRewriter; - -} - ANTLR3_COMMON_TREE_NODE_STREAM; - -/** This structure is used to save the state information in the treenodestream - * when walking ahead with cyclic DFA or for syntactic predicates, - * we need to record the state of the tree node stream. This - * class wraps up the current state of the CommonTreeNodeStream. - * Calling mark() will push another of these on the markers stack. - */ -typedef struct ANTLR3_TREE_WALK_STATE_struct -{ - ANTLR3_UINT32 currentChildIndex; - ANTLR3_MARKER absoluteNodeIndex; - pANTLR3_BASE_TREE currentNode; - pANTLR3_BASE_TREE previousNode; - ANTLR3_UINT32 nodeStackSize; - pANTLR3_BASE_TREE * lookAhead; - ANTLR3_UINT32 lookAheadLength; - ANTLR3_UINT32 tail; - ANTLR3_UINT32 head; -} - ANTLR3_TREE_WALK_STATE; - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/impl/antlr/libantlr3c-3.4/include/antlr3convertutf.h b/impl/antlr/libantlr3c-3.4/include/antlr3convertutf.h deleted file mode 100644 index 79cc82c..0000000 --- a/impl/antlr/libantlr3c-3.4/include/antlr3convertutf.h +++ /dev/null @@ -1,176 +0,0 @@ -/* - * Copyright 2001-2004 Unicode, Inc. - * - * Disclaimer - * - * This source code is provided as is by Unicode, Inc. No claims are - * made as to fitness for any particular purpose. No warranties of any - * kind are expressed or implied. The recipient agrees to determine - * applicability of information provided. If this file has been - * purchased on magnetic or optical media from Unicode, Inc., the - * sole remedy for any claim will be exchange of defective media - * within 90 days of receipt. - * - * Limitations on Rights to Redistribute This Code - * - * Unicode, Inc. hereby grants the right to freely use the information - * supplied in this file in the creation of products supporting the - * Unicode Standard, and to make copies of this file in any form - * for internal or external distribution as long as this notice - * remains attached. - */ - -/* --------------------------------------------------------------------- - - Conversions between UTF32, UTF-16, and UTF-8. Header file. - - Several functions are included here, forming a complete set of - conversions between the three formats. UTF-7 is not included - here, but is handled in a separate source file. - - Each of these routines takes pointers to input buffers and output - buffers. The input buffers are const. - - Each routine converts the text between *sourceStart and sourceEnd, - putting the result into the buffer between *targetStart and - targetEnd. Note: the end pointers are *after* the last item: e.g. - *(sourceEnd - 1) is the last item. - - The return result indicates whether the conversion was successful, - and if not, whether the problem was in the source or target buffers. - (Only the first encountered problem is indicated.) - - After the conversion, *sourceStart and *targetStart are both - updated to point to the end of last text successfully converted in - the respective buffers. - - Input parameters: - sourceStart - pointer to a pointer to the source buffer. - The contents of this are modified on return so that - it points at the next thing to be converted. - targetStart - similarly, pointer to pointer to the target buffer. - sourceEnd, targetEnd - respectively pointers to the ends of the - two buffers, for overflow checking only. - - These conversion functions take a ConversionFlags argument. When this - flag is set to strict, both irregular sequences and isolated surrogates - will cause an error. When the flag is set to lenient, both irregular - sequences and isolated surrogates are converted. - - Whether the flag is strict or lenient, all illegal sequences will cause - an error return. This includes sequences such as: , , - or in UTF-8, and values above 0x10FFFF in UTF-32. Conformant code - must check for illegal sequences. - - When the flag is set to lenient, characters over 0x10FFFF are converted - to the replacement character; otherwise (when the flag is set to strict) - they constitute an error. - - Output parameters: - The value "sourceIllegal" is returned from some routines if the input - sequence is malformed. When "sourceIllegal" is returned, the source - value will point to the illegal value that caused the problem. E.g., - in UTF-8 when a sequence is malformed, it points to the start of the - malformed sequence. - - Author: Mark E. Davis, 1994. - Rev History: Rick McGowan, fixes & updates May 2001. - Fixes & updates, Sept 2001. - ------------------------------------------------------------------------- */ - -/* --------------------------------------------------------------------- - The following 4 definitions are compiler-specific. - The C standard does not guarantee that wchar_t has at least - 16 bits, so wchar_t is no less portable than unsigned short! - All should be unsigned values to avoid sign extension during - bit mask & shift operations. ------------------------------------------------------------------------- */ - - -// Changes for ANTLR3 - Jim Idle, January 2008. -// builtin types defined for Unicode types changed to -// aliases for the types that are system determined by -// ANTLR at compile time. -// -// typedef unsigned long UTF32; /* at least 32 bits */ -// typedef unsigned short UTF16; /* at least 16 bits */ -// typedef unsigned char UTF8; /* typically 8 bits */ -// typedef unsigned char Boolean; /* 0 or 1 */ - -#ifndef _ANTLR3_CONVERTUTF_H -#define _ANTLR3_CONVERTUTF_H - -#include - -typedef ANTLR3_UINT32 UTF32; /* at least 32 bits */ -typedef ANTLR3_UINT16 UTF16; /* at least 16 bits */ -typedef ANTLR3_UINT8 UTF8; /* typically 8 bits */ - -/* Some fundamental constants */ -#define UNI_REPLACEMENT_CHAR (UTF32)0x0000FFFD -#define UNI_MAX_BMP (UTF32)0x0000FFFF -#define UNI_MAX_UTF16 (UTF32)0x0010FFFF -#define UNI_MAX_UTF32 (UTF32)0x7FFFFFFF -#define UNI_MAX_LEGAL_UTF32 (UTF32)0x0010FFFF - -#define UNI_SUR_HIGH_START (UTF32)0xD800 -#define UNI_SUR_HIGH_END (UTF32)0xDBFF -#define UNI_SUR_LOW_START (UTF32)0xDC00 -#define UNI_SUR_LOW_END (UTF32)0xDFFF -#define false ANTLR3_FALSE -#define true ANTLR3_TRUE -#define halfShift ((UTF32)10) -#define halfBase ((UTF32)0x0010000UL) -#define halfMask ((UTF32)0x3FFUL) - -typedef enum { - conversionOK, /* conversion successful */ - sourceExhausted, /* partial character in source, but hit end */ - targetExhausted, /* insuff. room in target for conversion */ - sourceIllegal /* source sequence is illegal/malformed */ -} ConversionResult; - -typedef enum { - strictConversion = 0, - lenientConversion -} ConversionFlags; - -/* This is for C++ and does no harm in C */ -#ifdef __cplusplus -extern "C" { -#endif - -ConversionResult ConvertUTF8toUTF16 ( - const UTF8** sourceStart, const UTF8* sourceEnd, - UTF16** targetStart, UTF16* targetEnd, ConversionFlags flags); - -ConversionResult ConvertUTF16toUTF8 ( - const UTF16** sourceStart, const UTF16* sourceEnd, - UTF8** targetStart, UTF8* targetEnd, ConversionFlags flags); - -ConversionResult ConvertUTF8toUTF32 ( - const UTF8** sourceStart, const UTF8* sourceEnd, - UTF32** targetStart, UTF32* targetEnd, ConversionFlags flags); - -ConversionResult ConvertUTF32toUTF8 ( - const UTF32** sourceStart, const UTF32* sourceEnd, - UTF8** targetStart, UTF8* targetEnd, ConversionFlags flags); - -ConversionResult ConvertUTF16toUTF32 ( - const UTF16** sourceStart, const UTF16* sourceEnd, - UTF32** targetStart, UTF32* targetEnd, ConversionFlags flags); - -ConversionResult ConvertUTF32toUTF16 ( - const UTF32** sourceStart, const UTF32* sourceEnd, - UTF16** targetStart, UTF16* targetEnd, ConversionFlags flags); - -ANTLR3_BOOLEAN isLegalUTF8Sequence(const UTF8 *source, const UTF8 *sourceEnd); - -#ifdef __cplusplus -} -#endif - -#endif - -/* --------------------------------------------------------------------- */ diff --git a/impl/antlr/libantlr3c-3.4/include/antlr3cyclicdfa.h b/impl/antlr/libantlr3c-3.4/include/antlr3cyclicdfa.h deleted file mode 100644 index 78708a0..0000000 --- a/impl/antlr/libantlr3c-3.4/include/antlr3cyclicdfa.h +++ /dev/null @@ -1,97 +0,0 @@ -/// Definition of a cyclic dfa structure such that it can be -/// initialized at compile time and have only a single -/// runtime function that can deal with all cyclic dfa -/// structures and show Java how it is done ;-) -/// -#ifndef ANTLR3_CYCLICDFA_H -#define ANTLR3_CYCLICDFA_H - -// [The "BSD licence"] -// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC -// http://www.temporal-wave.com -// http://www.linkedin.com/in/jimidle -// -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions -// are met: -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// 3. The name of the author may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include -#include - -#ifdef __cplusplus -extern "C" { - -// If this header file is included as part of a generated recognizer that -// is being compiled as if it were C++, and this is Windows, then the const elements -// of the structure cause the C++ compiler to (rightly) point out that -// there can be no instantiation of the structure because it needs a constructor -// that can initialize the data, however these structures are not -// useful for C++ as they are pre-generated and static in the recognizer. -// So, we turn off those warnings, which are only at /W4 anyway. -// -#ifdef ANTLR3_WINDOWS -#pragma warning (push) -#pragma warning (disable : 4510) -#pragma warning (disable : 4512) -#pragma warning (disable : 4610) -#endif -#endif - -typedef struct ANTLR3_CYCLIC_DFA_struct -{ - /// Decision number that a particular static structure - /// represents. - /// - const ANTLR3_INT32 decisionNumber; - - /// What this decision represents - /// - const pANTLR3_UCHAR description; - - ANTLR3_INT32 (*specialStateTransition) (void * ctx, pANTLR3_BASE_RECOGNIZER recognizer, pANTLR3_INT_STREAM is, struct ANTLR3_CYCLIC_DFA_struct * dfa, ANTLR3_INT32 s); - - ANTLR3_INT32 (*specialTransition) (void * ctx, pANTLR3_BASE_RECOGNIZER recognizer, pANTLR3_INT_STREAM is, struct ANTLR3_CYCLIC_DFA_struct * dfa, ANTLR3_INT32 s); - - ANTLR3_INT32 (*predict) (void * ctx, pANTLR3_BASE_RECOGNIZER recognizer, pANTLR3_INT_STREAM is, struct ANTLR3_CYCLIC_DFA_struct * dfa); - - const ANTLR3_INT32 * const eot; - const ANTLR3_INT32 * const eof; - const ANTLR3_INT32 * const min; - const ANTLR3_INT32 * const max; - const ANTLR3_INT32 * const accept; - const ANTLR3_INT32 * const special; - const ANTLR3_INT32 * const * const transition; - -} - ANTLR3_CYCLIC_DFA; - -typedef ANTLR3_INT32 (*CDFA_SPECIAL_FUNC) (void * , pANTLR3_BASE_RECOGNIZER , pANTLR3_INT_STREAM , struct ANTLR3_CYCLIC_DFA_struct * , ANTLR3_INT32); - -#ifdef __cplusplus -} -#ifdef ANTLR3_WINDOWS -#pragma warning (pop) -#endif -#endif - -#endif diff --git a/impl/antlr/libantlr3c-3.4/include/antlr3debugeventlistener.h b/impl/antlr/libantlr3c-3.4/include/antlr3debugeventlistener.h deleted file mode 100644 index c9cd6ce..0000000 --- a/impl/antlr/libantlr3c-3.4/include/antlr3debugeventlistener.h +++ /dev/null @@ -1,398 +0,0 @@ -/** - * \file - * The definition of all debugging events that a recognizer can trigger. - * - * \remark - * From the java implementation by Terence Parr... - * I did not create a separate AST debugging interface as it would create - * lots of extra classes and DebugParser has a dbg var defined, which makes - * it hard to change to ASTDebugEventListener. I looked hard at this issue - * and it is easier to understand as one monolithic event interface for all - * possible events. Hopefully, adding ST debugging stuff won't be bad. Leave - * for future. 4/26/2006. - */ - -#ifndef ANTLR3_DEBUG_EVENT_LISTENER_H -#define ANTLR3_DEBUG_EVENT_LISTENER_H - -// [The "BSD licence"] -// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC -// http://www.temporal-wave.com -// http://www.linkedin.com/in/jimidle -// -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions -// are met: -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// 3. The name of the author may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include -#include -#include - - -/// Default debugging port -/// -#define DEFAULT_DEBUGGER_PORT 0xBFCC; - -#ifdef __cplusplus -extern "C" { -#endif - -/** The ANTLR3 debugging interface for communicating with ANLTR Works. Function comments - * mostly taken from the Java version. - */ -typedef struct ANTLR3_DEBUG_EVENT_LISTENER_struct -{ - /// The port number which the debug listener should listen on for a connection - /// - ANTLR3_UINT32 port; - - /// The socket structure we receive after a successful accept on the serverSocket - /// - SOCKET socket; - - /** The version of the debugging protocol supported by the providing - * instance of the debug event listener. - */ - int PROTOCOL_VERSION; - - /// The name of the grammar file that we are debugging - /// - pANTLR3_STRING grammarFileName; - - /// Indicates whether we have already connected or not - /// - ANTLR3_BOOLEAN initialized; - - /// Used to serialize the values of any particular token we need to - /// send back to the debugger. - /// - pANTLR3_STRING tokenString; - - - /// Allows the debug event system to access the adapter in use - /// by the recognizer, if this is a tree parser of some sort. - /// - pANTLR3_BASE_TREE_ADAPTOR adaptor; - - /// Wait for a connection from the debugger and initiate the - /// debugging session. - /// - ANTLR3_BOOLEAN (*handshake) (pANTLR3_DEBUG_EVENT_LISTENER delboy); - - /** The parser has just entered a rule. No decision has been made about - * which alt is predicted. This is fired AFTER init actions have been - * executed. Attributes are defined and available etc... - */ - void (*enterRule) (pANTLR3_DEBUG_EVENT_LISTENER delboy, const char * grammarFileName, const char * ruleName); - - /** Because rules can have lots of alternatives, it is very useful to - * know which alt you are entering. This is 1..n for n alts. - */ - void (*enterAlt) (pANTLR3_DEBUG_EVENT_LISTENER delboy, int alt); - - /** This is the last thing executed before leaving a rule. It is - * executed even if an exception is thrown. This is triggered after - * error reporting and recovery have occurred (unless the exception is - * not caught in this rule). This implies an "exitAlt" event. - */ - void (*exitRule) (pANTLR3_DEBUG_EVENT_LISTENER delboy, const char * grammarFileName, const char * ruleName); - - /** Track entry into any (...) subrule other EBNF construct - */ - void (*enterSubRule) (pANTLR3_DEBUG_EVENT_LISTENER delboy, int decisionNumber); - - void (*exitSubRule) (pANTLR3_DEBUG_EVENT_LISTENER delboy, int decisionNumber); - - /** Every decision, fixed k or arbitrary, has an enter/exit event - * so that a GUI can easily track what LT/consume events are - * associated with prediction. You will see a single enter/exit - * subrule but multiple enter/exit decision events, one for each - * loop iteration. - */ - void (*enterDecision) (pANTLR3_DEBUG_EVENT_LISTENER delboy, int decisionNumber); - - void (*exitDecision) (pANTLR3_DEBUG_EVENT_LISTENER delboy, int decisionNumber); - - /** An input token was consumed; matched by any kind of element. - * Trigger after the token was matched by things like match(), matchAny(). - */ - void (*consumeToken) (pANTLR3_DEBUG_EVENT_LISTENER delboy, pANTLR3_COMMON_TOKEN t); - - /** An off-channel input token was consumed. - * Trigger after the token was matched by things like match(), matchAny(). - * (unless of course the hidden token is first stuff in the input stream). - */ - void (*consumeHiddenToken) (pANTLR3_DEBUG_EVENT_LISTENER delboy, pANTLR3_COMMON_TOKEN t); - - /** Somebody (anybody) looked ahead. Note that this actually gets - * triggered by both LA and LT calls. The debugger will want to know - * which Token object was examined. Like consumeToken, this indicates - * what token was seen at that depth. A remote debugger cannot look - * ahead into a file it doesn't have so LT events must pass the token - * even if the info is redundant. - */ - void (*LT) (pANTLR3_DEBUG_EVENT_LISTENER delboy, int i, pANTLR3_COMMON_TOKEN t); - - /** The parser is going to look arbitrarily ahead; mark this location, - * the token stream's marker is sent in case you need it. - */ - void (*mark) (pANTLR3_DEBUG_EVENT_LISTENER delboy, ANTLR3_MARKER marker); - - /** After an arbitrarily long lookahead as with a cyclic DFA (or with - * any backtrack), this informs the debugger that stream should be - * rewound to the position associated with marker. - */ - void (*rewind) (pANTLR3_DEBUG_EVENT_LISTENER delboy, ANTLR3_MARKER marker); - - /** Rewind to the input position of the last marker. - * Used currently only after a cyclic DFA and just - * before starting a sem/syn predicate to get the - * input position back to the start of the decision. - * Do not "pop" the marker off the state. mark(i) - * and rewind(i) should balance still. - */ - void (*rewindLast) (pANTLR3_DEBUG_EVENT_LISTENER delboy); - - void (*beginBacktrack) (pANTLR3_DEBUG_EVENT_LISTENER delboy, int level); - - void (*endBacktrack) (pANTLR3_DEBUG_EVENT_LISTENER delboy, int level, ANTLR3_BOOLEAN successful); - - /** To watch a parser move through the grammar, the parser needs to - * inform the debugger what line/charPos it is passing in the grammar. - * For now, this does not know how to switch from one grammar to the - * other and back for island grammars etc... - * - * This should also allow breakpoints because the debugger can stop - * the parser whenever it hits this line/pos. - */ - void (*location) (pANTLR3_DEBUG_EVENT_LISTENER delboy, int line, int pos); - - /** A recognition exception occurred such as NoViableAltException. I made - * this a generic event so that I can alter the exception hierarchy later - * without having to alter all the debug objects. - * - * Upon error, the stack of enter rule/subrule must be properly unwound. - * If no viable alt occurs it is within an enter/exit decision, which - * also must be rewound. Even the rewind for each mark must be unwound. - * In the Java target this is pretty easy using try/finally, if a bit - * ugly in the generated code. The rewind is generated in DFA.predict() - * actually so no code needs to be generated for that. For languages - * w/o this "finally" feature (C++?), the target implementor will have - * to build an event stack or something. - * - * Across a socket for remote debugging, only the RecognitionException - * data fields are transmitted. The token object or whatever that - * caused the problem was the last object referenced by LT. The - * immediately preceding LT event should hold the unexpected Token or - * char. - * - * Here is a sample event trace for grammar: - * - * b : C ({;}A|B) // {;} is there to prevent A|B becoming a set - * | D - * ; - * - * The sequence for this rule (with no viable alt in the subrule) for - * input 'c c' (there are 3 tokens) is: - * - * commence - * LT(1) - * enterRule b - * location 7 1 - * enter decision 3 - * LT(1) - * exit decision 3 - * enterAlt1 - * location 7 5 - * LT(1) - * consumeToken [c/<4>,1:0] - * location 7 7 - * enterSubRule 2 - * enter decision 2 - * LT(1) - * LT(1) - * recognitionException NoViableAltException 2 1 2 - * exit decision 2 - * exitSubRule 2 - * beginResync - * LT(1) - * consumeToken [c/<4>,1:1] - * LT(1) - * endResync - * LT(-1) - * exitRule b - * terminate - */ - void (*recognitionException) (pANTLR3_DEBUG_EVENT_LISTENER delboy, pANTLR3_EXCEPTION e); - - /** Indicates the recognizer is about to consume tokens to resynchronize - * the parser. Any consume events from here until the recovered event - * are not part of the parse--they are dead tokens. - */ - void (*beginResync) (pANTLR3_DEBUG_EVENT_LISTENER delboy); - - /** Indicates that the recognizer has finished consuming tokens in order - * to resynchronize. There may be multiple beginResync/endResync pairs - * before the recognizer comes out of errorRecovery mode (in which - * multiple errors are suppressed). This will be useful - * in a gui where you want to probably grey out tokens that are consumed - * but not matched to anything in grammar. Anything between - * a beginResync/endResync pair was tossed out by the parser. - */ - void (*endResync) (pANTLR3_DEBUG_EVENT_LISTENER delboy); - - /** A semantic predicate was evaluate with this result and action text - */ - void (*semanticPredicate) (pANTLR3_DEBUG_EVENT_LISTENER delboy, ANTLR3_BOOLEAN result, const char * predicate); - - /** Announce that parsing has begun. Not technically useful except for - * sending events over a socket. A GUI for example will launch a thread - * to connect and communicate with a remote parser. The thread will want - * to notify the GUI when a connection is made. ANTLR parsers - * trigger this upon entry to the first rule (the ruleLevel is used to - * figure this out). - */ - void (*commence) (pANTLR3_DEBUG_EVENT_LISTENER delboy); - - /** Parsing is over; successfully or not. Mostly useful for telling - * remote debugging listeners that it's time to quit. When the rule - * invocation level goes to zero at the end of a rule, we are done - * parsing. - */ - void (*terminate) (pANTLR3_DEBUG_EVENT_LISTENER delboy); - - /// Retrieve acknowledge response from the debugger. in fact this - /// response is never used at the moment. So we just read whatever - /// is in the socket buffer and throw it away. - /// - void (*ack) (pANTLR3_DEBUG_EVENT_LISTENER delboy); - - // T r e e P a r s i n g - - /** Input for a tree parser is an AST, but we know nothing for sure - * about a node except its type and text (obtained from the adaptor). - * This is the analog of the consumeToken method. The ID is usually - * the memory address of the node. - * If the type is UP or DOWN, then - * the ID is not really meaningful as it's fixed--there is - * just one UP node and one DOWN navigation node. - * - * Note that unlike the Java version, the node type of the C parsers - * is always fixed as pANTLR3_BASE_TREE because all such structures - * contain a super pointer to their parent, which is generally COMMON_TREE and within - * that there is a super pointer that can point to a user type that encapsulates it. - * Almost akin to saying that it is an interface pointer except we don't need to - * know what the interface is in full, just those bits that are the base. - * @param t - */ - void (*consumeNode) (pANTLR3_DEBUG_EVENT_LISTENER delboy, pANTLR3_BASE_TREE t); - - /** The tree parser looked ahead. If the type is UP or DOWN, - * then the ID is not really meaningful as it's fixed--there is - * just one UP node and one DOWN navigation node. - */ - void (*LTT) (pANTLR3_DEBUG_EVENT_LISTENER delboy, int i, pANTLR3_BASE_TREE t); - - - // A S T E v e n t s - - /** A nil was created (even nil nodes have a unique ID... - * they are not "null" per se). As of 4/28/2006, this - * seems to be uniquely triggered when starting a new subtree - * such as when entering a subrule in automatic mode and when - * building a tree in rewrite mode. - * - * If you are receiving this event over a socket via - * RemoteDebugEventSocketListener then only t.ID is set. - */ - void (*nilNode) (pANTLR3_DEBUG_EVENT_LISTENER delboy, pANTLR3_BASE_TREE t); - - /** If a syntax error occurs, recognizers bracket the error - * with an error node if they are building ASTs. This event - * notifies the listener that this is the case - */ - void (*errorNode) (pANTLR3_DEBUG_EVENT_LISTENER delboy, pANTLR3_BASE_TREE t); - - /** Announce a new node built from token elements such as type etc... - * - * If you are receiving this event over a socket via - * RemoteDebugEventSocketListener then only t.ID, type, text are - * set. - */ - void (*createNode) (pANTLR3_DEBUG_EVENT_LISTENER delboy, pANTLR3_BASE_TREE t); - - /** Announce a new node built from an existing token. - * - * If you are receiving this event over a socket via - * RemoteDebugEventSocketListener then only node.ID and token.tokenIndex - * are set. - */ - void (*createNodeTok) (pANTLR3_DEBUG_EVENT_LISTENER delboy, pANTLR3_BASE_TREE node, pANTLR3_COMMON_TOKEN token); - - /** Make a node the new root of an existing root. See - * - * Note: the newRootID parameter is possibly different - * than the TreeAdaptor.becomeRoot() newRoot parameter. - * In our case, it will always be the result of calling - * TreeAdaptor.becomeRoot() and not root_n or whatever. - * - * The listener should assume that this event occurs - * only when the current subrule (or rule) subtree is - * being reset to newRootID. - * - * If you are receiving this event over a socket via - * RemoteDebugEventSocketListener then only IDs are set. - * - * @see org.antlr.runtime.tree.TreeAdaptor.becomeRoot() - */ - void (*becomeRoot) (pANTLR3_DEBUG_EVENT_LISTENER delboy, pANTLR3_BASE_TREE newRoot, pANTLR3_BASE_TREE oldRoot); - - /** Make childID a child of rootID. - * - * If you are receiving this event over a socket via - * RemoteDebugEventSocketListener then only IDs are set. - * - * @see org.antlr.runtime.tree.TreeAdaptor.addChild() - */ - void (*addChild) (pANTLR3_DEBUG_EVENT_LISTENER delboy, pANTLR3_BASE_TREE root, pANTLR3_BASE_TREE child); - - /** Set the token start/stop token index for a subtree root or node. - * - * If you are receiving this event over a socket via - * RemoteDebugEventSocketListener then only t.ID is set. - */ - void (*setTokenBoundaries) (pANTLR3_DEBUG_EVENT_LISTENER delboy, pANTLR3_BASE_TREE t, ANTLR3_MARKER tokenStartIndex, ANTLR3_MARKER tokenStopIndex); - - /// Free up the resources allocated to this structure - /// - void (*free) (pANTLR3_DEBUG_EVENT_LISTENER delboy); - -} - ANTLR3_DEBUG_EVENT_LISTENER; - -#ifdef __cplusplus -} -#endif - -#endif - diff --git a/impl/antlr/libantlr3c-3.4/include/antlr3defs.h b/impl/antlr/libantlr3c-3.4/include/antlr3defs.h deleted file mode 100644 index 2435b02..0000000 --- a/impl/antlr/libantlr3c-3.4/include/antlr3defs.h +++ /dev/null @@ -1,632 +0,0 @@ -/** \file - * Basic type and constant definitions for ANTLR3 Runtime. - */ -#ifndef _ANTLR3DEFS_H -#define _ANTLR3DEFS_H - -// [The "BSD licence"] -// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC -// http://www.temporal-wave.com -// http://www.linkedin.com/in/jimidle -// -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions -// are met: -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// 3. The name of the author may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -/* Following are for generated code, they are not referenced internally!!! - */ -#if !defined(ANTLR3_HUGE) && !defined(ANTLR3_AVERAGE) && !defined(ANTLR3_SMALL) -#define ANTLR3_AVERAGE -#endif - -#ifdef ANTLR3_HUGE -#ifndef ANTLR3_SIZE_HINT -#define ANTLR3_SIZE_HINT 2049 -#endif -#ifndef ANTLR3_LIST_SIZE_HINT -#define ANTLR3_LIST_SIZE_HINT 127 -#endif -#endif - -#ifdef ANTLR3_AVERAGE -#ifndef ANTLR3_SIZE_HINT -#define ANTLR3_SIZE_HINT 1025 -#define ANTLR3_LIST_SIZE_HINT 63 -#endif -#endif - -#ifdef ANTLR3_SMALL -#ifndef ANTLR3_SIZE_HINT -#define ANTLR3_SIZE_HINT 211 -#define ANTLR3_LIST_SIZE_HINT 31 -#endif -#endif - -// Definitions that indicate the encoding scheme character streams and strings etc -// -/// Indicates Big Endian for encodings where this makes sense -/// -#define ANTLR3_BE 1 - -/// Indicates Little Endian for encoidngs where this makes sense -/// -#define ANTLR3_LE 2 - -/// General latin-1 or other 8 bit encoding scheme such as straight ASCII -/// -#define ANTLR3_ENC_8BIT 4 - -/// UTF-8 encoding scheme -/// -#define ANTLR3_ENC_UTF8 8 - -/// UTF-16 encoding scheme (which also covers UCS2 as that does not have surrogates) -/// -#define ANTLR3_ENC_UTF16 16 -#define ANTLR3_ENC_UTF16BE 16 + ANTLR3_BE -#define ANTLR3_ENC_UTF16LE 16 + ANTLR3_LE - -/// UTF-32 encoding scheme (basically straight 32 bit) -/// -#define ANTLR3_ENC_UTF32 32 -#define ANTLR3_ENC_UTF32BE 32 + ANTLR3_BE -#define ANTLR3_ENC_UTF32LE 32 + ANTLR3_LE - -/// Input is 8 bit EBCDIC (which we convert to 8 bit ASCII on the fly -/// -#define ANTLR3_ENC_EBCDIC 64 - -/* Common definitions come first - */ -#include - -/* Work out what operating system/compiler this is. We just do this once - * here and use an internal symbol after this. - */ -#ifdef _WIN64 - -# ifndef ANTLR3_WINDOWS -# define ANTLR3_WINDOWS -# endif -# define ANTLR3_WIN64 -# define ANTLR3_USE_64BIT - -#else - -#ifdef _WIN32 -# ifndef ANTLR3_WINDOWS -# define ANTLR3_WINDOWS -# endif - -#define ANTLR3_WIN32 -#endif - -#endif - -#ifdef ANTLR3_WINDOWS - -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif - -/* Allow VC 8 (vs2005) and above to use 'secure' versions of various functions such as sprintf - */ -#ifndef _CRT_SECURE_NO_DEPRECATE -#define _CRT_SECURE_NO_DEPRECATE -#endif - -#include -#include -#include -#include -#include -#include -#include - -#define ANTLR3_API __declspec(dllexport) -#define ANTLR3_CDECL __cdecl -#define ANTLR3_FASTCALL __fastcall - -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef __MINGW32__ -// Standard Windows types -// -typedef INT32 ANTLR3_CHAR, *pANTLR3_CHAR; -typedef UINT32 ANTLR3_UCHAR, *pANTLR3_UCHAR; - -typedef INT8 ANTLR3_INT8, *pANTLR3_INT8; -typedef INT16 ANTLR3_INT16, *pANTLR3_INT16; -typedef INT32 ANTLR3_INT32, *pANTLR3_INT32; -typedef INT64 ANTLR3_INT64, *pANTLR3_INT64; -typedef UINT8 ANTLR3_UINT8, *pANTLR3_UINT8; -typedef UINT16 ANTLR3_UINT16, *pANTLR3_UINT16; -typedef UINT32 ANTLR3_UINT32, *pANTLR3_UINT32; -typedef UINT64 ANTLR3_UINT64, *pANTLR3_UINT64; -typedef UINT64 ANTLR3_BITWORD, *pANTLR3_BITWORD; -typedef UINT8 ANTLR3_BOOLEAN, *pANTLR3_BOOLEAN; - -#else -// Mingw uses stdint.h and fails to define standard Microsoft typedefs -// such as UINT16, hence we must use stdint.h for Mingw. -// -#include -typedef int32_t ANTLR3_CHAR, *pANTLR3_CHAR; -typedef uint32_t ANTLR3_UCHAR, *pANTLR3_UCHAR; - -typedef int8_t ANTLR3_INT8, *pANTLR3_INT8; -typedef int16_t ANTLR3_INT16, *pANTLR3_INT16; -typedef int32_t ANTLR3_INT32, *pANTLR3_INT32; -typedef int64_t ANTLR3_INT64, *pANTLR3_INT64; - -typedef uint8_t ANTLR3_UINT8, *pANTLR3_UINT8; -typedef uint16_t ANTLR3_UINT16, *pANTLR3_UINT16; -typedef uint32_t ANTLR3_UINT32, *pANTLR3_UINT32; -typedef uint64_t ANTLR3_UINT64, *pANTLR3_UINT64; -typedef uint64_t ANTLR3_BITWORD, *pANTLR3_BITWORD; - -typedef uint8_t ANTLR3_BOOLEAN, *pANTLR3_BOOLEAN; - -#endif - - - -#define ANTLR3_UINT64_LIT(lit) lit##ULL - -#define ANTLR3_INLINE __inline - -typedef FILE * ANTLR3_FDSC; -typedef struct stat ANTLR3_FSTAT_STRUCT; - -#ifdef ANTLR3_USE_64BIT -#define ANTLR3_FUNC_PTR(ptr) (void *)((ANTLR3_UINT64)(ptr)) -#define ANTLR3_UINT64_CAST(ptr) (ANTLR3_UINT64)(ptr)) -#define ANTLR3_UINT32_CAST(ptr) (ANTLR3_UINT32)((ANTLR3_UINT64)(ptr)) -typedef ANTLR3_INT64 ANTLR3_MARKER; -typedef ANTLR3_UINT64 ANTLR3_INTKEY; -#else -#define ANTLR3_FUNC_PTR(ptr) (void *)((ANTLR3_UINT32)(ptr)) -#define ANTLR3_UINT64_CAST(ptr) (ANTLR3_UINT64)((ANTLR3_UINT32)(ptr)) -#define ANTLR3_UINT32_CAST(ptr) (ANTLR3_UINT32)(ptr) -typedef ANTLR3_INT32 ANTLR3_MARKER; -typedef ANTLR3_UINT32 ANTLR3_INTKEY; -#endif - -#ifdef ANTLR3_WIN32 -#endif - -#ifdef ANTLR3_WIN64 -#endif - - -typedef int ANTLR3_SALENT; // Type used for size of accept structure -typedef struct sockaddr_in ANTLR3_SOCKADDRT, * pANTLR3_SOCKADDRT; // Type used for socket address declaration -typedef struct sockaddr ANTLR3_SOCKADDRC, * pANTLR3_SOCKADDRC; // Type used for cast on accept() - -#define ANTLR3_CLOSESOCKET closesocket - -#ifdef __cplusplus -} -#endif - -/* Warnings that are over-zealous such as complaining about strdup, we - * can turn off. - */ - -/* Don't complain about "deprecated" functions such as strdup - */ -#pragma warning( disable : 4996 ) - -#else - -/* Include configure generated header file - */ -#include - -#include - -#if HAVE_STDINT_H -# include -#endif - -#if HAVE_SYS_TYPES_H -# include -#endif - -#if HAVE_SYS_STAT_H -# include -#endif - -#if STDC_HEADERS -# include -# include -# include -#else -# if HAVE_STDLIB_H -# include -# endif -# if HAVE_STDARG_H -# include -# endif -#endif - -#if HAVE_STRING_H -# if !STDC_HEADERS && HAVE_MEMORY_H -# include -# endif -# include -#endif - -#if HAVE_STRINGS_H -# include -#endif - -#if HAVE_INTTYPES_H -# include -#endif - -#if HAVE_UNISTD_H -# include -#endif - -#ifdef HAVE_NETINET_IN_H -#include -#endif - -#ifdef HAVE_SOCKET_H -# include -#else -# if HAVE_SYS_SOCKET_H -# include -# endif -#endif - -#ifdef HAVE_NETINET_TCP_H -#include -#endif - -#ifdef HAVE_ARPA_NAMESER_H -#include /* DNS HEADER struct */ -#endif - -#ifdef HAVE_NETDB_H -#include -#endif - - -#ifdef HAVE_SYS_RESOLVE_H -#include -#endif - -#ifdef HAVE_RESOLVE_H -#include -#endif - - -#ifdef HAVE_MALLOC_H -# include -#else -# ifdef HAVE_SYS_MALLOC_H -# include -# endif -#endif - -#ifdef HAVE_CTYPE_H -# include -#endif - -/* Some platforms define a macro, index() in string.h. AIX is - * one of these for instance. We must get rid of that definition - * as we use ->index all over the place. defining macros like this in system header - * files is a really bad idea, but I doubt that IBM will listen to me ;-) - */ -#ifdef index -#undef index -#endif - -#define _stat stat - -// SOCKET not defined on Unix -// -typedef int SOCKET; - -#define ANTLR3_API -#define ANTLR3_CDECL -#define ANTLR3_FASTCALL - -#ifdef __hpux - - // HPUX is always different usually for no good reason. Tru64 should have kicked it - // into touch and everyone knows it ;-) - // - typedef struct sockaddr_in ANTLR3_SOCKADDRT, * pANTLR3_SOCKADDRT; // Type used for socket address declaration - typedef void * pANTLR3_SOCKADDRC; // Type used for cast on accept() - typedef int ANTLR3_SALENT; - -#else - -# if defined(_AIX) || __GNUC__ > 3 - - typedef socklen_t ANTLR3_SALENT; - -# else - - typedef size_t ANTLR3_SALENT; - -# endif - - typedef struct sockaddr_in ANTLR3_SOCKADDRT, * pANTLR3_SOCKADDRT; // Type used for socket address declaration - typedef struct sockaddr * pANTLR3_SOCKADDRC; // Type used for cast on accept() - -#endif - -#define INVALID_SOCKET ((SOCKET)-1) -#define ANTLR3_CLOSESOCKET close - -#ifdef __cplusplus -extern "C" { -#endif - -/* Inherit type definitions for autoconf - */ -typedef int32_t ANTLR3_CHAR, *pANTLR3_CHAR; -typedef uint32_t ANTLR3_UCHAR, *pANTLR3_UCHAR; - -typedef int8_t ANTLR3_INT8, *pANTLR3_INT8; -typedef int16_t ANTLR3_INT16, *pANTLR3_INT16; -typedef int32_t ANTLR3_INT32, *pANTLR3_INT32; -typedef int64_t ANTLR3_INT64, *pANTLR3_INT64; - -typedef uint8_t ANTLR3_UINT8, *pANTLR3_UINT8; -typedef uint16_t ANTLR3_UINT16, *pANTLR3_UINT16; -typedef uint32_t ANTLR3_UINT32, *pANTLR3_UINT32; -typedef uint64_t ANTLR3_UINT64, *pANTLR3_UINT64; -typedef uint64_t ANTLR3_BITWORD, *pANTLR3_BITWORD; - -typedef uint32_t ANTLR3_BOOLEAN, *pANTLR3_BOOLEAN; - -#define ANTLR3_INLINE inline -#define ANTLR3_API - -typedef FILE * ANTLR3_FDSC; -typedef struct stat ANTLR3_FSTAT_STRUCT; - -#ifdef ANTLR3_USE_64BIT -#define ANTLR3_FUNC_PTR(ptr) (void *)((ANTLR3_UINT64)(ptr)) -#define ANTLR3_UINT64_CAST(ptr) (ANTLR3_UINT64)(ptr)) -#define ANTLR3_UINT32_CAST(ptr) (ANTLR3_UINT32)((ANTLR3_UINT64)(ptr)) -typedef ANTLR3_INT64 ANTLR3_MARKER; -typedef ANTLR3_UINT64 ANTLR3_INTKEY; -#else -#define ANTLR3_FUNC_PTR(ptr) (void *)((ANTLR3_UINT32)(ptr)) -#define ANTLR3_UINT64_CAST(ptr) (ANTLR3_UINT64)((ANTLR3_UINT32)(ptr)) -#define ANTLR3_UINT32_CAST(ptr) (ANTLR3_UINT32)(ptr) -typedef ANTLR3_INT32 ANTLR3_MARKER; -typedef ANTLR3_UINT32 ANTLR3_INTKEY; -#endif -#define ANTLR3_UINT64_LIT(lit) lit##ULL - -#ifdef __cplusplus -} -#endif - -#endif - -#ifdef ANTLR3_USE_64BIT -#define ANTLR3_TRIE_DEPTH 63 -#else -#define ANTLR3_TRIE_DEPTH 31 -#endif -/* Pre declare the typedefs for all the interfaces, then - * they can be inter-dependant and we will let the linker - * sort it out for us. - */ -#include - -// Include the unicode.org conversion library header. -// -#include - -/* Prototypes - */ -#ifndef ANTLR3_MALLOC -/// Default definition of ANTLR3_MALLOC. You can override this before including -/// antlr3.h if you wish to use your own implementation. -/// -#define ANTLR3_MALLOC(request) malloc ((size_t)(request)) -#endif - -#ifndef ANTLR3_CALLOC -/// Default definition of ANTLR3_CALLOC. You can override this before including -/// antlr3.h if you wish to use your own implementation. -/// -#define ANTLR3_CALLOC(numEl, elSize) calloc (numEl, (size_t)(elSize)) -#endif - -#ifndef ANTLR3_REALLOC -/// Default definition of ANTLR3_REALLOC. You can override this before including -/// antlr3.h if you wish to use your own implementation. -/// -#define ANTLR3_REALLOC(current, request) realloc ((void *)(current), (size_t)(request)) -#endif -#ifndef ANTLR3_FREE -/// Default definition of ANTLR3_FREE. You can override this before including -/// antlr3.h if you wish to use your own implementation. -/// -#define ANTLR3_FREE(ptr) free ((void *)(ptr)) -#endif -#ifndef ANTLR3_FREE_FUNC -/// Default definition of ANTLR3_FREE_FUNC. You can override this before including -/// antlr3.h if you wish to use your own implementation. -/// -#define ANTLR3_FREE_FUNC free -#endif -#ifndef ANTLR3_STRDUP -/// Default definition of ANTLR3_STRDUP. You can override this before including -/// antlr3.h if you wish to use your own implementation. -/// -#define ANTLR3_STRDUP(instr) (pANTLR3_UINT8)(strdup ((const char *)(instr))) -#endif -#ifndef ANTLR3_MEMCPY -/// Default definition of ANTLR3_MEMCPY. You can override this before including -/// antlr3.h if you wish to use your own implementation. -/// -#define ANTLR3_MEMCPY(target, source, size) memcpy((void *)(target), (const void *)(source), (size_t)(size)) -#endif -#ifndef ANTLR3_MEMMOVE -/// Default definition of ANTLR3_MEMMOVE. You can override this before including -/// antlr3.h if you wish to use your own implementation. -/// -#define ANTLR3_MEMMOVE(target, source, size) memmove((void *)(target), (const void *)(source), (size_t)(size)) -#endif -#ifndef ANTLR3_MEMSET -/// Default definition of ANTLR3_MEMSET. You can override this before including -/// antlr3.h if you wish to use your own implementation. -/// -#define ANTLR3_MEMSET(target, byte, size) memset((void *)(target), (int)(byte), (size_t)(size)) -#endif - -#ifndef ANTLR3_PRINTF -/// Default definition of printf, set this to something other than printf before including antlr3.h -/// if your system does not have a printf. Note that you can define this to be // -/// without harming the runtime. -/// -#define ANTLR3_PRINTF printf -#endif - -#ifndef ANTLR3_FPRINTF -/// Default definition of fprintf, set this to something other than fprintf before including antlr3.h -/// if your system does not have a fprintf. Note that you can define this to be // -/// without harming the runtime. -/// -#define ANTLR3_FPRINTF fprintf -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -ANTLR3_API pANTLR3_INT_TRIE antlr3IntTrieNew (ANTLR3_UINT32 depth); - -ANTLR3_API pANTLR3_BITSET antlr3BitsetNew (ANTLR3_UINT32 numBits); -ANTLR3_API pANTLR3_BITSET antlr3BitsetOf (ANTLR3_INT32 bit, ...); -ANTLR3_API pANTLR3_BITSET antlr3BitsetList (pANTLR3_HASH_TABLE list); -ANTLR3_API pANTLR3_BITSET antlr3BitsetCopy (pANTLR3_BITSET_LIST blist); -ANTLR3_API pANTLR3_BITSET antlr3BitsetLoad (pANTLR3_BITSET_LIST blist); -ANTLR3_API void antlr3BitsetSetAPI (pANTLR3_BITSET bitset); - - -ANTLR3_API pANTLR3_BASE_RECOGNIZER antlr3BaseRecognizerNew (ANTLR3_UINT32 type, ANTLR3_UINT32 sizeHint, pANTLR3_RECOGNIZER_SHARED_STATE state); -ANTLR3_API void antlr3RecognitionExceptionNew (pANTLR3_BASE_RECOGNIZER recognizer); -ANTLR3_API void antlr3MTExceptionNew (pANTLR3_BASE_RECOGNIZER recognizer); -ANTLR3_API void antlr3MTNExceptionNew (pANTLR3_BASE_RECOGNIZER recognizer); -ANTLR3_API pANTLR3_HASH_TABLE antlr3HashTableNew (ANTLR3_UINT32 sizeHint); -ANTLR3_API ANTLR3_UINT32 antlr3Hash (void * key, ANTLR3_UINT32 keylen); -ANTLR3_API pANTLR3_HASH_ENUM antlr3EnumNew (pANTLR3_HASH_TABLE table); -ANTLR3_API pANTLR3_LIST antlr3ListNew (ANTLR3_UINT32 sizeHint); -ANTLR3_API pANTLR3_VECTOR_FACTORY antlr3VectorFactoryNew (ANTLR3_UINT32 sizeHint); -ANTLR3_API pANTLR3_VECTOR antlr3VectorNew (ANTLR3_UINT32 sizeHint); -ANTLR3_API pANTLR3_STACK antlr3StackNew (ANTLR3_UINT32 sizeHint); -ANTLR3_API void antlr3SetVectorApi (pANTLR3_VECTOR vector, ANTLR3_UINT32 sizeHint); -ANTLR3_API ANTLR3_UCHAR antlr3c8toAntlrc (ANTLR3_INT8 inc); -ANTLR3_API pANTLR3_TOPO antlr3TopoNew(); - -ANTLR3_API pANTLR3_EXCEPTION antlr3ExceptionNew (ANTLR3_UINT32 exception, void * name, void * message, ANTLR3_BOOLEAN freeMessage); - - -ANTLR3_API pANTLR3_INPUT_STREAM antlr3FileStreamNew (pANTLR3_UINT8 fileName, ANTLR3_UINT32 encoding); -ANTLR3_API pANTLR3_INPUT_STREAM antlr3StringStreamNew (pANTLR3_UINT8 data, ANTLR3_UINT32 encoding, ANTLR3_UINT32 size, pANTLR3_UINT8 name); - -ANTLR3_API pANTLR3_INT_STREAM antlr3IntStreamNew (void); - -ANTLR3_API pANTLR3_STRING_FACTORY antlr3StringFactoryNew (ANTLR3_UINT32 encoding); - -ANTLR3_API pANTLR3_COMMON_TOKEN antlr3CommonTokenNew (ANTLR3_UINT32 ttype); -ANTLR3_API pANTLR3_TOKEN_FACTORY antlr3TokenFactoryNew (pANTLR3_INPUT_STREAM input); -ANTLR3_API void antlr3SetTokenAPI (pANTLR3_COMMON_TOKEN token); - -ANTLR3_API pANTLR3_LEXER antlr3LexerNewStream (ANTLR3_UINT32 sizeHint, pANTLR3_INPUT_STREAM input, pANTLR3_RECOGNIZER_SHARED_STATE state); -ANTLR3_API pANTLR3_LEXER antlr3LexerNew (ANTLR3_UINT32 sizeHint, pANTLR3_RECOGNIZER_SHARED_STATE state); -ANTLR3_API pANTLR3_PARSER antlr3ParserNewStreamDbg (ANTLR3_UINT32 sizeHint, pANTLR3_TOKEN_STREAM tstream, pANTLR3_DEBUG_EVENT_LISTENER dbg, pANTLR3_RECOGNIZER_SHARED_STATE state); -ANTLR3_API pANTLR3_PARSER antlr3ParserNewStream (ANTLR3_UINT32 sizeHint, pANTLR3_TOKEN_STREAM tstream, pANTLR3_RECOGNIZER_SHARED_STATE state); -ANTLR3_API pANTLR3_PARSER antlr3ParserNew (ANTLR3_UINT32 sizeHint, pANTLR3_RECOGNIZER_SHARED_STATE state); - -ANTLR3_API pANTLR3_COMMON_TOKEN_STREAM antlr3CommonTokenStreamSourceNew (ANTLR3_UINT32 hint, pANTLR3_TOKEN_SOURCE source); -ANTLR3_API pANTLR3_COMMON_TOKEN_STREAM antlr3CommonTokenStreamNew (ANTLR3_UINT32 hint); -ANTLR3_API pANTLR3_COMMON_TOKEN_STREAM antlr3CommonTokenDebugStreamSourceNew (ANTLR3_UINT32 hint, pANTLR3_TOKEN_SOURCE source, pANTLR3_DEBUG_EVENT_LISTENER debugger); - -ANTLR3_API pANTLR3_BASE_TREE_ADAPTOR ANTLR3_TREE_ADAPTORNew (pANTLR3_STRING_FACTORY strFactory); -ANTLR3_API pANTLR3_BASE_TREE_ADAPTOR ANTLR3_TREE_ADAPTORDebugNew (pANTLR3_STRING_FACTORY strFactory, pANTLR3_DEBUG_EVENT_LISTENER debugger); -ANTLR3_API pANTLR3_COMMON_TREE antlr3CommonTreeNew (void); -ANTLR3_API pANTLR3_COMMON_TREE antlr3CommonTreeNewFromTree (pANTLR3_COMMON_TREE tree); -ANTLR3_API pANTLR3_COMMON_TREE antlr3CommonTreeNewFromToken (pANTLR3_COMMON_TOKEN tree); -ANTLR3_API pANTLR3_ARBORETUM antlr3ArboretumNew (pANTLR3_STRING_FACTORY factory); -ANTLR3_API void antlr3SetCTAPI (pANTLR3_COMMON_TREE tree); -ANTLR3_API pANTLR3_BASE_TREE antlr3BaseTreeNew (pANTLR3_BASE_TREE tree); - -ANTLR3_API void antlr3BaseTreeAdaptorInit (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_DEBUG_EVENT_LISTENER debugger); - -ANTLR3_API pANTLR3_TREE_PARSER antlr3TreeParserNewStream (ANTLR3_UINT32 sizeHint, pANTLR3_COMMON_TREE_NODE_STREAM ctnstream, pANTLR3_RECOGNIZER_SHARED_STATE state); - -ANTLR3_API ANTLR3_INT32 antlr3dfaspecialTransition (void * ctx, pANTLR3_BASE_RECOGNIZER rec, pANTLR3_INT_STREAM is, pANTLR3_CYCLIC_DFA dfa, ANTLR3_INT32 s); -ANTLR3_API ANTLR3_INT32 antlr3dfaspecialStateTransition (void * ctx, pANTLR3_BASE_RECOGNIZER rec, pANTLR3_INT_STREAM is, pANTLR3_CYCLIC_DFA dfa, ANTLR3_INT32 s); -ANTLR3_API ANTLR3_INT32 antlr3dfapredict (void * ctx, pANTLR3_BASE_RECOGNIZER rec, pANTLR3_INT_STREAM is, pANTLR3_CYCLIC_DFA cdfa); - -ANTLR3_API pANTLR3_COMMON_TREE_NODE_STREAM antlr3CommonTreeNodeStreamNewTree (pANTLR3_BASE_TREE tree, ANTLR3_UINT32 hint); -ANTLR3_API pANTLR3_COMMON_TREE_NODE_STREAM antlr3CommonTreeNodeStreamNew (pANTLR3_STRING_FACTORY strFactory, ANTLR3_UINT32 hint); -ANTLR3_API pANTLR3_COMMON_TREE_NODE_STREAM antlr3UnbufTreeNodeStreamNewTree (pANTLR3_BASE_TREE tree, ANTLR3_UINT32 hint); -ANTLR3_API pANTLR3_COMMON_TREE_NODE_STREAM antlr3UnbufTreeNodeStreamNew (pANTLR3_STRING_FACTORY strFactory, ANTLR3_UINT32 hint); -ANTLR3_API pANTLR3_COMMON_TREE_NODE_STREAM antlr3CommonTreeNodeStreamNewStream (pANTLR3_COMMON_TREE_NODE_STREAM inStream); -ANTLR3_API pANTLR3_TREE_NODE_STREAM antlr3TreeNodeStreamNew (); -ANTLR3_API void fillBufferExt (pANTLR3_COMMON_TOKEN_STREAM tokenStream); - -ANTLR3_API pANTLR3_REWRITE_RULE_TOKEN_STREAM - antlr3RewriteRuleTOKENStreamNewAE (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_RECOGNIZER rec, pANTLR3_UINT8 description); -ANTLR3_API pANTLR3_REWRITE_RULE_TOKEN_STREAM - antlr3RewriteRuleTOKENStreamNewAEE (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_RECOGNIZER rec, pANTLR3_UINT8 description, void * oneElement); -ANTLR3_API pANTLR3_REWRITE_RULE_TOKEN_STREAM - antlr3RewriteRuleTOKENStreamNewAEV (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_RECOGNIZER rec, pANTLR3_UINT8 description, pANTLR3_VECTOR vector); - -ANTLR3_API pANTLR3_REWRITE_RULE_NODE_STREAM - antlr3RewriteRuleNODEStreamNewAE (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_RECOGNIZER rec, pANTLR3_UINT8 description); -ANTLR3_API pANTLR3_REWRITE_RULE_NODE_STREAM - antlr3RewriteRuleNODEStreamNewAEE (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_RECOGNIZER rec, pANTLR3_UINT8 description, void * oneElement); -ANTLR3_API pANTLR3_REWRITE_RULE_NODE_STREAM - antlr3RewriteRuleNODEStreamNewAEV (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_RECOGNIZER rec, pANTLR3_UINT8 description, pANTLR3_VECTOR vector); - -ANTLR3_API pANTLR3_REWRITE_RULE_SUBTREE_STREAM - antlr3RewriteRuleSubtreeStreamNewAE (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_RECOGNIZER rec, pANTLR3_UINT8 description); -ANTLR3_API pANTLR3_REWRITE_RULE_SUBTREE_STREAM - antlr3RewriteRuleSubtreeStreamNewAEE(pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_RECOGNIZER rec, pANTLR3_UINT8 description, void * oneElement); -ANTLR3_API pANTLR3_REWRITE_RULE_SUBTREE_STREAM - antlr3RewriteRuleSubtreeStreamNewAEV(pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_RECOGNIZER rec, pANTLR3_UINT8 description, pANTLR3_VECTOR vector); - -ANTLR3_API pANTLR3_DEBUG_EVENT_LISTENER antlr3DebugListenerNew(); - -#ifdef __cplusplus -} -#endif - -#endif /* _ANTLR3DEFS_H */ diff --git a/impl/antlr/libantlr3c-3.4/include/antlr3encodings.h b/impl/antlr/libantlr3c-3.4/include/antlr3encodings.h deleted file mode 100644 index f706735..0000000 --- a/impl/antlr/libantlr3c-3.4/include/antlr3encodings.h +++ /dev/null @@ -1,38 +0,0 @@ -#ifndef _ANTLR3_ENCODINGS_H -#define _ANTLR3_ENCODINGS_H - -// [The "BSD licence"] -// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC -// http://www.temporal-wave.com -// http://www.linkedin.com/in/jimidle -// -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions -// are met: -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// 3. The name of the author may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include - - - -#endif - diff --git a/impl/antlr/libantlr3c-3.4/include/antlr3errors.h b/impl/antlr/libantlr3c-3.4/include/antlr3errors.h deleted file mode 100644 index 4419ee3..0000000 --- a/impl/antlr/libantlr3c-3.4/include/antlr3errors.h +++ /dev/null @@ -1,53 +0,0 @@ -#ifndef _ANTLR3ERRORS_H -#define _ANTLR3ERRORS_H - -// [The "BSD licence"] -// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC -// http://www.temporal-wave.com -// http://www.linkedin.com/in/jimidle -// -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions -// are met: -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// 3. The name of the author may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#define ANTLR3_SUCCESS 0 -#define ANTLR3_FAIL 1 - -#define ANTLR3_TRUE 1 -#define ANTLR3_FALSE 0 - -/** Indicates end of character stream and is an invalid Unicode code point. */ -#define ANTLR3_CHARSTREAM_EOF 0xFFFFFFFF - -/** Indicates memoizing on a rule failed. - */ -#define MEMO_RULE_FAILED 0xFFFFFFFE -#define MEMO_RULE_UNKNOWN 0xFFFFFFFF - - -#define ANTLR3_ERR_BASE 0 -#define ANTLR3_ERR_NOMEM (ANTLR3_ERR_BASE + 1) -#define ANTLR3_ERR_NOFILE (ANTLR3_ERR_BASE + 2) -#define ANTLR3_ERR_HASHDUP (ANTLR3_ERR_BASE + 3) - -#endif /* _ANTLR3ERRORS_H */ diff --git a/impl/antlr/libantlr3c-3.4/include/antlr3exception.h b/impl/antlr/libantlr3c-3.4/include/antlr3exception.h deleted file mode 100644 index 8fab8da..0000000 --- a/impl/antlr/libantlr3c-3.4/include/antlr3exception.h +++ /dev/null @@ -1,218 +0,0 @@ -/** \file - * Contains the definition of a basic ANTLR3 exception structure created - * by a recognizer when errors are found/predicted. - */ -#ifndef _ANTLR3_EXCEPTION_H -#define _ANTLR3_EXCEPTION_H - -// [The "BSD licence"] -// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC -// http://www.temporal-wave.com -// http://www.linkedin.com/in/jimidle -// -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions -// are met: -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// 3. The name of the author may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include - -/** Indicates that the recognizer received a token - * in the input that was not predicted. - */ -#define ANTLR3_RECOGNITION_EXCEPTION 1 - -/** Name of exception #ANTLR3_RECOGNITION_EXCEPTION - */ -#define ANTLR3_RECOGNITION_EX_NAME "org.antlr.runtime.RecognitionException" - -/** Indicates that the recognizer was expecting one token and found a - * a different one. - */ -#define ANTLR3_MISMATCHED_TOKEN_EXCEPTION 2 - -/** Name of #ANTLR3_MISMATCHED_TOKEN_EXCEPTION - */ -#define ANTLR3_MISMATCHED_EX_NAME "org.antlr.runtime.MismatchedTokenException" - -/** Recognizer could not find a valid alternative from the input - */ -#define ANTLR3_NO_VIABLE_ALT_EXCEPTION 3 - -/** Name of #ANTLR3_NO_VIABLE_ALT_EXCEPTION - */ -#define ANTLR3_NO_VIABLE_ALT_NAME "org.antlr.runtime.NoViableAltException" - -/* Character in a set was not found - */ -#define ANTLR3_MISMATCHED_SET_EXCEPTION 4 - -/* Name of #ANTLR3_MISMATCHED_SET_EXCEPTION - */ -#define ANTLR3_MISMATCHED_SET_NAME "org.antlr.runtime.MismatchedSetException" - -/* A rule predicting at least n elements found less than that, - * such as: WS: " "+; - */ -#define ANTLR3_EARLY_EXIT_EXCEPTION 5 - -/* Name of #ANTLR3_EARLY_EXIT_EXCEPTION - */ -#define ANTLR3_EARLY_EXIT_NAME "org.antlr.runtime.EarlyExitException" - -#define ANTLR3_FAILED_PREDICATE_EXCEPTION 6 -#define ANTLR3_FAILED_PREDICATE_NAME "org.antlr.runtime.FailedPredicateException" - -#define ANTLR3_MISMATCHED_TREE_NODE_EXCEPTION 7 -#define ANTLR3_MISMATCHED_TREE_NODE_NAME "org.antlr.runtime.MismatchedTreeNodeException" - -#define ANTLR3_REWRITE_EARLY_EXCEPTION 8 -#define ANTLR3_REWRITE_EARLY_EXCEPTION_NAME "org.antlr.runtime.tree.RewriteEarlyExitException" - -#define ANTLR3_UNWANTED_TOKEN_EXCEPTION 9 -#define ANTLR3_UNWANTED_TOKEN_EXCEPTION_NAME "org.antlr.runtime.UnwantedTokenException" - -#define ANTLR3_MISSING_TOKEN_EXCEPTION 10 -#define ANTLR3_MISSING_TOKEN_EXCEPTION_NAME "org.antlr.runtime.MissingTokenException" - -#ifdef __cplusplus -extern "C" { -#endif - -/** Base structure for an ANTLR3 exception tracker - */ -typedef struct ANTLR3_EXCEPTION_struct -{ - /// Set to one of the exception type defines: - /// - /// - #ANTLR3_RECOGNITION_EXCEPTION - /// - #ANTLR3_MISMATCHED_TOKEN_EXCEPTION - /// - #ANTLR3_NO_VIABLE_ALT_EXCEPTION - /// - #ANTLR3_MISMATCHED_SET_EXCEPTION - /// - #ANTLR3_EARLY_EXIT_EXCEPTION - /// - #ANTLR3_FAILED_PREDICATE_EXCEPTION - /// - #ANTLR3_EARLY_EXIT_EXCEPTION - /// - ANTLR3_UINT32 type; - - /** The string name of the exception - */ - void * name; - - /** The printable message that goes with this exception, in your preferred - * encoding format. ANTLR just uses ASCII by default but you can ignore these - * messages or convert them to another format or whatever of course. They are - * really internal messages that you then decide how to print out in a form that - * the users of your product will understand, as they are unlikely to know what - * to do with "Recognition exception at: [[TOK_GERUND..... " ;-) - */ - void * message; - - /** Name of the file/input source for reporting. Note that this may be NULL!! - */ - pANTLR3_STRING streamName; - - /** If set to ANTLR3_TRUE, this indicates that the message element of this structure - * should be freed by calling ANTLR3_FREE() when the exception is destroyed. - */ - ANTLR3_BOOLEAN freeMessage; - - /** Indicates the index of the 'token' we were looking at when the - * exception occurred. - */ - ANTLR3_MARKER index; - - /** Indicates what the current token/tree was when the error occurred. Since not - * all input streams will be able to retrieve the nth token, we track it here - * instead. This is for parsers, and even tree parsers may set this. - */ - void * token; - - /** Indicates the token we were expecting to see next when the error occurred - */ - ANTLR3_UINT32 expecting; - - /** Indicates a set of tokens that we were expecting to see one of when the - * error occurred. It is a following bitset list, so you can use load it and use ->toIntList() on it - * to generate an array of integer tokens that it represents. - */ - pANTLR3_BITSET_LIST expectingSet; - - /** If this is a tree parser exception then the node is set to point to the node - * that caused the issue. - */ - void * node; - - /** The current character when an error occurred - for lexers. - */ - ANTLR3_UCHAR c; - - /** Track the line at which the error occurred in case this is - * generated from a lexer. We need to track this since the - * unexpected char doesn't carry the line info. - */ - ANTLR3_UINT32 line; - - /** Character position in the line where the error occurred. - */ - ANTLR3_INT32 charPositionInLine; - - /** decision number for NVE - */ - ANTLR3_UINT32 decisionNum; - - /** State for NVE - */ - ANTLR3_UINT32 state; - - /** Rule name for failed predicate exception - */ - void * ruleName; - - /** Pointer to the next exception in the chain (if any) - */ - struct ANTLR3_EXCEPTION_struct * nextException; - - /** Pointer to the input stream that this exception occurred in. - */ - pANTLR3_INT_STREAM input; - - /** Pointer for you, the programmer to add anything you like to an exception. - */ - void * custom; - - /** Pointer to a routine that is called to free the custom exception structure - * when the exception is destroyed. Set to NULL if nothing should be done. - */ - void (*freeCustom) (void * custom); - void (*print) (struct ANTLR3_EXCEPTION_struct * ex); - void (*freeEx) (struct ANTLR3_EXCEPTION_struct * ex); - -} - ANTLR3_EXCEPTION; - -#ifdef __cplusplus -} -#endif - - -#endif diff --git a/impl/antlr/libantlr3c-3.4/include/antlr3filestream.h b/impl/antlr/libantlr3c-3.4/include/antlr3filestream.h deleted file mode 100644 index b06eb45..0000000 --- a/impl/antlr/libantlr3c-3.4/include/antlr3filestream.h +++ /dev/null @@ -1,50 +0,0 @@ -#ifndef _ANTLR3_FILESTREAM_H -#define _ANTLR3_FILESTREAM_H - -// [The "BSD licence"] -// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC -// http://www.temporal-wave.com -// http://www.linkedin.com/in/jimidle -// -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions -// are met: -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// 3. The name of the author may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -ANTLR3_API ANTLR3_FDSC antlr3Fopen (pANTLR3_UINT8 filename, const char * mode); -ANTLR3_API void antlr3Fclose (ANTLR3_FDSC fd); - -ANTLR3_API ANTLR3_UINT32 antlr3Fsize (pANTLR3_UINT8 filename); -ANTLR3_API ANTLR3_UINT32 antlr3read8Bit (pANTLR3_INPUT_STREAM input, pANTLR3_UINT8 fileName); -ANTLR3_API ANTLR3_UINT32 antlr3Fread (ANTLR3_FDSC fdsc, ANTLR3_UINT32 count, void * data); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/impl/antlr/libantlr3c-3.4/include/antlr3input.h b/impl/antlr/libantlr3c-3.4/include/antlr3input.h deleted file mode 100644 index 3b01ae6..0000000 --- a/impl/antlr/libantlr3c-3.4/include/antlr3input.h +++ /dev/null @@ -1,281 +0,0 @@ -/** \file - * Defines the basic structures used to manipulate character - * streams from any input source. Any character size and encoding - * can in theory be used, so long as a set of functinos is provided that - * can return a 32 bit Integer representation of their characters amd efficiently mark and revert - * to specific offsets into their input streams. - */ -#ifndef _ANTLR3_INPUT_H -#define _ANTLR3_INPUT_H - -// [The "BSD licence"] -// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC -// http://www.temporal-wave.com -// http://www.linkedin.com/in/jimidle -// -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions -// are met: -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// 3. The name of the author may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include -#include -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - - - -/// Master context structure for an ANTLR3 C runtime based input stream. -/// \ingroup apistructures -/// -typedef struct ANTLR3_INPUT_STREAM_struct -{ - /** Interfaces that provide streams must all provide - * a generic ANTLR3_INT_STREAM interface and an ANTLR3_INPUT_STREAM - * is no different. - */ - pANTLR3_INT_STREAM istream; - - /** Whatever super structure is providing the INPUT stream needs a pointer to itself - * so that this can be passed back to it whenever the api functions - * are called back from this interface. - */ - void * super; - - /** Pointer the start of the input string, characters may be - * taken as offsets from here and in original input format encoding. - */ - void * data; - - /** Indicates if the data pointer was allocated by us, and so should be freed - * when the stream dies. - */ - int isAllocated; - - /** String factory for this input stream - */ - pANTLR3_STRING_FACTORY strFactory; - - - /** Pointer to the next character to be consumed from the input data - * This is cast to point at the encoding of the original file that - * was read by the functions installed as pointer in this input stream - * context instance at file/string/whatever load time. - */ - void * nextChar; - - /** Number of characters that can be consumed at this point in time. - * Mostly this is just what is left in the pre-read buffer, but if the - * input source is a stream such as a socket or something then we may - * call special read code to wait for more input. - */ - ANTLR3_UINT32 sizeBuf; - - /** The line number we are traversing in the input file. This gets incremented - * by a newline() call in the lexer grammar actions. - */ - ANTLR3_UINT32 line; - - /** Pointer into the input buffer where the current line - * started. - */ - void * currentLine; - - /** The offset within the current line of the current character - */ - ANTLR3_INT32 charPositionInLine; - - /** Tracks how deep mark() calls are nested - */ - ANTLR3_UINT32 markDepth; - - /** List of mark() points in the input stream - */ - pANTLR3_VECTOR markers; - - /** File name string, set to pointer to memory if - * you set it manually as it will be free()d - */ - pANTLR3_STRING fileName; - - /** File number, needs to be set manually to some file index of your devising. - */ - ANTLR3_UINT32 fileNo; - - /* API */ - - - /** Pointer to function that closes the input stream - */ - void (*close) (struct ANTLR3_INPUT_STREAM_struct * input); - void (*free) (struct ANTLR3_INPUT_STREAM_struct * input); - - /** Pointer to function that resets the input stream - */ - void (*reset) (struct ANTLR3_INPUT_STREAM_struct * input); - - /** Pointer to a function that reuses and resets an input stream by - * supplying a new 'source' - */ - void (*reuse) (struct ANTLR3_INPUT_STREAM_struct * input, pANTLR3_UINT8 inString, ANTLR3_UINT32 size, pANTLR3_UINT8 name); - - /** - * Pointer to function that installs a version of LA that always - * returns upper case. Only valid for character streams and creates a case - * insensitive lexer if the lexer tokens are described in upper case. The - * tokens will preserve case in the token text. - */ - void (*setUcaseLA) (pANTLR3_INPUT_STREAM input, ANTLR3_BOOLEAN flag); - - /** Pointer to function to return input stream element at 1 based - * offset from nextChar. Same as _LA for char stream, but token - * streams etc. have one of these that does other stuff of course. - */ - void * (*_LT) (struct ANTLR3_INPUT_STREAM_struct * input, ANTLR3_INT32 lt); - - /** Pointer to function to return the total size of the input buffer. For streams - * this may be just the total we have available so far. This means of course that - * the input stream must be careful to accumulate enough input so that any backtracking - * can be satisfied. - */ - ANTLR3_UINT32 (*size) (struct ANTLR3_INPUT_STREAM_struct * input); - - /** Pointer to function to return a substring of the input stream. String is returned in allocated - * memory and is in same encoding as the input stream itself, NOT internal ANTLR3_UCHAR form. - */ - pANTLR3_STRING (*substr) (struct ANTLR3_INPUT_STREAM_struct * input, ANTLR3_MARKER start, ANTLR3_MARKER stop); - - /** Pointer to function to return the current line number in the input stream - */ - ANTLR3_UINT32 (*getLine) (struct ANTLR3_INPUT_STREAM_struct * input); - - /** Pointer to function to return the current line buffer in the input stream - * The pointer returned is directly into the input stream so you must copy - * it if you wish to manipulate it without damaging the input stream. Encoding - * is obviously in the same form as the input stream. - * \remark - * - Note taht this function wil lbe inaccurate if setLine is called as there - * is no way at the moment to position the input stream at a particular line - * number offset. - */ - void * (*getLineBuf) (struct ANTLR3_INPUT_STREAM_struct * input); - - /** Pointer to function to return the current offset in the current input stream line - */ - ANTLR3_UINT32 (*getCharPositionInLine) (struct ANTLR3_INPUT_STREAM_struct * input); - - /** Pointer to function to set the current line number in the input stream - */ - void (*setLine) (struct ANTLR3_INPUT_STREAM_struct * input, ANTLR3_UINT32 line); - - /** Pointer to function to set the current position in the current line. - */ - void (*setCharPositionInLine) (struct ANTLR3_INPUT_STREAM_struct * input, ANTLR3_UINT32 position); - - /** Pointer to function to override the default newline character that the input stream - * looks for to trigger the line/offset and line buffer recording information. - * \remark - * - By default the chracter '\n' will be installed as the newline trigger character. When this - * character is seen by the consume() function then the current line number is incremented and the - * current line offset is reset to 0. The Pointer for the line of input we are consuming - * is updated to point to the next character after this one in the input stream (which means it - * may become invalid if the last newline character in the file is seen (so watch out). - * - If for some reason you do not want the counters and pointers to be restee, you can set the - * chracter to some impossible character such as '\0' or whatever. - * - This is a single character only, so choose the last character in a sequence of two or more. - * - This is only a simple aid to error reporting - if you have a complicated binary input structure - * it may not be adequate, but you can always override every function in the input stream with your - * own of course, and can even write your own complete input stream set if you like. - * - It is your responsiblity to set a valid character for the input stream type. There is no point - * setting this to 0xFFFFFFFF if the input stream is 8 bit ASCII, as this will just be truncated and never - * trigger as the comparison will be (INT32)0xFF == (INT32)0xFFFFFFFF - */ - void (*SetNewLineChar) (struct ANTLR3_INPUT_STREAM_struct * input, ANTLR3_UINT32 newlineChar); - - /// Character that automatically causes an internal line count - /// increment. - /// - ANTLR3_UCHAR newlineChar; - - /// Indicates the size, in 8 bit units, of a single character. Note that - /// the C runtime does not deal with surrogates as this would be - /// slow and complicated. If this is a UTF-8 stream then this field - /// will be set to 0. Generally you are best working internally with 32 bit characters - /// as this is the most efficient. - /// - ANTLR3_UINT8 charByteSize; - - /// Indicates the encoding scheme used in this input stream - /// - ANTLR3_UINT32 encoding; -} - - ANTLR3_INPUT_STREAM; - - -/** \brief Structure for track lex input states as part of mark() - * and rewind() of lexer. - */ -typedef struct ANTLR3_LEX_STATE_struct -{ - /** Pointer to the next character to be consumed from the input data - * This is cast to point at the encoding of the original file that - * was read by the functions installed as pointer in this input stream - * context instance at file/string/whatever load time. - */ - void * nextChar; - - /** The line number we are traversing in the input file. This gets incremented - * by a newline() call in the lexer grammer actions. - */ - ANTLR3_UINT32 line; - - /** Pointer into the input buffer where the current line - * started. - */ - void * currentLine; - - /** The offset within the current line of the current character - */ - ANTLR3_INT32 charPositionInLine; - -} - ANTLR3_LEX_STATE; - -/* Prototypes - */ -void antlr38BitSetupStream (pANTLR3_INPUT_STREAM input); -void antlr3UTF16SetupStream (pANTLR3_INPUT_STREAM input, ANTLR3_BOOLEAN machineBigEndian, ANTLR3_BOOLEAN inputBigEndian); -void antlr3UTF32SetupStream (pANTLR3_INPUT_STREAM input, ANTLR3_BOOLEAN machineBigEndian, ANTLR3_BOOLEAN inputBigEndian); -void antlr3UTF8SetupStream (pANTLR3_INPUT_STREAM input); -void antlr3EBCDICSetupStream (pANTLR3_INPUT_STREAM input); -void antlr3GenericSetupStream (pANTLR3_INPUT_STREAM input); -#ifdef __cplusplus -} -#endif - -#endif /* _ANTLR3_INPUT_H */ diff --git a/impl/antlr/libantlr3c-3.4/include/antlr3interfaces.h b/impl/antlr/libantlr3c-3.4/include/antlr3interfaces.h deleted file mode 100644 index 160e04d..0000000 --- a/impl/antlr/libantlr3c-3.4/include/antlr3interfaces.h +++ /dev/null @@ -1,239 +0,0 @@ -/** \file - * Declarations for all the antlr3 C runtime interfaces/classes. This - * allows the structures that define the interfaces to contain pointers to - * each other without trying to sort out the cyclic interdependencies that - * would otherwise result. - */ -#ifndef _ANTLR3_INTERFACES_H -#define _ANTLR3_INTERFACES_H - -// [The "BSD licence"] -// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC -// http://www.temporal-wave.com -// http://www.linkedin.com/in/jimidle -// -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions -// are met: -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// 3. The name of the author may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct ANTLR3_INT_STREAM_struct *pANTLR3_INT_STREAM; - -/// Pointer to an instantiation of the 'class' #ANTLR3_BASE_RECOGNIZER -/// \ingroup ANTLR3_BASE_RECOGNIZER -/// -typedef struct ANTLR3_BASE_RECOGNIZER_struct *pANTLR3_BASE_RECOGNIZER; -/// Pointer to an instantiation of 'class' #ANTLR3_RECOGNIZER_SHARED_STATE -/// \ingroup ANTLR3_RECOGNIZER_SHARED_STATE -/// -typedef struct ANTLR3_RECOGNIZER_SHARED_STATE_struct *pANTLR3_RECOGNIZER_SHARED_STATE; - -/// Pointer to an instantiation of 'class' #ANTLR3_BITSET_LIST -/// \ingroup ANTLR3_BITSET_LIST -/// -typedef struct ANTLR3_BITSET_LIST_struct *pANTLR3_BITSET_LIST; - -/// Pointer to an instantiation of 'class' #ANTLR3_BITSET -/// \ingroup ANTLR3_BITSET -/// -typedef struct ANTLR3_BITSET_struct *pANTLR3_BITSET; - -/// Pointer to an instantiation of 'class' #ANTLR3_TOKEN_FACTORY -/// \ingroup ANTLR3_TOKEN_FACTORY -/// -typedef struct ANTLR3_TOKEN_FACTORY_struct *pANTLR3_TOKEN_FACTORY; -/// Pointer to an instantiation of 'class' #ANTLR3_COMMON_TOKEN -/// \ingroup ANTLR3_COMMON_TOKEN -/// -typedef struct ANTLR3_COMMON_TOKEN_struct *pANTLR3_COMMON_TOKEN; - -/// Pointer to an instantiation of 'class' #ANTLR3_EXCEPTION -/// \ingroup ANTLR3_EXCEPTION -/// -typedef struct ANTLR3_EXCEPTION_struct *pANTLR3_EXCEPTION; - -/// Pointer to an instantiation of 'class' #ANTLR3_HASH_BUCKET -/// \ingroup ANTLR3_HASH_BUCKET -/// -typedef struct ANTLR3_HASH_BUCKET_struct *pANTLR3_HASH_BUCKET; -/// Pointer to an instantiation of 'class' #ANTLR3_HASH_ENTRY -/// \ingroup ANTLR3_HASH_ENTRY -/// -typedef struct ANTLR3_HASH_ENTRY_struct *pANTLR3_HASH_ENTRY; -/// Pointer to an instantiation of 'class' #ANTLR3_HASH_ENUM -/// \ingroup ANTLR3_HASH_ENUM -/// -typedef struct ANTLR3_HASH_ENUM_struct *pANTLR3_HASH_ENUM; -/// Pointer to an instantiation of 'class' #ANTLR3_HASH_TABLE -/// \ingroup ANTLR3_HASH_TABLE -/// -typedef struct ANTLR3_HASH_TABLE_struct *pANTLR3_HASH_TABLE; - -/// Pointer to an instantiation of 'class' #ANTLR3_LIST -/// \ingroup ANTLR3_LIST -/// -typedef struct ANTLR3_LIST_struct *pANTLR3_LIST; -/// Pointer to an instantiation of 'class' #ANTLR3_VECTOR_FACTORY -/// \ingroup ANTLR3_VECTOR_FACTORY -/// -typedef struct ANTLR3_VECTOR_FACTORY_struct *pANTLR3_VECTOR_FACTORY; -/// Pointer to an instantiation of 'class' #ANTLR3_VECTOR -/// \ingroup ANTLR3_VECTOR -/// -typedef struct ANTLR3_VECTOR_struct *pANTLR3_VECTOR; -/// Pointer to an instantiation of 'class' #ANTLR3_STACK -/// \ingroup ANTLR3_STACK -/// -typedef struct ANTLR3_STACK_struct *pANTLR3_STACK; - -/// Pointer to an instantiation of 'class' #ANTLR3_TOPO -/// \ingroup ANTLR3_TOPO -/// -typedef struct ANTLR3_TOPO_struct *pANTLR3_TOPO; - -/// Pointer to an instantiation of 'class' #ANTLR3_INPUT_STREAM -/// \ingroup ANTLR3_INPUT_STREAM -/// -typedef struct ANTLR3_INPUT_STREAM_struct *pANTLR3_INPUT_STREAM; -/// Pointer to an instantiation of 'class' #ANTLR3_LEX_STATE -/// \ingroup ANTLR3_LEX_STATE -/// -typedef struct ANTLR3_LEX_STATE_struct *pANTLR3_LEX_STATE; - -/// Pointer to an instantiation of 'class' #ANTLR3_STRING_FACTORY -/// \ingroup ANTLR3_STRING_FACTORY -/// -typedef struct ANTLR3_STRING_FACTORY_struct *pANTLR3_STRING_FACTORY; -/// Pointer to an instantiation of 'class' #ANTLR3_STRING -/// \ingroup ANTLR3_STRING -/// -typedef struct ANTLR3_STRING_struct *pANTLR3_STRING; - -/// Pointer to an instantiation of 'class' #ANTLR3_TOKEN_SOURCE -/// \ingroup ANTLR3_TOKEN_SOURCE -/// -typedef struct ANTLR3_TOKEN_SOURCE_struct *pANTLR3_TOKEN_SOURCE; -/// Pointer to an instantiation of 'class' #ANTLR3_TOKEN_STREAM -/// \ingroup ANTLR3_TOKEN_STREAM -/// -typedef struct ANTLR3_TOKEN_STREAM_struct *pANTLR3_TOKEN_STREAM; -/// Pointer to an instantiation of 'class' #ANTLR3_COMMON_TOKEN_STREAM -/// \ingroup ANTLR3_COMMON_TOKEN_STREAM -/// -typedef struct ANTLR3_COMMON_TOKEN_STREAM_struct *pANTLR3_COMMON_TOKEN_STREAM; - -/// Pointer to an instantiation of 'class' #ANTLR3_CYCLIC_DFA -/// \ingroup ANTLR3_CYCLIC_DFA -/// -typedef struct ANTLR3_CYCLIC_DFA_struct *pANTLR3_CYCLIC_DFA; - -/// Pointer to an instantiation of 'class' #ANTLR3_LEXER -/// \ingroup ANTLR3_LEXER -/// -typedef struct ANTLR3_LEXER_struct *pANTLR3_LEXER; -/// Pointer to an instantiation of 'class' #ANTLR3_PARSER -/// \ingroup ANTLR3_PARSER -/// -typedef struct ANTLR3_PARSER_struct *pANTLR3_PARSER; - -/// Pointer to an instantiation of 'class' #ANTLR3_BASE_TREE -/// \ingroup ANTLR3_BASE_TREE -/// -typedef struct ANTLR3_BASE_TREE_struct *pANTLR3_BASE_TREE; -/// Pointer to an instantiation of 'class' #ANTLR3_COMMON_TREE -/// \ingroup ANTLR3_COMMON_TREE -/// -typedef struct ANTLR3_COMMON_TREE_struct *pANTLR3_COMMON_TREE; -/// Pointer to an instantiation of 'class' #ANTLR3_ARBORETUM -/// \ingroup ANTLR3_ARBORETUM -/// -typedef struct ANTLR3_ARBORETUM_struct *pANTLR3_ARBORETUM; -/// Pointer to an instantiation of 'class' #ANTLR3_PARSE_TREE -/// \ingroup ANTLR3_PARSE_TREE -/// -typedef struct ANTLR3_PARSE_TREE_struct *pANTLR3_PARSE_TREE; - -/// Pointer to an instantiation of 'class' #ANTLR3_TREE_NODE_STREAM -/// \ingroup ANTLR3_TREE_NODE_STREAM -/// -typedef struct ANTLR3_TREE_NODE_STREAM_struct *pANTLR3_TREE_NODE_STREAM; -/// Pointer to an instantiation of 'class' #ANTLR3_COMMON_TREE_NODE_STREAM -/// \ingroup ANTLR3_COMMON_TREE_NODE_STREAM -/// -typedef struct ANTLR3_COMMON_TREE_NODE_STREAM_struct *pANTLR3_COMMON_TREE_NODE_STREAM; -/// Pointer to an instantiation of 'class' #ANTLR3_TREE_WALK_STATE -/// \ingroup ANTLR3_TREE_WALK_STATE -/// -typedef struct ANTLR3_TREE_WALK_STATE_struct *pANTLR3_TREE_WALK_STATE; - -/// Pointer to an instantiation of 'class' #ANTLR3_BASE_TREE_ADAPTOR -/// \ingroup ANTLR3_BASE_TREE_ADAPTOR -/// -typedef struct ANTLR3_BASE_TREE_ADAPTOR_struct *pANTLR3_BASE_TREE_ADAPTOR; -/// Pointer to an instantiation of 'class' #ANTLR3_COMMON_TREE_ADAPTOR -/// \ingroup ANTLR3_COMMON_TREE_ADAPTOR -/// -typedef struct ANTLR3_COMMON_TREE_ADAPTOR_struct *pANTLR3_COMMON_TREE_ADAPTOR; - -/// Pointer to an instantiation of 'class' #ANTLR3_TREE_PARSER -/// \ingroup ANTLR3_TREE_PARSER -/// -typedef struct ANTLR3_TREE_PARSER_struct *pANTLR3_TREE_PARSER; - -/// Pointer to an instantiation of 'class' #ANTLR3_INT_TRIE -/// \ingroup ANTLR3_INT_TRIE -/// -typedef struct ANTLR3_INT_TRIE_struct *pANTLR3_INT_TRIE; - -/// Pointer to an instantiation of 'class' #ANTLR3_REWRITE_RULE_ELEMENT_STREAM -/// \ingroup ANTLR3_REWRITE_RULE_ELEMENT_STREAM -/// -typedef struct ANTLR3_REWRITE_RULE_ELEMENT_STREAM_struct *pANTLR3_REWRITE_RULE_ELEMENT_STREAM; -/// Pointer to an instantiation of 'class' #ANTLR3_REWRITE_RULE_ELEMENT_STREAM -/// \ingroup ANTLR3_REWRITE_RULE_ELEMENT_STREAM -/// -typedef struct ANTLR3_REWRITE_RULE_ELEMENT_STREAM_struct *pANTLR3_REWRITE_RULE_TOKEN_STREAM; - -/// Pointer to an instantiation of 'class' #ANTLR3_REWRITE_RULE_SUBSTREE_STREAM -/// \ingroup ANTLR3_REWRITE_RULE_SUBTREE_STREAM -/// -typedef struct ANTLR3_REWRITE_RULE_ELEMENT_STREAM_struct *pANTLR3_REWRITE_RULE_SUBTREE_STREAM; - -/// Pointer to an instantiation of 'class' #ANTLR3_REWRITE_RULE_NODE_STREAM -/// \ingroup ANTLR3_REWRITE_RULE_NODE_STREAM -/// -typedef struct ANTLR3_REWRITE_RULE_ELEMENT_STREAM_struct *pANTLR3_REWRITE_RULE_NODE_STREAM; - -/// Pointer to an instantiation of 'class' #ANTLR3_DEBUG_EVENT_LISTENER -/// \ingroup ANTLR3_DEBUG_EVENT_LISTENER -/// -typedef struct ANTLR3_DEBUG_EVENT_LISTENER_struct *pANTLR3_DEBUG_EVENT_LISTENER; - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/impl/antlr/libantlr3c-3.4/include/antlr3intstream.h b/impl/antlr/libantlr3c-3.4/include/antlr3intstream.h deleted file mode 100644 index 21bac5b..0000000 --- a/impl/antlr/libantlr3c-3.4/include/antlr3intstream.h +++ /dev/null @@ -1,205 +0,0 @@ -/** \file - * Defines the the class interface for an antlr3 INTSTREAM. - * - * Certain functionality (such as DFAs for instance) abstract the stream of tokens - * or characters in to a steam of integers. Hence this structure should be included - * in any stream that is able to provide the output as a stream of integers (which is anything - * basically. - * - * There are no specific implementations of the methods in this interface in general. Though - * for purposes of casting and so on, it may be necesssary to implement a function with - * the signature in this interface which abstracts the base immplementation. In essence though - * the base stream provides a pointer to this interface, within which it installs its - * normal match() functions and so on. Interaces such as DFA are then passed the pANTLR3_INT_STREAM - * and can treat any input as an int stream. - * - * For instance, a lexer implements a pANTLR3_BASE_RECOGNIZER, within which there is a pANTLR3_INT_STREAM. - * However, a pANTLR3_INPUT_STREAM also provides a pANTLR3_INT_STREAM, which it has constructed from - * it's normal interface when it was created. This is then pointed at by the pANTLR_BASE_RECOGNIZER - * when it is intialized with a pANTLR3_INPUT_STREAM. - * - * Similarly if a pANTLR3_BASE_RECOGNIZER is initialized with a pANTLR3_TOKEN_STREAM, then the - * pANTLR3_INT_STREAM is taken from the pANTLR3_TOKEN_STREAM. - * - * If a pANTLR3_BASE_RECOGNIZER is initialized with a pANTLR3_TREENODE_STREAM, then guess where - * the pANTLR3_INT_STREAM comes from? - * - * Note that because the context pointer points to the actual interface structure that is providing - * the ANTLR3_INT_STREAM it is defined as a (void *) in this interface. There is no direct implementation - * of an ANTLR3_INT_STREAM (unless someone did not understand what I was doing here =;?P - */ -#ifndef _ANTLR3_INTSTREAM_H -#define _ANTLR3_INTSTREAM_H - -// [The "BSD licence"] -// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC -// http://www.temporal-wave.com -// http://www.linkedin.com/in/jimidle -// -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions -// are met: -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// 3. The name of the author may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include -#include - -/** Type indicator for a character stream - * \remark if a custom stream is created but it can be treated as - * a char stream, then you may OR in this value to your type indicator - */ -#define ANTLR3_CHARSTREAM 0x0001 - -/** Type indicator for a Token stream - * \remark if a custom stream is created but it can be treated as - * a token stream, then you may OR in this value to your type indicator - */ -#define ANTLR3_TOKENSTREAM 0x0002 - -/** Type indicator for a common tree node stream - * \remark if a custom stream is created but it can be treated as - * a common tree node stream, then you may OR in this value to your type indicator - */ -#define ANTLR3_COMMONTREENODE 0x0004 - -/** Type mask for input stream so we can switch in the above types - * \remark DO NOT USE 0x0000 as a stream type! - */ -#define ANTLR3_INPUT_MASK 0x0007 - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct ANTLR3_INT_STREAM_struct -{ - /** Input stream type indicator. Sometimes useful for error reporting etc. - */ - ANTLR3_UINT32 type; - - /** Potentially useful in error reporting and so on, this string is - * an identification of the input source. It may be NULL, so anything - * attempting to access it needs to check this and substitute a sensible - * default. - */ - pANTLR3_STRING streamName; - - /** Pointer to the super structure that contains this interface. This - * will usually be a token stream or a tree stream. - */ - void * super; - - /** Last marker position allocated - */ - ANTLR3_MARKER lastMarker; - - // Return a string that identifies the input source - // - pANTLR3_STRING (*getSourceName) (struct ANTLR3_INT_STREAM_struct * intStream); - - /** Consume the next 'ANTR3_UINT32' in the stream - */ - void (*consume) (struct ANTLR3_INT_STREAM_struct * intStream); - - /** Get ANTLR3_UINT32 at current input pointer + i ahead where i=1 is next ANTLR3_UINT32 - */ - ANTLR3_UINT32 (*_LA) (struct ANTLR3_INT_STREAM_struct * intStream, ANTLR3_INT32 i); - - /** Tell the stream to start buffering if it hasn't already. Return - * current input position, index(), or some other marker so that - * when passed to rewind() you get back to the same spot. - * rewind(mark()) should not affect the input cursor. - */ - ANTLR3_MARKER (*mark) (struct ANTLR3_INT_STREAM_struct * intStream); - - /** Return the current input symbol index 0..n where n indicates the - * last symbol has been read. - */ - ANTLR3_MARKER (*index) (struct ANTLR3_INT_STREAM_struct * intStream); - - /** Reset the stream so that next call to index would return marker. - * The marker will usually be index() but it doesn't have to be. It's - * just a marker to indicate what state the stream was in. This is - * essentially calling release() and seek(). If there are markers - * created after this marker argument, this routine must unroll them - * like a stack. Assume the state the stream was in when this marker - * was created. - */ - void (*rewind) (struct ANTLR3_INT_STREAM_struct * intStream, ANTLR3_MARKER marker); - - /** Reset the stream to the last marker position, witouh destryoing the - * last marker position. - */ - void (*rewindLast) (struct ANTLR3_INT_STREAM_struct * intStream); - - /** You may want to commit to a backtrack but don't want to force the - * stream to keep bookkeeping objects around for a marker that is - * no longer necessary. This will have the same behavior as - * rewind() except it releases resources without the backward seek. - */ - void (*release) (struct ANTLR3_INT_STREAM_struct * intStream, ANTLR3_MARKER mark); - - /** Set the input cursor to the position indicated by index. This is - * normally used to seek ahead in the input stream. No buffering is - * required to do this unless you know your stream will use seek to - * move backwards such as when backtracking. - * - * This is different from rewind in its multi-directional - * requirement and in that its argument is strictly an input cursor (index). - * - * For char streams, seeking forward must update the stream state such - * as line number. For seeking backwards, you will be presumably - * backtracking using the mark/rewind mechanism that restores state and - * so this method does not need to update state when seeking backwards. - * - * Currently, this method is only used for efficient backtracking, but - * in the future it may be used for incremental parsing. - */ - void (*seek) (struct ANTLR3_INT_STREAM_struct * intStream, ANTLR3_MARKER index); - - /** Only makes sense for streams that buffer everything up probably, but - * might be useful to display the entire stream or for testing. - */ - ANTLR3_UINT32 (*size) (struct ANTLR3_INT_STREAM_struct * intStream); - - /** Because the indirect call, though small in individual cases can - * mount up if there are thousands of tokens (very large input streams), callers - * of size can optionally use this cached size field. - */ - ANTLR3_UINT32 cachedSize; - - /** Frees any resources that were allocated for the implementation of this - * interface. Usually this is just releasing the memory allocated - * for the structure itself, but it may of course do anything it need to - * so long as it does not stamp on anything else. - */ - void (*free) (struct ANTLR3_INT_STREAM_struct * stream); - -} - ANTLR3_INT_STREAM; - -#ifdef __cplusplus -} -#endif - -#endif - diff --git a/impl/antlr/libantlr3c-3.4/include/antlr3lexer.h b/impl/antlr/libantlr3c-3.4/include/antlr3lexer.h deleted file mode 100644 index 6cc10ef..0000000 --- a/impl/antlr/libantlr3c-3.4/include/antlr3lexer.h +++ /dev/null @@ -1,193 +0,0 @@ -/** \file - * Base interface for any ANTLR3 lexer. - * - * An ANLTR3 lexer builds from two sets of components: - * - * - The runtime components that provide common functionality such as - * traversing character streams, building tokens for output and so on. - * - The generated rules and struutre of the actual lexer, which call upon the - * runtime components. - * - * A lexer class contains a character input stream, a base recognizer interface - * (which it will normally implement) and a token source interface (which it also - * implements. The Tokensource interface is called by a token consumer (such as - * a parser, but in theory it can be anything that wants a set of abstract - * tokens in place of a raw character stream. - * - * So then, we set up a lexer in a sequence akin to: - * - * - Create a character stream (something which implements ANTLR3_INPUT_STREAM) - * and initialize it. - * - Create a lexer interface and tell it where it its input stream is. - * This will cause the creation of a base recognizer class, which it will - * override with its own implementations of some methods. The lexer creator - * can also then in turn override anything it likes. - * - The lexer token source interface is then passed to some interface that - * knows how to use it, byte calling for a next token. - * - When a next token is called, let ze lexing begin. - * - */ -#ifndef _ANTLR3_LEXER -#define _ANTLR3_LEXER - -// [The "BSD licence"] -// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC -// http://www.temporal-wave.com -// http://www.linkedin.com/in/jimidle -// -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions -// are met: -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// 3. The name of the author may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -/* Definitions - */ -#define ANTLR3_STRING_TERMINATOR 0xFFFFFFFF - -#include -#include -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct ANTLR3_LEXER_struct -{ - /** If there is a super structure that is implementing the - * lexer, then a pointer to it can be stored here in case - * implementing functions are overridden by this super structure. - */ - void * super; - - /** A generated lexer has an mTokens() function, which needs - * the context pointer of the generated lexer, not the base lexer interface - * this is stored here and initialized by the generated code (or manually - * if this is a manually built lexer. - */ - void * ctx; - - /** A pointer to the character stream whence this lexer is receiving - * characters. - * TODO: I may come back to this and implement charstream outside - * the input stream as per the java implementation. - */ - pANTLR3_INPUT_STREAM input; - - /** Pointer to the implementation of a base recognizer, which the lexer - * creates and then overrides with its own lexer oriented functions (the - * default implementation is parser oriented). This also contains a - * token source interface, which the lexer instance will provide to anything - * that needs it, which is anything else that implements a base recognizer, - * such as a parser. - */ - pANTLR3_BASE_RECOGNIZER rec; - - /** Pointer to a function that sets the charstream source for the lexer and - * causes it to be reset. - */ - void (*setCharStream) (struct ANTLR3_LEXER_struct * lexer, pANTLR3_INPUT_STREAM input); - - /** Pointer to a function that switches the current character input stream to - * a new one, saving the old one, which we will revert to at the end of this - * new one. - */ - void (*pushCharStream) (struct ANTLR3_LEXER_struct * lexer, pANTLR3_INPUT_STREAM input); - - /** Pointer to a function that abandons the current input stream, whether it - * is empty or not and reverts to the previous stacked input stream. - */ - void (*popCharStream) (struct ANTLR3_LEXER_struct * lexer); - - /** Pointer to a function that emits the supplied token as the next token in - * the stream. - */ - void (*emitNew) (struct ANTLR3_LEXER_struct * lexer, pANTLR3_COMMON_TOKEN token); - - /** Pointer to a function that constructs a new token from the lexer stored information - */ - pANTLR3_COMMON_TOKEN (*emit) (struct ANTLR3_LEXER_struct * lexer); - - /** Pointer to the user provided (either manually or through code generation - * function that causes the lexer rules to run the lexing rules and produce - * the next token if there iss one. This is called from nextToken() in the - * pANTLR3_TOKEN_SOURCE. Note that the input parameter for this funciton is - * the generated lexer context (stored in ctx in this interface) it is a generated - * function and expects the context to be the generated lexer. - */ - void (*mTokens) (void * ctx); - - /** Pointer to a function that attempts to match and consume the specified string from the input - * stream. Note that strings muse be passed as terminated arrays of ANTLR3_UCHAR. Strings are terminated - * with 0xFFFFFFFF, which is an invalid UTF32 character - */ - ANTLR3_BOOLEAN (*matchs) (struct ANTLR3_LEXER_struct * lexer, ANTLR3_UCHAR * string); - - /** Pointer to a function that matches and consumes the specified character from the input stream. - * The input stream is required to provide characters via LA() as UTF32 characters. The default lexer - * implementation is source encoding agnostic and so input streams do not generally need to - * override the default implmentation. - */ - ANTLR3_BOOLEAN (*matchc) (struct ANTLR3_LEXER_struct * lexer, ANTLR3_UCHAR c); - - /** Pointer to a function that matches any character in the supplied range (I suppose it could be a token range too - * but this would only be useful if the tokens were in tsome guaranteed order which is - * only going to happen with a hand crafted token set). - */ - ANTLR3_BOOLEAN (*matchRange) (struct ANTLR3_LEXER_struct * lexer, ANTLR3_UCHAR low, ANTLR3_UCHAR high); - - /** Pointer to a function that matches the next token/char in the input stream - * regardless of what it actaully is. - */ - void (*matchAny) (struct ANTLR3_LEXER_struct * lexer); - - /** Pointer to a function that recovers from an error found in the input stream. - * Generally, this will be a #ANTLR3_EXCEPTION_NOVIABLE_ALT but it could also - * be from a mismatched token that the (*match)() could not recover from. - */ - void (*recover) (struct ANTLR3_LEXER_struct * lexer); - - /** Pointer to function to return the current line number in the input stream - */ - ANTLR3_UINT32 (*getLine) (struct ANTLR3_LEXER_struct * lexer); - ANTLR3_MARKER (*getCharIndex) (struct ANTLR3_LEXER_struct * lexer); - ANTLR3_UINT32 (*getCharPositionInLine)(struct ANTLR3_LEXER_struct * lexer); - - /** Pointer to function to return the text so far for the current token being generated - */ - pANTLR3_STRING (*getText) (struct ANTLR3_LEXER_struct * lexer); - - - /** Pointer to a function that knows how to free the resources of a lexer - */ - void (*free) (struct ANTLR3_LEXER_struct * lexer); - -} - ANTLR3_LEXER; - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/impl/antlr/libantlr3c-3.4/include/antlr3memory.h b/impl/antlr/libantlr3c-3.4/include/antlr3memory.h deleted file mode 100644 index 5e2d4c9..0000000 --- a/impl/antlr/libantlr3c-3.4/include/antlr3memory.h +++ /dev/null @@ -1,36 +0,0 @@ -#ifndef _ANTLR3MEMORY_H -#define _ANTLR3MEMORY_H - -// [The "BSD licence"] -// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC -// http://www.temporal-wave.com -// http://www.linkedin.com/in/jimidle -// -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions -// are met: -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// 3. The name of the author may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include - - -#endif /* _ANTLR3MEMORY_H */ diff --git a/impl/antlr/libantlr3c-3.4/include/antlr3parser.h b/impl/antlr/libantlr3c-3.4/include/antlr3parser.h deleted file mode 100644 index 95b7d18..0000000 --- a/impl/antlr/libantlr3c-3.4/include/antlr3parser.h +++ /dev/null @@ -1,93 +0,0 @@ -/** \file - * Base implementation of an ANTLR3 parser. - * - * - */ -#ifndef _ANTLR3_PARSER_H -#define _ANTLR3_PARSER_H - -// [The "BSD licence"] -// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC -// http://www.temporal-wave.com -// http://www.linkedin.com/in/jimidle -// -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions -// are met: -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// 3. The name of the author may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/** This is the main interface for an ANTLR3 parser. - */ -typedef struct ANTLR3_PARSER_struct -{ - /** All superstructure implementers of this interface require a pointer to their selves, - * which they can reference using the super pointer here. - */ - void * super; - - /** A pointer to the base recognizer, where most of the parser functions actually - * live because they are shared between parser and tree parser and this is the - * easier way than copying the interface all over the place. Macros hide this - * for the generated code so it is easier on the eye (though not the debugger ;-). - */ - pANTLR3_BASE_RECOGNIZER rec; - - /** A provider of a tokenstream interface, for the parser to consume - * tokens from. - */ - pANTLR3_TOKEN_STREAM tstream; - - /** A pointer to a function that installs a debugger object (it also - * installs the debugging versions of the parser methods. This means that - * a non debug parser incurs no overhead because of the debugging stuff. - */ - void (*setDebugListener) (struct ANTLR3_PARSER_struct * parser, pANTLR3_DEBUG_EVENT_LISTENER dbg); - - /** A pointer to a function that installs a token stream - * for the parser. - */ - void (*setTokenStream) (struct ANTLR3_PARSER_struct * parser, pANTLR3_TOKEN_STREAM); - - /** A pointer to a function that returns the token stream for this - * parser. - */ - pANTLR3_TOKEN_STREAM (*getTokenStream) (struct ANTLR3_PARSER_struct * parser); - - /** Pointer to a function that knows how to free resources of an ANTLR3 parser. - */ - void (*free) (struct ANTLR3_PARSER_struct * parser); - -} - ANTLR3_PARSER; - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/impl/antlr/libantlr3c-3.4/include/antlr3parsetree.h b/impl/antlr/libantlr3c-3.4/include/antlr3parsetree.h deleted file mode 100644 index 0e8c157..0000000 --- a/impl/antlr/libantlr3c-3.4/include/antlr3parsetree.h +++ /dev/null @@ -1,85 +0,0 @@ -/** \file - * Abstraction of Common tree to provide payload and string representation of node. - * - * \todo May not need this in the end - */ - -#ifndef ANTLR3_PARSETREE_H -#define ANTLR3_PARSETREE_H - -// [The "BSD licence"] -// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC -// http://www.temporal-wave.com -// http://www.linkedin.com/in/jimidle -// -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions -// are met: -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// 3. The name of the author may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct ANTLR3_PARSE_TREE_struct -{ - /** Any interface that implements methods in this interface - * may need to point back to itself using this pointer to its - * super structure. - */ - void * super; - - /** The payload that the parse tree node passes around - */ - void * payload; - - /** An encapsulated BASE TREE strcuture (NOT a pointer) - * that perfoms a lot of the dirty work of node management - */ - ANTLR3_BASE_TREE baseTree; - - /** How to dup this node - */ - pANTLR3_BASE_TREE (*dupNode) (struct ANTLR3_PARSE_TREE_struct * tree); - - /** Return the type of this node - */ - ANTLR3_UINT32 (*getType) (struct ANTLR3_PARSE_TREE_struct * tree); - - /** Return the string representation of the payload (must be installed - * when the payload is added and point to a function that knwos how to - * manifest a pANTLR3_STRING from a node. - */ - pANTLR3_STRING (*toString) (struct ANTLR3_PARSE_TREE_struct * payload); - - void (*free) (struct ANTLR3_PARSE_TREE_struct * tree); - -} - ANTLR3_PARSE_TREE; - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/impl/antlr/libantlr3c-3.4/include/antlr3recognizersharedstate.h b/impl/antlr/libantlr3c-3.4/include/antlr3recognizersharedstate.h deleted file mode 100644 index 9e024d8..0000000 --- a/impl/antlr/libantlr3c-3.4/include/antlr3recognizersharedstate.h +++ /dev/null @@ -1,218 +0,0 @@ -/** \file - * While the C runtime does not need to model the state of - * multiple lexers and parsers in the same way as the Java runtime does - * it is no overhead to reflect that model. In fact the - * C runtime has always been able to share recognizer state. - * - * This 'class' therefore defines all the elements of a recognizer - * (either lexer, parser or tree parser) that are need to - * track the current recognition state. Multiple recognizers - * may then share this state, for instance when one grammar - * imports another. - */ - -#ifndef _ANTLR3_RECOGNIZER_SHARED_STATE_H -#define _ANTLR3_RECOGNIZER_SHARED_STATE_H - -// [The "BSD licence"] -// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC -// http://www.temporal-wave.com -// http://www.linkedin.com/in/jimidle -// -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions -// are met: -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// 3. The name of the author may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/** All the data elements required to track the current state - * of any recognizer (lexer, parser, tree parser). - * May be share between multiple recognizers such that - * grammar inheritance is easily supported. - */ -typedef struct ANTLR3_RECOGNIZER_SHARED_STATE_struct -{ - /** If set to ANTLR3_TRUE then the recognizer has an exception - * condition (this is tested by the generated code for the rules of - * the grammar). - */ - ANTLR3_BOOLEAN error; - - /** Points to the first in a possible chain of exceptions that the - * recognizer has discovered. - */ - pANTLR3_EXCEPTION exception; - - /** Track around a hint from the creator of the recognizer as to how big this - * thing is going to get, as the actress said to the bishop. This allows us - * to tune hash tables accordingly. This might not be the best place for this - * in the end but we will see. - */ - ANTLR3_UINT32 sizeHint; - - /** Track the set of token types that can follow any rule invocation. - * Stack structure, to support: List. - */ - pANTLR3_STACK following; - - - /** This is true when we see an error and before having successfully - * matched a token. Prevents generation of more than one error message - * per error. - */ - ANTLR3_BOOLEAN errorRecovery; - - /** The index into the input stream where the last error occurred. - * This is used to prevent infinite loops where an error is found - * but no token is consumed during recovery...another error is found, - * ad nauseam. This is a failsafe mechanism to guarantee that at least - * one token/tree node is consumed for two errors. - */ - ANTLR3_MARKER lastErrorIndex; - - /** In lieu of a return value, this indicates that a rule or token - * has failed to match. Reset to false upon valid token match. - */ - ANTLR3_BOOLEAN failed; - - /** When the recognizer terminates, the error handling functions - * will have incremented this value if any error occurred (that was displayed). It can then be - * used by the grammar programmer without having to use static globals. - */ - ANTLR3_UINT32 errorCount; - - /** If 0, no backtracking is going on. Safe to exec actions etc... - * If >0 then it's the level of backtracking. - */ - ANTLR3_INT32 backtracking; - - /** ANTLR3_VECTOR of ANTLR3_LIST for rule memoizing. - * Tracks the stop token index for each rule. ruleMemo[ruleIndex] is - * the memoization table for ruleIndex. For key ruleStartIndex, you - * get back the stop token for associated rule or MEMO_RULE_FAILED. - * - * This is only used if rule memoization is on. - */ - pANTLR3_INT_TRIE ruleMemo; - - /** Pointer to an array of token names - * that are generally useful in error reporting. The generated parsers install - * this pointer. The table it points to is statically allocated as 8 bit ascii - * at parser compile time - grammar token names are thus restricted in character - * sets, which does not seem to terrible. - */ - pANTLR3_UINT8 * tokenNames; - - /** User programmable pointer that can be used for instance as a place to - * store some tracking structure specific to the grammar that would not normally - * be available to the error handling functions. - */ - void * userp; - - /** The goal of all lexer rules/methods is to create a token object. - * This is an instance variable as multiple rules may collaborate to - * create a single token. For example, NUM : INT | FLOAT ; - * In this case, you want the INT or FLOAT rule to set token and not - * have it reset to a NUM token in rule NUM. - */ - pANTLR3_COMMON_TOKEN token; - - /** The goal of all lexer rules being to create a token, then a lexer - * needs to build a token factory to create them. - */ - pANTLR3_TOKEN_FACTORY tokFactory; - - /** A lexer is a source of tokens, produced by all the generated (or - * hand crafted if you like) matching rules. As such it needs to provide - * a token source interface implementation. - */ - pANTLR3_TOKEN_SOURCE tokSource; - - /** The channel number for the current token - */ - ANTLR3_UINT32 channel; - - /** The token type for the current token - */ - ANTLR3_UINT32 type; - - /** The input line (where it makes sense) on which the first character of the current - * token resides. - */ - ANTLR3_INT32 tokenStartLine; - - /** The character position of the first character of the current token - * within the line specified by tokenStartLine - */ - ANTLR3_INT32 tokenStartCharPositionInLine; - - /** What character index in the stream did the current token start at? - * Needed, for example, to get the text for current token. Set at - * the start of nextToken. - */ - ANTLR3_MARKER tokenStartCharIndex; - - /** Text for the current token. This can be overridden by setting this - * variable directly or by using the SETTEXT() macro (preferred) in your - * lexer rules. - */ - pANTLR3_STRING text; - - /** User controlled variables that will be installed in a newly created - * token. - */ - ANTLR3_UINT32 user1, user2, user3; - void * custom; - - /** Input stream stack, which allows the C programmer to switch input streams - * easily and allow the standard nextToken() implementation to deal with it - * as this is a common requirement. - */ - pANTLR3_STACK streams; - - /// A stack of token/tree rewrite streams that are available for use - /// by a parser or tree parser that is using rewrites to generate - /// an AST. This saves each rule in the recongizer from having to - /// allocate and deallocate rewtire streams on entry and exit. As - /// the parser recurses throgh the rules it will reach a steady state - /// of the maximum number of allocated streams, which instead of - /// deallocating them at rule exit, it will place on this stack for - /// reuse. The streams are then all finally freed when this stack - /// is freed. - /// - pANTLR3_VECTOR rStreams; - -} - ANTLR3_RECOGNIZER_SHARED_STATE; - -#ifdef __cplusplus -} -#endif - -#endif - - diff --git a/impl/antlr/libantlr3c-3.4/include/antlr3rewritestreams.h b/impl/antlr/libantlr3c-3.4/include/antlr3rewritestreams.h deleted file mode 100644 index bf83fe9..0000000 --- a/impl/antlr/libantlr3c-3.4/include/antlr3rewritestreams.h +++ /dev/null @@ -1,180 +0,0 @@ -#ifndef ANTLR3REWRITESTREAM_H -#define ANTLR3REWRITESTREAM_H - -// [The "BSD licence"] -// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC -// http://www.temporal-wave.com -// http://www.linkedin.com/in/jimidle -// -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions -// are met: -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// 3. The name of the author may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/// A generic list of elements tracked in an alternative to be used in -/// a -> rewrite rule. -/// -/// In the C implementation, all tree oriented streams return a pointer to -/// the same type: pANTLR3_BASE_TREE. Anything that has subclassed from this -/// still passes this type, within which there is a super pointer, which points -/// to it's own data and methods. Hence we do not need to implement this as -/// the equivalent of an abstract class, but just fill in the appropriate interface -/// as usual with this model. -/// -/// Once you start next()ing, do not try to add more elements. It will -/// break the cursor tracking I believe. -/// -/// -/// \see #pANTLR3_REWRITE_RULE_NODE_STREAM -/// \see #pANTLR3_REWRITE_RULE_ELEMENT_STREAM -/// \see #pANTLR3_REWRITE_RULE_SUBTREE_STREAM -/// -/// TODO: add mechanism to detect/puke on modification after reading from stream -/// -typedef struct ANTLR3_REWRITE_RULE_ELEMENT_STREAM_struct -{ - - /// Cursor 0..n-1. If singleElement!=NULL, cursor is 0 until you next(), - /// which bumps it to 1 meaning no more elements. - /// - ANTLR3_UINT32 cursor; - - /// Track single elements w/o creating a list. Upon 2nd add, alloc list - /// - void * singleElement; - - /// The list of tokens or subtrees we are tracking - /// - pANTLR3_VECTOR elements; - - /// Indicates whether we should free the vector or it was supplied to us - /// - ANTLR3_BOOLEAN freeElements; - - /// The element or stream description; usually has name of the token or - /// rule reference that this list tracks. Can include rulename too, but - /// the exception would track that info. - /// - void * elementDescription; - - /// Pointer to the tree adaptor in use for this stream - /// - pANTLR3_BASE_TREE_ADAPTOR adaptor; - - /// Once a node / subtree has been used in a stream, it must be dup'ed - /// from then on. Streams are reset after sub rules so that the streams - /// can be reused in future sub rules. So, reset must set a dirty bit. - /// If dirty, then next() always returns a dup. - /// - ANTLR3_BOOLEAN dirty; - - // Pointer to the recognizer shared state to which this stream belongs - // - pANTLR3_BASE_RECOGNIZER rec; - - // Methods - - /// Reset the condition of this stream so that it appears we have - /// not consumed any of its elements. Elements themselves are untouched. - /// - void (*reset) (struct ANTLR3_REWRITE_RULE_ELEMENT_STREAM_struct * stream); - - /// Add a new pANTLR3_BASE_TREE to this stream - /// - void (*add) (struct ANTLR3_REWRITE_RULE_ELEMENT_STREAM_struct * stream, void *el, void (ANTLR3_CDECL *freePtr)(void *)); - - /// Return the next element in the stream. If out of elements, throw - /// an exception unless size()==1. If size is 1, then return elements[0]. - /// - void * (*next) (struct ANTLR3_REWRITE_RULE_ELEMENT_STREAM_struct * stream); - pANTLR3_BASE_TREE (*nextTree) (struct ANTLR3_REWRITE_RULE_ELEMENT_STREAM_struct * stream); - void * (*nextToken) (struct ANTLR3_REWRITE_RULE_ELEMENT_STREAM_struct * stream); - void * (*_next) (struct ANTLR3_REWRITE_RULE_ELEMENT_STREAM_struct * stream); - - /// When constructing trees, sometimes we need to dup a token or AST - /// subtree. Dup'ing a token means just creating another AST node - /// around it. For trees, you must call the adaptor.dupTree(). - /// - void * (*dup) (struct ANTLR3_REWRITE_RULE_ELEMENT_STREAM_struct * stream, void * el); - - /// Ensure stream emits trees; tokens must be converted to AST nodes. - /// AST nodes can be passed through unmolested. - /// - pANTLR3_BASE_TREE (*toTree) (struct ANTLR3_REWRITE_RULE_ELEMENT_STREAM_struct * stream, void * el); - - /// Returns ANTLR3_TRUE if there is a next element available - /// - ANTLR3_BOOLEAN (*hasNext) (struct ANTLR3_REWRITE_RULE_ELEMENT_STREAM_struct * stream); - - /// Treat next element as a single node even if it's a subtree. - /// This is used instead of next() when the result has to be a - /// tree root node. Also prevents us from duplicating recently-added - /// children; e.g., ^(type ID)+ adds ID to type and then 2nd iteration - /// must dup the type node, but ID has been added. - /// - /// Referencing to a rule result twice is ok; dup entire tree as - /// we can't be adding trees; e.g., expr expr. - /// - pANTLR3_BASE_TREE (*nextNode) (struct ANTLR3_REWRITE_RULE_ELEMENT_STREAM_struct * stream); - - /// Number of elements available in the stream - /// - ANTLR3_UINT32 (*size) (struct ANTLR3_REWRITE_RULE_ELEMENT_STREAM_struct * stream); - - /// Returns the description string if there is one available (check for NULL). - /// - void * (*getDescription) (struct ANTLR3_REWRITE_RULE_ELEMENT_STREAM_struct * stream); - - void (*free) (struct ANTLR3_REWRITE_RULE_ELEMENT_STREAM_struct * stream); - -} - ANTLR3_REWRITE_RULE_ELEMENT_STREAM; - -/// This is an implementation of a token stream, which is basically an element -/// stream that deals with tokens only. -/// -typedef struct ANTLR3_REWRITE_RULE_ELEMENT_STREAM_struct ANTLR3_REWRITE_RULE_TOKEN_STREAM; - -/// This is an implementation of a subtree stream which is a set of trees -/// modelled as an element stream. -/// -typedef struct ANTLR3_REWRITE_RULE_ELEMENT_STREAM_struct ANTLR3_REWRITE_RULE_SUBTREE_STREAM; - -/// This is an implementation of a node stream, which is basically an element -/// stream that deals with tree nodes only. -/// -typedef struct ANTLR3_REWRITE_RULE_ELEMENT_STREAM_struct ANTLR3_REWRITE_RULE_NODE_STREAM; - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/impl/antlr/libantlr3c-3.4/include/antlr3string.h b/impl/antlr/libantlr3c-3.4/include/antlr3string.h deleted file mode 100644 index 4a96e76..0000000 --- a/impl/antlr/libantlr3c-3.4/include/antlr3string.h +++ /dev/null @@ -1,272 +0,0 @@ -/** \file - * Simple string interface allows indiscriminate allocation of strings - * such that they can be allocated all over the place and released in - * one chunk via a string factory - saves lots of hassle in remembering what - * strings were allocated where. - */ -#ifndef _ANTLR3_STRING_H -#define _ANTLR3_STRING_H - -// [The "BSD licence"] -// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC -// http://www.temporal-wave.com -// http://www.linkedin.com/in/jimidle -// -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions -// are met: -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// 3. The name of the author may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/** Base string class tracks the allocations and provides simple string - * tracking functions. Mostly you can work directly on the string for things - * that don't reallocate it, like strchr() etc. Perhaps someone will want to provide implementations for UTF8 - * and so on. - */ -typedef struct ANTLR3_STRING_struct -{ - - /** The factory that created this string - */ - pANTLR3_STRING_FACTORY factory; - - /** Pointer to the current string value (starts at NULL unless - * the string allocator is told to create it with a pre known size. - */ - pANTLR3_UINT8 chars; - - /** Current length of the string up to and not including, the trailing '\0' - * Note that the actual allocation (->size) - * is always at least one byte more than this to accommodate trailing '\0' - */ - ANTLR3_UINT32 len; - - /** Current size of the string in bytes including the trailing '\0' - */ - ANTLR3_UINT32 size; - - /** Index of string (allocation number) in case someone wants - * to explicitly release it. - */ - ANTLR3_UINT32 index; - - /** Occasionally it is useful to know what the encoding of the string - * actually is, hence it is stored here as one the ANTLR3_ENCODING_ values - */ - ANTLR3_UINT8 encoding; - - /** Pointer to function that sets the string value to a specific string in the default encoding - * for this string. For instance, if this is 8 bit, then this function is the same as set8 - * but if the encoding is UTF16, then the pointer is assumed to point to UTF16 characters, not - * 8 bit. - */ - pANTLR3_UINT8 (*set) (struct ANTLR3_STRING_struct * string, const char * chars); - - /** Pointer to function that sets the string value to a specific 8 bit string in the default encoding - * for this string. For instance, if this is an 8 bit string, then this function is the same as set8 - * but if the encoding is UTF16, then the pointer is assumed to point to 8 bit characters that must - * be converted to UTF16 characters on the fly. - */ - pANTLR3_UINT8 (*set8) (struct ANTLR3_STRING_struct * string, const char * chars); - - /** Pointer to function adds a raw char * type pointer in the default encoding - * for this string. For instance, if this is 8 bit, then this function is the same as append8 - * but if the encoding is UTF16, then the pointer is assumed to point to UTF16 characters not - * 8 bit. - */ - pANTLR3_UINT8 (*append) (struct ANTLR3_STRING_struct * string, const char * newbit); - - /** Pointer to function adds a raw char * type pointer in the default encoding - * for this string. For instance, if this is a UTF16 string, then this function assumes the pointer - * points to 8 bit characters that must be converted on the fly. - */ - pANTLR3_UINT8 (*append8) (struct ANTLR3_STRING_struct * string, const char * newbit); - - /** Pointer to function that inserts the supplied string at the specified - * offset in the current string in the default encoding for this string. For instance, if this is an 8 - * bit string, then this is the same as insert8, but if this is a UTF16 string, then the pointer - * must point to UTF16 characters. - */ - pANTLR3_UINT8 (*insert) (struct ANTLR3_STRING_struct * string, ANTLR3_UINT32 point, const char * newbit); - - /** Pointer to function that inserts the supplied string at the specified - * offset in the current string in the default encoding for this string. For instance, if this is a UTF16 string - * then the pointer is assumed to point at 8 bit characteres that must be converted on the fly. - */ - pANTLR3_UINT8 (*insert8) (struct ANTLR3_STRING_struct * string, ANTLR3_UINT32 point, const char * newbit); - - /** Pointer to function that sets the string value to a copy of the supplied string (strings must be in the - * same encoding. - */ - pANTLR3_UINT8 (*setS) (struct ANTLR3_STRING_struct * string, struct ANTLR3_STRING_struct * chars); - - /** Pointer to function appends a copy of the characters contained in another string. Strings must be in the - * same encoding. - */ - pANTLR3_UINT8 (*appendS) (struct ANTLR3_STRING_struct * string, struct ANTLR3_STRING_struct * newbit); - - /** Pointer to function that inserts a copy of the characters in the supplied string at the specified - * offset in the current string. strings must be in the same encoding. - */ - pANTLR3_UINT8 (*insertS) (struct ANTLR3_STRING_struct * string, ANTLR3_UINT32 point, struct ANTLR3_STRING_struct * newbit); - - /** Pointer to function that inserts the supplied integer in string form at the specified - * offset in the current string. - */ - pANTLR3_UINT8 (*inserti) (struct ANTLR3_STRING_struct * string, ANTLR3_UINT32 point, ANTLR3_INT32 i); - - /** Pointer to function that adds a single character to the end of the string, in the encoding of the - * string - 8 bit, UTF16, utf-8 etc. Input is a single UTF32 (32 bits wide integer) character. - */ - pANTLR3_UINT8 (*addc) (struct ANTLR3_STRING_struct * string, ANTLR3_UINT32 c); - - /** Pointer to function that adds the stringified representation of an integer - * to the string. - */ - pANTLR3_UINT8 (*addi) (struct ANTLR3_STRING_struct * string, ANTLR3_INT32 i); - - /** Pointer to function that compares the text of a string to the supplied - * 8 bit character string and returns a result a la strcmp() - */ - ANTLR3_UINT32 (*compare8) (struct ANTLR3_STRING_struct * string, const char * compStr); - - /** Pointer to a function that compares the text of a string with the supplied character string - * (which is assumed to be in the same encoding as the string itself) and returns a result - * a la strcmp() - */ - ANTLR3_UINT32 (*compare) (struct ANTLR3_STRING_struct * string, const char * compStr); - - /** Pointer to a function that compares the text of a string with the supplied string - * (which is assumed to be in the same encoding as the string itself) and returns a result - * a la strcmp() - */ - ANTLR3_UINT32 (*compareS) (struct ANTLR3_STRING_struct * string, struct ANTLR3_STRING_struct * compStr); - - /** Pointer to a function that returns the character indexed at the supplied - * offset as a 32 bit character. - */ - ANTLR3_UCHAR (*charAt) (struct ANTLR3_STRING_struct * string, ANTLR3_UINT32 offset); - - /** Pointer to a function that returns a substring of the supplied string a la .subString(s,e) - * in the Java language. - */ - struct ANTLR3_STRING_struct * - (*subString) (struct ANTLR3_STRING_struct * string, ANTLR3_UINT32 startIndex, ANTLR3_UINT32 endIndex); - - /** Pointer to a function that returns the integer representation of any numeric characters - * at the beginning of the string - */ - ANTLR3_INT32 (*toInt32) (struct ANTLR3_STRING_struct * string); - - /** Pointer to a function that yields an 8 bit string regardless of the encoding of the supplied - * string. This is useful when you want to use the text of a token in some way that requires an 8 bit - * value, such as the key for a hashtable. The function is required to produce a usable string even - * if the text given as input has characters that do not fit in 8 bit space, it will replace them - * with some arbitrary character such as '?' - */ - struct ANTLR3_STRING_struct * - (*to8) (struct ANTLR3_STRING_struct * string); - - /// Pointer to a function that yields a UT8 encoded string of the current string, - /// regardless of the current encoding of the string. Because there is currently no UTF8 - /// handling in the string class, it creates therefore, a string that is useful only for read only - /// applications as it will not contain methods that deal with UTF8 at the moment. - /// - struct ANTLR3_STRING_struct * - (*toUTF8) (struct ANTLR3_STRING_struct * string); - -} - ANTLR3_STRING; - -/** Definition of the string factory interface, which creates and tracks - * strings for you of various shapes and sizes. - */ -typedef struct ANTLR3_STRING_FACTORY_struct -{ - /** List of all the strings that have been allocated by the factory - */ - pANTLR3_VECTOR strings; - - /* Index of next string that we allocate - */ - ANTLR3_UINT32 index; - - /** Pointer to function that manufactures an empty string - */ - pANTLR3_STRING (*newRaw) (struct ANTLR3_STRING_FACTORY_struct * factory); - - /** Pointer to function that manufactures a raw string with no text in it but space for size - * characters. - */ - pANTLR3_STRING (*newSize) (struct ANTLR3_STRING_FACTORY_struct * factory, ANTLR3_UINT32 size); - - /** Pointer to function that manufactures a string from a given pointer and length. The pointer is assumed - * to point to characters in the same encoding as the string type, hence if this is a UTF16 string the - * pointer should point to UTF16 characters. - */ - pANTLR3_STRING (*newPtr) (struct ANTLR3_STRING_FACTORY_struct * factory, pANTLR3_UINT8 string, ANTLR3_UINT32 size); - - /** Pointer to function that manufactures a string from a given pointer and length. The pointer is assumed to - * point at 8 bit characters which must be converted on the fly to the encoding of the actual string. - */ - pANTLR3_STRING (*newPtr8) (struct ANTLR3_STRING_FACTORY_struct * factory, pANTLR3_UINT8 string, ANTLR3_UINT32 size); - - /** Pointer to function that manufactures a string from a given pointer and works out the length. The pointer is - * assumed to point to characters in the same encoding as the string itself, i.e. UTF16 if a UTF16 - * string and so on. - */ - pANTLR3_STRING (*newStr) (struct ANTLR3_STRING_FACTORY_struct * factory, pANTLR3_UINT8 string); - - /** Pointer to function that manufactures a string from a given pointer and length. The pointer should - * point to 8 bit characters regardless of the actual encoding of the string. The 8 bit characters - * will be converted to the actual string encoding on the fly. - */ - pANTLR3_STRING (*newStr8) (struct ANTLR3_STRING_FACTORY_struct * factory, pANTLR3_UINT8 string); - - /** Pointer to function that deletes the string altogether - */ - void (*destroy) (struct ANTLR3_STRING_FACTORY_struct * factory, pANTLR3_STRING string); - - /** Pointer to function that returns a copy of the string in printable form without any control - * characters in it. - */ - pANTLR3_STRING (*printable)(struct ANTLR3_STRING_FACTORY_struct * factory, pANTLR3_STRING string); - - /** Pointer to function that closes the factory - */ - void (*close) (struct ANTLR3_STRING_FACTORY_struct * factory); - -} - ANTLR3_STRING_FACTORY; - -#ifdef __cplusplus -} -#endif - -#endif - diff --git a/impl/antlr/libantlr3c-3.4/include/antlr3tokenstream.h b/impl/antlr/libantlr3c-3.4/include/antlr3tokenstream.h deleted file mode 100644 index a5137ad..0000000 --- a/impl/antlr/libantlr3c-3.4/include/antlr3tokenstream.h +++ /dev/null @@ -1,303 +0,0 @@ -/** \file - * Defines the interface for an ANTLR3 common token stream. Custom token streams should create - * one of these and then override any functions by installing their own pointers - * to implement the various functions. - */ -#ifndef _ANTLR3_TOKENSTREAM_H -#define _ANTLR3_TOKENSTREAM_H - -// [The "BSD licence"] -// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC -// http://www.temporal-wave.com -// http://www.linkedin.com/in/jimidle -// -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions -// are met: -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// 3. The name of the author may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include -#include -#include -#include -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/** Definition of a token source, which has a pointer to a function that - * returns the next token (using a token factory if it is going to be - * efficient) and a pointer to an ANTLR3_INPUT_STREAM. This is slightly - * different to the Java interface because we have no way to implement - * multiple interfaces without defining them in the interface structure - * or casting (void *), which is too convoluted. - */ -typedef struct ANTLR3_TOKEN_SOURCE_struct -{ - /** Pointer to a function that returns the next token in the stream. - */ - pANTLR3_COMMON_TOKEN (*nextToken)(struct ANTLR3_TOKEN_SOURCE_struct * tokenSource); - - /** Whoever is providing tokens, needs to provide a string factory too - */ - pANTLR3_STRING_FACTORY strFactory; - - /** A special pre-allocated token, which signifies End Of Tokens. Because this must - * be set up with the current input index and so on, we embed the structure and - * return the address of it. It is marked as factoryMade, so that it is never - * attempted to be freed. - */ - ANTLR3_COMMON_TOKEN eofToken; - - /// A special pre-allocated token, which is returned by mTokens() if the - /// lexer rule said to just skip the generated token altogether. - /// Having this single token stops us wasting memory by have the token factory - /// actually create something that we are going to SKIP(); anyway. - /// - ANTLR3_COMMON_TOKEN skipToken; - - /** Whatever is supplying the token source interface, needs a pointer to - * itself so that this pointer can be passed to it when the nextToken - * function is called. - */ - void * super; - - /** When the token source is constructed, it is populated with the file - * name from whence the tokens were produced by the lexer. This pointer is a - * copy of the one supplied by the CharStream (and may be NULL) so should - * not be manipulated other than to copy or print it. - */ - pANTLR3_STRING fileName; -} - ANTLR3_TOKEN_SOURCE; - -/** Definition of the ANTLR3 common token stream interface. - * \remark - * Much of the documentation for this interface is stolen from Ter's Java implementation. - */ -typedef struct ANTLR3_TOKEN_STREAM_struct -{ - /** Pointer to the token source for this stream - */ - pANTLR3_TOKEN_SOURCE tokenSource; - - /** Whatever is providing this interface needs a pointer to itself - * so that this can be passed back to it whenever the api functions - * are called. - */ - void * super; - - /** All input streams implement the ANTLR3_INT_STREAM interface... - */ - pANTLR3_INT_STREAM istream; - - /// Debugger interface, is this is a debugging token stream - /// - pANTLR3_DEBUG_EVENT_LISTENER debugger; - - /// Indicates the initial stream state for dbgConsume() - /// - ANTLR3_BOOLEAN initialStreamState; - - /** Get Token at current input pointer + i ahead where i=1 is next Token. - * i<0 indicates tokens in the past. So -1 is previous token and -2 is - * two tokens ago. LT(0) is undefined. For i>=n, return Token.EOFToken. - * Return null for LT(0) and any index that results in an absolute address - * that is negative. - */ - pANTLR3_COMMON_TOKEN (*_LT) (struct ANTLR3_TOKEN_STREAM_struct * tokenStream, ANTLR3_INT32 k); - - /** Get a token at an absolute index i; 0..n-1. This is really only - * needed for profiling and debugging and token stream rewriting. - * If you don't want to buffer up tokens, then this method makes no - * sense for you. Naturally you can't use the rewrite stream feature. - * I believe DebugTokenStream can easily be altered to not use - * this method, removing the dependency. - */ - pANTLR3_COMMON_TOKEN (*get) (struct ANTLR3_TOKEN_STREAM_struct * tokenStream, ANTLR3_UINT32 i); - - /** Where is this stream pulling tokens from? This is not the name, but - * a pointer into an interface that contains a ANTLR3_TOKEN_SOURCE interface. - * The Token Source interface contains a pointer to the input stream and a pointer - * to a function that returns the next token. - */ - pANTLR3_TOKEN_SOURCE (*getTokenSource) (struct ANTLR3_TOKEN_STREAM_struct * tokenStream); - - /** Function that installs a token source for teh stream - */ - void (*setTokenSource) (struct ANTLR3_TOKEN_STREAM_struct * tokenStream, - pANTLR3_TOKEN_SOURCE tokenSource); - - /** Return the text of all the tokens in the stream, as the old tramp in - * Leeds market used to say; "Get the lot!" - */ - pANTLR3_STRING (*toString) (struct ANTLR3_TOKEN_STREAM_struct * tokenStream); - - /** Return the text of all tokens from start to stop, inclusive. - * If the stream does not buffer all the tokens then it can just - * return an empty ANTLR3_STRING or NULL; Grammars should not access $ruleLabel.text in - * an action in that case. - */ - pANTLR3_STRING (*toStringSS) (struct ANTLR3_TOKEN_STREAM_struct * tokenStream, ANTLR3_UINT32 start, ANTLR3_UINT32 stop); - - /** Because the user is not required to use a token with an index stored - * in it, we must provide a means for two token objects themselves to - * indicate the start/end location. Most often this will just delegate - * to the other toString(int,int). This is also parallel with - * the pTREENODE_STREAM->toString(Object,Object). - */ - pANTLR3_STRING (*toStringTT) (struct ANTLR3_TOKEN_STREAM_struct * tokenStream, pANTLR3_COMMON_TOKEN start, pANTLR3_COMMON_TOKEN stop); - - - /** Function that sets the token stream into debugging mode - */ - void (*setDebugListener) (struct ANTLR3_TOKEN_STREAM_struct * tokenStream, pANTLR3_DEBUG_EVENT_LISTENER debugger); - - - - /** Function that knows how to free the memory for an ANTLR3_TOKEN_STREAM - */ - void (*free) (struct ANTLR3_TOKEN_STREAM_struct * tokenStream); -} - ANTLR3_TOKEN_STREAM; - -/** Common token stream is an implementation of ANTLR_TOKEN_STREAM for the default - * parsers and recognizers. You may of course build your own implementation if - * you are so inclined. - */ -typedef struct ANTLR3_COMMON_TOKEN_STREAM_struct -{ - /** The ANTLR3_TOKEN_STREAM interface implementation, which also includes - * the intstream implementation. We could duplicate the pANTLR_INT_STREAM - * in this interface and initialize it to a copy, but this could be confusing - * it just results in one more level of indirection and I think that with - * judicial use of 'const' later, the optimizer will do decent job. - */ - pANTLR3_TOKEN_STREAM tstream; - - /** Whatever is supplying the COMMON_TOKEN_STREAM needs a pointer to itself - * so that this can be accessed by any of the API functions which it implements. - */ - void * super; - - /** Records every single token pulled from the source indexed by the token index. - * There might be more efficient ways to do this, such as referencing directly in to - * the token factory pools, but for now this is convenient and the ANTLR3_LIST is not - * a huge overhead as it only stores pointers anyway, but allows for iterations and - * so on. - */ - pANTLR3_VECTOR tokens; - - /** Override map of tokens. If a token type has an entry in here, then - * the pointer in the table points to an int, being the override channel number - * that should always be used for this token type. - */ - pANTLR3_LIST channelOverrides; - - /** Discared set. If a token has an entry in this table, then it is thrown - * away (data pointer is always NULL). - */ - pANTLR3_LIST discardSet; - - /* The channel number that this token stream is tuned to. For instance, whitespace - * is usually tuned to channel 99, which no token stream would normally tune to and - * so it is thrown away. - */ - ANTLR3_UINT32 channel; - - /** If this flag is set to ANTLR3_TRUE, then tokens that the stream sees that are not - * in the channel that this stream is tuned to, are not tracked in the - * tokens table. When set to false, ALL tokens are added to the tracking. - */ - ANTLR3_BOOLEAN discardOffChannel; - - /** The index into the tokens list of the current token (the next one that will be - * consumed. p = -1 indicates that the token list is empty. - */ - ANTLR3_INT32 p; - - /** A simple filter mechanism whereby you can tell this token stream - * to force all tokens of type ttype to be on channel. For example, - * when interpreting, we cannot exec actions so we need to tell - * the stream to force all WS and NEWLINE to be a different, ignored - * channel. - */ - void (*setTokenTypeChannel) (struct ANTLR3_COMMON_TOKEN_STREAM_struct * tokenStream, - ANTLR3_UINT32 ttype, ANTLR3_UINT32 channel); - - /** Add a particular token type to the discard set. If a token is found to belong - * to this set, then it is skipped/thrown away - */ - void (*discardTokenType) (struct ANTLR3_COMMON_TOKEN_STREAM_struct * tokenStream, ANTLR3_INT32 ttype); - - /** Signal to discard off channel tokens from here on in. - */ - void (*discardOffChannelToks)(struct ANTLR3_COMMON_TOKEN_STREAM_struct * tokenStream, ANTLR3_BOOLEAN discard); - - /** Function that returns a pointer to the ANTLR3_LIST of all tokens - * in the stream (this causes the buffer to fill if we have not get any yet) - */ - pANTLR3_VECTOR (*getTokens) (struct ANTLR3_COMMON_TOKEN_STREAM_struct * tokenStream); - - /** Function that returns all the tokens between a start and a stop index. - * TODO: This is a new list (Ack! Maybe this is a reason to have factories for LISTS and HASHTABLES etc :-( come back to this) - */ - pANTLR3_LIST (*getTokenRange) (struct ANTLR3_COMMON_TOKEN_STREAM_struct * tokenStream, ANTLR3_UINT32 start, ANTLR3_UINT32 stop); - - /** Function that returns all the tokens indicated by the specified bitset, within a range of tokens - */ - pANTLR3_LIST (*getTokensSet) (struct ANTLR3_COMMON_TOKEN_STREAM_struct * tokenStream, - ANTLR3_UINT32 start, ANTLR3_UINT32 stop, pANTLR3_BITSET types); - - /** Function that returns all the tokens indicated by being a member of the supplied List - */ - pANTLR3_LIST (*getTokensList) (struct ANTLR3_COMMON_TOKEN_STREAM_struct * tokenStream, - ANTLR3_UINT32 start, ANTLR3_UINT32 stop, pANTLR3_LIST list); - - /** Function that returns all tokens of a certain type within a range. - */ - pANTLR3_LIST (*getTokensType) (struct ANTLR3_COMMON_TOKEN_STREAM_struct * tokenStream, - ANTLR3_UINT32 start, ANTLR3_UINT32 stop, ANTLR3_UINT32 type); - - /** Function that resets the token stream so that it can be reused, but - * but that does not free up any resources, such as the token factory - * the factory pool and so on. This prevents the need to keep freeing - * and reallocating the token pools if the thing you are building is - * a multi-shot dameon or somethign like that. It is much faster to - * just reuse all the vectors. - */ - void (*reset) (struct ANTLR3_COMMON_TOKEN_STREAM_struct * tokenStream); - - /** Function that knows how to free an ANTLR3_COMMON_TOKEN_STREAM - */ - void (*free) (struct ANTLR3_COMMON_TOKEN_STREAM_struct * tokenStream); -} - ANTLR3_COMMON_TOKEN_STREAM; - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/impl/antlr/libantlr3c-3.4/include/antlr3treeparser.h b/impl/antlr/libantlr3c-3.4/include/antlr3treeparser.h deleted file mode 100644 index 8ee0e58..0000000 --- a/impl/antlr/libantlr3c-3.4/include/antlr3treeparser.h +++ /dev/null @@ -1,81 +0,0 @@ -#ifndef ANTLR3TREEPARSER_H -#define ANTLR3TREEPARSER_H - -// [The "BSD licence"] -// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC -// http://www.temporal-wave.com -// http://www.linkedin.com/in/jimidle -// -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions -// are met: -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// 3. The name of the author may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/** Internal structure representing an element in a hash bucket. - * Stores the original key so that duplicate keys can be rejected - * if necessary, and contains function can be supported If the hash key - * could be unique I would have invented the perfect compression algorithm ;-) - */ -typedef struct ANTLR3_TREE_PARSER_struct -{ - /** Pointer to any super class - */ - void * super; - - /** A pointer to the base recognizer, where most of the parser functions actually - * live because they are shared between parser and tree parser and this is the - * easier way than copying the interface all over the place. Macros hide this - * for the generated code so it is easier on the eye (though not the debugger ;-). - */ - pANTLR3_BASE_RECOGNIZER rec; - - /** Pointer to the common tree node stream for the parser - */ - pANTLR3_COMMON_TREE_NODE_STREAM ctnstream; - - /** Set the input stream and reset the parser - */ - void (*setTreeNodeStream) (struct ANTLR3_TREE_PARSER_struct * parser, pANTLR3_COMMON_TREE_NODE_STREAM input); - - /** Return a pointer to the input stream - */ - pANTLR3_COMMON_TREE_NODE_STREAM (*getTreeNodeStream) (struct ANTLR3_TREE_PARSER_struct * parser); - - /** Pointer to a function that knows how to free resources of an ANTLR3 tree parser. - */ - void (*free) (struct ANTLR3_TREE_PARSER_struct * parser); -} - ANTLR3_TREE_PARSER; - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/impl/antlr/libantlr3c-3.4/install-sh b/impl/antlr/libantlr3c-3.4/install-sh deleted file mode 100755 index 6781b98..0000000 --- a/impl/antlr/libantlr3c-3.4/install-sh +++ /dev/null @@ -1,520 +0,0 @@ -#!/bin/sh -# install - install a program, script, or datafile - -scriptversion=2009-04-28.21; # UTC - -# This originates from X11R5 (mit/util/scripts/install.sh), which was -# later released in X11R6 (xc/config/util/install.sh) with the -# following copyright and license. -# -# Copyright (C) 1994 X Consortium -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to -# deal in the Software without restriction, including without limitation the -# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -# sell copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN -# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- -# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -# -# Except as contained in this notice, the name of the X Consortium shall not -# be used in advertising or otherwise to promote the sale, use or other deal- -# ings in this Software without prior written authorization from the X Consor- -# tium. -# -# -# FSF changes to this file are in the public domain. -# -# Calling this script install-sh is preferred over install.sh, to prevent -# `make' implicit rules from creating a file called install from it -# when there is no Makefile. -# -# This script is compatible with the BSD install script, but was written -# from scratch. - -nl=' -' -IFS=" "" $nl" - -# set DOITPROG to echo to test this script - -# Don't use :- since 4.3BSD and earlier shells don't like it. -doit=${DOITPROG-} -if test -z "$doit"; then - doit_exec=exec -else - doit_exec=$doit -fi - -# Put in absolute file names if you don't have them in your path; -# or use environment vars. - -chgrpprog=${CHGRPPROG-chgrp} -chmodprog=${CHMODPROG-chmod} -chownprog=${CHOWNPROG-chown} -cmpprog=${CMPPROG-cmp} -cpprog=${CPPROG-cp} -mkdirprog=${MKDIRPROG-mkdir} -mvprog=${MVPROG-mv} -rmprog=${RMPROG-rm} -stripprog=${STRIPPROG-strip} - -posix_glob='?' -initialize_posix_glob=' - test "$posix_glob" != "?" || { - if (set -f) 2>/dev/null; then - posix_glob= - else - posix_glob=: - fi - } -' - -posix_mkdir= - -# Desired mode of installed file. -mode=0755 - -chgrpcmd= -chmodcmd=$chmodprog -chowncmd= -mvcmd=$mvprog -rmcmd="$rmprog -f" -stripcmd= - -src= -dst= -dir_arg= -dst_arg= - -copy_on_change=false -no_target_directory= - -usage="\ -Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE - or: $0 [OPTION]... SRCFILES... DIRECTORY - or: $0 [OPTION]... -t DIRECTORY SRCFILES... - or: $0 [OPTION]... -d DIRECTORIES... - -In the 1st form, copy SRCFILE to DSTFILE. -In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. -In the 4th, create DIRECTORIES. - -Options: - --help display this help and exit. - --version display version info and exit. - - -c (ignored) - -C install only if different (preserve the last data modification time) - -d create directories instead of installing files. - -g GROUP $chgrpprog installed files to GROUP. - -m MODE $chmodprog installed files to MODE. - -o USER $chownprog installed files to USER. - -s $stripprog installed files. - -t DIRECTORY install into DIRECTORY. - -T report an error if DSTFILE is a directory. - -Environment variables override the default commands: - CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG - RMPROG STRIPPROG -" - -while test $# -ne 0; do - case $1 in - -c) ;; - - -C) copy_on_change=true;; - - -d) dir_arg=true;; - - -g) chgrpcmd="$chgrpprog $2" - shift;; - - --help) echo "$usage"; exit $?;; - - -m) mode=$2 - case $mode in - *' '* | *' '* | *' -'* | *'*'* | *'?'* | *'['*) - echo "$0: invalid mode: $mode" >&2 - exit 1;; - esac - shift;; - - -o) chowncmd="$chownprog $2" - shift;; - - -s) stripcmd=$stripprog;; - - -t) dst_arg=$2 - 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-time-zone: "UTC" -# time-stamp-end: "; # UTC" -# End: diff --git a/impl/antlr/libantlr3c-3.4/libtool b/impl/antlr/libantlr3c-3.4/libtool deleted file mode 100755 index 2172935..0000000 --- a/impl/antlr/libantlr3c-3.4/libtool +++ /dev/null @@ -1,9239 +0,0 @@ -#! /bin/bash - -# libtool - Provide generalized library-building support services. -# Generated automatically by config.status (libantlr3c) 3.4 -# Libtool was configured on host pc-4w14-0: -# NOTE: Changes made to this file will be lost: look at ltmain.sh. -# -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, -# 2006, 2007, 2008, 2009, 2010 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=2.2.10 -macro_revision=1.3175 - -# Whether or not to build shared libraries. -build_libtool_libs=yes - -# Whether or not to build static libraries. -build_old_libs=yes - -# What type of objects to build. -pic_mode=default - -# Whether or not to optimize for fast installation. -fast_install=yes - -# Shell to use when invoking shell scripts. -SHELL="/bin/bash" - -# An echo program that protects backslashes. -ECHO="printf %s\\n" - -# The host system. -host_alias= -host=x86_64-unknown-linux-gnu -host_os=linux-gnu - -# The build system. -build_alias= -build=x86_64-unknown-linux-gnu -build_os=linux-gnu - -# A sed program that does not truncate output. -SED="/bin/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="/bin/grep" - -# An ERE matcher. -EGREP="/bin/grep -E" - -# A literal string matcher. -FGREP="/bin/grep -F" - -# A BSD- or MS-compatible name lister. -NM="/usr/bin/nm -B" - -# Whether we need soft or hard links. -LN_S="ln -s" - -# What is the maximum length of a command? -max_cmd_len=1572864 - -# Object file suffix (normally "o"). -objext=o - -# Executable file suffix (normally ""). -exeext= - -# whether the shell understands "unset". -lt_unset=unset - -# turn spaces into newlines. -SP2NL="tr \\040 \\012" - -# turn newlines into spaces. -NL2SP="tr \\015\\012 \\040\\040" - -# An object symbol dumper. -OBJDUMP="objdump" - -# Method to check whether dependent libraries are shared objects. -deplibs_check_method="pass_all" - -# Command to use when deplibs_check_method == "file_magic". -file_magic_cmd="\$MAGIC_CMD" - -# The archiver. -AR="ar" -AR_FLAGS="cru" - -# A symbol stripping program. -STRIP="strip" - -# Commands used to install an old-style archive. -RANLIB="ranlib" -old_postinstall_cmds="chmod 644 \$oldlib~\$RANLIB \$oldlib" -old_postuninstall_cmds="" - -# Whether to use a lock for old archive extraction. -lock_old_archive_extraction=no - -# A C compiler. -LTCC="gcc" - -# LTCC compiler flags. -LTCFLAGS="-m32 -O2 -Wall" - -# Take the output of nm and produce a listing of raw symbols and C names. -global_symbol_pipe="sed -n -e 's/^.*[ ]\\([ABCDGIRSTW][ABCDGIRSTW]*\\)[ ][ ]*\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2 \\2/p'" - -# Transform the output of nm in a proper C declaration. -global_symbol_to_cdecl="sed -n -e 's/^T .* \\(.*\\)\$/extern int \\1();/p' -e 's/^[ABCDGIRSTW]* .* \\(.*\\)\$/extern char \\1;/p'" - -# Transform the output of nm in a C name address pair. -global_symbol_to_c_name_address="sed -n -e 's/^: \\([^ ]*\\) \$/ {\\\"\\1\\\", (void *) 0},/p' -e 's/^[ABCDGIRSTW]* \\([^ ]*\\) \\([^ ]*\\)\$/ {\"\\2\", (void *) \\&\\2},/p'" - -# Transform the output of nm in a C name address pair when lib prefix is needed. -global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \\([^ ]*\\) \$/ {\\\"\\1\\\", (void *) 0},/p' -e 's/^[ABCDGIRSTW]* \\([^ ]*\\) \\(lib[^ ]*\\)\$/ {\"\\2\", (void *) \\&\\2},/p' -e 's/^[ABCDGIRSTW]* \\([^ ]*\\) \\([^ ]*\\)\$/ {\"lib\\2\", (void *) \\&\\2},/p'" - -# The name of the directory that contains temporary libtool files. -objdir=.libs - -# Used to examine libraries when file_magic_cmd begins with "file". -MAGIC_CMD=file - -# Must we lock files when doing compilation? -need_locks="no" - -# Tool to manipulate archived DWARF debug symbol files on Mac OS X. -DSYMUTIL="" - -# Tool to change global to local symbols on Mac OS X. -NMEDIT="" - -# Tool to manipulate fat objects and archives on Mac OS X. -LIPO="" - -# ldd/readelf like tool for Mach-O binaries on Mac OS X. -OTOOL="" - -# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. -OTOOL64="" - -# Old archive suffix (normally "a"). -libext=a - -# Shared library suffix (normally ".so"). -shrext_cmds=".so" - -# The commands to extract the exported symbol list from a shared archive. -extract_expsyms_cmds="" - -# Variables whose values should be saved in libtool wrapper scripts and -# restored at link time. -variables_saved_for_relink="PATH LD_LIBRARY_PATH LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" - -# Do we need the "lib" prefix for modules? -need_lib_prefix=no - -# Do we need a version for libraries? -need_version=no - -# Library versioning type. -version_type=linux - -# Shared library runtime path variable. -runpath_var=LD_RUN_PATH - -# Shared library path variable. -shlibpath_var=LD_LIBRARY_PATH - -# Is shlibpath searched before the hard-coded library search path? -shlibpath_overrides_runpath=no - -# Format of library name prefix. -libname_spec="lib\$name" - -# 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="\${libname}\${release}\${shared_ext}\$versuffix \${libname}\${release}\${shared_ext}\$major \$libname\${shared_ext}" - -# The coded name of the library, if different from the real name. -soname_spec="\${libname}\${release}\${shared_ext}\$major" - -# Permission mode override for installation of shared libraries. -install_override_mode="" - -# Command to use after installation of a shared archive. -postinstall_cmds="" - -# Command to use after uninstallation of a shared archive. -postuninstall_cmds="" - -# Commands used to finish a libtool library installation in a directory. -finish_cmds="PATH=\\\"\\\$PATH:/sbin\\\" ldconfig -n \$libdir" - -# As "finish_cmds", except a single script fragment to be evaled but -# not shown. -finish_eval="" - -# Whether we should hardcode library paths into libraries. -hardcode_into_libs=yes - -# Compile-time system search path for libraries. -sys_lib_search_path_spec="/usr/lib/gcc/x86_64-linux-gnu/4.6 /usr/lib/x86_64-linux-gnu /usr/lib /lib/x86_64-linux-gnu /lib " - -# Run-time system search path for libraries. -sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib /usr/local/lib /lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu /lib32 /usr/lib32 " - -# Whether dlopen is supported. -dlopen_support=unknown - -# Whether dlopen of programs is supported. -dlopen_self=unknown - -# Whether dlopen of statically linked programs is supported. -dlopen_self_static=unknown - -# Commands to strip libraries. -old_striplib="strip --strip-debug" -striplib="strip --strip-unneeded" - - -# The linker used to build libraries. -LD="/usr/bin/ld -m elf_x86_64" - -# How to create reloadable object files. -reload_flag=" -r" -reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs" - -# Commands used to build an old-style archive. -old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs~\$RANLIB \$oldlib" - -# A language specific compiler. -CC="gcc" - -# Is the compiler the GNU compiler? -with_gcc=yes - -# Compiler flag to turn off builtin functions. -no_builtin_flag=" -fno-builtin" - -# How to pass a linker flag through the compiler. -wl="-Wl," - -# Additional compiler flags for building library objects. -pic_flag=" -fPIC -DPIC" - -# Compiler flag to prevent dynamic linking. -link_static_flag="-static" - -# Does compiler simultaneously support -c and -o options? -compiler_c_o="yes" - -# Whether or not to add -lc for building shared libraries. -build_libtool_need_lc=no - -# Whether or not to disallow shared libs when runtime libs are static. -allow_libtool_libs_with_static_runtimes=no - -# Compiler flag to allow reflexive dlopens. -export_dynamic_flag_spec="\${wl}--export-dynamic" - -# Compiler flag to generate shared objects directly from archives. -whole_archive_flag_spec="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive" - -# Whether the compiler copes with passing no objects directly. -compiler_needs_object="no" - -# Create an old-style archive from a shared archive. -old_archive_from_new_cmds="" - -# Create a temporary old-style archive to link instead of a shared archive. -old_archive_from_expsyms_cmds="" - -# Commands used to build a shared archive. -archive_cmds="\$CC -shared \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname -o \$lib" -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 -shared \$libobjs \$deplibs \$compiler_flags \${wl}-soname \$wl\$soname \${wl}-version-script \${wl}\$output_objdir/\$libname.ver -o \$lib" - -# Commands used to build a loadable module if different from building -# a shared archive. -module_cmds="" -module_expsym_cmds="" - -# Whether we are building with GNU ld or not. -with_gnu_ld="yes" - -# Flag that allows shared libraries with undefined symbols to be built. -allow_undefined_flag="" - -# Flag that enforces no undefined symbols. -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="\${wl}-rpath \${wl}\$libdir" - -# 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="" - -# Whether we need a single "-rpath" flag with a separated argument. -hardcode_libdir_separator="" - -# Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes -# DIR into the resulting binary. -hardcode_direct=no - -# 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=no - -# Set to "yes" if using the -LDIR flag during linking hardcodes DIR -# into the resulting binary. -hardcode_minus_L=no - -# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR -# into the resulting binary. -hardcode_shlibpath_var=unsupported - -# 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=no - -# Set to yes if linker adds runtime paths of dependent libraries -# to runtime path list. -inherit_rpath=no - -# Whether libtool must link a program against all its dependency libraries. -link_all_deplibs=unknown - -# Fix the shell variable $srcfile for the compiler. -fix_srcfile_path="" - -# Set to "yes" if exported symbols are required. -always_export_symbols=no - -# The commands to list exported symbols. -export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | \$SED 's/.* //' | sort | uniq > \$export_symbols" - -# Symbols that should not be listed in the preloaded symbols. -exclude_expsyms="_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*" - -# Symbols that must always be exported. -include_expsyms="" - -# Commands necessary for linking programs (against libraries) with templates. -prelink_cmds="" - -# Specify filename containing input files. -file_list_spec="" - -# How to hardcode a shared library path into an executable. -hardcode_action=immediate - -# ### END LIBTOOL CONFIG - -# Generated from ltmain.m4sh. - -# libtool (GNU libtool) 2.2.10 -# Written by Gordon Matzigkeit , 1996 - -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, -# 2007, 2008, 2009, 2010 Free Software Foundation, Inc. -# This is free software; see the source for copying conditions. There is NO -# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -# GNU Libtool is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# As a special exception to the GNU General Public License, -# if you distribute this file as part of a program or library that -# is built using GNU Libtool, you may include this file under the -# same distribution terms that you use for the rest of that program. -# -# GNU Libtool is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Libtool; see the file COPYING. If not, a copy -# can be downloaded from http://www.gnu.org/licenses/gpl.html, -# or obtained by writing to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - -# Usage: $progname [OPTION]... [MODE-ARG]... -# -# Provide generalized library-building support services. -# -# --config show all configuration variables -# --debug enable verbose shell tracing -# -n, --dry-run display commands without modifying any files -# --features display basic configuration information and exit -# --mode=MODE use operation mode MODE -# --preserve-dup-deps don't remove duplicate dependency libraries -# --quiet, --silent don't print informational messages -# --no-quiet, --no-silent -# print informational messages (default) -# --tag=TAG use configuration variables from tag TAG -# -v, --verbose print more informational messages than default -# --no-verbose don't print the extra informational messages -# --version print version information -# -h, --help, --help-all print short, long, or detailed help message -# -# MODE must be one of the following: -# -# clean remove files from the build directory -# compile compile a source file into a libtool object -# execute automatically set library path, then run a program -# finish complete the installation of libtool libraries -# install install libraries or executables -# link create a library or an executable -# uninstall remove libraries from an installed directory -# -# MODE-ARGS vary depending on the MODE. When passed as first option, -# `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that. -# Try `$progname --help --mode=MODE' for a more detailed description of MODE. -# -# When reporting a bug, please describe a test case to reproduce it and -# include the following information: -# -# host-triplet: $host -# shell: $SHELL -# compiler: $LTCC -# compiler flags: $LTCFLAGS -# linker: $LD (gnu? $with_gnu_ld) -# $progname: (GNU libtool) 2.2.10 -# automake: $automake_version -# autoconf: $autoconf_version -# -# Report bugs to . - -PROGRAM=libtool -PACKAGE=libtool -VERSION=2.2.10 -TIMESTAMP="" -package_revision=1.3175 - -# Be Bourne compatible -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac -fi -BIN_SH=xpg4; export BIN_SH # for Tru64 -DUALCASE=1; export DUALCASE # for MKS sh - -# A function that is used when there is no print builtin or printf. -func_fallback_echo () -{ - eval 'cat <<_LTECHO_EOF -$1 -_LTECHO_EOF' -} - -# NLS nuisances: We save the old values to restore during execute mode. -lt_user_locale= -lt_safe_locale= -for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES -do - eval "if test \"\${$lt_var+set}\" = set; then - save_$lt_var=\$$lt_var - $lt_var=C - export $lt_var - lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\" - lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\" - fi" -done -LC_ALL=C -LANGUAGE=C -export LANGUAGE LC_ALL - -$lt_unset CDPATH - - -# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh -# is ksh but when the shell is invoked as "sh" and the current value of -# the _XPG environment variable is not equal to 1 (one), the special -# positional parameter $0, within a function call, is the name of the -# function. -progpath="$0" - - - -: ${CP="cp -f"} -test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'} -: ${EGREP="/bin/grep -E"} -: ${FGREP="/bin/grep -F"} -: ${GREP="/bin/grep"} -: ${LN_S="ln -s"} -: ${MAKE="make"} -: ${MKDIR="mkdir"} -: ${MV="mv -f"} -: ${RM="rm -f"} -: ${SED="/bin/sed"} -: ${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 "${1}" | $SED -e "$dirname"` - if test "X$func_dirname_result" = "X${1}"; then - func_dirname_result="${3}" - else - func_dirname_result="$func_dirname_result${2}" - fi - func_basename_result=`$ECHO "${1}" | $SED -e "$basename"` -} - -# Generated shell functions inserted here. - -# 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} -} - - -# func_append var value -# Append VALUE to the end of shell variable VAR. -func_append () -{ - eval "$1+=\$2" -} -# Generated shell functions inserted here. - -# These SED scripts presuppose an absolute path with a trailing slash. -pathcar='s,^/\([^/]*\).*$,\1,' -pathcdr='s,^/[^/]*,,' -removedotparts=':dotsl - s@/\./@/@g - t dotsl - s,/\.$,/,' -collapseslashes='s@/\{1,\}@/@g' -finalslash='s,/*$,/,' - -# func_normal_abspath PATH -# Remove doubled-up and trailing slashes, "." path components, -# and cancel out any ".." path components in PATH after making -# it an absolute path. -# value returned in "$func_normal_abspath_result" -func_normal_abspath () -{ - # Start from root dir and reassemble the path. - func_normal_abspath_result= - func_normal_abspath_tpath=$1 - func_normal_abspath_altnamespace= - case $func_normal_abspath_tpath in - "") - # Empty path, that just means $cwd. - func_stripname '' '/' "`pwd`" - func_normal_abspath_result=$func_stripname_result - return - ;; - # The next three entries are used to spot a run of precisely - # two leading slashes without using negated character classes; - # we take advantage of case's first-match behaviour. - ///*) - # Unusual form of absolute path, do nothing. - ;; - //*) - # Not necessarily an ordinary path; POSIX reserves leading '//' - # and for example Cygwin uses it to access remote file shares - # over CIFS/SMB, so we conserve a leading double slash if found. - func_normal_abspath_altnamespace=/ - ;; - /*) - # Absolute path, do nothing. - ;; - *) - # Relative path, prepend $cwd. - func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath - ;; - esac - # Cancel out all the simple stuff to save iterations. We also want - # the path to end with a slash for ease of parsing, so make sure - # there is one (and only one) here. - func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ - -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"` - while :; do - # Processed it all yet? - if test "$func_normal_abspath_tpath" = / ; then - # If we ascended to the root using ".." the result may be empty now. - if test -z "$func_normal_abspath_result" ; then - func_normal_abspath_result=/ - fi - break - fi - func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ - -e "$pathcar"` - func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ - -e "$pathcdr"` - # Figure out what to do with it - case $func_normal_abspath_tcomponent in - "") - # Trailing empty path component, ignore it. - ;; - ..) - # Parent dir; strip last assembled component from result. - func_dirname "$func_normal_abspath_result" - func_normal_abspath_result=$func_dirname_result - ;; - *) - # Actual path component, append it. - func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent - ;; - esac - done - # Restore leading double-slash if one was found on entry. - func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result -} - -# func_relative_path SRCDIR DSTDIR -# generates a relative path from SRCDIR to DSTDIR, with a trailing -# slash if non-empty, suitable for immediately appending a filename -# without needing to append a separator. -# value returned in "$func_relative_path_result" -func_relative_path () -{ - func_relative_path_result= - func_normal_abspath "$1" - func_relative_path_tlibdir=$func_normal_abspath_result - func_normal_abspath "$2" - func_relative_path_tbindir=$func_normal_abspath_result - - # Ascend the tree starting from libdir - while :; do - # check if we have found a prefix of bindir - case $func_relative_path_tbindir in - $func_relative_path_tlibdir) - # found an exact match - func_relative_path_tcancelled= - break - ;; - $func_relative_path_tlibdir*) - # found a matching prefix - func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" - func_relative_path_tcancelled=$func_stripname_result - if test -z "$func_relative_path_result"; then - func_relative_path_result=. - fi - break - ;; - *) - func_dirname $func_relative_path_tlibdir - func_relative_path_tlibdir=${func_dirname_result} - if test "x$func_relative_path_tlibdir" = x ; then - # Have to descend all the way to the root! - func_relative_path_result=../$func_relative_path_result - func_relative_path_tcancelled=$func_relative_path_tbindir - break - fi - func_relative_path_result=../$func_relative_path_result - ;; - esac - done - - # Now calculate path; take care to avoid doubling-up slashes. - func_stripname '' '/' "$func_relative_path_result" - func_relative_path_result=$func_stripname_result - func_stripname '/' '/' "$func_relative_path_tcancelled" - if test "x$func_stripname_result" != x ; then - func_relative_path_result=${func_relative_path_result}/${func_stripname_result} - fi - - # Normalisation. If bindir is libdir, return empty string, - # else relative path ending with a slash; either way, target - # file name can be directly appended. - if test ! -z "$func_relative_path_result"; then - func_stripname './' '' "$func_relative_path_result/" - func_relative_path_result=$func_stripname_result - fi -} - -# The name of this program: -func_dirname_and_basename "$progpath" -progname=$func_basename_result - -# Make sure we have an absolute path for reexecution: -case $progpath in - [\\/]*|[A-Za-z]:\\*) ;; - *[\\/]*) - progdir=$func_dirname_result - progdir=`cd "$progdir" && pwd` - progpath="$progdir/$progname" - ;; - *) - save_IFS="$IFS" - IFS=: - 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_echo_all arg... -# Invoke $ECHO with all args, space-separated. -func_echo_all () -{ - $ECHO "$*" -} - -# func_error arg... -# Echo program name prefixed message to standard error. -func_error () -{ - $ECHO "$progname${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 "$my_directory_path" | $SED -e "$dirname"` - done - my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'` - - save_mkdir_p_IFS="$IFS"; IFS=':' - for my_dir in $my_dir_list; do - IFS="$save_mkdir_p_IFS" - # mkdir can fail with a `File exist' error if two processes - # try to create one of the directories concurrently. Don't - # stop in that case! - $MKDIR "$my_dir" 2>/dev/null || : - done - IFS="$save_mkdir_p_IFS" - - # Bail out if we (or some other process) failed to create a directory. - test -d "$my_directory_path" || \ - func_fatal_error "Failed to create \`$1'" - fi -} - - -# func_mktempdir [string] -# Make a temporary directory that won't clash with other running -# libtool processes, and avoids race conditions if possible. If -# given, STRING is the basename for that directory. -func_mktempdir () -{ - my_template="${TMPDIR-/tmp}/${1-$progname}" - - if test "$opt_dry_run" = ":"; then - # Return a directory name, but don't create it in dry-run mode - my_tmpdir="${my_template}-$$" - else - - # If mktemp works, use that first and foremost - my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` - - if test ! -d "$my_tmpdir"; then - # Failing that, at least try and use $RANDOM to avoid a race - my_tmpdir="${my_template}-${RANDOM-0}$$" - - save_mktempdir_umask=`umask` - umask 0077 - $MKDIR "$my_tmpdir" - umask $save_mktempdir_umask - fi - - # If we're not in dry-run mode, bomb out on failure - test -d "$my_tmpdir" || \ - func_fatal_error "cannot create temporary directory \`$my_tmpdir'" - fi - - $ECHO "$my_tmpdir" -} - - -# func_quote_for_eval arg -# Aesthetically quote ARG to be evaled later. -# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT -# is double-quoted, suitable for a subsequent eval, whereas -# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters -# which are still active within double quotes backslashified. -func_quote_for_eval () -{ - case $1 in - *[\\\`\"\$]*) - func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;; - *) - func_quote_for_eval_unquoted_result="$1" ;; - esac - - case $func_quote_for_eval_unquoted_result in - # Double-quote args containing shell metacharacters to delay - # word splitting, command substitution and and variable - # expansion for a subsequent eval. - # Many Bourne shells cannot handle close brackets correctly - # in scan sets, so we specify it separately. - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\"" - ;; - *) - func_quote_for_eval_result="$func_quote_for_eval_unquoted_result" - esac -} - - -# func_quote_for_expand arg -# Aesthetically quote ARG to be evaled later; same as above, -# but do not quote variable references. -func_quote_for_expand () -{ - case $1 in - *[\\\`\"]*) - my_arg=`$ECHO "$1" | $SED \ - -e "$double_quote_subst" -e "$sed_double_backslash"` ;; - *) - my_arg="$1" ;; - esac - - case $my_arg in - # Double-quote args containing shell metacharacters to delay - # word splitting and command substitution for a subsequent eval. - # Many Bourne shells cannot handle close brackets correctly - # in scan sets, so we specify it separately. - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - my_arg="\"$my_arg\"" - ;; - esac - - func_quote_for_expand_result="$my_arg" -} - - -# func_show_eval cmd [fail_exp] -# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is -# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP -# is given, then evaluate it. -func_show_eval () -{ - my_cmd="$1" - my_fail_exp="${2-:}" - - ${opt_silent-false} || { - func_quote_for_expand "$my_cmd" - eval "func_echo $func_quote_for_expand_result" - } - - if ${opt_dry_run-false}; then :; else - eval "$my_cmd" - my_status=$? - if test "$my_status" -eq 0; then :; else - eval "(exit $my_status); $my_fail_exp" - fi - fi -} - - -# func_show_eval_locale cmd [fail_exp] -# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is -# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP -# is given, then evaluate it. Use the saved locale for evaluation. -func_show_eval_locale () -{ - my_cmd="$1" - my_fail_exp="${2-:}" - - ${opt_silent-false} || { - func_quote_for_expand "$my_cmd" - eval "func_echo $func_quote_for_expand_result" - } - - if ${opt_dry_run-false}; then :; else - eval "$lt_user_locale - $my_cmd" - my_status=$? - eval "$lt_safe_locale" - if test "$my_status" -eq 0; then :; else - eval "(exit $my_status); $my_fail_exp" - fi - fi -} - - -# func_version -# Echo version message to standard output and exit. -func_version () -{ - $SED -n '/(C)/!b go - :more - /\./!{ - N - s/\n# / / - b more - } - :go - /^# '$PROGRAM' (GNU /,/# warranty; / { - s/^# // - s/^# *$// - s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/ - p - }' < "$progpath" - exit $? -} - -# func_usage -# Echo short help message to standard output and exit. -func_usage () -{ - $SED -n '/^# Usage:/,/^# *.*--help/ { - s/^# // - s/^# *$// - s/\$progname/'$progname'/ - p - }' < "$progpath" - echo - $ECHO "run \`$progname --help | more' for full usage" - exit $? -} - -# func_help [NOEXIT] -# Echo long help message to standard output and exit, -# unless 'noexit' is passed as argument. -func_help () -{ - $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" - ret=$? - if test -z "$1"; then - exit $ret - fi -} - -# func_missing_arg argname -# Echo program name prefixed message to standard error and set global -# exit_cmd. -func_missing_arg () -{ - func_error "missing argument for $1." - exit_cmd=exit -} - -exit_cmd=: - - - - - - -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=: - opt_verbose=false - ;; - - --no-quiet|--no-silent) - preserve_args="$preserve_args $opt" - opt_silent=false - ;; - - --verbose| -v) preserve_args="$preserve_args $opt" - opt_silent=false - opt_verbose=: - ;; - - --no-verbose) preserve_args="$preserve_args $opt" - opt_verbose=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=: ;; - --help-all) opt_help=': help-all' ;; - --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 - CC_expanded=`func_echo_all $CC` - CC_quoted_expanded=`func_echo_all $CC_quoted` - case $@ in - # Blanks in the command may have been stripped by the calling shell, - # but not from the CC environment variable when configure was run. - " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ - " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; - # Blanks at the start of $base_compile will cause this to fail - # if we don't check for them as well. - *) - for z in $available_tags; do - if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then - # Evaluate the configuration. - eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" - CC_quoted= - for arg in $CC; do - # Double-quote args containing other shell metacharacters. - func_quote_for_eval "$arg" - CC_quoted="$CC_quoted $func_quote_for_eval_result" - done - CC_expanded=`func_echo_all $CC` - CC_quoted_expanded=`func_echo_all $CC_quoted` - case "$@ " in - " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ - " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) - # The compiler in the base compile command matches - # the one in the tagged configuration. - # Assume this is the tagged configuration we want. - tagname=$z - break - ;; - esac - fi - done - # If $tagname still isn't set, then no tagged configuration - # was found and let the user know that the "--tag" command - # line option must be used. - if test -z "$tagname"; then - func_echo "unable to infer tagged configuration" - func_fatal_error "specify a tag with \`--tag'" -# else -# func_verbose "using $tagname tagged configuration" - fi - ;; - esac - fi -} - - - -# func_write_libtool_object output_name pic_name nonpic_name -# Create a libtool object file (analogous to a ".la" file), -# but don't create it if we're doing a dry run. -func_write_libtool_object () -{ - write_libobj=${1} - if test "$build_libtool_libs" = yes; then - write_lobj=\'${2}\' - else - write_lobj=none - fi - - if test "$build_old_libs" = yes; then - write_oldobj=\'${3}\' - else - write_oldobj=none - fi - - $opt_dry_run || { - cat >${write_libobj}T <?"'"'"' &()|`$[]' \ - && func_warning "libobj name \`$libobj' may not contain shell special characters." - func_dirname_and_basename "$obj" "/" "" - objname="$func_basename_result" - xdir="$func_dirname_result" - lobj=${xdir}$objdir/$objname - - test -z "$base_compile" && \ - func_fatal_help "you must specify a compilation command" - - # Delete any leftover library objects. - if test "$build_old_libs" = yes; then - removelist="$obj $lobj $libobj ${libobj}T" - else - removelist="$lobj $libobj ${libobj}T" - fi - - # On Cygwin there's no "real" PIC flag so we must build both object types - case $host_os in - cygwin* | mingw* | pw32* | os2* | cegcc*) - pic_mode=default - ;; - esac - if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then - # non-PIC code in shared libraries is not supported - pic_mode=default - fi - - # Calculate the filename of the output object if compiler does - # not support -o with -c - if test "$compiler_c_o" = no; then - output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext} - lockfile="$output_obj.lock" - else - output_obj= - need_locks=no - lockfile= - fi - - # Lock this critical section if it is needed - # We use this script file to make the link, it avoids creating a new file - if test "$need_locks" = yes; then - until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do - func_echo "Waiting for $lockfile to be removed" - sleep 2 - done - elif test "$need_locks" = warn; then - if test -f "$lockfile"; then - $ECHO "\ -*** ERROR, $lockfile exists and contains: -`cat $lockfile 2>/dev/null` - -This indicates that another process is trying to use the same -temporary object file, and libtool could not work around it because -your compiler does not support \`-c' and \`-o' together. If you -repeat this compilation, it may succeed, by chance, but you had better -avoid parallel builds (make -j) in this platform, or get a better -compiler." - - $opt_dry_run || $RM $removelist - exit $EXIT_FAILURE - fi - 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 build PIC objects only - -prefer-non-pic try to build non-PIC objects only - -shared do not build a \`.o' file suitable for static linking - -static only build a \`.o' file suitable for static linking - -Wc,FLAG pass FLAG directly to the compiler - -COMPILE-COMMAND is a command to be used in creating a \`standard' object file -from the given SOURCEFILE. - -The output file name is determined by removing the directory component from -SOURCEFILE, then substituting the C source code suffix \`.c' with the -library object suffix, \`.lo'." - ;; - - execute) - $ECHO \ -"Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... - -Automatically set library path, then run a program. - -This mode accepts the following additional options: - - -dlopen FILE add the directory containing FILE to the library path - -This mode sets the library path environment variable according to \`-dlopen' -flags. - -If any of the ARGS are libtool executable wrappers, then they are translated -into their corresponding uninstalled binary, and any of their required library -directories are added to the library path. - -Then, COMMAND is executed, with ARGS as arguments." - ;; - - finish) - $ECHO \ -"Usage: $progname [OPTION]... --mode=finish [LIBDIR]... - -Complete the installation of libtool libraries. - -Each LIBDIR is a directory that contains libtool libraries. - -The commands that this mode executes may require superuser privileges. Use -the \`--dry-run' option if you just want to see what would be executed." - ;; - - install) - $ECHO \ -"Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... - -Install executables or libraries. - -INSTALL-COMMAND is the installation command. The first component should be -either the \`install' or \`cp' program. - -The following components of INSTALL-COMMAND are treated specially: - - -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation - -The rest of the components are interpreted as arguments to that command (only -BSD-compatible install options are recognized)." - ;; - - link) - $ECHO \ -"Usage: $progname [OPTION]... --mode=link LINK-COMMAND... - -Link object files or libraries together to form another library, or to -create an executable program. - -LINK-COMMAND is a command using the C compiler that you would use to create -a program from several object files. - -The following components of LINK-COMMAND are treated specially: - - -all-static do not do any dynamic linking at all - -avoid-version do not add a version suffix if possible - -bindir BINDIR specify path to binaries directory (for systems where - libraries must be found in the PATH setting at runtime) - -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime - -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols - -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) - -export-symbols SYMFILE - try to export only the symbols listed in SYMFILE - -export-symbols-regex REGEX - try to export only the symbols matching REGEX - -LLIBDIR search LIBDIR for required installed libraries - -lNAME OUTPUT-FILE requires the installed library libNAME - -module build a library that can dlopened - -no-fast-install disable the fast-install mode - -no-install link a not-installable executable - -no-undefined declare that a library does not refer to external symbols - -o OUTPUT-FILE create OUTPUT-FILE from the specified objects - -objectlist FILE Use a list of object files found in FILE to specify objects - -precious-files-regex REGEX - don't remove output files matching REGEX - -release RELEASE specify package release information - -rpath LIBDIR the created library will eventually be installed in LIBDIR - -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries - -shared only do dynamic linking of libtool libraries - -shrext SUFFIX override the standard shared library file extension - -static do not do any dynamic linking of uninstalled libtool libraries - -static-libtool-libs - do not do any dynamic linking of libtool libraries - -version-info CURRENT[:REVISION[:AGE]] - specify library version info [each variable defaults to 0] - -weak LIBNAME declare that the target provides the LIBNAME interface - -Wc,FLAG - -Xcompiler FLAG pass linker-specific FLAG directly to the compiler - -Wl,FLAG - -Xlinker FLAG pass linker-specific FLAG directly to the linker - -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) - -All other options (arguments beginning with \`-') are ignored. - -Every other argument is treated as a filename. Files ending in \`.la' are -treated as uninstalled libtool libraries, other files are standard or library -object files. - -If the OUTPUT-FILE ends in \`.la', then a libtool library is created, -only library objects (\`.lo' files) may be specified, and \`-rpath' is -required, except when creating a convenience library. - -If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created -using \`ar' and \`ranlib', or on Windows using \`lib'. - -If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file -is created, otherwise an executable program is created." - ;; - - uninstall) - $ECHO \ -"Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... - -Remove libraries from an installation directory. - -RM is the name of the program to use to delete files associated with each FILE -(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed -to RM. - -If FILE is a libtool library, all the files associated with it are deleted. -Otherwise, only FILE itself is deleted using RM." - ;; - - *) - func_fatal_help "invalid operation mode \`$mode'" - ;; - esac - - echo - $ECHO "Try \`$progname --help' for more information about other modes." -} - -# Now that we've collected a possible --mode arg, show help if necessary -if $opt_help; then - if test "$opt_help" = :; then - func_mode_help - else - { - func_help noexit - for mode in compile link execute install finish uninstall clean; do - func_mode_help - done - } | sed -n '1p; 2,$s/^Usage:/ or: /p' - { - func_help noexit - for mode in compile link execute install finish uninstall clean; do - echo - func_mode_help - done - } | - sed '1d - /^When reporting/,/^Report/{ - H - d - } - $x - /information about other modes/d - /more detailed .*MODE/d - s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' - fi - exit $? -fi - - -# func_mode_execute arg... -func_mode_execute () -{ - $opt_debug - # The first argument is the command name. - cmd="$nonopt" - test -z "$cmd" && \ - func_fatal_help "you must specify a COMMAND" - - # Handle -dlopen flags immediately. - for file in $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 - -* | *.la | *.lo ) ;; - *) - # Do a test to see if this is really a libtool program. - if func_ltwrapper_script_p "$file"; then - func_source "$file" - # Transform arg to wrapped name. - file="$progdir/$program" - elif func_ltwrapper_executable_p "$file"; then - func_ltwrapper_scriptname "$file" - func_source "$func_ltwrapper_scriptname_result" - # Transform arg to wrapped name. - file="$progdir/$program" - fi - ;; - esac - # Quote arguments (to preserve shell metacharacters). - func_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 "----------------------------------------------------------------------" - 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 "----------------------------------------------------------------------" - 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. - case $nonopt in *shtool*) :;; *) false;; esac; then - # Aesthetically quote it. - func_quote_for_eval "$nonopt" - install_prog="$func_quote_for_eval_result " - arg=$1 - shift - else - install_prog= - arg=$nonopt - fi - - # The real first argument should be the name of the installation program. - # Aesthetically quote it. - func_quote_for_eval "$arg" - install_prog="$install_prog$func_quote_for_eval_result" - install_shared_prog=$install_prog - case " $install_prog " in - *[\\\ /]cp\ *) install_cp=: ;; - *) install_cp=false ;; - esac - - # We need to accept at least all the BSD install flags. - dest= - files= - opts= - prev= - install_type= - isdir=no - stripme= - no_mode=: - for arg - do - arg2= - if test -n "$dest"; then - files="$files $dest" - dest=$arg - continue - fi - - case $arg in - -d) isdir=yes ;; - -f) - if $install_cp; then :; else - prev=$arg - fi - ;; - -g | -m | -o) - prev=$arg - ;; - -s) - stripme=" -s" - continue - ;; - -*) - ;; - *) - # If the previous option needed an argument, then skip it. - if test -n "$prev"; then - if test "x$prev" = x-m && test -n "$install_override_mode"; then - arg2=$install_override_mode - no_mode=false - fi - prev= - else - dest=$arg - continue - fi - ;; - esac - - # Aesthetically quote the argument. - func_quote_for_eval "$arg" - install_prog="$install_prog $func_quote_for_eval_result" - if test -n "$arg2"; then - func_quote_for_eval "$arg2" - fi - install_shared_prog="$install_shared_prog $func_quote_for_eval_result" - done - - test -z "$install_prog" && \ - func_fatal_help "you must specify an install program" - - test -n "$prev" && \ - func_fatal_help "the \`$prev' option requires an argument" - - if test -n "$install_override_mode" && $no_mode; then - if $install_cp; then :; else - func_quote_for_eval "$install_override_mode" - install_shared_prog="$install_shared_prog -m $func_quote_for_eval_result" - fi - fi - - if test -z "$files"; then - if test -z "$dest"; then - func_fatal_help "no file or destination specified" - else - func_fatal_help "you must specify a destination" - fi - fi - - # Strip any trailing slash from the destination. - func_stripname '' '/' "$dest" - dest=$func_stripname_result - - # Check to see that the destination is a directory. - test -d "$dest" && isdir=yes - if test "$isdir" = yes; then - destdir="$dest" - destname= - else - func_dirname_and_basename "$dest" "" "." - destdir="$func_dirname_result" - destname="$func_basename_result" - - # Not a directory, so check to see that there is only one file specified. - set dummy $files; shift - test "$#" -gt 1 && \ - func_fatal_help "\`$dest' is not a directory" - fi - case $destdir in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - for file in $files; do - case $file in - *.lo) ;; - *) - func_fatal_help "\`$destdir' must be an absolute directory name" - ;; - esac - done - ;; - esac - - # This variable tells wrapper scripts just to set variables rather - # than running their programs. - libtool_install_magic="$magic" - - staticlibs= - future_libdirs= - current_libdirs= - for file in $files; do - - # Do each installation. - case $file in - *.$libext) - # Do the static libraries later. - 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 "$destdir" | $SED -e "s%$libdir\$%%"` - - # Don't allow the user to place us outside of our expected - # location b/c this prevents finding dependent libraries that - # are installed to the same prefix. - # At present, this check doesn't affect windows .dll's that - # are installed into $libdir/../bin (currently, that works fine) - # but it's something to keep an eye on. - test "$inst_prefix_dir" = "$destdir" && \ - func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir" - - if test -n "$inst_prefix_dir"; then - # Stick the inst_prefix_dir data into the link command. - relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` - else - relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` - fi - - func_warning "relinking \`$file'" - func_show_eval "$relink_command" \ - 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"' - fi - - # See the names of the shared library. - set dummy $library_names; shift - if test -n "$1"; then - realname="$1" - shift - - srcname="$realname" - test -n "$relink_command" && srcname="$realname"T - - # Install the shared library and build the symlinks. - func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ - 'exit $?' - tstripme="$stripme" - case $host_os in - cygwin* | mingw* | pw32* | cegcc*) - case $realname in - *.dll.a) - tstripme="" - ;; - esac - ;; - esac - if test -n "$tstripme" && test -n "$striplib"; then - func_show_eval "$striplib $destdir/$realname" 'exit $?' - fi - - if test "$#" -gt 0; then - # Delete the old symlinks, and create new ones. - # Try `ln -sf' first, because the `ln' binary might depend on - # the symlink we replace! Solaris /bin/ln does not understand -f, - # so we also need to try rm && ln -s. - for linkname - do - test "$linkname" != "$realname" \ - && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" - done - fi - - # Do each command in the postinstall commands. - lib="$destdir/$realname" - func_execute_cmds "$postinstall_cmds" 'exit $?' - fi - - # Install the pseudo-library for information purposes. - func_basename "$file" - name="$func_basename_result" - instname="$dir/$name"i - func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' - - # Maybe install the static library, too. - test -n "$old_library" && 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 "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test - if test -n "$libdir" && test ! -f "$libfile"; then - func_warning "\`$lib' has not been installed in \`$libdir'" - finalize=no - fi - done - - relink_command= - func_source "$wrapper" - - outputname= - if test "$fast_install" = no && test -n "$relink_command"; then - $opt_dry_run || { - if test "$finalize" = yes; then - tmpdir=`func_mktempdir` - func_basename "$file$stripped_ext" - file="$func_basename_result" - outputname="$tmpdir/$file" - # Replace the output file specification. - relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` - - $opt_silent || { - func_quote_for_expand "$relink_command" - eval "func_echo $func_quote_for_expand_result" - } - if eval "$relink_command"; then : - else - func_error "error: relink \`$file' with the above command before installing it" - $opt_dry_run || ${RM}r "$tmpdir" - continue - fi - file="$outputname" - else - func_warning "cannot relink \`$file'" - fi - } - else - # Install the binary that we compiled earlier. - file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` - fi - fi - - # remove .exe since cygwin /usr/bin/install will append another - # one anyway - case $install_prog,$host in - */usr/bin/install*,*cygwin*) - case $file:$destfile in - *.exe:*.exe) - # this is ok - ;; - *.exe:*) - destfile=$destfile.exe - ;; - *:*.exe) - func_stripname '' '.exe' "$destfile" - destfile=$func_stripname_result - ;; - esac - ;; - esac - func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' - $opt_dry_run || if test -n "$outputname"; then - ${RM}r "$tmpdir" - fi - ;; - esac - done - - for file in $staticlibs; do - func_basename "$file" - name="$func_basename_result" - - # Set up the ranlib parameters. - oldlib="$destdir/$name" - - func_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 - -#if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) -#pragma GCC diagnostic ignored \"-Wstrict-prototypes\" -#endif - -/* External symbol declarations for the compiler. */\ -" - - if test "$dlself" = yes; then - func_verbose "generating symbol list for \`$output'" - - $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" - - # Add our own program objects to the symbol list. - progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` - for progfile in $progfiles; do - func_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 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 "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` - finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` - else - compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` - finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` - fi - ;; - *) - compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` - finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` - ;; - esac - ;; - *) - func_fatal_error "unknown suffix for \`$my_dlsyms'" - ;; - esac - else - # We keep going just in case the user didn't refer to - # lt_preloaded_symbols. The linker will fail if global_symbol_pipe - # really was required. - - # Nullify the symbol file. - compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` - finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` - fi -} - -# func_win32_libid arg -# return the library type of file 'arg' -# -# Need a lot of goo to handle *both* DLLs and import libs -# Has to be a shell function in order to 'eat' the argument -# that is supplied when $file_magic_command is called. -# Despite the name, also deal with 64 bit binaries. -func_win32_libid () -{ - $opt_debug - win32_libid_type="unknown" - win32_fileres=`file -L $1 2>/dev/null` - case $win32_fileres in - *ar\ archive\ import\ library*) # definitely import - win32_libid_type="x86 archive import" - ;; - *ar\ archive*) # could be an import, or static - # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. - if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | - $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then - 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" - if test "$lock_old_archive_extraction" = yes; then - lockfile=$f_ex_an_ar_oldlib.lock - until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do - func_echo "Waiting for $lockfile to be removed" - sleep 2 - done - fi - func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ - 'stat=$?; rm -f "$lockfile"; exit $stat' - if test "$lock_old_archive_extraction" = yes; then - $opt_dry_run || rm -f "$lockfile" - fi - if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then - : - else - func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" - fi -} - - -# func_extract_archives gentop oldlib ... -func_extract_archives () -{ - $opt_debug - my_gentop="$1"; shift - my_oldlibs=${1+"$@"} - my_oldobjs="" - my_xlib="" - my_xabs="" - my_xdir="" - - for my_xlib in $my_oldlibs; do - # Extract the objects. - case $my_xlib in - [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; - *) my_xabs=`pwd`"/$my_xlib" ;; - esac - func_basename "$my_xlib" - my_xlib="$func_basename_result" - my_xlib_u=$my_xlib - while :; do - case " $extracted_archives " in - *" $my_xlib_u "*) - func_arith $extracted_serial + 1 - extracted_serial=$func_arith_result - my_xlib_u=lt$extracted_serial-$my_xlib ;; - *) break ;; - esac - done - extracted_archives="$extracted_archives $my_xlib_u" - my_xdir="$my_gentop/$my_xlib_u" - - func_mkdir_p "$my_xdir" - - case $host in - *-darwin*) - func_verbose "Extracting $my_xabs" - # Do not bother doing anything if just a dry run - $opt_dry_run || { - darwin_orig_dir=`pwd` - cd $my_xdir || exit $? - darwin_archive=$my_xabs - darwin_curdir=`pwd` - darwin_base_archive=`basename "$darwin_archive"` - darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` - if test -n "$darwin_arches"; then - darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` - darwin_arch= - func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" - for darwin_arch in $darwin_arches ; do - func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}" - $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" - cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" - func_extract_an_archive "`pwd`" "${darwin_base_archive}" - cd "$darwin_curdir" - $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" - done # $darwin_arches - ## Okay now we've a bunch of thin objects, gotta fatten them up :) - darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u` - darwin_file= - darwin_files= - for darwin_file in $darwin_filelist; do - darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` - $LIPO -create -output "$darwin_file" $darwin_files - done # $darwin_filelist - $RM -rf unfat-$$ - cd "$darwin_orig_dir" - else - cd $darwin_orig_dir - func_extract_an_archive "$my_xdir" "$my_xabs" - fi # $darwin_arches - } # !$opt_dry_run - ;; - *) - func_extract_an_archive "$my_xdir" "$my_xabs" - ;; - esac - my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` - done - - func_extract_archives_result="$my_oldobjs" -} - - -# func_emit_wrapper [arg=no] -# -# Emit a libtool wrapper script on stdout. -# Don't directly open a file because we may want to -# incorporate the script contents within a cygwin/mingw -# wrapper executable. Must ONLY be called from within -# func_mode_link because it depends on a number of variables -# set therein. -# -# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR -# variable will take. If 'yes', then the emitted script -# will assume that the directory in which it is stored is -# the $objdir directory. This is a cygwin/mingw-specific -# behavior. -func_emit_wrapper () -{ - func_emit_wrapper_arg1=${1-no} - - $ECHO "\ -#! $SHELL - -# $output - temporary wrapper script for $objdir/$outputname -# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION -# -# The $output program cannot be directly executed until all the libtool -# libraries that it depends on are installed. -# -# This wrapper script should never be moved out of the build directory. -# If it is, it will not operate correctly. - -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -sed_quote_subst='$sed_quote_subst' - -# Be Bourne compatible -if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which - # is contrary to our usage. Disable this feature. - alias -g '\${1+\"\$@\"}'='\"\$@\"' - setopt NO_GLOB_SUBST -else - case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac -fi -BIN_SH=xpg4; export BIN_SH # for Tru64 -DUALCASE=1; export DUALCASE # for MKS sh - -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -relink_command=\"$relink_command\" - -# This environment variable determines our operation mode. -if test \"\$libtool_install_magic\" = \"$magic\"; then - # install mode needs the following variables: - generated_by_libtool_version='$macro_version' - notinst_deplibs='$notinst_deplibs' -else - # When we are sourced in execute mode, \$file and \$ECHO are already set. - if test \"\$libtool_execute_magic\" != \"$magic\"; then - file=\"\$0\"" - - qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` - $ECHO "\ - -# A function that is used when there is no print builtin or printf. -func_fallback_echo () -{ - eval 'cat <<_LTECHO_EOF -\$1 -_LTECHO_EOF' -} - ECHO=\"$qECHO\" - fi - -# Very basic option parsing. These options are (a) specific to -# the libtool wrapper, (b) are identical between the wrapper -# /script/ and the wrapper /executable/ which is used only on -# windows platforms, and (c) all begin with the string "--lt-" -# (application programs are unlikely to have options which match -# this pattern). -# -# There are only two supported options: --lt-debug and -# --lt-dump-script. There is, deliberately, no --lt-help. -# -# The first argument to this parsing function should be the -# script's $0 value, followed by "$@". -lt_option_debug= -func_parse_lt_options () -{ - lt_script_arg0=\$0 - shift - for lt_opt - do - case \"\$lt_opt\" in - --lt-debug) lt_option_debug=1 ;; - --lt-dump-script) - lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` - test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. - lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` - cat \"\$lt_dump_D/\$lt_dump_F\" - exit 0 - ;; - --lt-*) - \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 - exit 1 - ;; - esac - done - - # Print the debug banner immediately: - if test -n \"\$lt_option_debug\"; then - echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2 - fi -} - -# Used when --lt-debug. Prints its arguments to stdout -# (redirection is the responsibility of the caller) -func_lt_dump_args () -{ - lt_dump_args_N=1; - for lt_arg - do - \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\" - lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` - done -} - -# Core function for launching the target application -func_exec_program_core () -{ -" - case $host in - # Backslashes separate directories on plain windows - *-*-mingw | *-*-os2* | *-cegcc*) - $ECHO "\ - if test -n \"\$lt_option_debug\"; then - \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2 - func_lt_dump_args \${1+\"\$@\"} 1>&2 - fi - exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} -" - ;; - - *) - $ECHO "\ - if test -n \"\$lt_option_debug\"; then - \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2 - func_lt_dump_args \${1+\"\$@\"} 1>&2 - fi - exec \"\$progdir/\$program\" \${1+\"\$@\"} -" - ;; - esac - $ECHO "\ - \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 - exit 1 -} - -# A function to encapsulate launching the target application -# Strips options in the --lt-* namespace from \$@ and -# launches target application with the remaining arguments. -func_exec_program () -{ - for lt_wr_arg - do - case \$lt_wr_arg in - --lt-*) ;; - *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; - esac - shift - done - func_exec_program_core \${1+\"\$@\"} -} - - # Parse options - func_parse_lt_options \"\$0\" \${1+\"\$@\"} - - # Find the directory that this script lives in. - thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` - test \"x\$thisdir\" = \"x\$file\" && thisdir=. - - # Follow symbolic links until we get to the real thisdir. - file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\` - while test -n \"\$file\"; do - destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` - - # If there was a directory component, then change thisdir. - if test \"x\$destdir\" != \"x\$file\"; then - case \"\$destdir\" in - [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; - *) thisdir=\"\$thisdir/\$destdir\" ;; - esac - fi - - file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` - file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` - done - - # Usually 'no', except on cygwin/mingw when embedded into - # the cwrapper. - WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 - if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then - # special case for '.' - if test \"\$thisdir\" = \".\"; then - thisdir=\`pwd\` - fi - # remove .libs from thisdir - case \"\$thisdir\" in - *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; - $objdir ) thisdir=. ;; - esac - fi - - # Try to get the absolute directory name. - absdir=\`cd \"\$thisdir\" && pwd\` - test -n \"\$absdir\" && thisdir=\"\$absdir\" -" - - if test "$fast_install" = yes; then - $ECHO "\ - program=lt-'$outputname'$exeext - progdir=\"\$thisdir/$objdir\" - - if test ! -f \"\$progdir/\$program\" || - { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ - test \"X\$file\" != \"X\$progdir/\$program\"; }; then - - file=\"\$\$-\$program\" - - if test ! -d \"\$progdir\"; then - $MKDIR \"\$progdir\" - else - $RM \"\$progdir/\$file\" - fi" - - $ECHO "\ - - # relink executable if necessary - if test -n \"\$relink_command\"; then - if relink_command_output=\`eval \$relink_command 2>&1\`; then : - else - $ECHO \"\$relink_command_output\" >&2 - $RM \"\$progdir/\$file\" - exit 1 - fi - fi - - $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || - { $RM \"\$progdir/\$program\"; - $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } - $RM \"\$progdir/\$file\" - fi" - else - $ECHO "\ - program='$outputname' - progdir=\"\$thisdir/$objdir\" -" - fi - - $ECHO "\ - - if test -f \"\$progdir/\$program\"; then" - - # Export our shlibpath_var if we have one. - if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then - $ECHO "\ - # Add our own library path to $shlibpath_var - $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" - - # Some systems cannot cope with colon-terminated $shlibpath_var - # The second colon is a workaround for a bug in BeOS R4 sed - $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` - - export $shlibpath_var -" - fi - - # 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. - func_exec_program \${1+\"\$@\"} - fi - else - # The program doesn't exist. - \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 - \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 - \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 - exit 1 - fi -fi\ -" -} - - -# func_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 - func_to_host_path_result=`( cmd //c echo "$1" ) 2>/dev/null | - $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"` - ;; - *cygwin* ) - func_to_host_path_result=`cygpath -w "$1" | - $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_stripname : : "$1" - func_to_host_pathlist_tmp1=$func_stripname_result - case $build in - *mingw* ) # Actually, msys. - # Awkward: cmd appends spaces to result. - func_to_host_pathlist_result=` - ( cmd //c echo "$func_to_host_pathlist_tmp1" ) 2>/dev/null | - $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"` - ;; - *cygwin* ) - func_to_host_pathlist_result=`cygpath -w -p "$func_to_host_pathlist_tmp1" | - $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_append func_to_host_pathlist_result ";$func_to_host_path_result" - fi - fi - fi - 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_append 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 < -#include -#ifdef _MSC_VER -# include -# include -# include -#else -# include -# include -# ifdef __CYGWIN__ -# include -# endif -#endif -#include -#include -#include -#include -#include -#include -#include -#include - -/* declarations of non-ANSI functions */ -#if defined(__MINGW32__) -# ifdef __STRICT_ANSI__ -int _putenv (const char *); -# endif -#elif defined(__CYGWIN__) -# ifdef __STRICT_ANSI__ -char *realpath (const char *, char *); -int putenv (char *); -int setenv (const char *, const char *, int); -# endif -/* #elif defined (other platforms) ... */ -#endif - -/* portability defines, excluding path handling macros */ -#if defined(_MSC_VER) -# define setmode _setmode -# define stat _stat -# define chmod _chmod -# define getcwd _getcwd -# define putenv _putenv -# define S_IXUSR _S_IEXEC -# ifndef _INTPTR_T_DEFINED -# define _INTPTR_T_DEFINED -# define intptr_t int -# endif -#elif defined(__MINGW32__) -# define setmode _setmode -# define stat _stat -# define chmod _chmod -# define getcwd _getcwd -# define putenv _putenv -#elif defined(__CYGWIN__) -# define HAVE_SETENV -# define FOPEN_WB "wb" -/* #elif defined (other platforms) ... */ -#endif - -#if defined(PATH_MAX) -# define LT_PATHMAX PATH_MAX -#elif defined(MAXPATHLEN) -# define LT_PATHMAX MAXPATHLEN -#else -# define LT_PATHMAX 1024 -#endif - -#ifndef S_IXOTH -# define S_IXOTH 0 -#endif -#ifndef S_IXGRP -# define S_IXGRP 0 -#endif - -/* path handling portability macros */ -#ifndef DIR_SEPARATOR -# define DIR_SEPARATOR '/' -# define PATH_SEPARATOR ':' -#endif - -#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ - defined (__OS2__) -# define HAVE_DOS_BASED_FILE_SYSTEM -# define FOPEN_WB "wb" -# ifndef DIR_SEPARATOR_2 -# define DIR_SEPARATOR_2 '\\' -# endif -# ifndef PATH_SEPARATOR_2 -# define PATH_SEPARATOR_2 ';' -# endif -#endif - -#ifndef DIR_SEPARATOR_2 -# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) -#else /* DIR_SEPARATOR_2 */ -# define IS_DIR_SEPARATOR(ch) \ - (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) -#endif /* DIR_SEPARATOR_2 */ - -#ifndef PATH_SEPARATOR_2 -# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) -#else /* PATH_SEPARATOR_2 */ -# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) -#endif /* PATH_SEPARATOR_2 */ - -#ifndef FOPEN_WB -# define FOPEN_WB "w" -#endif -#ifndef _O_BINARY -# define _O_BINARY 0 -#endif - -#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) -#define XFREE(stale) do { \ - if (stale) { free ((void *) stale); stale = 0; } \ -} while (0) - -#if defined(LT_DEBUGWRAPPER) -static int lt_debug = 1; -#else -static int lt_debug = 0; -#endif - -const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ - -void *xmalloc (size_t num); -char *xstrdup (const char *string); -const char *base_name (const char *name); -char *find_executable (const char *wrapper); -char *chase_symlinks (const char *pathspec); -int make_executable (const char *path); -int check_executable (const char *path); -char *strendzap (char *str, const char *pat); -void lt_debugprintf (const char *file, int line, const char *fmt, ...); -void lt_fatal (const char *file, int line, const char *message, ...); -static const char *nonnull (const char *s); -static const char *nonempty (const char *s); -void lt_setenv (const char *name, const char *value); -char *lt_extend_str (const char *orig_value, const char *add, int to_end); -void lt_update_exe_path (const char *name, const char *value); -void lt_update_lib_path (const char *name, const char *value); -char **prepare_spawn (char **argv); -void lt_dump_script (FILE *f); -EOF - - cat <= 0) - && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) - return 1; - else - return 0; -} - -int -make_executable (const char *path) -{ - int rval = 0; - struct stat st; - - lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", - nonempty (path)); - if ((!path) || (!*path)) - return 0; - - if (stat (path, &st) >= 0) - { - rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); - } - return rval; -} - -/* Searches for the full path of the wrapper. Returns - newly allocated full path name if found, NULL otherwise - Does not chase symlinks, even on platforms that support them. -*/ -char * -find_executable (const char *wrapper) -{ - int has_slash = 0; - const char *p; - const char *p_next; - /* static buffer for getcwd */ - char tmp[LT_PATHMAX + 1]; - int tmp_len; - char *concat_name; - - lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", - nonempty (wrapper)); - - if ((wrapper == NULL) || (*wrapper == '\0')) - return NULL; - - /* Absolute path? */ -#if defined (HAVE_DOS_BASED_FILE_SYSTEM) - if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') - { - concat_name = xstrdup (wrapper); - if (check_executable (concat_name)) - return concat_name; - XFREE (concat_name); - } - else - { -#endif - if (IS_DIR_SEPARATOR (wrapper[0])) - { - concat_name = xstrdup (wrapper); - if (check_executable (concat_name)) - return concat_name; - XFREE (concat_name); - } -#if defined (HAVE_DOS_BASED_FILE_SYSTEM) - } -#endif - - for (p = wrapper; *p; p++) - if (*p == '/') - { - has_slash = 1; - break; - } - if (!has_slash) - { - /* no slashes; search PATH */ - const char *path = getenv ("PATH"); - if (path != NULL) - { - for (p = path; *p; p = p_next) - { - const char *q; - size_t p_len; - for (q = p; *q; q++) - if (IS_PATH_SEPARATOR (*q)) - break; - p_len = q - p; - p_next = (*q == '\0' ? q : q + 1); - if (p_len == 0) - { - /* empty path: current directory */ - if (getcwd (tmp, LT_PATHMAX) == NULL) - lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", - nonnull (strerror (errno))); - tmp_len = strlen (tmp); - concat_name = - XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); - memcpy (concat_name, tmp, tmp_len); - concat_name[tmp_len] = '/'; - strcpy (concat_name + tmp_len + 1, wrapper); - } - else - { - concat_name = - XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); - memcpy (concat_name, p, p_len); - concat_name[p_len] = '/'; - strcpy (concat_name + p_len + 1, wrapper); - } - if (check_executable (concat_name)) - return concat_name; - XFREE (concat_name); - } - } - /* not found in PATH; assume curdir */ - } - /* Relative path | not found in path: prepend cwd */ - if (getcwd (tmp, LT_PATHMAX) == NULL) - lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", - nonnull (strerror (errno))); - tmp_len = strlen (tmp); - concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); - memcpy (concat_name, tmp, tmp_len); - concat_name[tmp_len] = '/'; - strcpy (concat_name + tmp_len + 1, wrapper); - - if (check_executable (concat_name)) - return concat_name; - XFREE (concat_name); - return NULL; -} - -char * -chase_symlinks (const char *pathspec) -{ -#ifndef S_ISLNK - return xstrdup (pathspec); -#else - char buf[LT_PATHMAX]; - struct stat s; - char *tmp_pathspec = xstrdup (pathspec); - char *p; - int has_symlinks = 0; - while (strlen (tmp_pathspec) && !has_symlinks) - { - lt_debugprintf (__FILE__, __LINE__, - "checking path component for symlinks: %s\n", - tmp_pathspec); - if (lstat (tmp_pathspec, &s) == 0) - { - if (S_ISLNK (s.st_mode) != 0) - { - has_symlinks = 1; - break; - } - - /* search backwards for last DIR_SEPARATOR */ - p = tmp_pathspec + strlen (tmp_pathspec) - 1; - while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) - p--; - if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) - { - /* no more DIR_SEPARATORS left */ - break; - } - *p = '\0'; - } - else - { - lt_fatal (__FILE__, __LINE__, - "error accessing file \"%s\": %s", - tmp_pathspec, nonnull (strerror (errno))); - } - } - XFREE (tmp_pathspec); - - if (!has_symlinks) - { - return xstrdup (pathspec); - } - - tmp_pathspec = realpath (pathspec, buf); - if (tmp_pathspec == 0) - { - lt_fatal (__FILE__, __LINE__, - "could not follow symlinks for %s", pathspec); - } - return xstrdup (tmp_pathspec); -#endif -} - -char * -strendzap (char *str, const char *pat) -{ - size_t len, patlen; - - assert (str != NULL); - assert (pat != NULL); - - len = strlen (str); - patlen = strlen (pat); - - if (patlen <= len) - { - str += len - patlen; - if (strcmp (str, pat) == 0) - *str = '\0'; - } - return str; -} - -void -lt_debugprintf (const char *file, int line, const char *fmt, ...) -{ - va_list args; - if (lt_debug) - { - (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); - va_start (args, fmt); - (void) vfprintf (stderr, fmt, args); - va_end (args); - } -} - -static void -lt_error_core (int exit_status, const char *file, - int line, const char *mode, - const char *message, va_list ap) -{ - fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); - vfprintf (stderr, message, ap); - fprintf (stderr, ".\n"); - - if (exit_status >= 0) - exit (exit_status); -} - -void -lt_fatal (const char *file, int line, const char *message, ...) -{ - va_list ap; - va_start (ap, message); - lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); - va_end (ap); -} - -static const char * -nonnull (const char *s) -{ - return s ? s : "(null)"; -} - -static const char * -nonempty (const char *s) -{ - return (s && !*s) ? "(empty)" : nonnull (s); -} - -void -lt_setenv (const char *name, const char *value) -{ - lt_debugprintf (__FILE__, __LINE__, - "(lt_setenv) setting '%s' to '%s'\n", - nonnull (name), nonnull (value)); - { -#ifdef HAVE_SETENV - /* always make a copy, for consistency with !HAVE_SETENV */ - char *str = xstrdup (value); - setenv (name, str, 1); -#else - int len = strlen (name) + 1 + strlen (value) + 1; - char *str = XMALLOC (char, len); - sprintf (str, "%s=%s", name, value); - if (putenv (str) != EXIT_SUCCESS) - { - XFREE (str); - } -#endif - } -} - -char * -lt_extend_str (const char *orig_value, const char *add, int to_end) -{ - char *new_value; - if (orig_value && *orig_value) - { - int orig_value_len = strlen (orig_value); - int add_len = strlen (add); - new_value = XMALLOC (char, add_len + orig_value_len + 1); - if (to_end) - { - strcpy (new_value, orig_value); - strcpy (new_value + orig_value_len, add); - } - else - { - strcpy (new_value, add); - strcpy (new_value + add_len, orig_value); - } - } - else - { - new_value = xstrdup (add); - } - return new_value; -} - -void -lt_update_exe_path (const char *name, const char *value) -{ - lt_debugprintf (__FILE__, __LINE__, - "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", - nonnull (name), nonnull (value)); - - if (name && *name && value && *value) - { - char *new_value = lt_extend_str (getenv (name), value, 0); - /* some systems can't cope with a ':'-terminated path #' */ - int len = strlen (new_value); - while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1])) - { - new_value[len-1] = '\0'; - } - lt_setenv (name, new_value); - XFREE (new_value); - } -} - -void -lt_update_lib_path (const char *name, const char *value) -{ - lt_debugprintf (__FILE__, __LINE__, - "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", - nonnull (name), nonnull (value)); - - if (name && *name && value && *value) - { - char *new_value = lt_extend_str (getenv (name), value, 0); - lt_setenv (name, new_value); - XFREE (new_value); - } -} - -EOF - case $host_os in - mingw*) - cat <<"EOF" - -/* Prepares an argument vector before calling spawn(). - Note that spawn() does not by itself call the command interpreter - (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : - ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); - GetVersionEx(&v); - v.dwPlatformId == VER_PLATFORM_WIN32_NT; - }) ? "cmd.exe" : "command.com"). - Instead it simply concatenates the arguments, separated by ' ', and calls - CreateProcess(). We must quote the arguments since Win32 CreateProcess() - interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a - special way: - - Space and tab are interpreted as delimiters. They are not treated as - delimiters if they are surrounded by double quotes: "...". - - Unescaped double quotes are removed from the input. Their only effect is - that within double quotes, space and tab are treated like normal - characters. - - Backslashes not followed by double quotes are not special. - - But 2*n+1 backslashes followed by a double quote become - n backslashes followed by a double quote (n >= 0): - \" -> " - \\\" -> \" - \\\\\" -> \\" - */ -#define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" -#define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" -char ** -prepare_spawn (char **argv) -{ - size_t argc; - char **new_argv; - size_t i; - - /* Count number of arguments. */ - for (argc = 0; argv[argc] != NULL; argc++) - ; - - /* Allocate new argument vector. */ - new_argv = XMALLOC (char *, argc + 1); - - /* Put quoted arguments into the new argument vector. */ - for (i = 0; i < argc; i++) - { - const char *string = argv[i]; - - if (string[0] == '\0') - new_argv[i] = xstrdup ("\"\""); - else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) - { - int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); - size_t length; - unsigned int backslashes; - const char *s; - char *quoted_string; - char *p; - - length = 0; - backslashes = 0; - if (quote_around) - length++; - for (s = string; *s != '\0'; s++) - { - char c = *s; - if (c == '"') - length += backslashes + 1; - length++; - if (c == '\\') - backslashes++; - else - backslashes = 0; - } - if (quote_around) - length += backslashes + 1; - - quoted_string = XMALLOC (char, length + 1); - - p = quoted_string; - backslashes = 0; - if (quote_around) - *p++ = '"'; - for (s = string; *s != '\0'; s++) - { - char c = *s; - if (c == '"') - { - unsigned int j; - for (j = backslashes + 1; j > 0; j--) - *p++ = '\\'; - } - *p++ = c; - if (c == '\\') - backslashes++; - else - backslashes = 0; - } - if (quote_around) - { - unsigned int j; - for (j = backslashes; j > 0; j--) - *p++ = '\\'; - *p++ = '"'; - } - *p = '\0'; - - new_argv[i] = quoted_string; - } - else - new_argv[i] = (char *) string; - } - new_argv[argc] = NULL; - - return new_argv; -} -EOF - ;; - esac - - cat <<"EOF" -void lt_dump_script (FILE* f) -{ -EOF - func_emit_wrapper yes | - $SED -e 's/\([\\"]\)/\\\1/g' \ - -e 's/^/ fputs ("/' -e 's/$/\\n", f);/' - - cat <<"EOF" -} -EOF -} -# end: func_emit_cwrapperexe_src - -# func_win32_import_lib_p ARG -# True if ARG is an import lib, as indicated by $file_magic_cmd -func_win32_import_lib_p () -{ - $opt_debug - case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in - *import*) : ;; - *) false ;; - esac -} - -# func_mode_link arg... -func_mode_link () -{ - $opt_debug - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) - # It is impossible to link a dll without this setting, and - # we shouldn't force the makefile maintainer to figure out - # which system we are compiling for in order to pass an extra - # flag for every libtool invocation. - # allow_undefined=no - - # FIXME: Unfortunately, there are problems with the above when trying - # to make a dll which has undefined symbols, in which case not - # even a static library is built. For now, we need to specify - # -no-undefined on the libtool link line when we can be certain - # that all symbols are satisfied, otherwise we get a static library. - allow_undefined=yes - ;; - *) - allow_undefined=yes - ;; - esac - libtool_args=$nonopt - base_compile="$nonopt $@" - compile_command=$nonopt - finalize_command=$nonopt - - compile_rpath= - finalize_rpath= - compile_shlibpath= - finalize_shlibpath= - convenience= - old_convenience= - deplibs= - old_deplibs= - compiler_flags= - linker_flags= - dllsearchpath= - lib_search_path=`pwd` - inst_prefix_dir= - new_inherited_linker_flags= - - avoid_version=no - bindir= - dlfiles= - dlprefiles= - dlself=no - export_dynamic=no - export_symbols= - export_symbols_regex= - generated= - libobjs= - ltlibs= - module=no - no_install=no - objs= - non_pic_objects= - precious_files_regex= - prefer_static_libs=no - preload=no - prev= - prevarg= - release= - rpath= - xrpath= - perm_rpath= - temp_rpath= - thread_safe=no - vinfo= - vinfo_number=no - weak_libs= - single_module="${wl}-single_module" - func_infer_tag $base_compile - - # We need to know -static, to get the right output filenames. - for arg - do - case $arg in - -shared) - test "$build_libtool_libs" != yes && \ - func_fatal_configuration "can not build a shared library" - build_old_libs=no - break - ;; - -all-static | -static | -static-libtool-libs) - case $arg in - -all-static) - if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then - func_warning "complete static linking is impossible in this configuration" - fi - if test -n "$link_static_flag"; then - dlopen_self=$dlopen_self_static - fi - prefer_static_libs=yes - ;; - -static) - if test -z "$pic_flag" && test -n "$link_static_flag"; then - dlopen_self=$dlopen_self_static - fi - prefer_static_libs=built - ;; - -static-libtool-libs) - if test -z "$pic_flag" && test -n "$link_static_flag"; then - dlopen_self=$dlopen_self_static - fi - prefer_static_libs=yes - ;; - esac - build_libtool_libs=no - build_old_libs=yes - break - ;; - esac - done - - # See if our shared archives depend on static archives. - test -n "$old_archive_from_new_cmds" && build_old_libs=yes - - # Go through the arguments, transforming them on the way. - while test "$#" -gt 0; do - arg="$1" - shift - func_quote_for_eval "$arg" - qarg=$func_quote_for_eval_unquoted_result - func_append libtool_args " $func_quote_for_eval_result" - - # If the previous option needs an argument, assign it. - if test -n "$prev"; then - case $prev in - output) - func_append compile_command " @OUTPUT@" - func_append finalize_command " @OUTPUT@" - ;; - esac - - case $prev in - bindir) - bindir="$arg" - prev= - continue - ;; - dlfiles|dlprefiles) - if test "$preload" = no; then - # Add the symbol object into the linking commands. - func_append compile_command " @SYMFILE@" - func_append finalize_command " @SYMFILE@" - preload=yes - fi - case $arg in - *.la | *.lo) ;; # We handle these cases below. - force) - if test "$dlself" = no; then - dlself=needless - export_dynamic=yes - fi - prev= - continue - ;; - self) - if test "$prev" = dlprefiles; then - dlself=yes - elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then - dlself=yes - else - dlself=needless - export_dynamic=yes - fi - prev= - continue - ;; - *) - if test "$prev" = dlfiles; then - 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 - ;; - - -bindir) - prev=bindir - continue - ;; - - -dlopen) - prev=dlfiles - continue - ;; - - -dlpreopen) - prev=dlprefiles - continue - ;; - - -export-dynamic) - export_dynamic=yes - continue - ;; - - -export-symbols | -export-symbols-regex) - if test -n "$export_symbols" || test -n "$export_symbols_regex"; then - func_fatal_error "more than one -exported-symbols argument is not allowed" - fi - if test "X$arg" = "X-export-symbols"; then - prev=expsyms - else - prev=expsyms_regex - fi - continue - ;; - - -framework) - prev=framework - continue - ;; - - -inst-prefix-dir) - prev=inst_prefix - continue - ;; - - # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* - # so, if we see these flags be careful not to treat them like -L - -L[A-Z][A-Z]*:*) - case $with_gcc/$host in - no/*-*-irix* | /*-*-irix*) - func_append compile_command " $arg" - func_append finalize_command " $arg" - ;; - esac - continue - ;; - - -L*) - func_stripname '-L' '' "$arg" - 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 "$dir" | $SED '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* | *-*-haiku*) - # These systems don't actually have a C or math library (as such) - continue - ;; - *-*-os2*) - # These systems don't actually have a C library (as such) - test "X$arg" = "X-lc" && continue - ;; - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) - # Do not include libc due to us having libc/libc_r. - test "X$arg" = "X-lc" && continue - ;; - *-*-rhapsody* | *-*-darwin1.[012]) - # Rhapsody C and math libraries are in the System framework - 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 $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" - ;; - - # Flags to be passed through unchanged, with rationale: - # -64, -mips[0-9] enable 64-bit mode for the SGI compiler - # -r[0-9][0-9]* specify processor for the SGI compiler - # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler - # +DA*, +DD* enable 64-bit mode for the HP compiler - # -q* compiler args for the IBM compiler - # -m*, -t[45]*, -txscale* architecture-specific flags for GCC - # -F/path path to uninstalled frameworks, gcc on darwin - # -p, -pg, --coverage, -fprofile-* profiling flags for GCC - # @file GCC response files - # -tp=* Portland pgcc target processor selection - -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ - -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*) - 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 \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\` - else - shlib_search_path= - fi - eval sys_lib_search_path=\"$sys_lib_search_path_spec\" - eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" - - func_dirname "$output" "/" "" - output_objdir="$func_dirname_result$objdir" - # 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 - func_basename "$deplib" - deplib_base=$func_basename_result - 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 \"$deplib\"" 2>/dev/null | $SED 10q \ - | $EGREP "$match_pattern_regex" > /dev/null; then - valid_a_lib=yes - fi - ;; - pass_all) - valid_a_lib=yes - ;; - esac - if test "$valid_a_lib" != yes; then - echo - $ECHO "*** Warning: Trying to link with static lib archive $deplib." - echo "*** I have the capability to make that library automatically link in when" - echo "*** you link to this library. But I can only do this if you have a" - echo "*** shared version of the library, which you do not appear to have" - echo "*** because the file extensions .$libext of this argument makes me believe" - echo "*** that it is just a static archive that I should not use here." - else - echo - $ECHO "*** Warning: Linking the shared library $output against the" - $ECHO "*** static library $deplib is not portable!" - deplibs="$deplib $deplibs" - fi - ;; - esac - continue - ;; - prog) - if test "$pass" != link; then - deplibs="$deplib $deplibs" - else - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - fi - continue - ;; - esac # linkmode - ;; # *.$libext - *.lo | *.$objext) - if test "$pass" = conv; then - deplibs="$deplib $deplibs" - elif test "$linkmode" = prog; then - if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then - # If there is no dlopen support or we're linking statically, - # we need to preload. - 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 "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'` - for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do - case " $new_inherited_linker_flags " in - *" $tmp_inherited_linker_flag "*) ;; - *) new_inherited_linker_flags="$new_inherited_linker_flags $tmp_inherited_linker_flag";; - esac - done - fi - dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` - if test "$linkmode,$pass" = "lib,link" || - test "$linkmode,$pass" = "prog,scan" || - { test "$linkmode" != prog && test "$linkmode" != lib; }; then - test -n "$dlopen" && 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 - path= - 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 " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` - fi - fi - dependency_libs="$newdependency_libs" - if test "$pass" = dlpreopen; then - # Link the dlpreopened libraries before other libraries - for deplib in $save_deplibs; do - deplibs="$deplib $deplibs" - done - fi - if test "$pass" != dlopen; then - if test "$pass" != conv; then - # Make sure lib_search_path contains only unique directories. - lib_search_path= - for dir in $newlib_search_path; do - case "$lib_search_path " in - *" $dir "*) ;; - *) 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|qnx|sunos) - current="$number_major" - revision="$number_minor" - age="0" - ;; - irix|nonstopux) - func_arith $number_major + $number_minor - current=$func_arith_result - age="$number_minor" - revision="$number_minor" - lt_irix_increment=no - ;; - esac - ;; - no) - current="$1" - revision="$2" - age="$3" - ;; - esac - - # Check that each of the things are valid numbers. - case $current in - 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; - *) - func_error "CURRENT \`$current' must be a nonnegative integer" - func_fatal_error "\`$vinfo' is not valid version information" - ;; - esac - - case $revision in - 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; - *) - func_error "REVISION \`$revision' must be a nonnegative integer" - func_fatal_error "\`$vinfo' is not valid version information" - ;; - esac - - case $age in - 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; - *) - func_error "AGE \`$age' must be a nonnegative integer" - func_fatal_error "\`$vinfo' is not valid version information" - ;; - esac - - if test "$age" -gt "$current"; then - func_error "AGE \`$age' is greater than the current interface number \`$current'" - func_fatal_error "\`$vinfo' is not valid version information" - fi - - # Calculate the version variables. - major= - versuffix= - verstring= - case $version_type in - none) ;; - - darwin) - # Like Linux, but with the current version available in - # verstring for coding it into the library header - func_arith $current - $age - major=.$func_arith_result - versuffix="$major.$age.$revision" - # Darwin ld doesn't like 0 for these options... - func_arith $current + 1 - minor_current=$func_arith_result - xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" - verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" - ;; - - freebsd-aout) - major=".$current" - versuffix=".$current.$revision"; - ;; - - freebsd-elf) - major=".$current" - versuffix=".$current" - ;; - - irix | nonstopux) - if test "X$lt_irix_increment" = "Xno"; then - func_arith $current - $age - else - func_arith $current - $age + 1 - fi - major=$func_arith_result - - case $version_type in - nonstopux) verstring_prefix=nonstopux ;; - *) verstring_prefix=sgi ;; - esac - verstring="$verstring_prefix$major.$revision" - - # Add in all the interfaces that we are compatible with. - loop=$revision - while test "$loop" -ne 0; do - func_arith $revision - $loop - iface=$func_arith_result - func_arith $loop - 1 - loop=$func_arith_result - verstring="$verstring_prefix$major.$iface:$verstring" - done - - # Before this point, $major must not contain `.'. - major=.$major - versuffix="$major.$revision" - ;; - - linux) - 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 "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP` - fi - - # Eliminate all temporary directories. - #for path in $notinst_path; do - # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` - # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` - # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"` - #done - - if test -n "$xrpath"; then - # If the user specified any rpath flags, then add them. - temp_xrpath= - for libdir in $xrpath; do - 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* | *-*-haiku*) - # 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 </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 "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";; - esac - done - if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | - $SED -e 10q | - $EGREP "$file_magic_regex" > /dev/null; then - 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 \"$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 - ;; - *) - # Add a -L argument. - newdeplibs="$newdeplibs $a_deplib" - ;; - esac - done # Gone through all deplibs. - ;; - none | unknown | *) - newdeplibs="" - tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then - for i in $predeps $postdeps ; do - # can't use Xsed below, because $i might contain '/' - tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"` - done - fi - case $tmp_deplibs in - *[!\ \ ]*) - echo - if test "X$deplibs_check_method" = "Xnone"; then - echo "*** Warning: inter-library dependencies are not supported in this platform." - else - echo "*** Warning: inter-library dependencies are not known to be supported." - fi - echo "*** All declared inter-library dependencies are being dropped." - droppeddeps=yes - ;; - esac - ;; - esac - versuffix=$versuffix_save - major=$major_save - release=$release_save - libname=$libname_save - name=$name_save - - case $host in - *-*-rhapsody* | *-*-darwin1.[012]) - # On Rhapsody replace the C library with the System framework - newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` - ;; - esac - - if test "$droppeddeps" = yes; then - if test "$module" = yes; then - echo - echo "*** Warning: libtool could not satisfy all declared inter-library" - $ECHO "*** dependencies of module $libname. Therefore, libtool will create" - echo "*** a static module, that should work as long as the dlopening" - echo "*** application is linked with the -dlopen flag." - if test -z "$global_symbol_pipe"; then - echo - echo "*** However, this would only work if libtool was able to extract symbol" - echo "*** lists from a program, using \`nm' or equivalent, but libtool could" - echo "*** not find such a program. So, this module is probably useless." - echo "*** \`nm' from GNU binutils and a full rebuild may help." - fi - if test "$build_old_libs" = no; then - oldlibs="$output_objdir/$libname.$libext" - build_libtool_libs=module - build_old_libs=yes - else - build_libtool_libs=no - fi - else - echo "*** The inter-library dependencies that have been dropped here will be" - echo "*** automatically added whenever a program is linked with this library" - echo "*** or is declared to -dlopen it." - - if test "$allow_undefined" = no; then - echo - echo "*** Since this library must not contain undefined symbols," - echo "*** because either the platform does not support them or" - echo "*** it was explicitly requested with -no-undefined," - echo "*** libtool will only create a static version of it." - if test "$build_old_libs" = no; then - oldlibs="$output_objdir/$libname.$libext" - build_libtool_libs=module - build_old_libs=yes - else - build_libtool_libs=no - fi - fi - fi - fi - # Done checking deplibs! - deplibs=$newdeplibs - fi - # Time to change all our "foo.ltframework" stuff back to "-framework foo" - case $host in - *-*-darwin*) - newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` - new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` - deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` - ;; - esac - - # move library search paths that coincide with paths to not yet - # installed libraries to the beginning of the library search list - new_libs= - for path in $notinst_path; do - case " $new_libs " in - *" -L$path/$objdir "*) ;; - *) - case " $deplibs " in - *" -L$path/$objdir "*) - 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 "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP` - test "X$libobjs" = "X " && libobjs= - - delfiles= - if test -n "$export_symbols" && test -n "$include_expsyms"; then - $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" - export_symbols="$output_objdir/$libname.uexp" - 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 "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' - fi - - if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then - # The given exports_symbols file has to be filtered, so filter it. - func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" - # FIXME: $output_objdir/$libname.filter potentially contains lots of - # 's' commands which not all seds can handle. GNU sed should be fine - # though. Also, the filter scales superlinearly with the number of - # global variables. join(1) would be nice here, but unfortunately - # isn't a blessed tool. - $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter - 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 - func_basename "$output" - output_la=$func_basename_result - - # Clear the reloadable object creation command queue and - # initialize k to one. - test_cmds= - concat_cmds= - objlist= - last_robj= - k=1 - - if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then - output=${output_objdir}/${output_la}.lnkscript - func_verbose "creating GNU ld script: $output" - echo 'INPUT (' > $output - for obj in $save_libobjs - do - $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. - reload_objs=$objlist - eval concat_cmds=\"$reload_cmds\" - else - # All subsequent reloadable object files will link in - # the last one created. - reload_objs="$objlist $last_robj" - eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" - fi - last_robj=$output_objdir/$output_la-${k}.$objext - func_arith $k + 1 - k=$func_arith_result - output=$output_objdir/$output_la-${k}.$objext - objlist=" $obj" - func_len " $last_robj" - func_arith $len0 + $func_len_result - len=$func_arith_result - fi - done - # Handle the remaining objects by creating one last - # reloadable object file. All subsequent reloadable object - # files will link in the last one created. - test -z "$concat_cmds" || concat_cmds=$concat_cmds~ - reload_objs="$objlist $last_robj" - eval concat_cmds=\"\${concat_cmds}$reload_cmds\" - if test -n "$last_robj"; then - eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\" - fi - 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 "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' - fi - - if test -n "$orig_export_symbols"; then - # The given exports_symbols file has to be filtered, so filter it. - func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" - # FIXME: $output_objdir/$libname.filter potentially contains lots of - # 's' commands which not all seds can handle. GNU sed should be fine - # though. Also, the filter scales superlinearly with the number of - # global variables. join(1) would be nice here, but unfortunately - # isn't a blessed tool. - $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter - 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 "$tmp_whole_archive_flags" | $SED '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 "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test - - output="$obj" - func_execute_cmds "$reload_cmds" 'exit $?' - - # Exit if we aren't doing a library object file. - if test -z "$libobj"; then - if test -n "$gentop"; then - func_show_eval '${RM}r "$gentop"' - fi - - exit $EXIT_SUCCESS - fi - - if test "$build_libtool_libs" != yes; then - if test -n "$gentop"; then - func_show_eval '${RM}r "$gentop"' - fi - - # Create an invalid libtool object if no PIC, so that we don't - # accidentally link it into a program. - # $show "echo timestamp > $libobj" - # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? - exit $EXIT_SUCCESS - fi - - if test -n "$pic_flag" || test "$pic_mode" != default; then - # Only do commands if we really have different PIC objects. - reload_objs="$libobjs $reload_conv_objs" - output="$libobj" - func_execute_cmds "$reload_cmds" 'exit $?' - fi - - if test -n "$gentop"; then - func_show_eval '${RM}r "$gentop"' - fi - - exit $EXIT_SUCCESS - ;; - - prog) - case $host in - *cygwin*) func_stripname '' '.exe' "$output" - output=$func_stripname_result.exe;; - esac - test -n "$vinfo" && \ - func_warning "\`-version-info' is ignored for programs" - - test -n "$release" && \ - func_warning "\`-release' is ignored for programs" - - test "$preload" = yes \ - && test "$dlopen_support" = unknown \ - && test "$dlopen_self" = unknown \ - && test "$dlopen_self_static" = unknown && \ - func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support." - - case $host in - *-*-rhapsody* | *-*-darwin1.[012]) - # On Rhapsody replace the C library is the System framework - compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` - finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` - ;; - esac - - case $host in - *-*-darwin*) - # Don't allow lazy linking, it breaks C++ global constructors - # But is supposedly fixed on 10.4 or later (yay!). - if test "$tagname" = CXX ; then - case ${MACOSX_DEPLOYMENT_TARGET-10.0} in - 10.[0123]) - 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 " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` - finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` - ;; - esac - - - # move library search paths that coincide with paths to not yet - # installed libraries to the beginning of the library search list - new_libs= - for path in $notinst_path; do - case " $new_libs " in - *" -L$path/$objdir "*) ;; - *) - case " $compile_deplibs " in - *" -L$path/$objdir "*) - 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 "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` - finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` - fi - - func_generate_dlsyms "$outputname" "@PROGRAM@" "no" - - # template prelinking step - if test -n "$prelink_cmds"; then - func_execute_cmds "$prelink_cmds" 'exit $?' - fi - - wrappers_required=yes - case $host in - *cegcc* | *mingw32ce*) - # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. - wrappers_required=no - ;; - *cygwin* | *mingw* ) - if test "$build_libtool_libs" != yes; then - wrappers_required=no - fi - ;; - *) - if test "$need_relink" = no || test "$build_libtool_libs" != yes; then - wrappers_required=no - fi - ;; - esac - if test "$wrappers_required" = no; then - # Replace the output file specification. - compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` - link_command="$compile_command$compile_rpath" - - # We have no uninstalled library dependencies, so finalize right now. - exit_status=0 - func_show_eval "$link_command" 'exit_status=$?' - - # 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 "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` - # Delete the old output file. - $opt_dry_run || $RM $output - # Link the executable and exit - func_show_eval "$link_command" 'exit $?' - exit $EXIT_SUCCESS - fi - - if test "$hardcode_action" = relink; then - # Fast installation is not supported - link_command="$compile_var$compile_command$compile_rpath" - relink_command="$finalize_var$finalize_command$finalize_rpath" - - func_warning "this platform does not like uninstalled shared libraries" - func_warning "\`$output' will be relinked during installation" - else - if test "$fast_install" != no; then - link_command="$finalize_var$compile_command$finalize_rpath" - if test "$fast_install" = yes; then - relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` - else - # fast_install is set to needless - relink_command= - fi - else - link_command="$compile_var$compile_command$compile_rpath" - relink_command="$finalize_var$finalize_command$finalize_rpath" - fi - fi - - # Replace the output file specification. - link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` - - # Delete the old output files. - $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname - - func_show_eval "$link_command" 'exit $?' - - # Now create the wrapper script. - func_verbose "creating $output" - - # Quote the relink command for shipping. - if test -n "$relink_command"; then - # Preserve any variables that may affect compiler behavior - for var in $variables_saved_for_relink; do - if eval test -z \"\${$var+set}\"; then - relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" - elif eval var_value=\$$var; test -z "$var_value"; then - relink_command="$var=; export $var; $relink_command" - else - func_quote_for_eval "$var_value" - relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" - fi - done - relink_command="(cd `pwd`; $relink_command)" - relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` - fi - - # Only actually do things if not in dry run mode. - $opt_dry_run || { - # win32 will think the script is a binary if it has - # a .exe suffix, so we strip it off here. - case $output in - *.exe) func_stripname '' '.exe' "$output" - output=$func_stripname_result ;; - esac - # test for cygwin because mv fails w/o .exe extensions - case $host in - *cygwin*) - exeext=.exe - func_stripname '' '.exe' "$outputname" - outputname=$func_stripname_result ;; - *) exeext= ;; - esac - case $host in - *cygwin* | *mingw* ) - func_dirname_and_basename "$output" "" "." - output_name=$func_basename_result - output_path=$func_dirname_result - cwrappersource="$output_path/$objdir/lt-$output_name.c" - cwrapper="$output_path/$output_name.exe" - $RM $cwrappersource $cwrapper - trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 - - func_emit_cwrapperexe_src > $cwrappersource - - # The wrapper executable is built using the $host compiler, - # because it contains $host paths and files. If cross- - # compiling, it, like the target executable, must be - # executed on the $host or under an emulation environment. - $opt_dry_run || { - $LTCC $LTCFLAGS -o $cwrapper $cwrappersource - $STRIP $cwrapper - } - - # Now, create the wrapper script for func_source use: - func_ltwrapper_scriptname $cwrapper - $RM $func_ltwrapper_scriptname_result - trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 - $opt_dry_run || { - # note: this script will not be executed, so do not chmod. - if test "x$build" = "x$host" ; then - $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result - else - func_emit_wrapper no > $func_ltwrapper_scriptname_result - fi - } - ;; - * ) - $RM $output - trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 - - func_emit_wrapper no > $output - chmod +x $output - ;; - esac - } - exit $EXIT_SUCCESS - ;; - esac - - # See if we need to build an old-fashioned archive. - for oldlib in $oldlibs; do - - if test "$build_libtool_libs" = convenience; then - oldobjs="$libobjs_save $symfileobj" - addlibs="$convenience" - build_libtool_libs=no - else - if test "$build_libtool_libs" = module; then - oldobjs="$libobjs_save" - build_libtool_libs=no - else - oldobjs="$old_deplibs $non_pic_objects" - if test "$preload" = yes && test -f "$symfileobj"; then - 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 "$relink_command" | $SED "$sed_quote_subst"` - if test "$hardcode_automatic" = yes ; then - relink_command= - fi - - # Only create the output if not a dry run. - $opt_dry_run || { - for installed in no yes; do - if test "$installed" = yes; then - if test -z "$install_libdir"; then - break - fi - output="$output_objdir/$outputname"i - # Replace all uninstalled libtool libraries with the installed ones - newdependency_libs= - for deplib in $dependency_libs; do - case $deplib in - *.la) - func_basename "$deplib" - name="$func_basename_result" - 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 - # In fact, it would be nice if we could use this code for all target - # systems that can't hard-code library paths into their executables - # and that have no shared library path variable independent of PATH, - # but it turns out we can't easily determine that from inspecting - # libtool variables, so we have to hard-code the OSs to which it - # applies here; at the moment, that means platforms that use the PE - # object format with DLL files. See the long comment at the top of - # tests/bindir.at for full details. - tdlname=$dlname - case $host,$output,$installed,$module,$dlname in - *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) - # If a -bindir argument was supplied, place the dll there. - if test "x$bindir" != x ; - then - func_relative_path "$install_libdir" "$bindir" - tdlname=$func_relative_path_result$dlname - else - # Otherwise fall back on heuristic. - tdlname=../bin/$dlname - fi - ;; - esac - $ECHO > $output "\ -# $outputname - a libtool library file -# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION -# -# Please DO NOT delete this file! -# It is necessary for linking the library. - -# The name that we can dlopen(3). -dlname='$tdlname' - -# Names of this library. -library_names='$library_names' - -# The name of the static archive. -old_library='$old_library' - -# Linker flags that can not go in dependency_libs. -inherited_linker_flags='$new_inherited_linker_flags' - -# Libraries that this one depends upon. -dependency_libs='$dependency_libs' - -# Names of additional weak libraries provided by this library -weak_library_names='$weak_libs' - -# Version information for $libname. -current=$current -age=$age -revision=$revision - -# Is this an already installed library? -installed=$installed - -# Should we warn about portability when linking against -modules? -shouldnotlink=$module - -# Files to dlopen/dlpreopen -dlopen='$dlfiles' -dlpreopen='$dlprefiles' - -# Directory that this library needs to be installed in: -libdir='$install_libdir'" - if test "$installed" = no && test "$need_relink" = yes; then - $ECHO >> $output "\ -relink_command=\"$relink_command\"" - fi - done - } - - # Do a symbolic link so that the libtool archive can be found in - # LD_LIBRARY_PATH before the program is installed. - func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' - ;; - esac - exit $EXIT_SUCCESS -} - -{ test "$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/impl/antlr/libantlr3c-3.4/ltmain.sh b/impl/antlr/libantlr3c-3.4/ltmain.sh deleted file mode 100755 index d8efb57..0000000 --- a/impl/antlr/libantlr3c-3.4/ltmain.sh +++ /dev/null @@ -1,8745 +0,0 @@ -# Generated from ltmain.m4sh. - -# libtool (GNU libtool) 2.2.10 -# Written by Gordon Matzigkeit , 1996 - -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, -# 2007, 2008, 2009, 2010 Free Software Foundation, Inc. -# This is free software; see the source for copying conditions. There is NO -# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -# GNU Libtool is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# As a special exception to the GNU General Public License, -# if you distribute this file as part of a program or library that -# is built using GNU Libtool, you may include this file under the -# same distribution terms that you use for the rest of that program. -# -# GNU Libtool is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Libtool; see the file COPYING. If not, a copy -# can be downloaded from http://www.gnu.org/licenses/gpl.html, -# or obtained by writing to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - -# Usage: $progname [OPTION]... [MODE-ARG]... -# -# Provide generalized library-building support services. -# -# --config show all configuration variables -# --debug enable verbose shell tracing -# -n, --dry-run display commands without modifying any files -# --features display basic configuration information and exit -# --mode=MODE use operation mode MODE -# --preserve-dup-deps don't remove duplicate dependency libraries -# --quiet, --silent don't print informational messages -# --no-quiet, --no-silent -# print informational messages (default) -# --tag=TAG use configuration variables from tag TAG -# -v, --verbose print more informational messages than default -# --no-verbose don't print the extra informational messages -# --version print version information -# -h, --help, --help-all print short, long, or detailed help message -# -# MODE must be one of the following: -# -# clean remove files from the build directory -# compile compile a source file into a libtool object -# execute automatically set library path, then run a program -# finish complete the installation of libtool libraries -# install install libraries or executables -# link create a library or an executable -# uninstall remove libraries from an installed directory -# -# MODE-ARGS vary depending on the MODE. When passed as first option, -# `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that. -# Try `$progname --help --mode=MODE' for a more detailed description of MODE. -# -# When reporting a bug, please describe a test case to reproduce it and -# include the following information: -# -# host-triplet: $host -# shell: $SHELL -# compiler: $LTCC -# compiler flags: $LTCFLAGS -# linker: $LD (gnu? $with_gnu_ld) -# $progname: (GNU libtool) 2.2.10 -# automake: $automake_version -# autoconf: $autoconf_version -# -# Report bugs to . - -PROGRAM=libtool -PACKAGE=libtool -VERSION=2.2.10 -TIMESTAMP="" -package_revision=1.3175 - -# Be Bourne compatible -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac -fi -BIN_SH=xpg4; export BIN_SH # for Tru64 -DUALCASE=1; export DUALCASE # for MKS sh - -# A function that is used when there is no print builtin or printf. -func_fallback_echo () -{ - eval 'cat <<_LTECHO_EOF -$1 -_LTECHO_EOF' -} - -# NLS nuisances: We save the old values to restore during execute mode. -lt_user_locale= -lt_safe_locale= -for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES -do - eval "if test \"\${$lt_var+set}\" = set; then - save_$lt_var=\$$lt_var - $lt_var=C - export $lt_var - lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\" - lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\" - fi" -done -LC_ALL=C -LANGUAGE=C -export LANGUAGE LC_ALL - -$lt_unset CDPATH - - -# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh -# is ksh but when the shell is invoked as "sh" and the current value of -# the _XPG environment variable is not equal to 1 (one), the special -# positional parameter $0, within a function call, is the name of the -# function. -progpath="$0" - - - -: ${CP="cp -f"} -test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'} -: ${EGREP="/bin/grep -E"} -: ${FGREP="/bin/grep -F"} -: ${GREP="/bin/grep"} -: ${LN_S="ln -s"} -: ${MAKE="make"} -: ${MKDIR="mkdir"} -: ${MV="mv -f"} -: ${RM="rm -f"} -: ${SED="/bin/sed"} -: ${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 "${1}" | $SED -e "$dirname"` - if test "X$func_dirname_result" = "X${1}"; then - func_dirname_result="${3}" - else - func_dirname_result="$func_dirname_result${2}" - fi - func_basename_result=`$ECHO "${1}" | $SED -e "$basename"` -} - -# Generated shell functions inserted here. - -# These SED scripts presuppose an absolute path with a trailing slash. -pathcar='s,^/\([^/]*\).*$,\1,' -pathcdr='s,^/[^/]*,,' -removedotparts=':dotsl - s@/\./@/@g - t dotsl - s,/\.$,/,' -collapseslashes='s@/\{1,\}@/@g' -finalslash='s,/*$,/,' - -# func_normal_abspath PATH -# Remove doubled-up and trailing slashes, "." path components, -# and cancel out any ".." path components in PATH after making -# it an absolute path. -# value returned in "$func_normal_abspath_result" -func_normal_abspath () -{ - # Start from root dir and reassemble the path. - func_normal_abspath_result= - func_normal_abspath_tpath=$1 - func_normal_abspath_altnamespace= - case $func_normal_abspath_tpath in - "") - # Empty path, that just means $cwd. - func_stripname '' '/' "`pwd`" - func_normal_abspath_result=$func_stripname_result - return - ;; - # The next three entries are used to spot a run of precisely - # two leading slashes without using negated character classes; - # we take advantage of case's first-match behaviour. - ///*) - # Unusual form of absolute path, do nothing. - ;; - //*) - # Not necessarily an ordinary path; POSIX reserves leading '//' - # and for example Cygwin uses it to access remote file shares - # over CIFS/SMB, so we conserve a leading double slash if found. - func_normal_abspath_altnamespace=/ - ;; - /*) - # Absolute path, do nothing. - ;; - *) - # Relative path, prepend $cwd. - func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath - ;; - esac - # Cancel out all the simple stuff to save iterations. We also want - # the path to end with a slash for ease of parsing, so make sure - # there is one (and only one) here. - func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ - -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"` - while :; do - # Processed it all yet? - if test "$func_normal_abspath_tpath" = / ; then - # If we ascended to the root using ".." the result may be empty now. - if test -z "$func_normal_abspath_result" ; then - func_normal_abspath_result=/ - fi - break - fi - func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ - -e "$pathcar"` - func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ - -e "$pathcdr"` - # Figure out what to do with it - case $func_normal_abspath_tcomponent in - "") - # Trailing empty path component, ignore it. - ;; - ..) - # Parent dir; strip last assembled component from result. - func_dirname "$func_normal_abspath_result" - func_normal_abspath_result=$func_dirname_result - ;; - *) - # Actual path component, append it. - func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent - ;; - esac - done - # Restore leading double-slash if one was found on entry. - func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result -} - -# func_relative_path SRCDIR DSTDIR -# generates a relative path from SRCDIR to DSTDIR, with a trailing -# slash if non-empty, suitable for immediately appending a filename -# without needing to append a separator. -# value returned in "$func_relative_path_result" -func_relative_path () -{ - func_relative_path_result= - func_normal_abspath "$1" - func_relative_path_tlibdir=$func_normal_abspath_result - func_normal_abspath "$2" - func_relative_path_tbindir=$func_normal_abspath_result - - # Ascend the tree starting from libdir - while :; do - # check if we have found a prefix of bindir - case $func_relative_path_tbindir in - $func_relative_path_tlibdir) - # found an exact match - func_relative_path_tcancelled= - break - ;; - $func_relative_path_tlibdir*) - # found a matching prefix - func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" - func_relative_path_tcancelled=$func_stripname_result - if test -z "$func_relative_path_result"; then - func_relative_path_result=. - fi - break - ;; - *) - func_dirname $func_relative_path_tlibdir - func_relative_path_tlibdir=${func_dirname_result} - if test "x$func_relative_path_tlibdir" = x ; then - # Have to descend all the way to the root! - func_relative_path_result=../$func_relative_path_result - func_relative_path_tcancelled=$func_relative_path_tbindir - break - fi - func_relative_path_result=../$func_relative_path_result - ;; - esac - done - - # Now calculate path; take care to avoid doubling-up slashes. - func_stripname '' '/' "$func_relative_path_result" - func_relative_path_result=$func_stripname_result - func_stripname '/' '/' "$func_relative_path_tcancelled" - if test "x$func_stripname_result" != x ; then - func_relative_path_result=${func_relative_path_result}/${func_stripname_result} - fi - - # Normalisation. If bindir is libdir, return empty string, - # else relative path ending with a slash; either way, target - # file name can be directly appended. - if test ! -z "$func_relative_path_result"; then - func_stripname './' '' "$func_relative_path_result/" - func_relative_path_result=$func_stripname_result - fi -} - -# The name of this program: -func_dirname_and_basename "$progpath" -progname=$func_basename_result - -# Make sure we have an absolute path for reexecution: -case $progpath in - [\\/]*|[A-Za-z]:\\*) ;; - *[\\/]*) - progdir=$func_dirname_result - progdir=`cd "$progdir" && pwd` - progpath="$progdir/$progname" - ;; - *) - save_IFS="$IFS" - IFS=: - 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_echo_all arg... -# Invoke $ECHO with all args, space-separated. -func_echo_all () -{ - $ECHO "$*" -} - -# func_error arg... -# Echo program name prefixed message to standard error. -func_error () -{ - $ECHO "$progname${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 "$my_directory_path" | $SED -e "$dirname"` - done - my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'` - - save_mkdir_p_IFS="$IFS"; IFS=':' - for my_dir in $my_dir_list; do - IFS="$save_mkdir_p_IFS" - # mkdir can fail with a `File exist' error if two processes - # try to create one of the directories concurrently. Don't - # stop in that case! - $MKDIR "$my_dir" 2>/dev/null || : - done - IFS="$save_mkdir_p_IFS" - - # Bail out if we (or some other process) failed to create a directory. - test -d "$my_directory_path" || \ - func_fatal_error "Failed to create \`$1'" - fi -} - - -# func_mktempdir [string] -# Make a temporary directory that won't clash with other running -# libtool processes, and avoids race conditions if possible. If -# given, STRING is the basename for that directory. -func_mktempdir () -{ - my_template="${TMPDIR-/tmp}/${1-$progname}" - - if test "$opt_dry_run" = ":"; then - # Return a directory name, but don't create it in dry-run mode - my_tmpdir="${my_template}-$$" - else - - # If mktemp works, use that first and foremost - my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` - - if test ! -d "$my_tmpdir"; then - # Failing that, at least try and use $RANDOM to avoid a race - my_tmpdir="${my_template}-${RANDOM-0}$$" - - save_mktempdir_umask=`umask` - umask 0077 - $MKDIR "$my_tmpdir" - umask $save_mktempdir_umask - fi - - # If we're not in dry-run mode, bomb out on failure - test -d "$my_tmpdir" || \ - func_fatal_error "cannot create temporary directory \`$my_tmpdir'" - fi - - $ECHO "$my_tmpdir" -} - - -# func_quote_for_eval arg -# Aesthetically quote ARG to be evaled later. -# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT -# is double-quoted, suitable for a subsequent eval, whereas -# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters -# which are still active within double quotes backslashified. -func_quote_for_eval () -{ - case $1 in - *[\\\`\"\$]*) - func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;; - *) - func_quote_for_eval_unquoted_result="$1" ;; - esac - - case $func_quote_for_eval_unquoted_result in - # Double-quote args containing shell metacharacters to delay - # word splitting, command substitution and and variable - # expansion for a subsequent eval. - # Many Bourne shells cannot handle close brackets correctly - # in scan sets, so we specify it separately. - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\"" - ;; - *) - func_quote_for_eval_result="$func_quote_for_eval_unquoted_result" - esac -} - - -# func_quote_for_expand arg -# Aesthetically quote ARG to be evaled later; same as above, -# but do not quote variable references. -func_quote_for_expand () -{ - case $1 in - *[\\\`\"]*) - my_arg=`$ECHO "$1" | $SED \ - -e "$double_quote_subst" -e "$sed_double_backslash"` ;; - *) - my_arg="$1" ;; - esac - - case $my_arg in - # Double-quote args containing shell metacharacters to delay - # word splitting and command substitution for a subsequent eval. - # Many Bourne shells cannot handle close brackets correctly - # in scan sets, so we specify it separately. - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - my_arg="\"$my_arg\"" - ;; - esac - - func_quote_for_expand_result="$my_arg" -} - - -# func_show_eval cmd [fail_exp] -# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is -# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP -# is given, then evaluate it. -func_show_eval () -{ - my_cmd="$1" - my_fail_exp="${2-:}" - - ${opt_silent-false} || { - func_quote_for_expand "$my_cmd" - eval "func_echo $func_quote_for_expand_result" - } - - if ${opt_dry_run-false}; then :; else - eval "$my_cmd" - my_status=$? - if test "$my_status" -eq 0; then :; else - eval "(exit $my_status); $my_fail_exp" - fi - fi -} - - -# func_show_eval_locale cmd [fail_exp] -# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is -# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP -# is given, then evaluate it. Use the saved locale for evaluation. -func_show_eval_locale () -{ - my_cmd="$1" - my_fail_exp="${2-:}" - - ${opt_silent-false} || { - func_quote_for_expand "$my_cmd" - eval "func_echo $func_quote_for_expand_result" - } - - if ${opt_dry_run-false}; then :; else - eval "$lt_user_locale - $my_cmd" - my_status=$? - eval "$lt_safe_locale" - if test "$my_status" -eq 0; then :; else - eval "(exit $my_status); $my_fail_exp" - fi - fi -} - - -# func_version -# Echo version message to standard output and exit. -func_version () -{ - $SED -n '/(C)/!b go - :more - /\./!{ - N - s/\n# / / - b more - } - :go - /^# '$PROGRAM' (GNU /,/# warranty; / { - s/^# // - s/^# *$// - s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/ - p - }' < "$progpath" - exit $? -} - -# func_usage -# Echo short help message to standard output and exit. -func_usage () -{ - $SED -n '/^# Usage:/,/^# *.*--help/ { - s/^# // - s/^# *$// - s/\$progname/'$progname'/ - p - }' < "$progpath" - echo - $ECHO "run \`$progname --help | more' for full usage" - exit $? -} - -# func_help [NOEXIT] -# Echo long help message to standard output and exit, -# unless 'noexit' is passed as argument. -func_help () -{ - $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" - ret=$? - if test -z "$1"; then - exit $ret - fi -} - -# func_missing_arg argname -# Echo program name prefixed message to standard error and set global -# exit_cmd. -func_missing_arg () -{ - func_error "missing argument for $1." - exit_cmd=exit -} - -exit_cmd=: - - - - - - -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=: - opt_verbose=false - ;; - - --no-quiet|--no-silent) - preserve_args="$preserve_args $opt" - opt_silent=false - ;; - - --verbose| -v) preserve_args="$preserve_args $opt" - opt_silent=false - opt_verbose=: - ;; - - --no-verbose) preserve_args="$preserve_args $opt" - opt_verbose=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=: ;; - --help-all) opt_help=': help-all' ;; - --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 - CC_expanded=`func_echo_all $CC` - CC_quoted_expanded=`func_echo_all $CC_quoted` - case $@ in - # Blanks in the command may have been stripped by the calling shell, - # but not from the CC environment variable when configure was run. - " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ - " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; - # Blanks at the start of $base_compile will cause this to fail - # if we don't check for them as well. - *) - for z in $available_tags; do - if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then - # Evaluate the configuration. - eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" - CC_quoted= - for arg in $CC; do - # Double-quote args containing other shell metacharacters. - func_quote_for_eval "$arg" - CC_quoted="$CC_quoted $func_quote_for_eval_result" - done - CC_expanded=`func_echo_all $CC` - CC_quoted_expanded=`func_echo_all $CC_quoted` - case "$@ " in - " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ - " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) - # The compiler in the base compile command matches - # the one in the tagged configuration. - # Assume this is the tagged configuration we want. - tagname=$z - break - ;; - esac - fi - done - # If $tagname still isn't set, then no tagged configuration - # was found and let the user know that the "--tag" command - # line option must be used. - if test -z "$tagname"; then - func_echo "unable to infer tagged configuration" - func_fatal_error "specify a tag with \`--tag'" -# else -# func_verbose "using $tagname tagged configuration" - fi - ;; - esac - fi -} - - - -# func_write_libtool_object output_name pic_name nonpic_name -# Create a libtool object file (analogous to a ".la" file), -# but don't create it if we're doing a dry run. -func_write_libtool_object () -{ - write_libobj=${1} - if test "$build_libtool_libs" = yes; then - write_lobj=\'${2}\' - else - write_lobj=none - fi - - if test "$build_old_libs" = yes; then - write_oldobj=\'${3}\' - else - write_oldobj=none - fi - - $opt_dry_run || { - cat >${write_libobj}T <?"'"'"' &()|`$[]' \ - && func_warning "libobj name \`$libobj' may not contain shell special characters." - func_dirname_and_basename "$obj" "/" "" - objname="$func_basename_result" - xdir="$func_dirname_result" - lobj=${xdir}$objdir/$objname - - test -z "$base_compile" && \ - func_fatal_help "you must specify a compilation command" - - # Delete any leftover library objects. - if test "$build_old_libs" = yes; then - removelist="$obj $lobj $libobj ${libobj}T" - else - removelist="$lobj $libobj ${libobj}T" - fi - - # On Cygwin there's no "real" PIC flag so we must build both object types - case $host_os in - cygwin* | mingw* | pw32* | os2* | cegcc*) - pic_mode=default - ;; - esac - if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then - # non-PIC code in shared libraries is not supported - pic_mode=default - fi - - # Calculate the filename of the output object if compiler does - # not support -o with -c - if test "$compiler_c_o" = no; then - output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext} - lockfile="$output_obj.lock" - else - output_obj= - need_locks=no - lockfile= - fi - - # Lock this critical section if it is needed - # We use this script file to make the link, it avoids creating a new file - if test "$need_locks" = yes; then - until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do - func_echo "Waiting for $lockfile to be removed" - sleep 2 - done - elif test "$need_locks" = warn; then - if test -f "$lockfile"; then - $ECHO "\ -*** ERROR, $lockfile exists and contains: -`cat $lockfile 2>/dev/null` - -This indicates that another process is trying to use the same -temporary object file, and libtool could not work around it because -your compiler does not support \`-c' and \`-o' together. If you -repeat this compilation, it may succeed, by chance, but you had better -avoid parallel builds (make -j) in this platform, or get a better -compiler." - - $opt_dry_run || $RM $removelist - exit $EXIT_FAILURE - fi - 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 build PIC objects only - -prefer-non-pic try to build non-PIC objects only - -shared do not build a \`.o' file suitable for static linking - -static only build a \`.o' file suitable for static linking - -Wc,FLAG pass FLAG directly to the compiler - -COMPILE-COMMAND is a command to be used in creating a \`standard' object file -from the given SOURCEFILE. - -The output file name is determined by removing the directory component from -SOURCEFILE, then substituting the C source code suffix \`.c' with the -library object suffix, \`.lo'." - ;; - - execute) - $ECHO \ -"Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... - -Automatically set library path, then run a program. - -This mode accepts the following additional options: - - -dlopen FILE add the directory containing FILE to the library path - -This mode sets the library path environment variable according to \`-dlopen' -flags. - -If any of the ARGS are libtool executable wrappers, then they are translated -into their corresponding uninstalled binary, and any of their required library -directories are added to the library path. - -Then, COMMAND is executed, with ARGS as arguments." - ;; - - finish) - $ECHO \ -"Usage: $progname [OPTION]... --mode=finish [LIBDIR]... - -Complete the installation of libtool libraries. - -Each LIBDIR is a directory that contains libtool libraries. - -The commands that this mode executes may require superuser privileges. Use -the \`--dry-run' option if you just want to see what would be executed." - ;; - - install) - $ECHO \ -"Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... - -Install executables or libraries. - -INSTALL-COMMAND is the installation command. The first component should be -either the \`install' or \`cp' program. - -The following components of INSTALL-COMMAND are treated specially: - - -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation - -The rest of the components are interpreted as arguments to that command (only -BSD-compatible install options are recognized)." - ;; - - link) - $ECHO \ -"Usage: $progname [OPTION]... --mode=link LINK-COMMAND... - -Link object files or libraries together to form another library, or to -create an executable program. - -LINK-COMMAND is a command using the C compiler that you would use to create -a program from several object files. - -The following components of LINK-COMMAND are treated specially: - - -all-static do not do any dynamic linking at all - -avoid-version do not add a version suffix if possible - -bindir BINDIR specify path to binaries directory (for systems where - libraries must be found in the PATH setting at runtime) - -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime - -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols - -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) - -export-symbols SYMFILE - try to export only the symbols listed in SYMFILE - -export-symbols-regex REGEX - try to export only the symbols matching REGEX - -LLIBDIR search LIBDIR for required installed libraries - -lNAME OUTPUT-FILE requires the installed library libNAME - -module build a library that can dlopened - -no-fast-install disable the fast-install mode - -no-install link a not-installable executable - -no-undefined declare that a library does not refer to external symbols - -o OUTPUT-FILE create OUTPUT-FILE from the specified objects - -objectlist FILE Use a list of object files found in FILE to specify objects - -precious-files-regex REGEX - don't remove output files matching REGEX - -release RELEASE specify package release information - -rpath LIBDIR the created library will eventually be installed in LIBDIR - -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries - -shared only do dynamic linking of libtool libraries - -shrext SUFFIX override the standard shared library file extension - -static do not do any dynamic linking of uninstalled libtool libraries - -static-libtool-libs - do not do any dynamic linking of libtool libraries - -version-info CURRENT[:REVISION[:AGE]] - specify library version info [each variable defaults to 0] - -weak LIBNAME declare that the target provides the LIBNAME interface - -Wc,FLAG - -Xcompiler FLAG pass linker-specific FLAG directly to the compiler - -Wl,FLAG - -Xlinker FLAG pass linker-specific FLAG directly to the linker - -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) - -All other options (arguments beginning with \`-') are ignored. - -Every other argument is treated as a filename. Files ending in \`.la' are -treated as uninstalled libtool libraries, other files are standard or library -object files. - -If the OUTPUT-FILE ends in \`.la', then a libtool library is created, -only library objects (\`.lo' files) may be specified, and \`-rpath' is -required, except when creating a convenience library. - -If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created -using \`ar' and \`ranlib', or on Windows using \`lib'. - -If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file -is created, otherwise an executable program is created." - ;; - - uninstall) - $ECHO \ -"Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... - -Remove libraries from an installation directory. - -RM is the name of the program to use to delete files associated with each FILE -(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed -to RM. - -If FILE is a libtool library, all the files associated with it are deleted. -Otherwise, only FILE itself is deleted using RM." - ;; - - *) - func_fatal_help "invalid operation mode \`$mode'" - ;; - esac - - echo - $ECHO "Try \`$progname --help' for more information about other modes." -} - -# Now that we've collected a possible --mode arg, show help if necessary -if $opt_help; then - if test "$opt_help" = :; then - func_mode_help - else - { - func_help noexit - for mode in compile link execute install finish uninstall clean; do - func_mode_help - done - } | sed -n '1p; 2,$s/^Usage:/ or: /p' - { - func_help noexit - for mode in compile link execute install finish uninstall clean; do - echo - func_mode_help - done - } | - sed '1d - /^When reporting/,/^Report/{ - H - d - } - $x - /information about other modes/d - /more detailed .*MODE/d - s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' - fi - exit $? -fi - - -# func_mode_execute arg... -func_mode_execute () -{ - $opt_debug - # The first argument is the command name. - cmd="$nonopt" - test -z "$cmd" && \ - func_fatal_help "you must specify a COMMAND" - - # Handle -dlopen flags immediately. - for file in $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 - -* | *.la | *.lo ) ;; - *) - # Do a test to see if this is really a libtool program. - if func_ltwrapper_script_p "$file"; then - func_source "$file" - # Transform arg to wrapped name. - file="$progdir/$program" - elif func_ltwrapper_executable_p "$file"; then - func_ltwrapper_scriptname "$file" - func_source "$func_ltwrapper_scriptname_result" - # Transform arg to wrapped name. - file="$progdir/$program" - fi - ;; - esac - # Quote arguments (to preserve shell metacharacters). - func_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 "----------------------------------------------------------------------" - 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 "----------------------------------------------------------------------" - 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. - case $nonopt in *shtool*) :;; *) false;; esac; then - # Aesthetically quote it. - func_quote_for_eval "$nonopt" - install_prog="$func_quote_for_eval_result " - arg=$1 - shift - else - install_prog= - arg=$nonopt - fi - - # The real first argument should be the name of the installation program. - # Aesthetically quote it. - func_quote_for_eval "$arg" - install_prog="$install_prog$func_quote_for_eval_result" - install_shared_prog=$install_prog - case " $install_prog " in - *[\\\ /]cp\ *) install_cp=: ;; - *) install_cp=false ;; - esac - - # We need to accept at least all the BSD install flags. - dest= - files= - opts= - prev= - install_type= - isdir=no - stripme= - no_mode=: - for arg - do - arg2= - if test -n "$dest"; then - files="$files $dest" - dest=$arg - continue - fi - - case $arg in - -d) isdir=yes ;; - -f) - if $install_cp; then :; else - prev=$arg - fi - ;; - -g | -m | -o) - prev=$arg - ;; - -s) - stripme=" -s" - continue - ;; - -*) - ;; - *) - # If the previous option needed an argument, then skip it. - if test -n "$prev"; then - if test "x$prev" = x-m && test -n "$install_override_mode"; then - arg2=$install_override_mode - no_mode=false - fi - prev= - else - dest=$arg - continue - fi - ;; - esac - - # Aesthetically quote the argument. - func_quote_for_eval "$arg" - install_prog="$install_prog $func_quote_for_eval_result" - if test -n "$arg2"; then - func_quote_for_eval "$arg2" - fi - install_shared_prog="$install_shared_prog $func_quote_for_eval_result" - done - - test -z "$install_prog" && \ - func_fatal_help "you must specify an install program" - - test -n "$prev" && \ - func_fatal_help "the \`$prev' option requires an argument" - - if test -n "$install_override_mode" && $no_mode; then - if $install_cp; then :; else - func_quote_for_eval "$install_override_mode" - install_shared_prog="$install_shared_prog -m $func_quote_for_eval_result" - fi - fi - - if test -z "$files"; then - if test -z "$dest"; then - func_fatal_help "no file or destination specified" - else - func_fatal_help "you must specify a destination" - fi - fi - - # Strip any trailing slash from the destination. - func_stripname '' '/' "$dest" - dest=$func_stripname_result - - # Check to see that the destination is a directory. - test -d "$dest" && isdir=yes - if test "$isdir" = yes; then - destdir="$dest" - destname= - else - func_dirname_and_basename "$dest" "" "." - destdir="$func_dirname_result" - destname="$func_basename_result" - - # Not a directory, so check to see that there is only one file specified. - set dummy $files; shift - test "$#" -gt 1 && \ - func_fatal_help "\`$dest' is not a directory" - fi - case $destdir in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - for file in $files; do - case $file in - *.lo) ;; - *) - func_fatal_help "\`$destdir' must be an absolute directory name" - ;; - esac - done - ;; - esac - - # This variable tells wrapper scripts just to set variables rather - # than running their programs. - libtool_install_magic="$magic" - - staticlibs= - future_libdirs= - current_libdirs= - for file in $files; do - - # Do each installation. - case $file in - *.$libext) - # Do the static libraries later. - 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 "$destdir" | $SED -e "s%$libdir\$%%"` - - # Don't allow the user to place us outside of our expected - # location b/c this prevents finding dependent libraries that - # are installed to the same prefix. - # At present, this check doesn't affect windows .dll's that - # are installed into $libdir/../bin (currently, that works fine) - # but it's something to keep an eye on. - test "$inst_prefix_dir" = "$destdir" && \ - func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir" - - if test -n "$inst_prefix_dir"; then - # Stick the inst_prefix_dir data into the link command. - relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` - else - relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` - fi - - func_warning "relinking \`$file'" - func_show_eval "$relink_command" \ - 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"' - fi - - # See the names of the shared library. - set dummy $library_names; shift - if test -n "$1"; then - realname="$1" - shift - - srcname="$realname" - test -n "$relink_command" && srcname="$realname"T - - # Install the shared library and build the symlinks. - func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ - 'exit $?' - tstripme="$stripme" - case $host_os in - cygwin* | mingw* | pw32* | cegcc*) - case $realname in - *.dll.a) - tstripme="" - ;; - esac - ;; - esac - if test -n "$tstripme" && test -n "$striplib"; then - func_show_eval "$striplib $destdir/$realname" 'exit $?' - fi - - if test "$#" -gt 0; then - # Delete the old symlinks, and create new ones. - # Try `ln -sf' first, because the `ln' binary might depend on - # the symlink we replace! Solaris /bin/ln does not understand -f, - # so we also need to try rm && ln -s. - for linkname - do - test "$linkname" != "$realname" \ - && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" - done - fi - - # Do each command in the postinstall commands. - lib="$destdir/$realname" - func_execute_cmds "$postinstall_cmds" 'exit $?' - fi - - # Install the pseudo-library for information purposes. - func_basename "$file" - name="$func_basename_result" - instname="$dir/$name"i - func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' - - # Maybe install the static library, too. - test -n "$old_library" && 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 "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test - if test -n "$libdir" && test ! -f "$libfile"; then - func_warning "\`$lib' has not been installed in \`$libdir'" - finalize=no - fi - done - - relink_command= - func_source "$wrapper" - - outputname= - if test "$fast_install" = no && test -n "$relink_command"; then - $opt_dry_run || { - if test "$finalize" = yes; then - tmpdir=`func_mktempdir` - func_basename "$file$stripped_ext" - file="$func_basename_result" - outputname="$tmpdir/$file" - # Replace the output file specification. - relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` - - $opt_silent || { - func_quote_for_expand "$relink_command" - eval "func_echo $func_quote_for_expand_result" - } - if eval "$relink_command"; then : - else - func_error "error: relink \`$file' with the above command before installing it" - $opt_dry_run || ${RM}r "$tmpdir" - continue - fi - file="$outputname" - else - func_warning "cannot relink \`$file'" - fi - } - else - # Install the binary that we compiled earlier. - file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` - fi - fi - - # remove .exe since cygwin /usr/bin/install will append another - # one anyway - case $install_prog,$host in - */usr/bin/install*,*cygwin*) - case $file:$destfile in - *.exe:*.exe) - # this is ok - ;; - *.exe:*) - destfile=$destfile.exe - ;; - *:*.exe) - func_stripname '' '.exe' "$destfile" - destfile=$func_stripname_result - ;; - esac - ;; - esac - func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' - $opt_dry_run || if test -n "$outputname"; then - ${RM}r "$tmpdir" - fi - ;; - esac - done - - for file in $staticlibs; do - func_basename "$file" - name="$func_basename_result" - - # Set up the ranlib parameters. - oldlib="$destdir/$name" - - func_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 - -#if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) -#pragma GCC diagnostic ignored \"-Wstrict-prototypes\" -#endif - -/* External symbol declarations for the compiler. */\ -" - - if test "$dlself" = yes; then - func_verbose "generating symbol list for \`$output'" - - $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" - - # Add our own program objects to the symbol list. - progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` - for progfile in $progfiles; do - func_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 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 "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` - finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` - else - compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` - finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` - fi - ;; - *) - compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` - finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` - ;; - esac - ;; - *) - func_fatal_error "unknown suffix for \`$my_dlsyms'" - ;; - esac - else - # We keep going just in case the user didn't refer to - # lt_preloaded_symbols. The linker will fail if global_symbol_pipe - # really was required. - - # Nullify the symbol file. - compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` - finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` - fi -} - -# func_win32_libid arg -# return the library type of file 'arg' -# -# Need a lot of goo to handle *both* DLLs and import libs -# Has to be a shell function in order to 'eat' the argument -# that is supplied when $file_magic_command is called. -# Despite the name, also deal with 64 bit binaries. -func_win32_libid () -{ - $opt_debug - win32_libid_type="unknown" - win32_fileres=`file -L $1 2>/dev/null` - case $win32_fileres in - *ar\ archive\ import\ library*) # definitely import - win32_libid_type="x86 archive import" - ;; - *ar\ archive*) # could be an import, or static - # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. - if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | - $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then - 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" - if test "$lock_old_archive_extraction" = yes; then - lockfile=$f_ex_an_ar_oldlib.lock - until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do - func_echo "Waiting for $lockfile to be removed" - sleep 2 - done - fi - func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ - 'stat=$?; rm -f "$lockfile"; exit $stat' - if test "$lock_old_archive_extraction" = yes; then - $opt_dry_run || rm -f "$lockfile" - fi - if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then - : - else - func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" - fi -} - - -# func_extract_archives gentop oldlib ... -func_extract_archives () -{ - $opt_debug - my_gentop="$1"; shift - my_oldlibs=${1+"$@"} - my_oldobjs="" - my_xlib="" - my_xabs="" - my_xdir="" - - for my_xlib in $my_oldlibs; do - # Extract the objects. - case $my_xlib in - [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; - *) my_xabs=`pwd`"/$my_xlib" ;; - esac - func_basename "$my_xlib" - my_xlib="$func_basename_result" - my_xlib_u=$my_xlib - while :; do - case " $extracted_archives " in - *" $my_xlib_u "*) - func_arith $extracted_serial + 1 - extracted_serial=$func_arith_result - my_xlib_u=lt$extracted_serial-$my_xlib ;; - *) break ;; - esac - done - extracted_archives="$extracted_archives $my_xlib_u" - my_xdir="$my_gentop/$my_xlib_u" - - func_mkdir_p "$my_xdir" - - case $host in - *-darwin*) - func_verbose "Extracting $my_xabs" - # Do not bother doing anything if just a dry run - $opt_dry_run || { - darwin_orig_dir=`pwd` - cd $my_xdir || exit $? - darwin_archive=$my_xabs - darwin_curdir=`pwd` - darwin_base_archive=`basename "$darwin_archive"` - darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` - if test -n "$darwin_arches"; then - darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` - darwin_arch= - func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" - for darwin_arch in $darwin_arches ; do - func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}" - $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" - cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" - func_extract_an_archive "`pwd`" "${darwin_base_archive}" - cd "$darwin_curdir" - $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" - done # $darwin_arches - ## Okay now we've a bunch of thin objects, gotta fatten them up :) - darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u` - darwin_file= - darwin_files= - for darwin_file in $darwin_filelist; do - darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` - $LIPO -create -output "$darwin_file" $darwin_files - done # $darwin_filelist - $RM -rf unfat-$$ - cd "$darwin_orig_dir" - else - cd $darwin_orig_dir - func_extract_an_archive "$my_xdir" "$my_xabs" - fi # $darwin_arches - } # !$opt_dry_run - ;; - *) - func_extract_an_archive "$my_xdir" "$my_xabs" - ;; - esac - my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` - done - - func_extract_archives_result="$my_oldobjs" -} - - -# func_emit_wrapper [arg=no] -# -# Emit a libtool wrapper script on stdout. -# Don't directly open a file because we may want to -# incorporate the script contents within a cygwin/mingw -# wrapper executable. Must ONLY be called from within -# func_mode_link because it depends on a number of variables -# set therein. -# -# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR -# variable will take. If 'yes', then the emitted script -# will assume that the directory in which it is stored is -# the $objdir directory. This is a cygwin/mingw-specific -# behavior. -func_emit_wrapper () -{ - func_emit_wrapper_arg1=${1-no} - - $ECHO "\ -#! $SHELL - -# $output - temporary wrapper script for $objdir/$outputname -# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION -# -# The $output program cannot be directly executed until all the libtool -# libraries that it depends on are installed. -# -# This wrapper script should never be moved out of the build directory. -# If it is, it will not operate correctly. - -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -sed_quote_subst='$sed_quote_subst' - -# Be Bourne compatible -if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which - # is contrary to our usage. Disable this feature. - alias -g '\${1+\"\$@\"}'='\"\$@\"' - setopt NO_GLOB_SUBST -else - case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac -fi -BIN_SH=xpg4; export BIN_SH # for Tru64 -DUALCASE=1; export DUALCASE # for MKS sh - -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -relink_command=\"$relink_command\" - -# This environment variable determines our operation mode. -if test \"\$libtool_install_magic\" = \"$magic\"; then - # install mode needs the following variables: - generated_by_libtool_version='$macro_version' - notinst_deplibs='$notinst_deplibs' -else - # When we are sourced in execute mode, \$file and \$ECHO are already set. - if test \"\$libtool_execute_magic\" != \"$magic\"; then - file=\"\$0\"" - - qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` - $ECHO "\ - -# A function that is used when there is no print builtin or printf. -func_fallback_echo () -{ - eval 'cat <<_LTECHO_EOF -\$1 -_LTECHO_EOF' -} - ECHO=\"$qECHO\" - fi - -# Very basic option parsing. These options are (a) specific to -# the libtool wrapper, (b) are identical between the wrapper -# /script/ and the wrapper /executable/ which is used only on -# windows platforms, and (c) all begin with the string "--lt-" -# (application programs are unlikely to have options which match -# this pattern). -# -# There are only two supported options: --lt-debug and -# --lt-dump-script. There is, deliberately, no --lt-help. -# -# The first argument to this parsing function should be the -# script's $0 value, followed by "$@". -lt_option_debug= -func_parse_lt_options () -{ - lt_script_arg0=\$0 - shift - for lt_opt - do - case \"\$lt_opt\" in - --lt-debug) lt_option_debug=1 ;; - --lt-dump-script) - lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` - test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. - lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` - cat \"\$lt_dump_D/\$lt_dump_F\" - exit 0 - ;; - --lt-*) - \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 - exit 1 - ;; - esac - done - - # Print the debug banner immediately: - if test -n \"\$lt_option_debug\"; then - echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2 - fi -} - -# Used when --lt-debug. Prints its arguments to stdout -# (redirection is the responsibility of the caller) -func_lt_dump_args () -{ - lt_dump_args_N=1; - for lt_arg - do - \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\" - lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` - done -} - -# Core function for launching the target application -func_exec_program_core () -{ -" - case $host in - # Backslashes separate directories on plain windows - *-*-mingw | *-*-os2* | *-cegcc*) - $ECHO "\ - if test -n \"\$lt_option_debug\"; then - \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2 - func_lt_dump_args \${1+\"\$@\"} 1>&2 - fi - exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} -" - ;; - - *) - $ECHO "\ - if test -n \"\$lt_option_debug\"; then - \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2 - func_lt_dump_args \${1+\"\$@\"} 1>&2 - fi - exec \"\$progdir/\$program\" \${1+\"\$@\"} -" - ;; - esac - $ECHO "\ - \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 - exit 1 -} - -# A function to encapsulate launching the target application -# Strips options in the --lt-* namespace from \$@ and -# launches target application with the remaining arguments. -func_exec_program () -{ - for lt_wr_arg - do - case \$lt_wr_arg in - --lt-*) ;; - *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; - esac - shift - done - func_exec_program_core \${1+\"\$@\"} -} - - # Parse options - func_parse_lt_options \"\$0\" \${1+\"\$@\"} - - # Find the directory that this script lives in. - thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` - test \"x\$thisdir\" = \"x\$file\" && thisdir=. - - # Follow symbolic links until we get to the real thisdir. - file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\` - while test -n \"\$file\"; do - destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` - - # If there was a directory component, then change thisdir. - if test \"x\$destdir\" != \"x\$file\"; then - case \"\$destdir\" in - [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; - *) thisdir=\"\$thisdir/\$destdir\" ;; - esac - fi - - file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` - file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` - done - - # Usually 'no', except on cygwin/mingw when embedded into - # the cwrapper. - WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 - if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then - # special case for '.' - if test \"\$thisdir\" = \".\"; then - thisdir=\`pwd\` - fi - # remove .libs from thisdir - case \"\$thisdir\" in - *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; - $objdir ) thisdir=. ;; - esac - fi - - # Try to get the absolute directory name. - absdir=\`cd \"\$thisdir\" && pwd\` - test -n \"\$absdir\" && thisdir=\"\$absdir\" -" - - if test "$fast_install" = yes; then - $ECHO "\ - program=lt-'$outputname'$exeext - progdir=\"\$thisdir/$objdir\" - - if test ! -f \"\$progdir/\$program\" || - { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ - test \"X\$file\" != \"X\$progdir/\$program\"; }; then - - file=\"\$\$-\$program\" - - if test ! -d \"\$progdir\"; then - $MKDIR \"\$progdir\" - else - $RM \"\$progdir/\$file\" - fi" - - $ECHO "\ - - # relink executable if necessary - if test -n \"\$relink_command\"; then - if relink_command_output=\`eval \$relink_command 2>&1\`; then : - else - $ECHO \"\$relink_command_output\" >&2 - $RM \"\$progdir/\$file\" - exit 1 - fi - fi - - $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || - { $RM \"\$progdir/\$program\"; - $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } - $RM \"\$progdir/\$file\" - fi" - else - $ECHO "\ - program='$outputname' - progdir=\"\$thisdir/$objdir\" -" - fi - - $ECHO "\ - - if test -f \"\$progdir/\$program\"; then" - - # Export our shlibpath_var if we have one. - if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then - $ECHO "\ - # Add our own library path to $shlibpath_var - $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" - - # Some systems cannot cope with colon-terminated $shlibpath_var - # The second colon is a workaround for a bug in BeOS R4 sed - $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` - - export $shlibpath_var -" - fi - - # 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. - func_exec_program \${1+\"\$@\"} - fi - else - # The program doesn't exist. - \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 - \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 - \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 - exit 1 - fi -fi\ -" -} - - -# func_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 - func_to_host_path_result=`( cmd //c echo "$1" ) 2>/dev/null | - $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"` - ;; - *cygwin* ) - func_to_host_path_result=`cygpath -w "$1" | - $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_stripname : : "$1" - func_to_host_pathlist_tmp1=$func_stripname_result - case $build in - *mingw* ) # Actually, msys. - # Awkward: cmd appends spaces to result. - func_to_host_pathlist_result=` - ( cmd //c echo "$func_to_host_pathlist_tmp1" ) 2>/dev/null | - $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"` - ;; - *cygwin* ) - func_to_host_pathlist_result=`cygpath -w -p "$func_to_host_pathlist_tmp1" | - $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_append func_to_host_pathlist_result ";$func_to_host_path_result" - fi - fi - fi - 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_append 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 < -#include -#ifdef _MSC_VER -# include -# include -# include -#else -# include -# include -# ifdef __CYGWIN__ -# include -# endif -#endif -#include -#include -#include -#include -#include -#include -#include -#include - -/* declarations of non-ANSI functions */ -#if defined(__MINGW32__) -# ifdef __STRICT_ANSI__ -int _putenv (const char *); -# endif -#elif defined(__CYGWIN__) -# ifdef __STRICT_ANSI__ -char *realpath (const char *, char *); -int putenv (char *); -int setenv (const char *, const char *, int); -# endif -/* #elif defined (other platforms) ... */ -#endif - -/* portability defines, excluding path handling macros */ -#if defined(_MSC_VER) -# define setmode _setmode -# define stat _stat -# define chmod _chmod -# define getcwd _getcwd -# define putenv _putenv -# define S_IXUSR _S_IEXEC -# ifndef _INTPTR_T_DEFINED -# define _INTPTR_T_DEFINED -# define intptr_t int -# endif -#elif defined(__MINGW32__) -# define setmode _setmode -# define stat _stat -# define chmod _chmod -# define getcwd _getcwd -# define putenv _putenv -#elif defined(__CYGWIN__) -# define HAVE_SETENV -# define FOPEN_WB "wb" -/* #elif defined (other platforms) ... */ -#endif - -#if defined(PATH_MAX) -# define LT_PATHMAX PATH_MAX -#elif defined(MAXPATHLEN) -# define LT_PATHMAX MAXPATHLEN -#else -# define LT_PATHMAX 1024 -#endif - -#ifndef S_IXOTH -# define S_IXOTH 0 -#endif -#ifndef S_IXGRP -# define S_IXGRP 0 -#endif - -/* path handling portability macros */ -#ifndef DIR_SEPARATOR -# define DIR_SEPARATOR '/' -# define PATH_SEPARATOR ':' -#endif - -#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ - defined (__OS2__) -# define HAVE_DOS_BASED_FILE_SYSTEM -# define FOPEN_WB "wb" -# ifndef DIR_SEPARATOR_2 -# define DIR_SEPARATOR_2 '\\' -# endif -# ifndef PATH_SEPARATOR_2 -# define PATH_SEPARATOR_2 ';' -# endif -#endif - -#ifndef DIR_SEPARATOR_2 -# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) -#else /* DIR_SEPARATOR_2 */ -# define IS_DIR_SEPARATOR(ch) \ - (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) -#endif /* DIR_SEPARATOR_2 */ - -#ifndef PATH_SEPARATOR_2 -# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) -#else /* PATH_SEPARATOR_2 */ -# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) -#endif /* PATH_SEPARATOR_2 */ - -#ifndef FOPEN_WB -# define FOPEN_WB "w" -#endif -#ifndef _O_BINARY -# define _O_BINARY 0 -#endif - -#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) -#define XFREE(stale) do { \ - if (stale) { free ((void *) stale); stale = 0; } \ -} while (0) - -#if defined(LT_DEBUGWRAPPER) -static int lt_debug = 1; -#else -static int lt_debug = 0; -#endif - -const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ - -void *xmalloc (size_t num); -char *xstrdup (const char *string); -const char *base_name (const char *name); -char *find_executable (const char *wrapper); -char *chase_symlinks (const char *pathspec); -int make_executable (const char *path); -int check_executable (const char *path); -char *strendzap (char *str, const char *pat); -void lt_debugprintf (const char *file, int line, const char *fmt, ...); -void lt_fatal (const char *file, int line, const char *message, ...); -static const char *nonnull (const char *s); -static const char *nonempty (const char *s); -void lt_setenv (const char *name, const char *value); -char *lt_extend_str (const char *orig_value, const char *add, int to_end); -void lt_update_exe_path (const char *name, const char *value); -void lt_update_lib_path (const char *name, const char *value); -char **prepare_spawn (char **argv); -void lt_dump_script (FILE *f); -EOF - - cat <= 0) - && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) - return 1; - else - return 0; -} - -int -make_executable (const char *path) -{ - int rval = 0; - struct stat st; - - lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", - nonempty (path)); - if ((!path) || (!*path)) - return 0; - - if (stat (path, &st) >= 0) - { - rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); - } - return rval; -} - -/* Searches for the full path of the wrapper. Returns - newly allocated full path name if found, NULL otherwise - Does not chase symlinks, even on platforms that support them. -*/ -char * -find_executable (const char *wrapper) -{ - int has_slash = 0; - const char *p; - const char *p_next; - /* static buffer for getcwd */ - char tmp[LT_PATHMAX + 1]; - int tmp_len; - char *concat_name; - - lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", - nonempty (wrapper)); - - if ((wrapper == NULL) || (*wrapper == '\0')) - return NULL; - - /* Absolute path? */ -#if defined (HAVE_DOS_BASED_FILE_SYSTEM) - if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') - { - concat_name = xstrdup (wrapper); - if (check_executable (concat_name)) - return concat_name; - XFREE (concat_name); - } - else - { -#endif - if (IS_DIR_SEPARATOR (wrapper[0])) - { - concat_name = xstrdup (wrapper); - if (check_executable (concat_name)) - return concat_name; - XFREE (concat_name); - } -#if defined (HAVE_DOS_BASED_FILE_SYSTEM) - } -#endif - - for (p = wrapper; *p; p++) - if (*p == '/') - { - has_slash = 1; - break; - } - if (!has_slash) - { - /* no slashes; search PATH */ - const char *path = getenv ("PATH"); - if (path != NULL) - { - for (p = path; *p; p = p_next) - { - const char *q; - size_t p_len; - for (q = p; *q; q++) - if (IS_PATH_SEPARATOR (*q)) - break; - p_len = q - p; - p_next = (*q == '\0' ? q : q + 1); - if (p_len == 0) - { - /* empty path: current directory */ - if (getcwd (tmp, LT_PATHMAX) == NULL) - lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", - nonnull (strerror (errno))); - tmp_len = strlen (tmp); - concat_name = - XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); - memcpy (concat_name, tmp, tmp_len); - concat_name[tmp_len] = '/'; - strcpy (concat_name + tmp_len + 1, wrapper); - } - else - { - concat_name = - XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); - memcpy (concat_name, p, p_len); - concat_name[p_len] = '/'; - strcpy (concat_name + p_len + 1, wrapper); - } - if (check_executable (concat_name)) - return concat_name; - XFREE (concat_name); - } - } - /* not found in PATH; assume curdir */ - } - /* Relative path | not found in path: prepend cwd */ - if (getcwd (tmp, LT_PATHMAX) == NULL) - lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", - nonnull (strerror (errno))); - tmp_len = strlen (tmp); - concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); - memcpy (concat_name, tmp, tmp_len); - concat_name[tmp_len] = '/'; - strcpy (concat_name + tmp_len + 1, wrapper); - - if (check_executable (concat_name)) - return concat_name; - XFREE (concat_name); - return NULL; -} - -char * -chase_symlinks (const char *pathspec) -{ -#ifndef S_ISLNK - return xstrdup (pathspec); -#else - char buf[LT_PATHMAX]; - struct stat s; - char *tmp_pathspec = xstrdup (pathspec); - char *p; - int has_symlinks = 0; - while (strlen (tmp_pathspec) && !has_symlinks) - { - lt_debugprintf (__FILE__, __LINE__, - "checking path component for symlinks: %s\n", - tmp_pathspec); - if (lstat (tmp_pathspec, &s) == 0) - { - if (S_ISLNK (s.st_mode) != 0) - { - has_symlinks = 1; - break; - } - - /* search backwards for last DIR_SEPARATOR */ - p = tmp_pathspec + strlen (tmp_pathspec) - 1; - while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) - p--; - if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) - { - /* no more DIR_SEPARATORS left */ - break; - } - *p = '\0'; - } - else - { - lt_fatal (__FILE__, __LINE__, - "error accessing file \"%s\": %s", - tmp_pathspec, nonnull (strerror (errno))); - } - } - XFREE (tmp_pathspec); - - if (!has_symlinks) - { - return xstrdup (pathspec); - } - - tmp_pathspec = realpath (pathspec, buf); - if (tmp_pathspec == 0) - { - lt_fatal (__FILE__, __LINE__, - "could not follow symlinks for %s", pathspec); - } - return xstrdup (tmp_pathspec); -#endif -} - -char * -strendzap (char *str, const char *pat) -{ - size_t len, patlen; - - assert (str != NULL); - assert (pat != NULL); - - len = strlen (str); - patlen = strlen (pat); - - if (patlen <= len) - { - str += len - patlen; - if (strcmp (str, pat) == 0) - *str = '\0'; - } - return str; -} - -void -lt_debugprintf (const char *file, int line, const char *fmt, ...) -{ - va_list args; - if (lt_debug) - { - (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); - va_start (args, fmt); - (void) vfprintf (stderr, fmt, args); - va_end (args); - } -} - -static void -lt_error_core (int exit_status, const char *file, - int line, const char *mode, - const char *message, va_list ap) -{ - fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); - vfprintf (stderr, message, ap); - fprintf (stderr, ".\n"); - - if (exit_status >= 0) - exit (exit_status); -} - -void -lt_fatal (const char *file, int line, const char *message, ...) -{ - va_list ap; - va_start (ap, message); - lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); - va_end (ap); -} - -static const char * -nonnull (const char *s) -{ - return s ? s : "(null)"; -} - -static const char * -nonempty (const char *s) -{ - return (s && !*s) ? "(empty)" : nonnull (s); -} - -void -lt_setenv (const char *name, const char *value) -{ - lt_debugprintf (__FILE__, __LINE__, - "(lt_setenv) setting '%s' to '%s'\n", - nonnull (name), nonnull (value)); - { -#ifdef HAVE_SETENV - /* always make a copy, for consistency with !HAVE_SETENV */ - char *str = xstrdup (value); - setenv (name, str, 1); -#else - int len = strlen (name) + 1 + strlen (value) + 1; - char *str = XMALLOC (char, len); - sprintf (str, "%s=%s", name, value); - if (putenv (str) != EXIT_SUCCESS) - { - XFREE (str); - } -#endif - } -} - -char * -lt_extend_str (const char *orig_value, const char *add, int to_end) -{ - char *new_value; - if (orig_value && *orig_value) - { - int orig_value_len = strlen (orig_value); - int add_len = strlen (add); - new_value = XMALLOC (char, add_len + orig_value_len + 1); - if (to_end) - { - strcpy (new_value, orig_value); - strcpy (new_value + orig_value_len, add); - } - else - { - strcpy (new_value, add); - strcpy (new_value + add_len, orig_value); - } - } - else - { - new_value = xstrdup (add); - } - return new_value; -} - -void -lt_update_exe_path (const char *name, const char *value) -{ - lt_debugprintf (__FILE__, __LINE__, - "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", - nonnull (name), nonnull (value)); - - if (name && *name && value && *value) - { - char *new_value = lt_extend_str (getenv (name), value, 0); - /* some systems can't cope with a ':'-terminated path #' */ - int len = strlen (new_value); - while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1])) - { - new_value[len-1] = '\0'; - } - lt_setenv (name, new_value); - XFREE (new_value); - } -} - -void -lt_update_lib_path (const char *name, const char *value) -{ - lt_debugprintf (__FILE__, __LINE__, - "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", - nonnull (name), nonnull (value)); - - if (name && *name && value && *value) - { - char *new_value = lt_extend_str (getenv (name), value, 0); - lt_setenv (name, new_value); - XFREE (new_value); - } -} - -EOF - case $host_os in - mingw*) - cat <<"EOF" - -/* Prepares an argument vector before calling spawn(). - Note that spawn() does not by itself call the command interpreter - (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : - ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); - GetVersionEx(&v); - v.dwPlatformId == VER_PLATFORM_WIN32_NT; - }) ? "cmd.exe" : "command.com"). - Instead it simply concatenates the arguments, separated by ' ', and calls - CreateProcess(). We must quote the arguments since Win32 CreateProcess() - interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a - special way: - - Space and tab are interpreted as delimiters. They are not treated as - delimiters if they are surrounded by double quotes: "...". - - Unescaped double quotes are removed from the input. Their only effect is - that within double quotes, space and tab are treated like normal - characters. - - Backslashes not followed by double quotes are not special. - - But 2*n+1 backslashes followed by a double quote become - n backslashes followed by a double quote (n >= 0): - \" -> " - \\\" -> \" - \\\\\" -> \\" - */ -#define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" -#define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" -char ** -prepare_spawn (char **argv) -{ - size_t argc; - char **new_argv; - size_t i; - - /* Count number of arguments. */ - for (argc = 0; argv[argc] != NULL; argc++) - ; - - /* Allocate new argument vector. */ - new_argv = XMALLOC (char *, argc + 1); - - /* Put quoted arguments into the new argument vector. */ - for (i = 0; i < argc; i++) - { - const char *string = argv[i]; - - if (string[0] == '\0') - new_argv[i] = xstrdup ("\"\""); - else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) - { - int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); - size_t length; - unsigned int backslashes; - const char *s; - char *quoted_string; - char *p; - - length = 0; - backslashes = 0; - if (quote_around) - length++; - for (s = string; *s != '\0'; s++) - { - char c = *s; - if (c == '"') - length += backslashes + 1; - length++; - if (c == '\\') - backslashes++; - else - backslashes = 0; - } - if (quote_around) - length += backslashes + 1; - - quoted_string = XMALLOC (char, length + 1); - - p = quoted_string; - backslashes = 0; - if (quote_around) - *p++ = '"'; - for (s = string; *s != '\0'; s++) - { - char c = *s; - if (c == '"') - { - unsigned int j; - for (j = backslashes + 1; j > 0; j--) - *p++ = '\\'; - } - *p++ = c; - if (c == '\\') - backslashes++; - else - backslashes = 0; - } - if (quote_around) - { - unsigned int j; - for (j = backslashes; j > 0; j--) - *p++ = '\\'; - *p++ = '"'; - } - *p = '\0'; - - new_argv[i] = quoted_string; - } - else - new_argv[i] = (char *) string; - } - new_argv[argc] = NULL; - - return new_argv; -} -EOF - ;; - esac - - cat <<"EOF" -void lt_dump_script (FILE* f) -{ -EOF - func_emit_wrapper yes | - $SED -e 's/\([\\"]\)/\\\1/g' \ - -e 's/^/ fputs ("/' -e 's/$/\\n", f);/' - - cat <<"EOF" -} -EOF -} -# end: func_emit_cwrapperexe_src - -# func_win32_import_lib_p ARG -# True if ARG is an import lib, as indicated by $file_magic_cmd -func_win32_import_lib_p () -{ - $opt_debug - case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in - *import*) : ;; - *) false ;; - esac -} - -# func_mode_link arg... -func_mode_link () -{ - $opt_debug - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) - # It is impossible to link a dll without this setting, and - # we shouldn't force the makefile maintainer to figure out - # which system we are compiling for in order to pass an extra - # flag for every libtool invocation. - # allow_undefined=no - - # FIXME: Unfortunately, there are problems with the above when trying - # to make a dll which has undefined symbols, in which case not - # even a static library is built. For now, we need to specify - # -no-undefined on the libtool link line when we can be certain - # that all symbols are satisfied, otherwise we get a static library. - allow_undefined=yes - ;; - *) - allow_undefined=yes - ;; - esac - libtool_args=$nonopt - base_compile="$nonopt $@" - compile_command=$nonopt - finalize_command=$nonopt - - compile_rpath= - finalize_rpath= - compile_shlibpath= - finalize_shlibpath= - convenience= - old_convenience= - deplibs= - old_deplibs= - compiler_flags= - linker_flags= - dllsearchpath= - lib_search_path=`pwd` - inst_prefix_dir= - new_inherited_linker_flags= - - avoid_version=no - bindir= - dlfiles= - dlprefiles= - dlself=no - export_dynamic=no - export_symbols= - export_symbols_regex= - generated= - libobjs= - ltlibs= - module=no - no_install=no - objs= - non_pic_objects= - precious_files_regex= - prefer_static_libs=no - preload=no - prev= - prevarg= - release= - rpath= - xrpath= - perm_rpath= - temp_rpath= - thread_safe=no - vinfo= - vinfo_number=no - weak_libs= - single_module="${wl}-single_module" - func_infer_tag $base_compile - - # We need to know -static, to get the right output filenames. - for arg - do - case $arg in - -shared) - test "$build_libtool_libs" != yes && \ - func_fatal_configuration "can not build a shared library" - build_old_libs=no - break - ;; - -all-static | -static | -static-libtool-libs) - case $arg in - -all-static) - if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then - func_warning "complete static linking is impossible in this configuration" - fi - if test -n "$link_static_flag"; then - dlopen_self=$dlopen_self_static - fi - prefer_static_libs=yes - ;; - -static) - if test -z "$pic_flag" && test -n "$link_static_flag"; then - dlopen_self=$dlopen_self_static - fi - prefer_static_libs=built - ;; - -static-libtool-libs) - if test -z "$pic_flag" && test -n "$link_static_flag"; then - dlopen_self=$dlopen_self_static - fi - prefer_static_libs=yes - ;; - esac - build_libtool_libs=no - build_old_libs=yes - break - ;; - esac - done - - # See if our shared archives depend on static archives. - test -n "$old_archive_from_new_cmds" && build_old_libs=yes - - # Go through the arguments, transforming them on the way. - while test "$#" -gt 0; do - arg="$1" - shift - func_quote_for_eval "$arg" - qarg=$func_quote_for_eval_unquoted_result - func_append libtool_args " $func_quote_for_eval_result" - - # If the previous option needs an argument, assign it. - if test -n "$prev"; then - case $prev in - output) - func_append compile_command " @OUTPUT@" - func_append finalize_command " @OUTPUT@" - ;; - esac - - case $prev in - bindir) - bindir="$arg" - prev= - continue - ;; - dlfiles|dlprefiles) - if test "$preload" = no; then - # Add the symbol object into the linking commands. - func_append compile_command " @SYMFILE@" - func_append finalize_command " @SYMFILE@" - preload=yes - fi - case $arg in - *.la | *.lo) ;; # We handle these cases below. - force) - if test "$dlself" = no; then - dlself=needless - export_dynamic=yes - fi - prev= - continue - ;; - self) - if test "$prev" = dlprefiles; then - dlself=yes - elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then - dlself=yes - else - dlself=needless - export_dynamic=yes - fi - prev= - continue - ;; - *) - if test "$prev" = dlfiles; then - 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 - ;; - - -bindir) - prev=bindir - continue - ;; - - -dlopen) - prev=dlfiles - continue - ;; - - -dlpreopen) - prev=dlprefiles - continue - ;; - - -export-dynamic) - export_dynamic=yes - continue - ;; - - -export-symbols | -export-symbols-regex) - if test -n "$export_symbols" || test -n "$export_symbols_regex"; then - func_fatal_error "more than one -exported-symbols argument is not allowed" - fi - if test "X$arg" = "X-export-symbols"; then - prev=expsyms - else - prev=expsyms_regex - fi - continue - ;; - - -framework) - prev=framework - continue - ;; - - -inst-prefix-dir) - prev=inst_prefix - continue - ;; - - # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* - # so, if we see these flags be careful not to treat them like -L - -L[A-Z][A-Z]*:*) - case $with_gcc/$host in - no/*-*-irix* | /*-*-irix*) - func_append compile_command " $arg" - func_append finalize_command " $arg" - ;; - esac - continue - ;; - - -L*) - func_stripname '-L' '' "$arg" - 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 "$dir" | $SED '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* | *-*-haiku*) - # These systems don't actually have a C or math library (as such) - continue - ;; - *-*-os2*) - # These systems don't actually have a C library (as such) - test "X$arg" = "X-lc" && continue - ;; - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) - # Do not include libc due to us having libc/libc_r. - test "X$arg" = "X-lc" && continue - ;; - *-*-rhapsody* | *-*-darwin1.[012]) - # Rhapsody C and math libraries are in the System framework - 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 $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" - ;; - - # Flags to be passed through unchanged, with rationale: - # -64, -mips[0-9] enable 64-bit mode for the SGI compiler - # -r[0-9][0-9]* specify processor for the SGI compiler - # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler - # +DA*, +DD* enable 64-bit mode for the HP compiler - # -q* compiler args for the IBM compiler - # -m*, -t[45]*, -txscale* architecture-specific flags for GCC - # -F/path path to uninstalled frameworks, gcc on darwin - # -p, -pg, --coverage, -fprofile-* profiling flags for GCC - # @file GCC response files - # -tp=* Portland pgcc target processor selection - -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ - -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*) - 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 \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\` - else - shlib_search_path= - fi - eval sys_lib_search_path=\"$sys_lib_search_path_spec\" - eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" - - func_dirname "$output" "/" "" - output_objdir="$func_dirname_result$objdir" - # 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 - func_basename "$deplib" - deplib_base=$func_basename_result - 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 \"$deplib\"" 2>/dev/null | $SED 10q \ - | $EGREP "$match_pattern_regex" > /dev/null; then - valid_a_lib=yes - fi - ;; - pass_all) - valid_a_lib=yes - ;; - esac - if test "$valid_a_lib" != yes; then - echo - $ECHO "*** Warning: Trying to link with static lib archive $deplib." - echo "*** I have the capability to make that library automatically link in when" - echo "*** you link to this library. But I can only do this if you have a" - echo "*** shared version of the library, which you do not appear to have" - echo "*** because the file extensions .$libext of this argument makes me believe" - echo "*** that it is just a static archive that I should not use here." - else - echo - $ECHO "*** Warning: Linking the shared library $output against the" - $ECHO "*** static library $deplib is not portable!" - deplibs="$deplib $deplibs" - fi - ;; - esac - continue - ;; - prog) - if test "$pass" != link; then - deplibs="$deplib $deplibs" - else - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - fi - continue - ;; - esac # linkmode - ;; # *.$libext - *.lo | *.$objext) - if test "$pass" = conv; then - deplibs="$deplib $deplibs" - elif test "$linkmode" = prog; then - if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then - # If there is no dlopen support or we're linking statically, - # we need to preload. - 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 "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'` - for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do - case " $new_inherited_linker_flags " in - *" $tmp_inherited_linker_flag "*) ;; - *) new_inherited_linker_flags="$new_inherited_linker_flags $tmp_inherited_linker_flag";; - esac - done - fi - dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` - if test "$linkmode,$pass" = "lib,link" || - test "$linkmode,$pass" = "prog,scan" || - { test "$linkmode" != prog && test "$linkmode" != lib; }; then - test -n "$dlopen" && 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 - path= - 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 " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` - fi - fi - dependency_libs="$newdependency_libs" - if test "$pass" = dlpreopen; then - # Link the dlpreopened libraries before other libraries - for deplib in $save_deplibs; do - deplibs="$deplib $deplibs" - done - fi - if test "$pass" != dlopen; then - if test "$pass" != conv; then - # Make sure lib_search_path contains only unique directories. - lib_search_path= - for dir in $newlib_search_path; do - case "$lib_search_path " in - *" $dir "*) ;; - *) 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|qnx|sunos) - current="$number_major" - revision="$number_minor" - age="0" - ;; - irix|nonstopux) - func_arith $number_major + $number_minor - current=$func_arith_result - age="$number_minor" - revision="$number_minor" - lt_irix_increment=no - ;; - esac - ;; - no) - current="$1" - revision="$2" - age="$3" - ;; - esac - - # Check that each of the things are valid numbers. - case $current in - 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; - *) - func_error "CURRENT \`$current' must be a nonnegative integer" - func_fatal_error "\`$vinfo' is not valid version information" - ;; - esac - - case $revision in - 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; - *) - func_error "REVISION \`$revision' must be a nonnegative integer" - func_fatal_error "\`$vinfo' is not valid version information" - ;; - esac - - case $age in - 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; - *) - func_error "AGE \`$age' must be a nonnegative integer" - func_fatal_error "\`$vinfo' is not valid version information" - ;; - esac - - if test "$age" -gt "$current"; then - func_error "AGE \`$age' is greater than the current interface number \`$current'" - func_fatal_error "\`$vinfo' is not valid version information" - fi - - # Calculate the version variables. - major= - versuffix= - verstring= - case $version_type in - none) ;; - - darwin) - # Like Linux, but with the current version available in - # verstring for coding it into the library header - func_arith $current - $age - major=.$func_arith_result - versuffix="$major.$age.$revision" - # Darwin ld doesn't like 0 for these options... - func_arith $current + 1 - minor_current=$func_arith_result - xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" - verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" - ;; - - freebsd-aout) - major=".$current" - versuffix=".$current.$revision"; - ;; - - freebsd-elf) - major=".$current" - versuffix=".$current" - ;; - - irix | nonstopux) - if test "X$lt_irix_increment" = "Xno"; then - func_arith $current - $age - else - func_arith $current - $age + 1 - fi - major=$func_arith_result - - case $version_type in - nonstopux) verstring_prefix=nonstopux ;; - *) verstring_prefix=sgi ;; - esac - verstring="$verstring_prefix$major.$revision" - - # Add in all the interfaces that we are compatible with. - loop=$revision - while test "$loop" -ne 0; do - func_arith $revision - $loop - iface=$func_arith_result - func_arith $loop - 1 - loop=$func_arith_result - verstring="$verstring_prefix$major.$iface:$verstring" - done - - # Before this point, $major must not contain `.'. - major=.$major - versuffix="$major.$revision" - ;; - - linux) - 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 "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP` - fi - - # Eliminate all temporary directories. - #for path in $notinst_path; do - # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` - # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` - # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"` - #done - - if test -n "$xrpath"; then - # If the user specified any rpath flags, then add them. - temp_xrpath= - for libdir in $xrpath; do - 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* | *-*-haiku*) - # 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 </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 "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";; - esac - done - if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | - $SED -e 10q | - $EGREP "$file_magic_regex" > /dev/null; then - 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 \"$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 - ;; - *) - # Add a -L argument. - newdeplibs="$newdeplibs $a_deplib" - ;; - esac - done # Gone through all deplibs. - ;; - none | unknown | *) - newdeplibs="" - tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then - for i in $predeps $postdeps ; do - # can't use Xsed below, because $i might contain '/' - tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"` - done - fi - case $tmp_deplibs in - *[!\ \ ]*) - echo - if test "X$deplibs_check_method" = "Xnone"; then - echo "*** Warning: inter-library dependencies are not supported in this platform." - else - echo "*** Warning: inter-library dependencies are not known to be supported." - fi - echo "*** All declared inter-library dependencies are being dropped." - droppeddeps=yes - ;; - esac - ;; - esac - versuffix=$versuffix_save - major=$major_save - release=$release_save - libname=$libname_save - name=$name_save - - case $host in - *-*-rhapsody* | *-*-darwin1.[012]) - # On Rhapsody replace the C library with the System framework - newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` - ;; - esac - - if test "$droppeddeps" = yes; then - if test "$module" = yes; then - echo - echo "*** Warning: libtool could not satisfy all declared inter-library" - $ECHO "*** dependencies of module $libname. Therefore, libtool will create" - echo "*** a static module, that should work as long as the dlopening" - echo "*** application is linked with the -dlopen flag." - if test -z "$global_symbol_pipe"; then - echo - echo "*** However, this would only work if libtool was able to extract symbol" - echo "*** lists from a program, using \`nm' or equivalent, but libtool could" - echo "*** not find such a program. So, this module is probably useless." - echo "*** \`nm' from GNU binutils and a full rebuild may help." - fi - if test "$build_old_libs" = no; then - oldlibs="$output_objdir/$libname.$libext" - build_libtool_libs=module - build_old_libs=yes - else - build_libtool_libs=no - fi - else - echo "*** The inter-library dependencies that have been dropped here will be" - echo "*** automatically added whenever a program is linked with this library" - echo "*** or is declared to -dlopen it." - - if test "$allow_undefined" = no; then - echo - echo "*** Since this library must not contain undefined symbols," - echo "*** because either the platform does not support them or" - echo "*** it was explicitly requested with -no-undefined," - echo "*** libtool will only create a static version of it." - if test "$build_old_libs" = no; then - oldlibs="$output_objdir/$libname.$libext" - build_libtool_libs=module - build_old_libs=yes - else - build_libtool_libs=no - fi - fi - fi - fi - # Done checking deplibs! - deplibs=$newdeplibs - fi - # Time to change all our "foo.ltframework" stuff back to "-framework foo" - case $host in - *-*-darwin*) - newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` - new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` - deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` - ;; - esac - - # move library search paths that coincide with paths to not yet - # installed libraries to the beginning of the library search list - new_libs= - for path in $notinst_path; do - case " $new_libs " in - *" -L$path/$objdir "*) ;; - *) - case " $deplibs " in - *" -L$path/$objdir "*) - 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 "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP` - test "X$libobjs" = "X " && libobjs= - - delfiles= - if test -n "$export_symbols" && test -n "$include_expsyms"; then - $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" - export_symbols="$output_objdir/$libname.uexp" - 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 "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' - fi - - if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then - # The given exports_symbols file has to be filtered, so filter it. - func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" - # FIXME: $output_objdir/$libname.filter potentially contains lots of - # 's' commands which not all seds can handle. GNU sed should be fine - # though. Also, the filter scales superlinearly with the number of - # global variables. join(1) would be nice here, but unfortunately - # isn't a blessed tool. - $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter - 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 - func_basename "$output" - output_la=$func_basename_result - - # Clear the reloadable object creation command queue and - # initialize k to one. - test_cmds= - concat_cmds= - objlist= - last_robj= - k=1 - - if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then - output=${output_objdir}/${output_la}.lnkscript - func_verbose "creating GNU ld script: $output" - echo 'INPUT (' > $output - for obj in $save_libobjs - do - $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. - reload_objs=$objlist - eval concat_cmds=\"$reload_cmds\" - else - # All subsequent reloadable object files will link in - # the last one created. - reload_objs="$objlist $last_robj" - eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" - fi - last_robj=$output_objdir/$output_la-${k}.$objext - func_arith $k + 1 - k=$func_arith_result - output=$output_objdir/$output_la-${k}.$objext - objlist=" $obj" - func_len " $last_robj" - func_arith $len0 + $func_len_result - len=$func_arith_result - fi - done - # Handle the remaining objects by creating one last - # reloadable object file. All subsequent reloadable object - # files will link in the last one created. - test -z "$concat_cmds" || concat_cmds=$concat_cmds~ - reload_objs="$objlist $last_robj" - eval concat_cmds=\"\${concat_cmds}$reload_cmds\" - if test -n "$last_robj"; then - eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\" - fi - 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 "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' - fi - - if test -n "$orig_export_symbols"; then - # The given exports_symbols file has to be filtered, so filter it. - func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" - # FIXME: $output_objdir/$libname.filter potentially contains lots of - # 's' commands which not all seds can handle. GNU sed should be fine - # though. Also, the filter scales superlinearly with the number of - # global variables. join(1) would be nice here, but unfortunately - # isn't a blessed tool. - $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter - 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 "$tmp_whole_archive_flags" | $SED '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 "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test - - output="$obj" - func_execute_cmds "$reload_cmds" 'exit $?' - - # Exit if we aren't doing a library object file. - if test -z "$libobj"; then - if test -n "$gentop"; then - func_show_eval '${RM}r "$gentop"' - fi - - exit $EXIT_SUCCESS - fi - - if test "$build_libtool_libs" != yes; then - if test -n "$gentop"; then - func_show_eval '${RM}r "$gentop"' - fi - - # Create an invalid libtool object if no PIC, so that we don't - # accidentally link it into a program. - # $show "echo timestamp > $libobj" - # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? - exit $EXIT_SUCCESS - fi - - if test -n "$pic_flag" || test "$pic_mode" != default; then - # Only do commands if we really have different PIC objects. - reload_objs="$libobjs $reload_conv_objs" - output="$libobj" - func_execute_cmds "$reload_cmds" 'exit $?' - fi - - if test -n "$gentop"; then - func_show_eval '${RM}r "$gentop"' - fi - - exit $EXIT_SUCCESS - ;; - - prog) - case $host in - *cygwin*) func_stripname '' '.exe' "$output" - output=$func_stripname_result.exe;; - esac - test -n "$vinfo" && \ - func_warning "\`-version-info' is ignored for programs" - - test -n "$release" && \ - func_warning "\`-release' is ignored for programs" - - test "$preload" = yes \ - && test "$dlopen_support" = unknown \ - && test "$dlopen_self" = unknown \ - && test "$dlopen_self_static" = unknown && \ - func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support." - - case $host in - *-*-rhapsody* | *-*-darwin1.[012]) - # On Rhapsody replace the C library is the System framework - compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` - finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` - ;; - esac - - case $host in - *-*-darwin*) - # Don't allow lazy linking, it breaks C++ global constructors - # But is supposedly fixed on 10.4 or later (yay!). - if test "$tagname" = CXX ; then - case ${MACOSX_DEPLOYMENT_TARGET-10.0} in - 10.[0123]) - 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 " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` - finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` - ;; - esac - - - # move library search paths that coincide with paths to not yet - # installed libraries to the beginning of the library search list - new_libs= - for path in $notinst_path; do - case " $new_libs " in - *" -L$path/$objdir "*) ;; - *) - case " $compile_deplibs " in - *" -L$path/$objdir "*) - 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 "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` - finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` - fi - - func_generate_dlsyms "$outputname" "@PROGRAM@" "no" - - # template prelinking step - if test -n "$prelink_cmds"; then - func_execute_cmds "$prelink_cmds" 'exit $?' - fi - - wrappers_required=yes - case $host in - *cegcc* | *mingw32ce*) - # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. - wrappers_required=no - ;; - *cygwin* | *mingw* ) - if test "$build_libtool_libs" != yes; then - wrappers_required=no - fi - ;; - *) - if test "$need_relink" = no || test "$build_libtool_libs" != yes; then - wrappers_required=no - fi - ;; - esac - if test "$wrappers_required" = no; then - # Replace the output file specification. - compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` - link_command="$compile_command$compile_rpath" - - # We have no uninstalled library dependencies, so finalize right now. - exit_status=0 - func_show_eval "$link_command" 'exit_status=$?' - - # 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 "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` - # Delete the old output file. - $opt_dry_run || $RM $output - # Link the executable and exit - func_show_eval "$link_command" 'exit $?' - exit $EXIT_SUCCESS - fi - - if test "$hardcode_action" = relink; then - # Fast installation is not supported - link_command="$compile_var$compile_command$compile_rpath" - relink_command="$finalize_var$finalize_command$finalize_rpath" - - func_warning "this platform does not like uninstalled shared libraries" - func_warning "\`$output' will be relinked during installation" - else - if test "$fast_install" != no; then - link_command="$finalize_var$compile_command$finalize_rpath" - if test "$fast_install" = yes; then - relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` - else - # fast_install is set to needless - relink_command= - fi - else - link_command="$compile_var$compile_command$compile_rpath" - relink_command="$finalize_var$finalize_command$finalize_rpath" - fi - fi - - # Replace the output file specification. - link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` - - # Delete the old output files. - $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname - - func_show_eval "$link_command" 'exit $?' - - # Now create the wrapper script. - func_verbose "creating $output" - - # Quote the relink command for shipping. - if test -n "$relink_command"; then - # Preserve any variables that may affect compiler behavior - for var in $variables_saved_for_relink; do - if eval test -z \"\${$var+set}\"; then - relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" - elif eval var_value=\$$var; test -z "$var_value"; then - relink_command="$var=; export $var; $relink_command" - else - func_quote_for_eval "$var_value" - relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" - fi - done - relink_command="(cd `pwd`; $relink_command)" - relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` - fi - - # Only actually do things if not in dry run mode. - $opt_dry_run || { - # win32 will think the script is a binary if it has - # a .exe suffix, so we strip it off here. - case $output in - *.exe) func_stripname '' '.exe' "$output" - output=$func_stripname_result ;; - esac - # test for cygwin because mv fails w/o .exe extensions - case $host in - *cygwin*) - exeext=.exe - func_stripname '' '.exe' "$outputname" - outputname=$func_stripname_result ;; - *) exeext= ;; - esac - case $host in - *cygwin* | *mingw* ) - func_dirname_and_basename "$output" "" "." - output_name=$func_basename_result - output_path=$func_dirname_result - cwrappersource="$output_path/$objdir/lt-$output_name.c" - cwrapper="$output_path/$output_name.exe" - $RM $cwrappersource $cwrapper - trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 - - func_emit_cwrapperexe_src > $cwrappersource - - # The wrapper executable is built using the $host compiler, - # because it contains $host paths and files. If cross- - # compiling, it, like the target executable, must be - # executed on the $host or under an emulation environment. - $opt_dry_run || { - $LTCC $LTCFLAGS -o $cwrapper $cwrappersource - $STRIP $cwrapper - } - - # Now, create the wrapper script for func_source use: - func_ltwrapper_scriptname $cwrapper - $RM $func_ltwrapper_scriptname_result - trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 - $opt_dry_run || { - # note: this script will not be executed, so do not chmod. - if test "x$build" = "x$host" ; then - $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result - else - func_emit_wrapper no > $func_ltwrapper_scriptname_result - fi - } - ;; - * ) - $RM $output - trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 - - func_emit_wrapper no > $output - chmod +x $output - ;; - esac - } - exit $EXIT_SUCCESS - ;; - esac - - # See if we need to build an old-fashioned archive. - for oldlib in $oldlibs; do - - if test "$build_libtool_libs" = convenience; then - oldobjs="$libobjs_save $symfileobj" - addlibs="$convenience" - build_libtool_libs=no - else - if test "$build_libtool_libs" = module; then - oldobjs="$libobjs_save" - build_libtool_libs=no - else - oldobjs="$old_deplibs $non_pic_objects" - if test "$preload" = yes && test -f "$symfileobj"; then - 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 "$relink_command" | $SED "$sed_quote_subst"` - if test "$hardcode_automatic" = yes ; then - relink_command= - fi - - # Only create the output if not a dry run. - $opt_dry_run || { - for installed in no yes; do - if test "$installed" = yes; then - if test -z "$install_libdir"; then - break - fi - output="$output_objdir/$outputname"i - # Replace all uninstalled libtool libraries with the installed ones - newdependency_libs= - for deplib in $dependency_libs; do - case $deplib in - *.la) - func_basename "$deplib" - name="$func_basename_result" - 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 - # In fact, it would be nice if we could use this code for all target - # systems that can't hard-code library paths into their executables - # and that have no shared library path variable independent of PATH, - # but it turns out we can't easily determine that from inspecting - # libtool variables, so we have to hard-code the OSs to which it - # applies here; at the moment, that means platforms that use the PE - # object format with DLL files. See the long comment at the top of - # tests/bindir.at for full details. - tdlname=$dlname - case $host,$output,$installed,$module,$dlname in - *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) - # If a -bindir argument was supplied, place the dll there. - if test "x$bindir" != x ; - then - func_relative_path "$install_libdir" "$bindir" - tdlname=$func_relative_path_result$dlname - else - # Otherwise fall back on heuristic. - tdlname=../bin/$dlname - fi - ;; - esac - $ECHO > $output "\ -# $outputname - a libtool library file -# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION -# -# Please DO NOT delete this file! -# It is necessary for linking the library. - -# The name that we can dlopen(3). -dlname='$tdlname' - -# Names of this library. -library_names='$library_names' - -# The name of the static archive. -old_library='$old_library' - -# Linker flags that can not go in dependency_libs. -inherited_linker_flags='$new_inherited_linker_flags' - -# Libraries that this one depends upon. -dependency_libs='$dependency_libs' - -# Names of additional weak libraries provided by this library -weak_library_names='$weak_libs' - -# Version information for $libname. -current=$current -age=$age -revision=$revision - -# Is this an already installed library? -installed=$installed - -# Should we warn about portability when linking against -modules? -shouldnotlink=$module - -# Files to dlopen/dlpreopen -dlopen='$dlfiles' -dlpreopen='$dlprefiles' - -# Directory that this library needs to be installed in: -libdir='$install_libdir'" - if test "$installed" = no && test "$need_relink" = yes; then - $ECHO >> $output "\ -relink_command=\"$relink_command\"" - fi - done - } - - # Do a symbolic link so that the libtool archive can be found in - # LD_LIBRARY_PATH before the program is installed. - func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' - ;; - esac - exit $EXIT_SUCCESS -} - -{ test "$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/impl/antlr/libantlr3c-3.4/m4/libtool.m4 b/impl/antlr/libantlr3c-3.4/m4/libtool.m4 deleted file mode 100644 index 8c99a62..0000000 --- a/impl/antlr/libantlr3c-3.4/m4/libtool.m4 +++ /dev/null @@ -1,7441 +0,0 @@ -# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- -# -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, -# 2006, 2007, 2008, 2009, 2010 Free Software Foundation, -# Inc. -# Written by Gordon Matzigkeit, 1996 -# -# This file is free software; the Free Software Foundation gives -# unlimited permission to copy and/or distribute it, with or without -# modifications, as long as this notice is preserved. - -m4_define([_LT_COPYING], [dnl -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, -# 2006, 2007, 2008, 2009, 2010 Free Software Foundation, -# Inc. -# Written by Gordon Matzigkeit, 1996 -# -# This file is part of GNU Libtool. -# -# GNU Libtool is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License as -# published by the Free Software Foundation; either version 2 of -# the License, or (at your option) any later version. -# -# As a special exception to the GNU General Public License, -# if you distribute this file as part of a program or library that -# is built using GNU Libtool, you may include this file under the -# same distribution terms that you use for the rest of that program. -# -# GNU Libtool is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Libtool; see the file COPYING. If not, a copy -# can be downloaded from http://www.gnu.org/licenses/gpl.html, or -# obtained by writing to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -]) - -# serial 57 LT_INIT - - -# LT_PREREQ(VERSION) -# ------------------ -# Complain and exit if this libtool version is less that VERSION. -m4_defun([LT_PREREQ], -[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, - [m4_default([$3], - [m4_fatal([Libtool version $1 or higher is required], - 63)])], - [$2])]) - - -# _LT_CHECK_BUILDDIR -# ------------------ -# Complain if the absolute build directory name contains unusual characters -m4_defun([_LT_CHECK_BUILDDIR], -[case `pwd` in - *\ * | *\ *) - AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; -esac -]) - - -# LT_INIT([OPTIONS]) -# ------------------ -AC_DEFUN([LT_INIT], -[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT -AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl -AC_BEFORE([$0], [LT_LANG])dnl -AC_BEFORE([$0], [LT_OUTPUT])dnl -AC_BEFORE([$0], [LTDL_INIT])dnl -m4_require([_LT_CHECK_BUILDDIR])dnl - -dnl Autoconf doesn't catch unexpanded LT_ macros by default: -m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl -m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl -dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 -dnl unless we require an AC_DEFUNed macro: -AC_REQUIRE([LTOPTIONS_VERSION])dnl -AC_REQUIRE([LTSUGAR_VERSION])dnl -AC_REQUIRE([LTVERSION_VERSION])dnl -AC_REQUIRE([LTOBSOLETE_VERSION])dnl -m4_require([_LT_PROG_LTMAIN])dnl - -_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) - -dnl Parse OPTIONS -_LT_SET_OPTIONS([$0], [$1]) - -# This can be used to rebuild libtool when needed -LIBTOOL_DEPS="$ltmain" - -# Always use our own libtool. -LIBTOOL='$(SHELL) $(top_builddir)/libtool' -AC_SUBST(LIBTOOL)dnl - -_LT_SETUP - -# Only expand once: -m4_define([LT_INIT]) -])# LT_INIT - -# Old names: -AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) -AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_PROG_LIBTOOL], []) -dnl AC_DEFUN([AM_PROG_LIBTOOL], []) - - -# _LT_CC_BASENAME(CC) -# ------------------- -# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. -m4_defun([_LT_CC_BASENAME], -[for cc_temp in $1""; do - case $cc_temp in - compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; - distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` -]) - - -# _LT_FILEUTILS_DEFAULTS -# ---------------------- -# It is okay to use these file commands and assume they have been set -# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'. -m4_defun([_LT_FILEUTILS_DEFAULTS], -[: ${CP="cp -f"} -: ${MV="mv -f"} -: ${RM="rm -f"} -])# _LT_FILEUTILS_DEFAULTS - - -# _LT_SETUP -# --------- -m4_defun([_LT_SETUP], -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_REQUIRE([AC_CANONICAL_BUILD])dnl -AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl -AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl - -_LT_DECL([], [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 - -case $host_os in -aix3*) - # AIX sometimes has problems with the GCC collect2 program. For some - # reason, if we set the COLLECT_NAMES environment variable, the problems - # vanish in a puff of smoke. - if test "X${COLLECT_NAMES+set}" != Xset; then - COLLECT_NAMES= - export COLLECT_NAMES - fi - ;; -esac - -# Global variables: -ofile=libtool -can_build_shared=yes - -# All known linkers require a `.a' archive for static linking (except MSVC, -# which needs '.lib'). -libext=a - -with_gnu_ld="$lt_cv_prog_gnu_ld" - -old_CC="$CC" -old_CFLAGS="$CFLAGS" - -# Set sane defaults for various variables -test -z "$CC" && CC=cc -test -z "$LTCC" && LTCC=$CC -test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS -test -z "$LD" && LD=ld -test -z "$ac_objext" && ac_objext=o - -_LT_CC_BASENAME([$compiler]) - -# Only perform the check for file, if the check method requires it -test -z "$MAGIC_CMD" && MAGIC_CMD=file -case $deplibs_check_method in -file_magic*) - if test "$file_magic_cmd" = '$MAGIC_CMD'; then - _LT_PATH_MAGIC - fi - ;; -esac - -# Use C for the default configuration in the libtool script -LT_SUPPORTED_TAG([CC]) -_LT_LANG_C_CONFIG -_LT_LANG_DEFAULT_CONFIG -_LT_CONFIG_COMMANDS -])# _LT_SETUP - - -# _LT_PREPARE_SED_QUOTE_VARS -# -------------------------- -# Define a few sed substitution that help us do robust quoting. -m4_defun([_LT_PREPARE_SED_QUOTE_VARS], -[# Backslashify metacharacters that are still active within -# double-quoted strings. -sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' - -# Same as above, but do not quote variable references. -double_quote_subst='s/\([["`\\]]\)/\\\1/g' - -# Sed substitution to delay expansion of an escaped shell variable in a -# double_quote_subst'ed string. -delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' - -# Sed substitution to delay expansion of an escaped single quote. -delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' - -# Sed substitution to avoid accidental globbing in evaled expressions -no_glob_subst='s/\*/\\\*/g' -]) - -# _LT_PROG_LTMAIN -# --------------- -# Note that this code is called both from `configure', and `config.status' -# now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, -# `config.status' has no value for ac_aux_dir unless we are using Automake, -# so we pass a copy along to make sure it has a sensible value anyway. -m4_defun([_LT_PROG_LTMAIN], -[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl -_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) -ltmain="$ac_aux_dir/ltmain.sh" -])# _LT_PROG_LTMAIN - - -## ------------------------------------- ## -## Accumulate code for creating libtool. ## -## ------------------------------------- ## - -# So that we can recreate a full libtool script including additional -# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS -# in macros and then make a single call at the end using the `libtool' -# label. - - -# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) -# ---------------------------------------- -# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. -m4_define([_LT_CONFIG_LIBTOOL_INIT], -[m4_ifval([$1], - [m4_append([_LT_OUTPUT_LIBTOOL_INIT], - [$1 -])])]) - -# Initialize. -m4_define([_LT_OUTPUT_LIBTOOL_INIT]) - - -# _LT_CONFIG_LIBTOOL([COMMANDS]) -# ------------------------------ -# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. -m4_define([_LT_CONFIG_LIBTOOL], -[m4_ifval([$1], - [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], - [$1 -])])]) - -# Initialize. -m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) - - -# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) -# ----------------------------------------------------- -m4_defun([_LT_CONFIG_SAVE_COMMANDS], -[_LT_CONFIG_LIBTOOL([$1]) -_LT_CONFIG_LIBTOOL_INIT([$2]) -]) - - -# _LT_FORMAT_COMMENT([COMMENT]) -# ----------------------------- -# Add leading comment marks to the start of each line, and a trailing -# full-stop to the whole comment if one is not present already. -m4_define([_LT_FORMAT_COMMENT], -[m4_ifval([$1], [ -m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], - [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) -)]) - - - -## ------------------------ ## -## FIXME: Eliminate VARNAME ## -## ------------------------ ## - - -# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) -# ------------------------------------------------------------------- -# CONFIGNAME is the name given to the value in the libtool script. -# VARNAME is the (base) name used in the configure script. -# VALUE may be 0, 1 or 2 for a computed quote escaped value based on -# VARNAME. Any other value will be used directly. -m4_define([_LT_DECL], -[lt_if_append_uniq([lt_decl_varnames], [$2], [, ], - [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], - [m4_ifval([$1], [$1], [$2])]) - lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) - m4_ifval([$4], - [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) - lt_dict_add_subkey([lt_decl_dict], [$2], - [tagged?], [m4_ifval([$5], [yes], [no])])]) -]) - - -# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) -# -------------------------------------------------------- -m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) - - -# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) -# ------------------------------------------------ -m4_define([lt_decl_tag_varnames], -[_lt_decl_filter([tagged?], [yes], $@)]) - - -# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) -# --------------------------------------------------------- -m4_define([_lt_decl_filter], -[m4_case([$#], - [0], [m4_fatal([$0: too few arguments: $#])], - [1], [m4_fatal([$0: too few arguments: $#: $1])], - [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], - [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], - [lt_dict_filter([lt_decl_dict], $@)])[]dnl -]) - - -# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) -# -------------------------------------------------- -m4_define([lt_decl_quote_varnames], -[_lt_decl_filter([value], [1], $@)]) - - -# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) -# --------------------------------------------------- -m4_define([lt_decl_dquote_varnames], -[_lt_decl_filter([value], [2], $@)]) - - -# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) -# --------------------------------------------------- -m4_define([lt_decl_varnames_tagged], -[m4_assert([$# <= 2])dnl -_$0(m4_quote(m4_default([$1], [[, ]])), - m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), - m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) -m4_define([_lt_decl_varnames_tagged], -[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) - - -# lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) -# ------------------------------------------------ -m4_define([lt_decl_all_varnames], -[_$0(m4_quote(m4_default([$1], [[, ]])), - m4_if([$2], [], - m4_quote(lt_decl_varnames), - m4_quote(m4_shift($@))))[]dnl -]) -m4_define([_lt_decl_all_varnames], -[lt_join($@, lt_decl_varnames_tagged([$1], - lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl -]) - - -# _LT_CONFIG_STATUS_DECLARE([VARNAME]) -# ------------------------------------ -# Quote a variable value, and forward it to `config.status' so that its -# declaration there will have the same value as in `configure'. VARNAME -# must have a single quote delimited value for this to work. -m4_define([_LT_CONFIG_STATUS_DECLARE], -[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) - - -# _LT_CONFIG_STATUS_DECLARATIONS -# ------------------------------ -# We delimit libtool config variables with single quotes, so when -# we write them to config.status, we have to be sure to quote all -# embedded single quotes properly. In configure, this macro expands -# each variable declared with _LT_DECL (and _LT_TAGDECL) into: -# -# ='`$ECHO "$" | $SED "$delay_single_quote_subst"`' -m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], -[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), - [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) - - -# _LT_LIBTOOL_TAGS -# ---------------- -# Output comment and list of tags supported by the script -m4_defun([_LT_LIBTOOL_TAGS], -[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl -available_tags="_LT_TAGS"dnl -]) - - -# _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) -# ----------------------------------- -# Extract the dictionary values for VARNAME (optionally with TAG) and -# expand to a commented shell variable setting: -# -# # Some comment about what VAR is for. -# visible_name=$lt_internal_name -m4_define([_LT_LIBTOOL_DECLARE], -[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], - [description])))[]dnl -m4_pushdef([_libtool_name], - m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl -m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), - [0], [_libtool_name=[$]$1], - [1], [_libtool_name=$lt_[]$1], - [2], [_libtool_name=$lt_[]$1], - [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl -m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl -]) - - -# _LT_LIBTOOL_CONFIG_VARS -# ----------------------- -# Produce commented declarations of non-tagged libtool config variables -# suitable for insertion in the LIBTOOL CONFIG section of the `libtool' -# script. Tagged libtool config variables (even for the LIBTOOL CONFIG -# section) are produced by _LT_LIBTOOL_TAG_VARS. -m4_defun([_LT_LIBTOOL_CONFIG_VARS], -[m4_foreach([_lt_var], - m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), - [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) - - -# _LT_LIBTOOL_TAG_VARS(TAG) -# ------------------------- -m4_define([_LT_LIBTOOL_TAG_VARS], -[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), - [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) - - -# _LT_TAGVAR(VARNAME, [TAGNAME]) -# ------------------------------ -m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) - - -# _LT_CONFIG_COMMANDS -# ------------------- -# Send accumulated output to $CONFIG_STATUS. Thanks to the lists of -# variables for single and double quote escaping we saved from calls -# to _LT_DECL, we can put quote escaped variables declarations -# into `config.status', and then the shell code to quote escape them in -# for loops in `config.status'. Finally, any additional code accumulated -# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. -m4_defun([_LT_CONFIG_COMMANDS], -[AC_PROVIDE_IFELSE([LT_OUTPUT], - dnl If the libtool generation code has been placed in $CONFIG_LT, - dnl instead of duplicating it all over again into config.status, - dnl then we will have config.status run $CONFIG_LT later, so it - dnl needs to know what name is stored there: - [AC_CONFIG_COMMANDS([libtool], - [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], - dnl If the libtool generation code is destined for config.status, - dnl expand the accumulated commands and init code now: - [AC_CONFIG_COMMANDS([libtool], - [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) -])#_LT_CONFIG_COMMANDS - - -# Initialize. -m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], -[ - -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -sed_quote_subst='$sed_quote_subst' -double_quote_subst='$double_quote_subst' -delay_variable_subst='$delay_variable_subst' -_LT_CONFIG_STATUS_DECLARATIONS -LTCC='$LTCC' -LTCFLAGS='$LTCFLAGS' -compiler='$compiler_DEFAULT' - -# A function that is used when there is no print builtin or printf. -func_fallback_echo () -{ - eval 'cat <<_LTECHO_EOF -\$[]1 -_LTECHO_EOF' -} - -# Quote evaled strings. -for var in lt_decl_all_varnames([[ \ -]], lt_decl_quote_varnames); do - case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in - *[[\\\\\\\`\\"\\\$]]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" - ;; - *) - eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" - ;; - esac -done - -# Double-quote double-evaled strings. -for var in lt_decl_all_varnames([[ \ -]], lt_decl_dquote_varnames); do - case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in - *[[\\\\\\\`\\"\\\$]]*) - eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" - ;; - *) - eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" - ;; - esac -done - -_LT_OUTPUT_LIBTOOL_INIT -]) - -# _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) -# ------------------------------------ -# Generate a child script FILE with all initialization necessary to -# reuse the environment learned by the parent script, and make the -# file executable. If COMMENT is supplied, it is inserted after the -# `#!' sequence but before initialization text begins. After this -# macro, additional text can be appended to FILE to form the body of -# the child script. The macro ends with non-zero status if the -# file could not be fully written (such as if the disk is full). -m4_ifdef([AS_INIT_GENERATED], -[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], -[m4_defun([_LT_GENERATED_FILE_INIT], -[m4_require([AS_PREPARE])]dnl -[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl -[lt_write_fail=0 -cat >$1 <<_ASEOF || lt_write_fail=1 -#! $SHELL -# Generated by $as_me. -$2 -SHELL=\${CONFIG_SHELL-$SHELL} -export SHELL -_ASEOF -cat >>$1 <<\_ASEOF || lt_write_fail=1 -AS_SHELL_SANITIZE -_AS_PREPARE -exec AS_MESSAGE_FD>&1 -_ASEOF -test $lt_write_fail = 0 && chmod +x $1[]dnl -m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT - -# LT_OUTPUT -# --------- -# This macro allows early generation of the libtool script (before -# AC_OUTPUT is called), incase it is used in configure for compilation -# tests. -AC_DEFUN([LT_OUTPUT], -[: ${CONFIG_LT=./config.lt} -AC_MSG_NOTICE([creating $CONFIG_LT]) -_LT_GENERATED_FILE_INIT(["$CONFIG_LT"], -[# Run this file to recreate a libtool stub with the current configuration.]) - -cat >>"$CONFIG_LT" <<\_LTEOF -lt_cl_silent=false -exec AS_MESSAGE_LOG_FD>>config.log -{ - echo - AS_BOX([Running $as_me.]) -} >&AS_MESSAGE_LOG_FD - -lt_cl_help="\ -\`$as_me' creates a local libtool stub from the current configuration, -for use in further configure time tests before the real libtool is -generated. - -Usage: $[0] [[OPTIONS]] - - -h, --help print this help, then exit - -V, --version print version number, then exit - -q, --quiet do not print progress messages - -d, --debug don't remove temporary files - -Report bugs to ." - -lt_cl_version="\ -m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl -m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) -configured by $[0], generated by m4_PACKAGE_STRING. - -Copyright (C) 2010 Free Software Foundation, Inc. -This config.lt script is free software; the Free Software Foundation -gives unlimited permision to copy, distribute and modify it." - -while test $[#] != 0 -do - case $[1] in - --version | --v* | -V ) - echo "$lt_cl_version"; exit 0 ;; - --help | --h* | -h ) - echo "$lt_cl_help"; exit 0 ;; - --debug | --d* | -d ) - debug=: ;; - --quiet | --q* | --silent | --s* | -q ) - lt_cl_silent=: ;; - - -*) AC_MSG_ERROR([unrecognized option: $[1] -Try \`$[0] --help' for more information.]) ;; - - *) AC_MSG_ERROR([unrecognized argument: $[1] -Try \`$[0] --help' for more information.]) ;; - esac - shift -done - -if $lt_cl_silent; then - exec AS_MESSAGE_FD>/dev/null -fi -_LTEOF - -cat >>"$CONFIG_LT" <<_LTEOF -_LT_OUTPUT_LIBTOOL_COMMANDS_INIT -_LTEOF - -cat >>"$CONFIG_LT" <<\_LTEOF -AC_MSG_NOTICE([creating $ofile]) -_LT_OUTPUT_LIBTOOL_COMMANDS -AS_EXIT(0) -_LTEOF -chmod +x "$CONFIG_LT" - -# configure is writing to config.log, but config.lt does its own redirection, -# appending to config.log, which fails on DOS, as config.log is still kept -# open by configure. Here we exec the FD to /dev/null, effectively closing -# config.log, so it can be properly (re)opened and appended to by config.lt. -lt_cl_success=: -test "$silent" = yes && - lt_config_lt_args="$lt_config_lt_args --quiet" -exec AS_MESSAGE_LOG_FD>/dev/null -$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false -exec AS_MESSAGE_LOG_FD>>config.log -$lt_cl_success || AS_EXIT(1) -])# LT_OUTPUT - - -# _LT_CONFIG(TAG) -# --------------- -# If TAG is the built-in tag, create an initial libtool script with a -# default configuration from the untagged config vars. Otherwise add code -# to config.status for appending the configuration named by TAG from the -# matching tagged config vars. -m4_defun([_LT_CONFIG], -[m4_require([_LT_FILEUTILS_DEFAULTS])dnl -_LT_CONFIG_SAVE_COMMANDS([ - m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl - m4_if(_LT_TAG, [C], [ - # See if we are running on zsh, and set the options which allow our - # commands through without removal of \ escapes. - if test -n "${ZSH_VERSION+set}" ; then - setopt NO_GLOB_SUBST - fi - - cfgfile="${ofile}T" - trap "$RM \"$cfgfile\"; exit 1" 1 2 15 - $RM "$cfgfile" - - cat <<_LT_EOF >> "$cfgfile" -#! $SHELL - -# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. -# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION -# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: -# NOTE: Changes made to this file will be lost: look at ltmain.sh. -# -_LT_COPYING -_LT_LIBTOOL_TAGS - -# ### BEGIN LIBTOOL CONFIG -_LT_LIBTOOL_CONFIG_VARS -_LT_LIBTOOL_TAG_VARS -# ### END LIBTOOL CONFIG - -_LT_EOF - - case $host_os in - aix3*) - cat <<\_LT_EOF >> "$cfgfile" -# AIX sometimes has problems with the GCC collect2 program. For some -# reason, if we set the COLLECT_NAMES environment variable, the problems -# vanish in a puff of smoke. -if test "X${COLLECT_NAMES+set}" != Xset; then - COLLECT_NAMES= - export COLLECT_NAMES -fi -_LT_EOF - ;; - esac - - _LT_PROG_LTMAIN - - # We use sed instead of cat because bash on DJGPP gets confused if - # if finds mixed CR/LF and LF-only lines. Since sed operates in - # text mode, it properly converts lines to CR/LF. This bash problem - # is reportedly fixed, but why not run on old versions too? - sed '/^# 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)]) -AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_LIBTOOL_CXX], []) -dnl AC_DEFUN([AC_LIBTOOL_F77], []) -dnl AC_DEFUN([AC_LIBTOOL_FC], []) -dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) -dnl AC_DEFUN([AC_LIBTOOL_RC], []) - - -# _LT_TAG_COMPILER -# ---------------- -m4_defun([_LT_TAG_COMPILER], -[AC_REQUIRE([AC_PROG_CC])dnl - -_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl -_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl -_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl -_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl - -# If no C compiler was specified, use CC. -LTCC=${LTCC-"$CC"} - -# If no C compiler flags were specified, use CFLAGS. -LTCFLAGS=${LTCFLAGS-"$CFLAGS"} - -# Allow CC to be a program name with arguments. -compiler=$CC -])# _LT_TAG_COMPILER - - -# _LT_COMPILER_BOILERPLATE -# ------------------------ -# Check for compiler boilerplate output or warnings with -# the simple compiler test code. -m4_defun([_LT_COMPILER_BOILERPLATE], -[m4_require([_LT_DECL_SED])dnl -ac_outfile=conftest.$ac_objext -echo "$lt_simple_compile_test_code" >conftest.$ac_ext -eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err -_lt_compiler_boilerplate=`cat conftest.err` -$RM conftest* -])# _LT_COMPILER_BOILERPLATE - - -# _LT_LINKER_BOILERPLATE -# ---------------------- -# Check for linker boilerplate output or warnings with -# the simple link test code. -m4_defun([_LT_LINKER_BOILERPLATE], -[m4_require([_LT_DECL_SED])dnl -ac_outfile=conftest.$ac_objext -echo "$lt_simple_link_test_code" >conftest.$ac_ext -eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err -_lt_linker_boilerplate=`cat conftest.err` -$RM -r conftest* -])# _LT_LINKER_BOILERPLATE - -# _LT_REQUIRED_DARWIN_CHECKS -# ------------------------- -m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ - case $host_os in - rhapsody* | darwin*) - AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) - AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) - AC_CHECK_TOOL([LIPO], [lipo], [:]) - AC_CHECK_TOOL([OTOOL], [otool], [:]) - AC_CHECK_TOOL([OTOOL64], [otool64], [:]) - _LT_DECL([], [DSYMUTIL], [1], - [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) - _LT_DECL([], [NMEDIT], [1], - [Tool to change global to local symbols on Mac OS X]) - _LT_DECL([], [LIPO], [1], - [Tool to manipulate fat objects and archives on Mac OS X]) - _LT_DECL([], [OTOOL], [1], - [ldd/readelf like tool for Mach-O binaries on Mac OS X]) - _LT_DECL([], [OTOOL64], [1], - [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) - - AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], - [lt_cv_apple_cc_single_mod=no - if test -z "${LT_MULTI_MODULE}"; then - # By default we will add the -single_module flag. You can override - # by either setting the environment variable LT_MULTI_MODULE - # non-empty at configure time, or by adding -multi_module to the - # link flags. - rm -rf libconftest.dylib* - echo "int foo(void){return 1;}" > conftest.c - echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ --dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD - $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ - -dynamiclib -Wl,-single_module conftest.c 2>conftest.err - _lt_result=$? - if 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" - ]) - AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], - [lt_cv_ld_force_load=no - cat > conftest.c << _LT_EOF -int forced_loaded() { return 2;} -_LT_EOF - echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD - $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD - echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD - $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD - echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD - $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD - cat > conftest.c << _LT_EOF -int main() { return 0;} -_LT_EOF - echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD - $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err - _lt_result=$? - if test -f conftest && test ! -s conftest.err && test $_lt_result = 0 && $GREP forced_load conftest 2>&1 >/dev/null; then - lt_cv_ld_force_load=yes - else - cat conftest.err >&AS_MESSAGE_LOG_FD - fi - rm -f conftest.err libconftest.a conftest conftest.c - rm -rf conftest.dSYM - ]) - case $host_os in - rhapsody* | darwin1.[[012]]) - _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; - darwin1.*) - _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; - darwin*) # darwin 5.x on - # if running on 10.5 or later, the deployment target defaults - # to the OS version, if on x86, and 10.4, the deployment - # target defaults to 10.4. Don't you love it? - case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in - 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) - _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; - 10.[[012]]*) - _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; - 10.*) - _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; - esac - ;; - esac - if test "$lt_cv_apple_cc_single_mod" = "yes"; then - _lt_dar_single_mod='$single_module' - fi - if test "$lt_cv_ld_exported_symbols_list" = "yes"; then - _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' - else - _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' - fi - if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then - _lt_dsymutil='~$DSYMUTIL $lib || :' - else - _lt_dsymutil= - fi - ;; - esac -]) - - -# _LT_DARWIN_LINKER_FEATURES -# -------------------------- -# Checks for linker and compiler features on darwin -m4_defun([_LT_DARWIN_LINKER_FEATURES], -[ - m4_require([_LT_REQUIRED_DARWIN_CHECKS]) - _LT_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_TAGVAR(hardcode_direct, $1)=no - _LT_TAGVAR(hardcode_automatic, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported - if test "$lt_cv_ld_force_load" = "yes"; then - _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' - else - _LT_TAGVAR(whole_archive_flag_spec, $1)='' - fi - _LT_TAGVAR(link_all_deplibs, $1)=yes - _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" - case $cc_basename in - ifort*) _lt_dar_can_shared=yes ;; - *) _lt_dar_can_shared=$GCC ;; - esac - if test "$_lt_dar_can_shared" = "yes"; then - output_verbose_link_cmd=func_echo_all - _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" - _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" - _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" - _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" - m4_if([$1], [CXX], -[ if test "$lt_cv_apple_cc_single_mod" != "yes"; then - _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" - _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" - fi -],[]) - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi -]) - -# _LT_SYS_MODULE_PATH_AIX -# ----------------------- -# 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], -[m4_divert_text([M4SH-INIT], [$1 -])])# _LT_SHELL_INIT - - - -# _LT_PROG_ECHO_BACKSLASH -# ----------------------- -# Find how we can fake an echo command that does not interpret backslash. -# In particular, with Autoconf 2.60 or later we add some code to the start -# of the generated configure script which will find a shell with a builtin -# printf (which we can use as an echo command). -m4_defun([_LT_PROG_ECHO_BACKSLASH], -[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO -ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO - -AC_MSG_CHECKING([how to print strings]) -# Test print first, because it will be a builtin if present. -if test "X`print -r -- -n 2>/dev/null`" = X-n && \ - test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then - ECHO='print -r --' -elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then - ECHO='printf %s\n' -else - # Use this function as a fallback that always works. - func_fallback_echo () - { - eval 'cat <<_LTECHO_EOF -$[]1 -_LTECHO_EOF' - } - ECHO='func_fallback_echo' -fi - -# func_echo_all arg... -# Invoke $ECHO with all args, space-separated. -func_echo_all () -{ - $ECHO "$*" -} - -case "$ECHO" in - printf*) AC_MSG_RESULT([printf]) ;; - print*) AC_MSG_RESULT([print -r]) ;; - *) AC_MSG_RESULT([cat]) ;; -esac - -m4_ifdef([_AS_DETECT_SUGGESTED], -[_AS_DETECT_SUGGESTED([ - test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( - ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' - ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO - ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO - PATH=/empty FPATH=/empty; export PATH FPATH - test "X`printf %s $ECHO`" = "X$ECHO" \ - || test "X`print -r -- $ECHO`" = "X$ECHO" )])]) - -_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) -_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) -])# _LT_PROG_ECHO_BACKSLASH - - -# _LT_ENABLE_LOCK -# --------------- -m4_defun([_LT_ENABLE_LOCK], -[AC_ARG_ENABLE([libtool-lock], - [AS_HELP_STRING([--disable-libtool-lock], - [avoid locking (might break parallel builds)])]) -test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes - -# Some flags need to be propagated to the compiler or linker for good -# libtool support. -case $host in -ia64-*-hpux*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - case `/usr/bin/file conftest.$ac_objext` in - *ELF-32*) - HPUX_IA64_MODE="32" - ;; - *ELF-64*) - HPUX_IA64_MODE="64" - ;; - esac - fi - rm -rf conftest* - ;; -*-*-irix6*) - # Find out which ABI we are using. - echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - if test "$lt_cv_prog_gnu_ld" = yes; then - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - LD="${LD-ld} -melf32bsmip" - ;; - *N32*) - LD="${LD-ld} -melf32bmipn32" - ;; - *64-bit*) - LD="${LD-ld} -melf64bmip" - ;; - esac - else - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - LD="${LD-ld} -32" - ;; - *N32*) - LD="${LD-ld} -n32" - ;; - *64-bit*) - LD="${LD-ld} -64" - ;; - esac - fi - fi - rm -rf conftest* - ;; - -x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ -s390*-*linux*|s390*-*tpf*|sparc*-*linux*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - case `/usr/bin/file conftest.o` in - *32-bit*) - case $host in - x86_64-*kfreebsd*-gnu) - LD="${LD-ld} -m elf_i386_fbsd" - ;; - x86_64-*linux*) - LD="${LD-ld} -m elf_i386" - ;; - ppc64-*linux*|powerpc64-*linux*) - LD="${LD-ld} -m elf32ppclinux" - ;; - s390x-*linux*) - LD="${LD-ld} -m elf_s390" - ;; - sparc64-*linux*) - LD="${LD-ld} -m elf32_sparc" - ;; - esac - ;; - *64-bit*) - case $host in - x86_64-*kfreebsd*-gnu) - LD="${LD-ld} -m elf_x86_64_fbsd" - ;; - x86_64-*linux*) - LD="${LD-ld} -m elf_x86_64" - ;; - ppc*-*linux*|powerpc*-*linux*) - LD="${LD-ld} -m elf64ppc" - ;; - s390*-*linux*|s390*-*tpf*) - LD="${LD-ld} -m elf64_s390" - ;; - sparc*-*linux*) - LD="${LD-ld} -m elf64_sparc" - ;; - esac - ;; - esac - fi - rm -rf conftest* - ;; - -*-*-sco3.2v5*) - # On SCO OpenServer 5, we need -belf to get full-featured binaries. - SAVE_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -belf" - AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, - [AC_LANG_PUSH(C) - AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) - AC_LANG_POP]) - if test x"$lt_cv_cc_needs_belf" != x"yes"; then - # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf - CFLAGS="$SAVE_CFLAGS" - fi - ;; -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 - -case $host_os in - darwin*) - lock_old_archive_extraction=yes ;; - *) - lock_old_archive_extraction=no ;; -esac -_LT_DECL([], [old_postinstall_cmds], [2]) -_LT_DECL([], [old_postuninstall_cmds], [2]) -_LT_TAGDECL([], [old_archive_cmds], [2], - [Commands used to build an old-style archive]) -_LT_DECL([], [lock_old_archive_extraction], [0], - [Whether to use a lock for old archive extraction]) -])# _LT_CMD_OLD_ARCHIVE - - -# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, -# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) -# ---------------------------------------------------------------- -# Check whether the given compiler option works -AC_DEFUN([_LT_COMPILER_OPTION], -[m4_require([_LT_FILEUTILS_DEFAULTS])dnl -m4_require([_LT_DECL_SED])dnl -AC_CACHE_CHECK([$1], [$2], - [$2=no - m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="$3" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - # The option is referenced via a variable to avoid confusing sed. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&AS_MESSAGE_LOG_FD - echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD - if (exit $ac_status) && test -s "$ac_outfile"; then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings other than the usual output. - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then - $2=yes - fi - fi - $RM conftest* -]) - -if test x"[$]$2" = xyes; then - m4_if([$5], , :, [$5]) -else - m4_if([$6], , :, [$6]) -fi -])# _LT_COMPILER_OPTION - -# Old name: -AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) - - -# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, -# [ACTION-SUCCESS], [ACTION-FAILURE]) -# ---------------------------------------------------- -# Check whether the given linker option works -AC_DEFUN([_LT_LINKER_OPTION], -[m4_require([_LT_FILEUTILS_DEFAULTS])dnl -m4_require([_LT_DECL_SED])dnl -AC_CACHE_CHECK([$1], [$2], - [$2=no - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS $3" - echo "$lt_simple_link_test_code" > conftest.$ac_ext - if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then - # The linker can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s conftest.err; then - # Append any errors to the config.log. - cat conftest.err 1>&AS_MESSAGE_LOG_FD - $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if diff conftest.exp conftest.er2 >/dev/null; then - $2=yes - fi - else - $2=yes - fi - fi - $RM -r conftest* - LDFLAGS="$save_LDFLAGS" -]) - -if test x"[$]$2" = xyes; then - m4_if([$4], , :, [$4]) -else - m4_if([$5], , :, [$5]) -fi -])# _LT_LINKER_OPTION - -# Old name: -AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) - - -# LT_CMD_MAX_LEN -#--------------- -AC_DEFUN([LT_CMD_MAX_LEN], -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -# find the maximum length of command line arguments -AC_MSG_CHECKING([the maximum length of command line arguments]) -AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl - i=0 - teststring="ABCD" - - case $build_os in - msdosdjgpp*) - # On DJGPP, this test can blow up pretty badly due to problems in libc - # (any single argument exceeding 2000 bytes causes a buffer overrun - # during glob expansion). Even if it were fixed, the result of this - # check would be larger than it should be. - lt_cv_sys_max_cmd_len=12288; # 12K is about right - ;; - - gnu*) - # Under GNU Hurd, this test is not required because there is - # no limit to the length of command line arguments. - # Libtool will interpret -1 as no limit whatsoever - lt_cv_sys_max_cmd_len=-1; - ;; - - cygwin* | mingw* | cegcc*) - # On Win9x/ME, this test blows up -- it succeeds, but takes - # about 5 minutes as the teststring grows exponentially. - # Worse, since 9x/ME are not pre-emptively multitasking, - # you end up with a "frozen" computer, even though with patience - # the test eventually succeeds (with a max line length of 256k). - # Instead, let's just punt: use the minimum linelength reported by - # all of the supported platforms: 8192 (on NT/2K/XP). - lt_cv_sys_max_cmd_len=8192; - ;; - - mint*) - # On MiNT this can take a long time and run out of memory. - lt_cv_sys_max_cmd_len=8192; - ;; - - amigaos*) - # On AmigaOS with pdksh, this test takes hours, literally. - # So we just punt and use a minimum line length of 8192. - lt_cv_sys_max_cmd_len=8192; - ;; - - netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) - # This has been around since 386BSD, at least. Likely further. - if test -x /sbin/sysctl; then - lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` - elif test -x /usr/sbin/sysctl; then - lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` - else - lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs - fi - # And add a safety zone - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` - ;; - - interix*) - # We know the value 262144 and hardcode it with a safety zone (like BSD) - lt_cv_sys_max_cmd_len=196608 - ;; - - 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"`func_fallback_echo "$teststring$teststring" 2>/dev/null` \ - = "X$teststring$teststring"; } >/dev/null 2>&1 && - test $i != 17 # 1/2 MB should be enough - do - i=`expr $i + 1` - teststring=$teststring$teststring - done - # Only check the string length outside the loop. - lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` - teststring= - # Add a significant safety factor because C++ compilers can tack on - # massive amounts of additional arguments before passing them to the - # linker. It appears as though 1/2 is a usable value. - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` - fi - ;; - esac -]) -if test -n $lt_cv_sys_max_cmd_len ; then - AC_MSG_RESULT($lt_cv_sys_max_cmd_len) -else - AC_MSG_RESULT(none) -fi -max_cmd_len=$lt_cv_sys_max_cmd_len -_LT_DECL([], [max_cmd_len], [0], - [What is the maximum length of a command?]) -])# LT_CMD_MAX_LEN - -# Old name: -AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) - - -# _LT_HEADER_DLFCN -# ---------------- -m4_defun([_LT_HEADER_DLFCN], -[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl -])# _LT_HEADER_DLFCN - - -# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, -# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) -# ---------------------------------------------------------------- -m4_defun([_LT_TRY_DLOPEN_SELF], -[m4_require([_LT_HEADER_DLFCN])dnl -if test "$cross_compiling" = yes; then : - [$4] -else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<_LT_EOF -[#line $LINENO "configure" -#include "confdefs.h" - -#if HAVE_DLFCN_H -#include -#endif - -#include - -#ifdef RTLD_GLOBAL -# define LT_DLGLOBAL RTLD_GLOBAL -#else -# ifdef DL_GLOBAL -# define LT_DLGLOBAL DL_GLOBAL -# else -# define LT_DLGLOBAL 0 -# endif -#endif - -/* We may have to define LT_DLLAZY_OR_NOW in the command line if we - find out it does not work in some platform. */ -#ifndef LT_DLLAZY_OR_NOW -# ifdef RTLD_LAZY -# define LT_DLLAZY_OR_NOW RTLD_LAZY -# else -# ifdef DL_LAZY -# define LT_DLLAZY_OR_NOW DL_LAZY -# else -# ifdef RTLD_NOW -# define LT_DLLAZY_OR_NOW RTLD_NOW -# else -# ifdef DL_NOW -# define LT_DLLAZY_OR_NOW DL_NOW -# else -# define LT_DLLAZY_OR_NOW 0 -# endif -# endif -# endif -# endif -#endif - -/* When -fvisbility=hidden is used, assume the code has been annotated - correspondingly for the symbols needed. */ -#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) -void fnord () __attribute__((visibility("default"))); -#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; - else puts (dlerror ()); - } - /* dlclose (self); */ - } - else - puts (dlerror ()); - - return status; -}] -_LT_EOF - if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then - (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null - lt_status=$? - case x$lt_status in - x$lt_dlno_uscore) $1 ;; - x$lt_dlneed_uscore) $2 ;; - x$lt_dlunknown|x*) $3 ;; - esac - else : - # compilation failed - $3 - fi -fi -rm -fr conftest* -])# _LT_TRY_DLOPEN_SELF - - -# LT_SYS_DLOPEN_SELF -# ------------------ -AC_DEFUN([LT_SYS_DLOPEN_SELF], -[m4_require([_LT_HEADER_DLFCN])dnl -if test "x$enable_dlopen" != xyes; then - enable_dlopen=unknown - enable_dlopen_self=unknown - enable_dlopen_self_static=unknown -else - lt_cv_dlopen=no - lt_cv_dlopen_libs= - - case $host_os in - beos*) - lt_cv_dlopen="load_add_on" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes - ;; - - mingw* | pw32* | cegcc*) - lt_cv_dlopen="LoadLibrary" - lt_cv_dlopen_libs= - ;; - - cygwin*) - lt_cv_dlopen="dlopen" - lt_cv_dlopen_libs= - ;; - - darwin*) - # if libdl is installed we need to link against it - AC_CHECK_LIB([dl], [dlopen], - [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ - lt_cv_dlopen="dyld" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes - ]) - ;; - - *) - AC_CHECK_FUNC([shl_load], - [lt_cv_dlopen="shl_load"], - [AC_CHECK_LIB([dld], [shl_load], - [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"], - [AC_CHECK_FUNC([dlopen], - [lt_cv_dlopen="dlopen"], - [AC_CHECK_LIB([dl], [dlopen], - [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], - [AC_CHECK_LIB([svld], [dlopen], - [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], - [AC_CHECK_LIB([dld], [dld_link], - [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"]) - ]) - ]) - ]) - ]) - ]) - ;; - esac - - if test "x$lt_cv_dlopen" != xno; then - enable_dlopen=yes - else - enable_dlopen=no - fi - - case $lt_cv_dlopen in - dlopen) - save_CPPFLAGS="$CPPFLAGS" - test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" - - save_LDFLAGS="$LDFLAGS" - wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" - - save_LIBS="$LIBS" - LIBS="$lt_cv_dlopen_libs $LIBS" - - AC_CACHE_CHECK([whether a program can dlopen itself], - lt_cv_dlopen_self, [dnl - _LT_TRY_DLOPEN_SELF( - lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, - lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) - ]) - - if test "x$lt_cv_dlopen_self" = xyes; then - wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" - AC_CACHE_CHECK([whether a statically linked program can dlopen itself], - lt_cv_dlopen_self_static, [dnl - _LT_TRY_DLOPEN_SELF( - lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, - lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) - ]) - fi - - CPPFLAGS="$save_CPPFLAGS" - LDFLAGS="$save_LDFLAGS" - LIBS="$save_LIBS" - ;; - esac - - case $lt_cv_dlopen_self in - yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; - *) enable_dlopen_self=unknown ;; - esac - - case $lt_cv_dlopen_self_static in - yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; - *) enable_dlopen_self_static=unknown ;; - esac -fi -_LT_DECL([dlopen_support], [enable_dlopen], [0], - [Whether dlopen is supported]) -_LT_DECL([dlopen_self], [enable_dlopen_self], [0], - [Whether dlopen of programs is supported]) -_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], - [Whether dlopen of statically linked programs is supported]) -])# LT_SYS_DLOPEN_SELF - -# Old name: -AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) - - -# _LT_COMPILER_C_O([TAGNAME]) -# --------------------------- -# Check to see if options -c and -o are simultaneously supported by compiler. -# This macro does not hard code the compiler like AC_PROG_CC_C_O. -m4_defun([_LT_COMPILER_C_O], -[m4_require([_LT_DECL_SED])dnl -m4_require([_LT_FILEUTILS_DEFAULTS])dnl -m4_require([_LT_TAG_COMPILER])dnl -AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], - [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], - [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no - $RM -r conftest 2>/dev/null - mkdir conftest - cd conftest - mkdir out - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - - lt_compiler_flag="-o out/conftest2.$ac_objext" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&AS_MESSAGE_LOG_FD - echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD - if (exit $ac_status) && test -s out/conftest2.$ac_objext - then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp - $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 - if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then - _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes - fi - fi - chmod u+w . 2>&AS_MESSAGE_LOG_FD - $RM conftest* - # SGI C++ compiler will create directory out/ii_files/ for - # template instantiation - test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files - $RM out/* && rmdir out - cd .. - $RM -r conftest - $RM conftest* -]) -_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], - [Does compiler simultaneously support -c and -o options?]) -])# _LT_COMPILER_C_O - - -# _LT_COMPILER_FILE_LOCKS([TAGNAME]) -# ---------------------------------- -# Check to see if we can do hard links to lock some files if needed -m4_defun([_LT_COMPILER_FILE_LOCKS], -[m4_require([_LT_ENABLE_LOCK])dnl -m4_require([_LT_FILEUTILS_DEFAULTS])dnl -_LT_COMPILER_C_O([$1]) - -hard_links="nottested" -if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then - # do not overwrite the value of need_locks provided by the user - AC_MSG_CHECKING([if we can lock with hard links]) - hard_links=yes - $RM conftest* - ln conftest.a conftest.b 2>/dev/null && hard_links=no - touch conftest.a - ln conftest.a conftest.b 2>&5 || hard_links=no - ln conftest.a conftest.b 2>/dev/null && hard_links=no - AC_MSG_RESULT([$hard_links]) - if test "$hard_links" = no; then - AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) - need_locks=warn - fi -else - need_locks=no -fi -_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) -])# _LT_COMPILER_FILE_LOCKS - - -# _LT_CHECK_OBJDIR -# ---------------- -m4_defun([_LT_CHECK_OBJDIR], -[AC_CACHE_CHECK([for objdir], [lt_cv_objdir], -[rm -f .libs 2>/dev/null -mkdir .libs 2>/dev/null -if test -d .libs; then - lt_cv_objdir=.libs -else - # MS-DOS does not allow filenames that begin with a dot. - lt_cv_objdir=_libs -fi -rmdir .libs 2>/dev/null]) -objdir=$lt_cv_objdir -_LT_DECL([], [objdir], [0], - [The name of the directory that contains temporary libtool files])dnl -m4_pattern_allow([LT_OBJDIR])dnl -AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/", - [Define to the sub-directory in which libtool stores uninstalled libraries.]) -])# _LT_CHECK_OBJDIR - - -# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) -# -------------------------------------- -# Check hardcoding attributes. -m4_defun([_LT_LINKER_HARDCODE_LIBPATH], -[AC_MSG_CHECKING([how to hardcode library paths into programs]) -_LT_TAGVAR(hardcode_action, $1)= -if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || - test -n "$_LT_TAGVAR(runpath_var, $1)" || - test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then - - # We can hardcode non-existent directories. - if test "$_LT_TAGVAR(hardcode_direct, $1)" != no && - # If the only mechanism to avoid hardcoding is shlibpath_var, we - # have to relink, otherwise we might link with an installed library - # when we should be linking with a yet-to-be-installed one - ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no && - test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then - # Linking always hardcodes the temporary library directory. - _LT_TAGVAR(hardcode_action, $1)=relink - else - # We can link without hardcoding, and we can hardcode nonexisting dirs. - _LT_TAGVAR(hardcode_action, $1)=immediate - fi -else - # We cannot hardcode anything, or else we can only hardcode existing - # directories. - _LT_TAGVAR(hardcode_action, $1)=unsupported -fi -AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) - -if test "$_LT_TAGVAR(hardcode_action, $1)" = relink || - test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then - # Fast installation is not supported - enable_fast_install=no -elif test "$shlibpath_overrides_runpath" = yes || - test "$enable_shared" = no; then - # Fast installation is not necessary - enable_fast_install=needless -fi -_LT_TAGDECL([], [hardcode_action], [0], - [How to hardcode a shared library path into an executable]) -])# _LT_LINKER_HARDCODE_LIBPATH - - -# _LT_CMD_STRIPLIB -# ---------------- -m4_defun([_LT_CMD_STRIPLIB], -[m4_require([_LT_DECL_EGREP]) -striplib= -old_striplib= -AC_MSG_CHECKING([whether stripping libraries is possible]) -if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then - test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" - test -z "$striplib" && striplib="$STRIP --strip-unneeded" - AC_MSG_RESULT([yes]) -else -# FIXME - insert some real tests, host_os isn't really good enough - case $host_os in - darwin*) - if test -n "$STRIP" ; then - striplib="$STRIP -x" - old_striplib="$STRIP -S" - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) - fi - ;; - *) - AC_MSG_RESULT([no]) - ;; - esac -fi -_LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) -_LT_DECL([], [striplib], [1]) -])# _LT_CMD_STRIPLIB - - -# _LT_SYS_DYNAMIC_LINKER([TAG]) -# ----------------------------- -# PORTME Fill in your ld.so characteristics -m4_defun([_LT_SYS_DYNAMIC_LINKER], -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -m4_require([_LT_DECL_EGREP])dnl -m4_require([_LT_FILEUTILS_DEFAULTS])dnl -m4_require([_LT_DECL_OBJDUMP])dnl -m4_require([_LT_DECL_SED])dnl -m4_require([_LT_CHECK_SHELL_FEATURES])dnl -AC_MSG_CHECKING([dynamic linker characteristics]) -m4_if([$1], - [], [ -if test "$GCC" = yes; then - case $host_os in - darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; - *) lt_awk_arg="/^libraries:/" ;; - esac - case $host_os in - mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;; - *) lt_sed_strip_eq="s,=/,/,g" ;; - esac - lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` - case $lt_search_path_spec in - *\;*) - # if the path contains ";" then we assume it to be the separator - # otherwise default to the standard path separator (i.e. ":") - it is - # assumed that no part of a normal pathname contains ";" but that should - # okay in the real world where ";" in dirpaths is itself problematic. - lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` - ;; - *) - lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` - ;; - esac - # Ok, now we have the path, separated by spaces, we can step through it - # and add multilib dir if necessary. - lt_tmp_lt_search_path_spec= - lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` - for lt_sys_path in $lt_search_path_spec; do - if test -d "$lt_sys_path/$lt_multi_os_dir"; then - lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" - else - test -d "$lt_sys_path" && \ - lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" - fi - done - lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' -BEGIN {RS=" "; FS="/|\n";} { - lt_foo=""; - lt_count=0; - for (lt_i = NF; lt_i > 0; lt_i--) { - if ($lt_i != "" && $lt_i != ".") { - if ($lt_i == "..") { - lt_count++; - } else { - if (lt_count == 0) { - lt_foo="/" $lt_i lt_foo; - } else { - lt_count--; - } - } - } - } - if (lt_foo != "") { lt_freq[[lt_foo]]++; } - if (lt_freq[[lt_foo]] == 1) { print lt_foo; } -}'` - # AWK program above erroneously prepends '/' to C:/dos/paths - # for these hosts. - case $host_os in - mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ - $SED 's,/\([[A-Za-z]]:\),\1,g'` ;; - esac - sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` -else - sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" -fi]) -library_names_spec= -libname_spec='lib$name' -soname_spec= -shrext_cmds=".so" -postinstall_cmds= -postuninstall_cmds= -finish_cmds= -finish_eval= -shlibpath_var= -shlibpath_overrides_runpath=unknown -version_type=none -dynamic_linker="$host_os ld.so" -sys_lib_dlsearch_path_spec="/lib /usr/lib" -need_lib_prefix=unknown -hardcode_into_libs=no - -# when you set need_version to no, make sure it does not cause -set_version -# flags to be left without arguments -need_version=unknown - -case $host_os in -aix3*) - version_type=linux - 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.so - # instead of lib.a to let people know that these are not - # typical AIX shared libraries. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - else - # We preserve .a as extension for shared libraries through AIX4.2 - # and later when we are not doing run time linking. - library_names_spec='${libname}${release}.a $libname.a' - soname_spec='${libname}${release}${shared_ext}$major' - fi - shlibpath_var=LIBPATH - fi - ;; - -amigaos*) - case $host_cpu in - powerpc) - # Since July 2007 AmigaOS4 officially supports .so libraries. - # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - ;; - m68k) - library_names_spec='$libname.ixlibrary $libname.a' - # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' - ;; - esac - ;; - -beos*) - library_names_spec='${libname}${shared_ext}' - dynamic_linker="$host_os ld.so" - shlibpath_var=LIBRARY_PATH - ;; - -bsdi[[45]]*) - version_type=linux - 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}' -m4_if([$1], [],[ - sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) - ;; - mingw* | cegcc*) - # MinGW DLLs use traditional 'lib' prefix - soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' - ;; - pw32*) - # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' - ;; - esac - ;; - - *) - 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 - ;; - -haiku*) - version_type=linux - need_lib_prefix=no - need_version=no - dynamic_linker="$host_os runtime_loader" - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LIBRARY_PATH - shlibpath_overrides_runpath=yes - sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' - hardcode_into_libs=yes - ;; - -hpux9* | hpux10* | hpux11*) - # Give a soname corresponding to the major version so that dld.sl refuses to - # link against other versions. - version_type=sunos - need_lib_prefix=no - need_version=no - case $host_cpu in - ia64*) - shrext_cmds='.so' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.so" - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - if test "X$HPUX_IA64_MODE" = X32; then - sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" - else - sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" - fi - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - hppa*64*) - shrext_cmds='.sl' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.sl" - shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - *) - shrext_cmds='.sl' - dynamic_linker="$host_os dld.sl" - shlibpath_var=SHLIB_PATH - shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - ;; - esac - # HP-UX runs *really* slowly unless shared libraries are mode 555, ... - postinstall_cmds='chmod 555 $lib' - # or fails outright, so override atomically: - install_override_mode=555 - ;; - -interix[[3-9]]*) - version_type=linux - 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 | kopensolaris*-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 - AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath], - [lt_cv_shlibpath_overrides_runpath=no - save_LDFLAGS=$LDFLAGS - save_libdir=$libdir - eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ - LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" - AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], - [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], - [lt_cv_shlibpath_overrides_runpath=yes])]) - LDFLAGS=$save_LDFLAGS - libdir=$save_libdir - ]) - shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath - - # This implies no fast_install, which is unacceptable. - # Some rework will be needed to allow for fast_install - # before this can be enabled. - hardcode_into_libs=yes - - # Add ABI-specific directories to the system library path. - sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib" - - # Append ld.so.conf contents to the search path - if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` - sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" - - fi - - # We used to test for /lib/ld.so.1 and disable shared libraries on - # powerpc, because MkLinux only supported shared libraries with the - # GNU dynamic linker. Since this was broken with cross compilers, - # most powerpc-linux boxes support dynamic linking these days and - # people can always --disable-shared, the test was removed, and we - # assume the GNU/Linux dynamic linker is in use. - dynamic_linker='GNU/Linux ld.so' - ;; - -netbsd*) - version_type=sunos - need_lib_prefix=no - need_version=no - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - dynamic_linker='NetBSD (a.out) ld.so' - else - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - dynamic_linker='NetBSD ld.elf_so' - fi - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - -newsos6) - version_type=linux - 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([], [install_override_mode], [1], - [Permission mode override for installation of shared libraries]) -_LT_DECL([], [postinstall_cmds], [2], - [Command to use after installation of a shared archive]) -_LT_DECL([], [postuninstall_cmds], [2], - [Command to use after uninstallation of a shared archive]) -_LT_DECL([], [finish_cmds], [2], - [Commands used to finish a libtool library installation in a directory]) -_LT_DECL([], [finish_eval], [1], - [[As "finish_cmds", except a single script fragment to be evaled but - not shown]]) -_LT_DECL([], [hardcode_into_libs], [0], - [Whether we should hardcode library paths into libraries]) -_LT_DECL([], [sys_lib_search_path_spec], [2], - [Compile-time system search path for libraries]) -_LT_DECL([], [sys_lib_dlsearch_path_spec], [2], - [Run-time system search path for libraries]) -])# _LT_SYS_DYNAMIC_LINKER - - -# _LT_PATH_TOOL_PREFIX(TOOL) -# -------------------------- -# find a file program which can recognize shared library -AC_DEFUN([_LT_PATH_TOOL_PREFIX], -[m4_require([_LT_DECL_EGREP])dnl -AC_MSG_CHECKING([for $1]) -AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, -[case $MAGIC_CMD in -[[\\/*] | ?:[\\/]*]) - lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. - ;; -*) - lt_save_MAGIC_CMD="$MAGIC_CMD" - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR -dnl $ac_dummy forces splitting on constant user-supplied paths. -dnl POSIX.2 word splitting is done only on the output of word expansions, -dnl not every word. This closes a longstanding sh security hole. - ac_dummy="m4_if([$2], , $PATH, [$2])" - for ac_dir in $ac_dummy; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$1; then - lt_cv_path_MAGIC_CMD="$ac_dir/$1" - if test -n "$file_magic_test_file"; then - case $deplibs_check_method in - "file_magic "*) - file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` - MAGIC_CMD="$lt_cv_path_MAGIC_CMD" - if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | - $EGREP "$file_magic_regex" > /dev/null; then - : - else - cat <<_LT_EOF 1>&2 - -*** Warning: the command libtool uses to detect shared libraries, -*** $file_magic_cmd, produces output that libtool cannot recognize. -*** The result is that libtool may fail to recognize shared libraries -*** as such. This will affect the creation of libtool libraries that -*** depend on shared libraries, but programs linked with such libtool -*** libraries will work regardless of this problem. Nevertheless, you -*** may want to report the problem to your system manager and/or to -*** bug-libtool@gnu.org - -_LT_EOF - fi ;; - esac - fi - break - fi - done - IFS="$lt_save_ifs" - MAGIC_CMD="$lt_save_MAGIC_CMD" - ;; -esac]) -MAGIC_CMD="$lt_cv_path_MAGIC_CMD" -if test -n "$MAGIC_CMD"; then - AC_MSG_RESULT($MAGIC_CMD) -else - AC_MSG_RESULT(no) -fi -_LT_DECL([], [MAGIC_CMD], [0], - [Used to examine libraries when file_magic_cmd begins with "file"])dnl -])# _LT_PATH_TOOL_PREFIX - -# Old name: -AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) - - -# _LT_PATH_MAGIC -# -------------- -# find a file program which can recognize a shared library -m4_defun([_LT_PATH_MAGIC], -[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) -if test -z "$lt_cv_path_MAGIC_CMD"; then - if test -n "$ac_tool_prefix"; then - _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) - else - MAGIC_CMD=: - fi -fi -])# _LT_PATH_MAGIC - - -# LT_PATH_LD -# ---------- -# find the pathname to the GNU or non-GNU linker -AC_DEFUN([LT_PATH_LD], -[AC_REQUIRE([AC_PROG_CC])dnl -AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_REQUIRE([AC_CANONICAL_BUILD])dnl -m4_require([_LT_DECL_SED])dnl -m4_require([_LT_DECL_EGREP])dnl -m4_require([_LT_PROG_ECHO_BACKSLASH])dnl - -AC_ARG_WITH([gnu-ld], - [AS_HELP_STRING([--with-gnu-ld], - [assume the C compiler uses GNU ld @<:@default=no@:>@])], - [test "$withval" = no || with_gnu_ld=yes], - [with_gnu_ld=no])dnl - -ac_prog=ld -if test "$GCC" = yes; then - # Check if gcc -print-prog-name=ld gives a path. - AC_MSG_CHECKING([for ld used by $CC]) - case $host in - *-*-mingw*) - # gcc leaves a trailing carriage return which upsets mingw - ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; - *) - ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; - esac - case $ac_prog in - # Accept absolute paths. - [[\\/]]* | ?:[[\\/]]*) - re_direlt='/[[^/]][[^/]]*/\.\./' - # Canonicalize the pathname of ld - ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` - while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do - ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` - done - test -z "$LD" && LD="$ac_prog" - ;; - "") - # If it fails, then pretend we aren't using GCC. - ac_prog=ld - ;; - *) - # If it is relative, then search for the first ld in PATH. - with_gnu_ld=unknown - ;; - esac -elif test "$with_gnu_ld" = yes; then - AC_MSG_CHECKING([for GNU ld]) -else - AC_MSG_CHECKING([for non-GNU ld]) -fi -AC_CACHE_VAL(lt_cv_path_LD, -[if test -z "$LD"; then - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for ac_dir in $PATH; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then - lt_cv_path_LD="$ac_dir/$ac_prog" - # Check to see if the program is GNU ld. I'd rather use --version, - # but apparently some variants of GNU ld only accept -v. - # Break only if it was the GNU/non-GNU ld that we prefer. - case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null 2>&1; then - lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' - lt_cv_file_magic_cmd='func_win32_libid' - else - # Keep this pattern in sync with the one in func_win32_libid. - lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' - lt_cv_file_magic_cmd='$OBJDUMP -f' - fi - ;; - -cegcc*) - # use the weaker test based on 'objdump'. See mingw*. - lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' - lt_cv_file_magic_cmd='$OBJDUMP -f' - ;; - -darwin* | rhapsody*) - lt_cv_deplibs_check_method=pass_all - ;; - -freebsd* | dragonfly*) - if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then - case $host_cpu in - i*86 ) - # Not sure whether the presence of OpenBSD here was a mistake. - # Let's accept both of them until this is cleared up. - lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` - ;; - esac - else - lt_cv_deplibs_check_method=pass_all - fi - ;; - -gnu*) - lt_cv_deplibs_check_method=pass_all - ;; - -haiku*) - lt_cv_deplibs_check_method=pass_all - ;; - -hpux10.20* | hpux11*) - lt_cv_file_magic_cmd=/usr/bin/file - case $host_cpu in - ia64*) - lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' - lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so - ;; - hppa*64*) - [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'] - lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl - ;; - *) - lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library' - lt_cv_file_magic_test_file=/usr/lib/libc.sl - ;; - esac - ;; - -interix[[3-9]]*) - # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here - lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' - ;; - -irix5* | irix6* | nonstopux*) - case $LD in - *-32|*"-32 ") libmagic=32-bit;; - *-n32|*"-n32 ") libmagic=N32;; - *-64|*"-64 ") libmagic=64-bit;; - *) libmagic=never-match;; - esac - lt_cv_deplibs_check_method=pass_all - ;; - -# This must be Linux ELF. -linux* | k*bsd*-gnu | kopensolaris*-gnu) - lt_cv_deplibs_check_method=pass_all - ;; - -netbsd*) - if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then - lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' - else - lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' - fi - ;; - -newos6*) - lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=/usr/lib/libnls.so - ;; - -*nto* | *qnx*) - lt_cv_deplibs_check_method=pass_all - ;; - -openbsd*) - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' - else - lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' - fi - ;; - -osf3* | osf4* | osf5*) - lt_cv_deplibs_check_method=pass_all - ;; - -rdos*) - lt_cv_deplibs_check_method=pass_all - ;; - -solaris*) - lt_cv_deplibs_check_method=pass_all - ;; - -sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) - lt_cv_deplibs_check_method=pass_all - ;; - -sysv4 | sysv4.3*) - case $host_vendor in - motorola) - lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` - ;; - ncr) - lt_cv_deplibs_check_method=pass_all - ;; - sequent) - lt_cv_file_magic_cmd='/bin/file' - lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' - ;; - sni) - lt_cv_file_magic_cmd='/bin/file' - lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" - lt_cv_file_magic_test_file=/lib/libc.so - ;; - siemens) - lt_cv_deplibs_check_method=pass_all - ;; - pc) - lt_cv_deplibs_check_method=pass_all - ;; - esac - ;; - -tpf*) - lt_cv_deplibs_check_method=pass_all - ;; -esac -]) -file_magic_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. - if test -n "$DUMPBIN"; then : - # Let the user override the test. - else - AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) - case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in - *COFF*) - DUMPBIN="$DUMPBIN -symbols" - ;; - *) - DUMPBIN=: - ;; - esac - fi - AC_SUBST([DUMPBIN]) - if test "$DUMPBIN" != ":"; then - NM="$DUMPBIN" - fi -fi -test -z "$NM" && NM=nm -AC_SUBST([NM]) -_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl - -AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], - [lt_cv_nm_interface="BSD nm" - echo "int some_variable = 0;" > conftest.$ac_ext - (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) - (eval "$ac_compile" 2>conftest.err) - cat conftest.err >&AS_MESSAGE_LOG_FD - (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) - (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) - cat conftest.err >&AS_MESSAGE_LOG_FD - (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) - cat conftest.out >&AS_MESSAGE_LOG_FD - if $GREP 'External.*some_variable' conftest.out > /dev/null; then - lt_cv_nm_interface="MS dumpbin" - fi - rm -f conftest*]) -])# LT_PATH_NM - -# Old names: -AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) -AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AM_PROG_NM], []) -dnl AC_DEFUN([AC_PROG_NM], []) - - -# LT_LIB_M -# -------- -# check for math library -AC_DEFUN([LT_LIB_M], -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -LIBM= -case $host in -*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) - # These system don't have libm, or don't need it - ;; -*-ncr-sysv4.3*) - AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") - AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") - ;; -*) - AC_CHECK_LIB(m, cos, LIBM="-lm") - ;; -esac -AC_SUBST([LIBM]) -])# LT_LIB_M - -# Old name: -AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_CHECK_LIBM], []) - - -# _LT_COMPILER_NO_RTTI([TAGNAME]) -# ------------------------------- -m4_defun([_LT_COMPILER_NO_RTTI], -[m4_require([_LT_TAG_COMPILER])dnl - -_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= - -if test "$GCC" = yes; then - case $cc_basename in - nvcc*) - _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; - *) - _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;; - esac - - _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], - lt_cv_prog_compiler_rtti_exceptions, - [-fno-rtti -fno-exceptions], [], - [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) -fi -_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], - [Compiler flag to turn off builtin functions]) -])# _LT_COMPILER_NO_RTTI - - -# _LT_CMD_GLOBAL_SYMBOLS -# ---------------------- -m4_defun([_LT_CMD_GLOBAL_SYMBOLS], -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_REQUIRE([AC_PROG_CC])dnl -AC_REQUIRE([AC_PROG_AWK])dnl -AC_REQUIRE([LT_PATH_NM])dnl -AC_REQUIRE([LT_PATH_LD])dnl -m4_require([_LT_DECL_SED])dnl -m4_require([_LT_DECL_EGREP])dnl -m4_require([_LT_TAG_COMPILER])dnl - -# Check for command to grab the raw symbol name followed by C symbol from nm. -AC_MSG_CHECKING([command to parse $NM output from $compiler object]) -AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], -[ -# These are sane defaults that work on at least a few old systems. -# [They come from Ultrix. What could be older than Ultrix?!! ;)] - -# Character class describing NM global symbol codes. -symcode='[[BCDEGRST]]' - -# Regexp to match symbols that can be accessed directly from C. -sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' - -# Define system-specific variables. -case $host_os in -aix*) - symcode='[[BCDT]]' - ;; -cygwin* | mingw* | pw32* | cegcc*) - symcode='[[ABCDGISTW]]' - ;; -hpux*) - if test "$host_cpu" = ia64; then - symcode='[[ABCDEGRST]]' - fi - ;; -irix* | nonstopux*) - symcode='[[BCDEGRST]]' - ;; -osf*) - symcode='[[BCDEGQRST]]' - ;; -solaris*) - symcode='[[BDRT]]' - ;; -sco3.2v5*) - symcode='[[DT]]' - ;; -sysv4.2uw2*) - symcode='[[DT]]' - ;; -sysv5* | sco5v6* | unixware* | OpenUNIX*) - symcode='[[ABDT]]' - ;; -sysv4) - symcode='[[DFNSTU]]' - ;; -esac - -# If we're using GNU nm, then use its standard symbol codes. -case `$NM -V 2>&1` in -*GNU* | *'with BFD'*) - symcode='[[ABCDGIRSTW]]' ;; -esac - -# Transform an extracted symbol line into a proper C declaration. -# Some systems (esp. on ia64) link data and code symbols differently, -# so use this general approach. -lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" - -# Transform an extracted symbol line into symbol name and symbol address -lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'" -lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'" - -# Handle CRLF in mingw tool chain -opt_cr= -case $build_os in -mingw*) - opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp - ;; -esac - -# Try without a prefix underscore, then with it. -for ac_symprfx in "" "_"; do - - # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. - symxfrm="\\1 $ac_symprfx\\2 \\2" - - # Write the raw and C identifiers. - if test "$lt_cv_nm_interface" = "MS dumpbin"; then - # Fake it for dumpbin and say T for any non-static function - # and D for any global variable. - # Also find C++ and __fastcall symbols from MSVC++, - # which start with @ or ?. - lt_cv_sys_global_symbol_pipe="$AWK ['"\ -" {last_section=section; section=\$ 3};"\ -" /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)= - ;; - haiku*) - # PIC is the default for Haiku. - # The "-static" flag exists, but is broken. - _LT_TAGVAR(lt_prog_compiler_static, $1)= - ;; - interix[[3-9]]*) - # Interix 3.x gcc -fpic/-fPIC options generate broken code. - # Instead, we relocate shared libraries at runtime. - ;; - sysv4*MP*) - if test -d /usr/nec; then - _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic - fi - ;; - hpux*) - # PIC is the default for 64-bit PA HP-UX, but not for 32-bit - # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag - # sets the default TLS model and affects inlining. - case $host_cpu in - hppa*64*) - ;; - *) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - esac - ;; - *qnx* | *nto*) - # QNX uses GNU C++, but need to define -shared option too, otherwise - # it will coredump. - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' - ;; - *) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - esac - else - case $host_os in - aix[[4-9]]*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - else - _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' - fi - ;; - chorus*) - case $cc_basename in - cxch68*) - # Green Hills C++ Compiler - # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" - ;; - esac - ;; - dgux*) - case $cc_basename in - ec++*) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - ;; - ghcx*) - # Green Hills C++ Compiler - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - ;; - *) - ;; - esac - ;; - freebsd* | dragonfly*) - # FreeBSD uses GNU C++ - ;; - hpux9* | hpux10* | hpux11*) - case $cc_basename in - CC*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' - if test "$host_cpu" != ia64; then - _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' - fi - ;; - aCC*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' - case $host_cpu in - hppa*64*|ia64*) - # +Z the default - ;; - *) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' - ;; - esac - ;; - *) - ;; - esac - ;; - interix*) - # This is c89, which is MS Visual C++ (no shared libs) - # Anyone wants to do a port? - ;; - irix5* | irix6* | nonstopux*) - case $cc_basename in - CC*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - # CC pic flag -KPIC is the default. - ;; - *) - ;; - esac - ;; - linux* | k*bsd*-gnu | kopensolaris*-gnu) - case $cc_basename in - KCC*) - # KAI C++ Compiler - _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - ecpc* ) - # old Intel C++ for x86_64 which still supported -KPIC. - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' - ;; - icpc* ) - # Intel C++, used to be incompatible with GCC. - # ICC 10 doesn't accept -KPIC any more. - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' - ;; - pgCC* | pgcpp*) - # Portland Group C++ compiler - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - cxx*) - # Compaq C++ - # Make sure the PIC flag is empty. It appears that all Alpha - # Linux and Compaq Tru64 Unix objects are PIC. - _LT_TAGVAR(lt_prog_compiler_pic, $1)= - _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*) - # IBM XL 8.0, 9.0 on PPC and BlueGene - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' - ;; - *) - case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) - # Sun C++ 5.9 - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' - ;; - esac - ;; - esac - ;; - lynxos*) - ;; - m88k*) - ;; - mvs*) - case $cc_basename in - cxx*) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' - ;; - *) - ;; - esac - ;; - netbsd*) - ;; - *qnx* | *nto*) - # QNX uses GNU C++, but need to define -shared option too, otherwise - # it will coredump. - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' - ;; - osf3* | osf4* | osf5*) - case $cc_basename in - KCC*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' - ;; - RCC*) - # Rational C++ 2.4.1 - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - ;; - cxx*) - # Digital/Compaq C++ - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # Make sure the PIC flag is empty. It appears that all Alpha - # Linux and Compaq Tru64 Unix objects are PIC. - _LT_TAGVAR(lt_prog_compiler_pic, $1)= - _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - *) - ;; - esac - ;; - psos*) - ;; - solaris*) - case $cc_basename in - CC* | sunCC*) - # Sun C++ 4.2, 5.x and Centerline C++ - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' - ;; - gcx*) - # Green Hills C++ Compiler - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' - ;; - *) - ;; - esac - ;; - sunos4*) - case $cc_basename in - CC*) - # Sun C++ 4.x - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - lcc*) - # Lucid - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - ;; - *) - ;; - esac - ;; - sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) - case $cc_basename in - CC*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - esac - ;; - tandem*) - case $cc_basename in - NCC*) - # NonStop-UX NCC 3.20 - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - ;; - *) - ;; - esac - ;; - vxworks*) - ;; - *) - _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - ;; - esac - fi -], -[ - if test "$GCC" = yes; then - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' - - case $host_os in - aix*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - fi - ;; - - amigaos*) - case $host_cpu in - powerpc) - # see comment about AmigaOS4 .so support - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - m68k) - # FIXME: we need at least 68020 code to build shared libraries, but - # adding the `-m68020' flag to GCC prevents building anything better, - # like `-m68040'. - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' - ;; - esac - ;; - - beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - - mingw* | cygwin* | pw32* | os2* | cegcc*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - # Although the cygwin gcc ignores -fPIC, still need this for old-style - # (--disable-auto-import) libraries - m4_if([$1], [GCJ], [], - [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) - ;; - - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' - ;; - - haiku*) - # PIC is the default for Haiku. - # The "-static" flag exists, but is broken. - _LT_TAGVAR(lt_prog_compiler_static, $1)= - ;; - - hpux*) - # PIC is the default for 64-bit PA HP-UX, but not for 32-bit - # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag - # sets the default TLS model and affects inlining. - case $host_cpu in - hppa*64*) - # +Z the default - ;; - *) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - esac - ;; - - interix[[3-9]]*) - # Interix 3.x gcc -fpic/-fPIC options generate broken code. - # Instead, we relocate shared libraries at runtime. - ;; - - msdosdjgpp*) - # Just because we use GCC doesn't mean we suddenly get shared libraries - # on systems that don't support them. - _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - enable_shared=no - ;; - - *nto* | *qnx*) - # QNX uses GNU C++, but need to define -shared option too, otherwise - # it will coredump. - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' - ;; - - sysv4*MP*) - if test -d /usr/nec; then - _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic - fi - ;; - - *) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - esac - - case $cc_basename in - nvcc*) # Cuda Compiler Driver 2.2 - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Xcompiler -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 | kopensolaris*-gnu) - case $cc_basename in - # old Intel for x86_64 which still supported -KPIC. - ecc*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' - ;; - # icc used to be incompatible with GCC. - # ICC 10 doesn't accept -KPIC any more. - icc* | ifort*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' - ;; - # Lahey Fortran 8.1. - lf95*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' - _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' - ;; - pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) - # Portland Group compilers (*not* the Pentium gcc compiler, - # which looks to be a dead project) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - ccc*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # All Alpha code is PIC. - _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - xl* | bgxl* | bgf* | mpixl*) - # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' - ;; - *) - case `$CC -V 2>&1 | sed 5q` in - *Sun\ F* | *Sun*Fortran*) - # Sun Fortran 8.3 passes all unrecognized flags to the linker - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - _LT_TAGVAR(lt_prog_compiler_wl, $1)='' - ;; - *Sun\ 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,' - ;; - esac - ;; - esac - ;; - - newsos6) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - *nto* | *qnx*) - # QNX uses GNU C++, but need to define -shared option too, otherwise - # it will coredump. - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' - ;; - - osf3* | osf4* | osf5*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # All OSF/1 code is PIC. - _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - - rdos*) - _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - - solaris*) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - case $cc_basename in - f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; - *) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; - esac - ;; - - sunos4*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - sysv4 | sysv4.2uw2* | sysv4.3*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - sysv4*MP*) - if test -d /usr/nec ;then - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - fi - ;; - - sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - unicos*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - ;; - - uts4*) - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - *) - _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - ;; - esac - fi -]) -case $host_os in - # For platforms which do not support PIC, -DPIC is meaningless: - *djgpp*) - _LT_TAGVAR(lt_prog_compiler_pic, $1)= - ;; - *) - _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" - ;; -esac -AC_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 - # Also, AIX nm treats weak defined symbols like other global defined - # symbols, whereas GNU nm marks them as "W". - if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' - else - _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' - fi - ;; - pw32*) - _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" - ;; - cygwin* | mingw* | cegcc*) - _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 - - # On some targets, GNU ld is compatible enough with the native linker - # that we're better off using the native interface for both. - lt_use_gnu_ld_interface=no - if test "$with_gnu_ld" = yes; then - case $host_os in - aix*) - # The AIX port of GNU ld has always aspired to compatibility - # with the native linker. However, as the warning in the GNU ld - # block says, versions before 2.19.5* couldn't really create working - # shared libraries, regardless of the interface used. - case `$LD -v 2>&1` in - *\ \(GNU\ Binutils\)\ 2.19.5*) ;; - *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;; - *\ \(GNU\ Binutils\)\ [[3-9]]*) ;; - *) - lt_use_gnu_ld_interface=yes - ;; - esac - ;; - *) - lt_use_gnu_ld_interface=yes - ;; - esac - fi - - if test "$lt_use_gnu_ld_interface" = yes; then - # If archive_cmds runs LD, not CC, wlarc should be empty - wlarc='${wl}' - - # Set some defaults for GNU ld with shared library support. These - # are reset later if shared libraries are not supported. Putting them - # here allows them to be overridden if necessary. - runpath_var=LD_RUN_PATH - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - # ancient GNU ld didn't support --whole-archive et. al. - if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then - _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - _LT_TAGVAR(whole_archive_flag_spec, $1)= - fi - supports_anon_versioning=no - case `$LD -v 2>&1` in - *GNU\ gold*) supports_anon_versioning=yes ;; - *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 - *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... - *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... - *\ 2.11.*) ;; # other 2.11 versions - *) supports_anon_versioning=yes ;; - esac - - # See if GNU ld supports shared libraries. - case $host_os in - aix[[3-9]]*) - # On AIX/PPC, the GNU linker is very broken - if test "$host_cpu" != ia64; then - _LT_TAGVAR(ld_shlibs, $1)=no - cat <<_LT_EOF 1>&2 - -*** Warning: the GNU linker, at least up to release 2.19, is reported -*** to be unable to reliably create shared libraries on AIX. -*** Therefore, libtool is disabling shared libraries support. If you -*** really care for shared libraries, you may want to install binutils -*** 2.20 or above, or modify your PATH so that a non-GNU linker is found. -*** You will then need to restart the configuration process. - -_LT_EOF - fi - ;; - - amigaos*) - case $host_cpu in - powerpc) - # see comment about AmigaOS4 .so support - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='' - ;; - m68k) - _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(hardcode_minus_L, $1)=yes - ;; - esac - ;; - - beos*) - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - # Joseph Beckenbach says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - cygwin* | mingw* | pw32* | cegcc*) - # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, - # as there is no search path for DLLs. - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_TAGVAR(always_export_symbols, $1)=no - _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/'\'' | $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 - ;; - - haiku*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(link_all_deplibs, $1)=yes - ;; - - interix[[3-9]]*) - _LT_TAGVAR(hardcode_direct, $1)=no - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. - # Instead, shared libraries are loaded at an image base (0x10000000 by - # default) and relocated if they conflict, which is a slow very memory - # consuming and fragmenting process. To avoid this, we pick a random, - # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link - # time. Moving up from 0x10000000 also allows more sbrk(2) space. - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - ;; - - gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) - tmp_diet=no - if test "$host_os" = linux-dietlibc; then - case $cc_basename in - diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) - esac - fi - if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ - && test "$tmp_diet" = no - then - tmp_addflag= - tmp_sharedflag='-shared' - case $cc_basename,$host_cpu in - pgcc*) # Portland Group C compiler - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' - tmp_addflag=' $pic_flag' - ;; - pgf77* | pgf90* | pgf95* | pgfortran*) - # Portland Group f77 and f90 compilers - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' - tmp_addflag=' $pic_flag -Mnomain' ;; - ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 - tmp_addflag=' -i_dynamic' ;; - efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 - tmp_addflag=' -i_dynamic -nofor_main' ;; - ifc* | ifort*) # Intel Fortran compiler - tmp_addflag=' -nofor_main' ;; - lf95*) # Lahey Fortran 8.1 - _LT_TAGVAR(whole_archive_flag_spec, $1)= - tmp_sharedflag='--shared' ;; - xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) - tmp_sharedflag='-qmkshrobj' - tmp_addflag= ;; - nvcc*) # Cuda Compiler Driver 2.2 - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' - _LT_TAGVAR(compiler_needs_object, $1)=yes - ;; - esac - case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) # Sun C 5.9 - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' - _LT_TAGVAR(compiler_needs_object, $1)=yes - tmp_sharedflag='-G' ;; - *Sun\ F*) # Sun Fortran 8.3 - tmp_sharedflag='-G' ;; - esac - _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - - if test "x$supports_anon_versioning" = xyes; then - _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' - fi - - case $cc_basename in - xlf* | bgf* | bgxlf* | mpixlf*) - # IBM XL Fortran 10.1 on PPC cannot create shared libs itself - _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= - _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' - _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' - if test "x$supports_anon_versioning" = xyes; then - _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - echo "local: *; };" >> $output_objdir/$libname.ver~ - $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' - fi - ;; - esac - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - netbsd*) - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' - wlarc= - else - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $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 - # Also, AIX nm treats weak defined symbols like other global - # defined symbols, whereas GNU nm marks them as "W". - if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then - _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' - else - _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' - fi - aix_use_runtimelinking=no - - # Test if we are trying to use run time linking or normal - # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # need to do runtime linking. - case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) - for ld_flag in $LDFLAGS; do - if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then - aix_use_runtimelinking=yes - break - fi - done - ;; - esac - - exp_sym_flag='-bexport' - no_entry_flag='-bnoentry' - fi - - # When large executables or shared objects are built, AIX ld can - # have problems creating the table of contents. If linking a library - # or program results in "error TOC overflow" add -mminimal-toc to - # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not - # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. - - _LT_TAGVAR(archive_cmds, $1)='' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_direct_absolute, $1)=yes - _LT_TAGVAR(hardcode_libdir_separator, $1)=':' - _LT_TAGVAR(link_all_deplibs, $1)=yes - _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' - - if test "$GCC" = yes; then - case $host_os in aix4.[[012]]|aix4.[[012]].*) - # We only want to do this on AIX 4.2 and lower, the check - # below for broken collect2 doesn't work under 4.3+ - collect2name=`${CC} -print-prog-name=collect2` - if test -f "$collect2name" && - strings "$collect2name" | $GREP resolve_lib_name >/dev/null - then - # We have reworked collect2 - : - else - # We have old collect2 - _LT_TAGVAR(hardcode_direct, $1)=unsupported - # It fails to find uninstalled libraries when the uninstalled - # path is not listed in the libpath. Setting hardcode_minus_L - # to unsupported forces relinking - _LT_TAGVAR(hardcode_minus_L, $1)=yes - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)= - fi - ;; - esac - shared_flag='-shared' - if test "$aix_use_runtimelinking" = yes; then - shared_flag="$shared_flag "'${wl}-G' - fi - 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 func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" - else - if test "$host_cpu" = ia64; then - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' - _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" - _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" - else - # Determine the default libpath from the value encoded in an - # empty executable. - _LT_SYS_MODULE_PATH_AIX - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" - # Warning - without using the other run time loading flags, - # -berok will link without error, but may produce a broken library. - _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' - _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' - if test "$with_gnu_ld" = yes; then - # We only use this code for GNU lds that support --whole-archive. - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' - else - # Exported symbols can be pulled into shared objects from archives - _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' - fi - _LT_TAGVAR(archive_cmds_need_lc, $1)=yes - # This is similar to how AIX traditionally builds its shared libraries. - _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' - fi - fi - ;; - - amigaos*) - case $host_cpu in - powerpc) - # see comment about AmigaOS4 .so support - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='' - ;; - m68k) - _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(hardcode_minus_L, $1)=yes - ;; - esac - ;; - - bsdi[[45]]*) - _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic - ;; - - cygwin* | mingw* | pw32* | cegcc*) - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - # hardcode_libdir_flag_spec is actually meaningless, as there is - # no search path for DLLs. - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" - # FIXME: Setting linknames here is a bad hack. - _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' - # The linker will automatically build a .lib file if we build a DLL. - _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' - # FIXME: Should let the user specify the lib program. - _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' - _LT_TAGVAR(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 && test "$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 && test "$with_gnu_ld" = no; then - case $host_cpu in - hppa*64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -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' - ;; - *) - m4_if($1, [], [ - # Older versions of the 11.00 compiler do not understand -b yet - # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) - _LT_LINKER_OPTION([if $CC understands -b], - _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], - [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], - [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], - [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) - ;; - esac - fi - if test "$with_gnu_ld" = no; then - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - - case $host_cpu in - hppa*64*|ia64*) - _LT_TAGVAR(hardcode_direct, $1)=no - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - *) - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_direct_absolute, $1)=yes - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - _LT_TAGVAR(hardcode_minus_L, $1)=yes - ;; - esac - fi - ;; - - irix5* | irix6* | nonstopux*) - if test "$GCC" = yes; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - # Try to use the -exported_symbol ld option, if it does not - # work, assume that -exports_file does not work either and - # implicitly export all symbols. - 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" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${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" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' - fi - _LT_TAGVAR(archive_cmds_need_lc, $1)='no' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_TAGVAR(inherit_rpath, $1)=yes - _LT_TAGVAR(link_all_deplibs, $1)=yes - ;; - - netbsd*) - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out - else - _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF - fi - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - newsos6) - _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - *nto* | *qnx*) - ;; - - openbsd*) - if test -f /usr/libexec/ld.so; then - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_TAGVAR(hardcode_direct_absolute, $1)=yes - if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - else - case $host_os in - openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) - _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - ;; - *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - ;; - esac - fi - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - os2*) - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(hardcode_minus_L, $1)=yes - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' - _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' - ;; - - osf3*) - if test "$GCC" = yes; then - _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' - fi - _LT_TAGVAR(archive_cmds_need_lc, $1)='no' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - ;; - - osf4* | osf5*) # as osf3* with the addition of -msym flag - if test "$GCC" = yes; then - _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - else - _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ - $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' - - # Both c and cxx compiler support -rpath directly - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' - fi - _LT_TAGVAR(archive_cmds_need_lc, $1)='no' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - ;; - - solaris*) - _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' - if test "$GCC" = yes; then - wlarc='${wl}' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${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_CACHE_CHECK([whether -lc should be explicitly linked in], - [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1), - [$RM conftest* - echo "$lt_simple_compile_test_code" > conftest.$ac_ext - - if AC_TRY_EVAL(ac_compile) 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) - pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) - _LT_TAGVAR(allow_undefined_flag, $1)= - if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) - then - lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no - else - lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes - fi - _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $RM conftest* - ]) - _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1) - ;; - esac - fi - ;; -esac - -_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], - [Whether or not to add -lc for building shared libraries]) -_LT_TAGDECL([allow_libtool_libs_with_static_runtimes], - [enable_shared_with_static_runtimes], [0], - [Whether or not to disallow shared libs when runtime libs are static]) -_LT_TAGDECL([], [export_dynamic_flag_spec], [1], - [Compiler flag to allow reflexive dlopens]) -_LT_TAGDECL([], [whole_archive_flag_spec], [1], - [Compiler flag to generate shared objects directly from archives]) -_LT_TAGDECL([], [compiler_needs_object], [1], - [Whether the compiler copes with passing no objects directly]) -_LT_TAGDECL([], [old_archive_from_new_cmds], [2], - [Create an old-style archive from a shared archive]) -_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], - [Create a temporary old-style archive to link instead of a shared archive]) -_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) -_LT_TAGDECL([], [archive_expsym_cmds], [2]) -_LT_TAGDECL([], [module_cmds], [2], - [Commands used to build a loadable module if different from building - a shared archive.]) -_LT_TAGDECL([], [module_expsym_cmds], [2]) -_LT_TAGDECL([], [with_gnu_ld], [1], - [Whether we are building with GNU ld or not]) -_LT_TAGDECL([], [allow_undefined_flag], [1], - [Flag that allows shared libraries with undefined symbols to be built]) -_LT_TAGDECL([], [no_undefined_flag], [1], - [Flag that enforces no undefined symbols]) -_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], - [Flag to hardcode $libdir into a binary during linking. - This must work even if $libdir does not exist]) -_LT_TAGDECL([], [hardcode_libdir_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_LANG_CXX_CONFIG([TAG]) -# -------------------------- -# Ensure that the configuration variables for a C++ compiler are suitably -# defined. These variables are subsequently used by _LT_CONFIG to write -# the compiler configuration to `libtool'. -m4_defun([_LT_LANG_CXX_CONFIG], -[m4_require([_LT_FILEUTILS_DEFAULTS])dnl -m4_require([_LT_DECL_EGREP])dnl -if test -n "$CXX" && ( test "X$CXX" != "Xno" && - ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || - (test "X$CXX" != "Xg++"))) ; then - AC_PROG_CXXCPP -else - _lt_caught_CXX_error=yes -fi - -AC_LANG_PUSH(C++) -_LT_TAGVAR(archive_cmds_need_lc, $1)=no -_LT_TAGVAR(allow_undefined_flag, $1)= -_LT_TAGVAR(always_export_symbols, $1)=no -_LT_TAGVAR(archive_expsym_cmds, $1)= -_LT_TAGVAR(compiler_needs_object, $1)=no -_LT_TAGVAR(export_dynamic_flag_spec, $1)= -_LT_TAGVAR(hardcode_direct, $1)=no -_LT_TAGVAR(hardcode_direct_absolute, $1)=no -_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= -_LT_TAGVAR(hardcode_libdir_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(reload_flag, $1)=$reload_flag -_LT_TAGVAR(reload_cmds, $1)=$reload_cmds -_LT_TAGVAR(no_undefined_flag, $1)= -_LT_TAGVAR(whole_archive_flag_spec, $1)= -_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no - -# Source file extension for C++ test sources. -ac_ext=cpp - -# Object file extension for compiled C++ test sources. -objext=o -_LT_TAGVAR(objext, $1)=$objext - -# No sense in running all these tests if we already determined that -# the CXX compiler isn't working. Some variables (like enable_shared) -# are currently assumed to apply to all compilers on this platform, -# and will be corrupted by setting them based on a non-working compiler. -if test "$_lt_caught_CXX_error" != yes; then - # Code to be used in simple compile tests - lt_simple_compile_test_code="int some_variable = 0;" - - # Code to be used in simple link tests - lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' - - # ltmain only uses $CC for tagged configurations so make sure $CC is set. - _LT_TAG_COMPILER - - # save warnings/boilerplate of simple test code - _LT_COMPILER_BOILERPLATE - _LT_LINKER_BOILERPLATE - - # Allow CC to be a program name with arguments. - lt_save_CC=$CC - lt_save_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 -v "^Configured with:" | $GREP "\-L"' - - else - GXX=no - with_gnu_ld=no - wlarc= - fi - - # PORTME: fill in a description of your system's C++ link characteristics - AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) - _LT_TAGVAR(ld_shlibs, $1)=yes - case $host_os in - aix3*) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - aix[[4-9]]*) - if test "$host_cpu" = ia64; then - # On IA64, the linker does run time linking by default, so we don't - # have to do anything special. - aix_use_runtimelinking=no - exp_sym_flag='-Bexport' - no_entry_flag="" - else - aix_use_runtimelinking=no - - # Test if we are trying to use run time linking or normal - # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # need to do runtime linking. - case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) - for ld_flag in $LDFLAGS; do - case $ld_flag in - *-brtl*) - aix_use_runtimelinking=yes - break - ;; - esac - done - ;; - esac - - exp_sym_flag='-bexport' - no_entry_flag='-bnoentry' - fi - - # When large executables or shared objects are built, AIX ld can - # have problems creating the table of contents. If linking a library - # or program results in "error TOC overflow" add -mminimal-toc to - # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not - # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. - - _LT_TAGVAR(archive_cmds, $1)='' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_direct_absolute, $1)=yes - _LT_TAGVAR(hardcode_libdir_separator, $1)=':' - _LT_TAGVAR(link_all_deplibs, $1)=yes - _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' - - if test "$GXX" = yes; then - case $host_os in aix4.[[012]]|aix4.[[012]].*) - # We only want to do this on AIX 4.2 and lower, the check - # below for broken collect2 doesn't work under 4.3+ - collect2name=`${CC} -print-prog-name=collect2` - if test -f "$collect2name" && - strings "$collect2name" | $GREP resolve_lib_name >/dev/null - then - # We have reworked collect2 - : - else - # We have old collect2 - _LT_TAGVAR(hardcode_direct, $1)=unsupported - # It fails to find uninstalled libraries when the uninstalled - # path is not listed in the libpath. Setting hardcode_minus_L - # to unsupported forces relinking - _LT_TAGVAR(hardcode_minus_L, $1)=yes - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)= - fi - esac - shared_flag='-shared' - if test "$aix_use_runtimelinking" = yes; then - shared_flag="$shared_flag "'${wl}-G' - fi - 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 func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" - else - if test "$host_cpu" = ia64; then - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' - _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" - _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" - else - # Determine the default libpath from the value encoded in an - # empty executable. - _LT_SYS_MODULE_PATH_AIX - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" - # Warning - without using the other run time loading flags, - # -berok will link without error, but may produce a broken library. - _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' - _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' - if test "$with_gnu_ld" = yes; then - # We only use this code for GNU lds that support --whole-archive. - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' - else - # Exported symbols can be pulled into shared objects from archives - _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' - fi - _LT_TAGVAR(archive_cmds_need_lc, $1)=yes - # This is similar to how AIX traditionally builds its shared - # libraries. - _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' - fi - fi - ;; - - beos*) - if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - # Joseph Beckenbach says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - chorus*) - case $cc_basename in - *) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - - cygwin* | mingw* | pw32* | cegcc*) - # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, - # as there is no search path for DLLs. - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' - _LT_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_TAGVAR(always_export_symbols, $1)=no - _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - - if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is; otherwise, prepend... - _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - 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*) - ;; - - haiku*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(link_all_deplibs, $1)=yes - ;; - - hpux9*) - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, - # but as the default - # location of the library. - - case $cc_basename in - CC*) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - aCC*) - _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' - ;; - *) - if test "$GXX" = yes; then - _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib -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; func_echo_all "$list"' - ;; - *) - if test "$GXX" = yes; then - if test $with_gnu_ld = no; then - case $host_cpu in - hppa*64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - ia64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -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" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' - - # Archives containing C++ object files must be created using - # "CC -ar", where "CC" is the IRIX C++ compiler. This is - # necessary to make sure instantiated templates are included - # in the archive. - _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' - ;; - *) - if test "$GXX" = yes; then - if test "$with_gnu_ld" = no; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' - fi - fi - _LT_TAGVAR(link_all_deplibs, $1)=yes - ;; - esac - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_TAGVAR(inherit_rpath, $1)=yes - ;; - - linux* | k*bsd*-gnu | kopensolaris*-gnu) - case $cc_basename in - KCC*) - # Kuck and Associates, Inc. (KAI) C++ Compiler - - # KCC will only create a shared library if the output file - # ends with ".so" (or ".sl" for HP-UX), so rename the library - # to its proper name (with version) after linking. - _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' - - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - - # Archives containing C++ object files must be created using - # "CC -Bstatic", where "CC" is the KAI C++ compiler. - _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' - ;; - icpc* | ecpc* ) - # Intel C++ - with_gnu_ld=yes - # version 8.0 and above of icpc choke on multiply defined symbols - # if we add $predep_objects and $postdep_objects, however 7.1 and - # earlier do not add the objects themselves. - case `$CC -V 2>&1` in - *"Version 7."*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - ;; - *) # Version 8.0 or newer - tmp_idyn= - case $host_cpu in - ia64*) tmp_idyn=' -i_dynamic';; - esac - _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - ;; - esac - _LT_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' - ;; - pgCC* | pgcpp*) - # Portland Group C++ compiler - case `$CC -V` in - *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) - _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ - rm -rf $tpldir~ - $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ - compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' - _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ - rm -rf $tpldir~ - $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ - $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ - $RANLIB $oldlib' - _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ - rm -rf $tpldir~ - $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ - $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ - rm -rf $tpldir~ - $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ - $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' - ;; - *) # Version 6 and above use weak symbols - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' - ;; - esac - - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' - ;; - cxx*) - # Compaq C++ - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' - - runpath_var=LD_RUN_PATH - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' - ;; - xl* | mpixl* | bgxl*) - # IBM XL 8.0 on PPC, with GNU ld - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - if test "x$supports_anon_versioning" = xyes; then - _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' - fi - ;; - *) - case `$CC -V 2>&1 | sed 5q` in - *Sun\ C*) - # Sun C++ 5.9 - _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' - _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' - _LT_TAGVAR(compiler_needs_object, $1)=yes - - # Not sure whether something based on - # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 - # would be better. - output_verbose_link_cmd='func_echo_all' - - # Archives containing C++ object files must be created using - # "CC -xar", where "CC" is the Sun C++ compiler. This is - # necessary to make sure instantiated templates are included - # in the archive. - _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' - ;; - esac - ;; - esac - ;; - - lynxos*) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - - m88k*) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - - mvs*) - case $cc_basename in - cxx*) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - - netbsd*) - if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' - wlarc= - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - fi - # Workaround some broken pre-1.5 toolchains - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' - ;; - - *nto* | *qnx*) - _LT_TAGVAR(ld_shlibs, $1)=yes - ;; - - openbsd2*) - # C++ shared libraries are fairly broken - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - - openbsd*) - if test -f /usr/libexec/ld.so; then - _LT_TAGVAR(hardcode_direct, $1)=yes - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_TAGVAR(hardcode_direct_absolute, $1)=yes - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - fi - output_verbose_link_cmd=func_echo_all - else - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - osf3* | osf4* | osf5*) - case $cc_basename in - KCC*) - # Kuck and Associates, Inc. (KAI) C++ Compiler - - # KCC will only create a shared library if the output file - # ends with ".so" (or ".sl" for HP-UX), so rename the library - # to its proper name (with version) after linking. - _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - - # Archives containing C++ object files must be created using - # the KAI C++ compiler. - case $host in - osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; - *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; - esac - ;; - RCC*) - # Rational C++ 2.4.1 - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - cxx*) - case $host in - osf3*) - _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - ;; - *) - _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ - echo "-hidden">> $lib.exp~ - $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~ - $RM $lib.exp' - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' - ;; - esac - - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' - ;; - *) - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - case $host in - osf3*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - ;; - *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - ;; - esac - - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' - - else - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - - psos*) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - - sunos4*) - case $cc_basename in - CC*) - # Sun C++ 4.x - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - lcc*) - # Lucid - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - - solaris*) - case $cc_basename in - CC* | sunCC*) - # Sun C++ 4.2, 5.x and Centerline C++ - _LT_TAGVAR(archive_cmds_need_lc,$1)=yes - _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' - _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' - - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - case $host_os in - solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; - *) - # The compiler driver will combine and reorder linker options, - # but understands `-z linker_flag'. - # Supported since Solaris 2.6 (maybe 2.5.1?) - _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' - ;; - esac - _LT_TAGVAR(link_all_deplibs, $1)=yes - - output_verbose_link_cmd='func_echo_all' - - # Archives containing C++ object files must be created using - # "CC -xar", where "CC" is the Sun C++ compiler. This is - # necessary to make sure instantiated templates are included - # in the archive. - _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' - ;; - gcx*) - # Green Hills C++ Compiler - _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - - # The C++ compiler must be used to create the archive. - _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' - ;; - *) - # GNU C++ compiler with Solaris linker - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' - if $CC --version | $GREP -v '^2\.7' > /dev/null; then - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -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 -v "^Configured with:" | $GREP "\-L"' - else - # g++ 2.7 appears to require `-G' NOT `-shared' on this - # platform. - _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ - $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' - fi - - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' - case $host_os in - solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; - *) - _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' - ;; - esac - fi - ;; - esac - ;; - - sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) - _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' - _LT_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - runpath_var='LD_RUN_PATH' - - case $cc_basename in - CC*) - _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - ;; - - sysv5* | sco3.2v5* | sco5v6*) - # Note: We can NOT use -z defs as we might desire, because we do not - # link with -lc, and that would cause any symbols used from libc to - # always be unresolved, which means just about no library would - # ever link correctly. If we're not using GNU ld we use -z text - # though, which does catch some bad symbols but isn't as heavy-handed - # as -z defs. - _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' - _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' - _LT_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' - _LT_TAGVAR(hardcode_libdir_separator, $1)=':' - _LT_TAGVAR(link_all_deplibs, $1)=yes - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' - runpath_var='LD_RUN_PATH' - - case $cc_basename in - CC*) - _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ - '"$_LT_TAGVAR(old_archive_cmds, $1)" - _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ - '"$_LT_TAGVAR(reload_cmds, $1)" - ;; - *) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - ;; - - tandem*) - case $cc_basename in - NCC*) - # NonStop-UX NCC 3.20 - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - - vxworks*) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - - *) - # FIXME: insert proper C++ library support - _LT_TAGVAR(ld_shlibs, $1)=no - ;; - esac - - AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) - test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no - - _LT_TAGVAR(GCC, $1)="$GXX" - _LT_TAGVAR(LD, $1)="$LD" - - ## CAVEAT EMPTOR: - ## There is no encapsulation within the following macros, do not change - ## the running order or otherwise move them around unless you know exactly - ## what you are doing... - _LT_SYS_HIDDEN_LIBDEPS($1) - _LT_COMPILER_PIC($1) - _LT_COMPILER_C_O($1) - _LT_COMPILER_FILE_LOCKS($1) - _LT_LINKER_SHLIBS($1) - _LT_SYS_DYNAMIC_LINKER($1) - _LT_LINKER_HARDCODE_LIBPATH($1) - - _LT_CONFIG($1) - fi # test -n "$compiler" - - CC=$lt_save_CC - 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* | sunCC*) - # The more standards-conforming stlport4 library is - # incompatible with the Cstd library. Avoid specifying - # it if it's in CXXFLAGS. Ignore libCrun as - # -library=stlport4 depends on it. - case " $CXX $CXXFLAGS " in - *" -library=stlport4 "*) - solaris_use_stlport4=yes - ;; - esac - - # Adding this requires a known-good setup of shared libraries for - # Sun compiler versions before 5.6, else PIC objects from an old - # archive will be linked into the output, leading to subtle bugs. - if test "$solaris_use_stlport4" != yes; then - _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' - fi - ;; - esac - ;; -esac -]) - -case " $_LT_TAGVAR(postdeps, $1) " in -*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; -esac - _LT_TAGVAR(compiler_lib_search_dirs, $1)= -if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then - _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` -fi -_LT_TAGDECL([], [compiler_lib_search_dirs], [1], - [The directories searched by this compiler when creating a shared library]) -_LT_TAGDECL([], [predep_objects], [1], - [Dependencies to place before and after the objects being linked to - create a shared library]) -_LT_TAGDECL([], [postdep_objects], [1]) -_LT_TAGDECL([], [predeps], [1]) -_LT_TAGDECL([], [postdeps], [1]) -_LT_TAGDECL([], [compiler_lib_search_path], [1], - [The library search path used internally by the compiler when linking - a shared library]) -])# _LT_SYS_HIDDEN_LIBDEPS - - -# _LT_LANG_F77_CONFIG([TAG]) -# -------------------------- -# Ensure that the configuration variables for a Fortran 77 compiler are -# suitably defined. These variables are subsequently used by _LT_CONFIG -# to write the compiler configuration to `libtool'. -m4_defun([_LT_LANG_F77_CONFIG], -[AC_LANG_PUSH(Fortran 77) -if test -z "$F77" || test "X$F77" = "Xno"; then - _lt_disable_F77=yes -fi - -_LT_TAGVAR(archive_cmds_need_lc, $1)=no -_LT_TAGVAR(allow_undefined_flag, $1)= -_LT_TAGVAR(always_export_symbols, $1)=no -_LT_TAGVAR(archive_expsym_cmds, $1)= -_LT_TAGVAR(export_dynamic_flag_spec, $1)= -_LT_TAGVAR(hardcode_direct, $1)=no -_LT_TAGVAR(hardcode_direct_absolute, $1)=no -_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= -_LT_TAGVAR(hardcode_libdir_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(reload_flag, $1)=$reload_flag -_LT_TAGVAR(reload_cmds, $1)=$reload_cmds -_LT_TAGVAR(no_undefined_flag, $1)= -_LT_TAGVAR(whole_archive_flag_spec, $1)= -_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no - -# Source file extension for f77 test sources. -ac_ext=f - -# Object file extension for compiled f77 test sources. -objext=o -_LT_TAGVAR(objext, $1)=$objext - -# No sense in running all these tests if we already determined that -# the F77 compiler isn't working. Some variables (like enable_shared) -# are currently assumed to apply to all compilers on this platform, -# and will be corrupted by setting them based on a non-working compiler. -if test "$_lt_disable_F77" != yes; then - # Code to be used in simple compile tests - lt_simple_compile_test_code="\ - subroutine t - return - end -" - - # Code to be used in simple link tests - lt_simple_link_test_code="\ - program t - end -" - - # ltmain only uses $CC for tagged configurations so make sure $CC is set. - _LT_TAG_COMPILER - - # save warnings/boilerplate of simple test code - _LT_COMPILER_BOILERPLATE - _LT_LINKER_BOILERPLATE - - # Allow CC to be a program name with arguments. - lt_save_CC="$CC" - lt_save_GCC=$GCC - 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_LANG_FC_CONFIG([TAG]) -# ------------------------- -# Ensure that the configuration variables for a Fortran compiler are -# suitably defined. These variables are subsequently used by _LT_CONFIG -# to write the compiler configuration to `libtool'. -m4_defun([_LT_LANG_FC_CONFIG], -[AC_LANG_PUSH(Fortran) - -if test -z "$FC" || test "X$FC" = "Xno"; then - _lt_disable_FC=yes -fi - -_LT_TAGVAR(archive_cmds_need_lc, $1)=no -_LT_TAGVAR(allow_undefined_flag, $1)= -_LT_TAGVAR(always_export_symbols, $1)=no -_LT_TAGVAR(archive_expsym_cmds, $1)= -_LT_TAGVAR(export_dynamic_flag_spec, $1)= -_LT_TAGVAR(hardcode_direct, $1)=no -_LT_TAGVAR(hardcode_direct_absolute, $1)=no -_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= -_LT_TAGVAR(hardcode_libdir_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(reload_flag, $1)=$reload_flag -_LT_TAGVAR(reload_cmds, $1)=$reload_cmds -_LT_TAGVAR(no_undefined_flag, $1)= -_LT_TAGVAR(whole_archive_flag_spec, $1)= -_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no - -# Source file extension for fc test sources. -ac_ext=${ac_fc_srcext-f} - -# Object file extension for compiled fc test sources. -objext=o -_LT_TAGVAR(objext, $1)=$objext - -# No sense in running all these tests if we already determined that -# the FC compiler isn't working. Some variables (like enable_shared) -# are currently assumed to apply to all compilers on this platform, -# and will be corrupted by setting them based on a non-working compiler. -if test "$_lt_disable_FC" != yes; then - # Code to be used in simple compile tests - lt_simple_compile_test_code="\ - subroutine t - return - end -" - - # Code to be used in simple link tests - lt_simple_link_test_code="\ - program t - end -" - - # ltmain only uses $CC for tagged configurations so make sure $CC is set. - _LT_TAG_COMPILER - - # save warnings/boilerplate of simple test code - _LT_COMPILER_BOILERPLATE - _LT_LINKER_BOILERPLATE - - # Allow CC to be a program name with arguments. - lt_save_CC="$CC" - lt_save_GCC=$GCC - 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 -_LT_TAGVAR(reload_flag, $1)=$reload_flag -_LT_TAGVAR(reload_cmds, $1)=$reload_cmds - -## CAVEAT EMPTOR: -## There is no encapsulation within the following macros, do not change -## the running order or otherwise move them around unless you know exactly -## what you are doing... -if test -n "$compiler"; then - _LT_COMPILER_NO_RTTI($1) - _LT_COMPILER_PIC($1) - _LT_COMPILER_C_O($1) - _LT_COMPILER_FILE_LOCKS($1) - _LT_LINKER_SHLIBS($1) - _LT_LINKER_HARDCODE_LIBPATH($1) - - _LT_CONFIG($1) -fi - -AC_LANG_RESTORE - -GCC=$lt_save_GCC -CC="$lt_save_CC" -])# _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 "${1}" | $SED "$dirname"` - if test "X$func_dirname_result" = "X${1}"; then - func_dirname_result="${3}" - else - func_dirname_result="$func_dirname_result${2}" - fi -} - -# func_basename file -func_basename () -{ - func_basename_result=`$ECHO "${1}" | $SED "$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 "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; - *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; 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 "${1}" | $SED "$my_sed_long_opt"` - func_opt_split_arg=`$ECHO "${1}" | $SED "$my_sed_long_arg"` -} - -# func_lo2o object -func_lo2o () -{ - func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` -} - -# func_xform libobj-or-source -func_xform () -{ - func_xform_result=`$ECHO "${1}" | $SED '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/impl/antlr/libantlr3c-3.4/m4/ltoptions.m4 b/impl/antlr/libantlr3c-3.4/m4/ltoptions.m4 deleted file mode 100644 index 17cfd51..0000000 --- a/impl/antlr/libantlr3c-3.4/m4/ltoptions.m4 +++ /dev/null @@ -1,369 +0,0 @@ -# Helper functions for option handling. -*- Autoconf -*- -# -# Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation, -# Inc. -# Written by Gary V. Vaughan, 2004 -# -# This file is free software; the Free Software Foundation gives -# unlimited permission to copy and/or distribute it, with or without -# modifications, as long as this notice is preserved. - -# serial 7 ltoptions.m4 - -# This is to help aclocal find these macros, as it can't see m4_define. -AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) - - -# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) -# ------------------------------------------ -m4_define([_LT_MANGLE_OPTION], -[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) - - -# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) -# --------------------------------------- -# Set option OPTION-NAME for macro MACRO-NAME, and if there is a -# matching handler defined, dispatch to it. Other OPTION-NAMEs are -# saved as a flag. -m4_define([_LT_SET_OPTION], -[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl -m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), - _LT_MANGLE_DEFUN([$1], [$2]), - [m4_warning([Unknown $1 option `$2'])])[]dnl -]) - - -# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) -# ------------------------------------------------------------ -# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. -m4_define([_LT_IF_OPTION], -[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) - - -# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) -# ------------------------------------------------------- -# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME -# are set. -m4_define([_LT_UNLESS_OPTIONS], -[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), - [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), - [m4_define([$0_found])])])[]dnl -m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 -])[]dnl -]) - - -# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) -# ---------------------------------------- -# OPTION-LIST is a space-separated list of Libtool options associated -# with MACRO-NAME. If any OPTION has a matching handler declared with -# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about -# the unknown option and exit. -m4_defun([_LT_SET_OPTIONS], -[# Set options -m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), - [_LT_SET_OPTION([$1], _LT_Option)]) - -m4_if([$1],[LT_INIT],[ - dnl - dnl Simply set some default values (i.e off) if boolean options were not - dnl specified: - _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no - ]) - _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no - ]) - dnl - dnl If no reference was made to various pairs of opposing options, then - dnl we run the default mode handler for the pair. For example, if neither - dnl `shared' nor `disable-shared' was passed, we enable building of shared - dnl archives by default: - _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) - _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) - _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) - _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], - [_LT_ENABLE_FAST_INSTALL]) - ]) -])# _LT_SET_OPTIONS - - -## --------------------------------- ## -## Macros to handle LT_INIT options. ## -## --------------------------------- ## - -# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) -# ----------------------------------------- -m4_define([_LT_MANGLE_DEFUN], -[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) - - -# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) -# ----------------------------------------------- -m4_define([LT_OPTION_DEFINE], -[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl -])# LT_OPTION_DEFINE - - -# dlopen -# ------ -LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes -]) - -AU_DEFUN([AC_LIBTOOL_DLOPEN], -[_LT_SET_OPTION([LT_INIT], [dlopen]) -AC_DIAGNOSE([obsolete], -[$0: Remove this warning and the call to _LT_SET_OPTION when you -put the `dlopen' option into LT_INIT's first parameter.]) -]) - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) - - -# win32-dll -# --------- -# Declare package support for building win32 dll's. -LT_OPTION_DEFINE([LT_INIT], [win32-dll], -[enable_win32_dll=yes - -case $host in -*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) - AC_CHECK_TOOL(AS, as, false) - AC_CHECK_TOOL(DLLTOOL, dlltool, false) - AC_CHECK_TOOL(OBJDUMP, objdump, false) - ;; -esac - -test -z "$AS" && AS=as -_LT_DECL([], [AS], [1], [Assembler program])dnl - -test -z "$DLLTOOL" && DLLTOOL=dlltool -_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl - -test -z "$OBJDUMP" && OBJDUMP=objdump -_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl -])# win32-dll - -AU_DEFUN([AC_LIBTOOL_WIN32_DLL], -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -_LT_SET_OPTION([LT_INIT], [win32-dll]) -AC_DIAGNOSE([obsolete], -[$0: Remove this warning and the call to _LT_SET_OPTION when you -put the `win32-dll' option into LT_INIT's first parameter.]) -]) - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) - - -# _LT_ENABLE_SHARED([DEFAULT]) -# ---------------------------- -# implement the --enable-shared flag, and supports the `shared' and -# `disable-shared' LT_INIT options. -# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. -m4_define([_LT_ENABLE_SHARED], -[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl -AC_ARG_ENABLE([shared], - [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], - [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], - [p=${PACKAGE-default} - case $enableval in - yes) enable_shared=yes ;; - no) enable_shared=no ;; - *) - enable_shared=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_shared=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac], - [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) - - _LT_DECL([build_libtool_libs], [enable_shared], [0], - [Whether or not to build shared libraries]) -])# _LT_ENABLE_SHARED - -LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) -LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) - -# Old names: -AC_DEFUN([AC_ENABLE_SHARED], -[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) -]) - -AC_DEFUN([AC_DISABLE_SHARED], -[_LT_SET_OPTION([LT_INIT], [disable-shared]) -]) - -AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) -AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AM_ENABLE_SHARED], []) -dnl AC_DEFUN([AM_DISABLE_SHARED], []) - - - -# _LT_ENABLE_STATIC([DEFAULT]) -# ---------------------------- -# implement the --enable-static flag, and support the `static' and -# `disable-static' LT_INIT options. -# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. -m4_define([_LT_ENABLE_STATIC], -[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl -AC_ARG_ENABLE([static], - [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], - [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], - [p=${PACKAGE-default} - case $enableval in - yes) enable_static=yes ;; - no) enable_static=no ;; - *) - enable_static=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_static=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac], - [enable_static=]_LT_ENABLE_STATIC_DEFAULT) - - _LT_DECL([build_old_libs], [enable_static], [0], - [Whether or not to build static libraries]) -])# _LT_ENABLE_STATIC - -LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) -LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) - -# Old names: -AC_DEFUN([AC_ENABLE_STATIC], -[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) -]) - -AC_DEFUN([AC_DISABLE_STATIC], -[_LT_SET_OPTION([LT_INIT], [disable-static]) -]) - -AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) -AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AM_ENABLE_STATIC], []) -dnl AC_DEFUN([AM_DISABLE_STATIC], []) - - - -# _LT_ENABLE_FAST_INSTALL([DEFAULT]) -# ---------------------------------- -# implement the --enable-fast-install flag, and support the `fast-install' -# and `disable-fast-install' LT_INIT options. -# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. -m4_define([_LT_ENABLE_FAST_INSTALL], -[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl -AC_ARG_ENABLE([fast-install], - [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], - [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], - [p=${PACKAGE-default} - case $enableval in - yes) enable_fast_install=yes ;; - no) enable_fast_install=no ;; - *) - enable_fast_install=no - # Look at the argument we got. We use all the common list separators. - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for pkg in $enableval; do - IFS="$lt_save_ifs" - if test "X$pkg" = "X$p"; then - enable_fast_install=yes - fi - done - IFS="$lt_save_ifs" - ;; - esac], - [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) - -_LT_DECL([fast_install], [enable_fast_install], [0], - [Whether or not to optimize for fast installation])dnl -])# _LT_ENABLE_FAST_INSTALL - -LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) -LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) - -# Old names: -AU_DEFUN([AC_ENABLE_FAST_INSTALL], -[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) -AC_DIAGNOSE([obsolete], -[$0: Remove this warning and the call to _LT_SET_OPTION when you put -the `fast-install' option into LT_INIT's first parameter.]) -]) - -AU_DEFUN([AC_DISABLE_FAST_INSTALL], -[_LT_SET_OPTION([LT_INIT], [disable-fast-install]) -AC_DIAGNOSE([obsolete], -[$0: Remove this warning and the call to _LT_SET_OPTION when you put -the `disable-fast-install' option into LT_INIT's first parameter.]) -]) - -dnl aclocal-1.4 backwards compatibility: -dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) -dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) - - -# _LT_WITH_PIC([MODE]) -# -------------------- -# implement the --with-pic flag, and support the `pic-only' and `no-pic' -# LT_INIT options. -# MODE is either `yes' or `no'. If omitted, it defaults to `both'. -m4_define([_LT_WITH_PIC], -[AC_ARG_WITH([pic], - [AS_HELP_STRING([--with-pic], - [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/impl/antlr/libantlr3c-3.4/m4/ltsugar.m4 b/impl/antlr/libantlr3c-3.4/m4/ltsugar.m4 deleted file mode 100644 index 9000a05..0000000 --- a/impl/antlr/libantlr3c-3.4/m4/ltsugar.m4 +++ /dev/null @@ -1,123 +0,0 @@ -# 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/impl/antlr/libantlr3c-3.4/m4/ltversion.m4 b/impl/antlr/libantlr3c-3.4/m4/ltversion.m4 deleted file mode 100644 index 93fc771..0000000 --- a/impl/antlr/libantlr3c-3.4/m4/ltversion.m4 +++ /dev/null @@ -1,23 +0,0 @@ -# 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 3175 ltversion.m4 -# This file is part of GNU Libtool - -m4_define([LT_PACKAGE_VERSION], [2.2.10]) -m4_define([LT_PACKAGE_REVISION], [1.3175]) - -AC_DEFUN([LTVERSION_VERSION], -[macro_version='2.2.10' -macro_revision='1.3175' -_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) -_LT_DECL(, macro_revision, 0) -]) diff --git a/impl/antlr/libantlr3c-3.4/m4/lt~obsolete.m4 b/impl/antlr/libantlr3c-3.4/m4/lt~obsolete.m4 deleted file mode 100644 index c573da9..0000000 --- a/impl/antlr/libantlr3c-3.4/m4/lt~obsolete.m4 +++ /dev/null @@ -1,98 +0,0 @@ -# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- -# -# Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc. -# Written by Scott James Remnant, 2004. -# -# This file is free software; the Free Software Foundation gives -# unlimited permission to copy and/or distribute it, with or without -# modifications, as long as this notice is preserved. - -# serial 5 lt~obsolete.m4 - -# These exist entirely to fool aclocal when bootstrapping libtool. -# -# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN) -# which have later been changed to m4_define as they aren't part of the -# exported API, or moved to Autoconf or Automake where they belong. -# -# The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN -# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us -# using a macro with the same name in our local m4/libtool.m4 it'll -# pull the old libtool.m4 in (it doesn't see our shiny new m4_define -# and doesn't know about Autoconf macros at all.) -# -# So we provide this file, which has a silly filename so it's always -# included after everything else. This provides aclocal with the -# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything -# because those macros already exist, or will be overwritten later. -# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. -# -# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. -# Yes, that means every name once taken will need to remain here until -# we give up compatibility with versions before 1.7, at which point -# we need to keep only those names which we still refer to. - -# This is to help aclocal find these macros, as it can't see m4_define. -AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) - -m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) -m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) -m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) -m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) -m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) -m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) -m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) -m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) -m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) -m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) -m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) -m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) -m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) -m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) -m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) -m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) -m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) -m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) -m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) -m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) -m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) -m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) -m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) -m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) -m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) -m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) -m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) -m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) -m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) -m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) -m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) -m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) -m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) -m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) -m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) -m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) -m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) -m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) -m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) -m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) -m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) -m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) -m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) -m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) -m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) -m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) -m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) -m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) -m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) -m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) -m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) -m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) -m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) -m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) -m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) -m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) -m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) -m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) -m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) -m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) -m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) diff --git a/impl/antlr/libantlr3c-3.4/missing b/impl/antlr/libantlr3c-3.4/missing deleted file mode 100755 index 28055d2..0000000 --- a/impl/antlr/libantlr3c-3.4/missing +++ /dev/null @@ -1,376 +0,0 @@ -#! /bin/sh -# Common stub for a few missing GNU programs while installing. - -scriptversion=2009-04-28.21; # UTC - -# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006, -# 2008, 2009 Free Software Foundation, Inc. -# Originally by Fran,cois Pinard , 1996. - -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -if test $# -eq 0; then - echo 1>&2 "Try \`$0 --help' for more information" - exit 1 -fi - -run=: -sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' -sed_minuso='s/.* -o \([^ ]*\).*/\1/p' - -# In the cases where this matters, `missing' is being run in the -# srcdir already. -if test -f configure.ac; then - configure_ac=configure.ac -else - configure_ac=configure.in -fi - -msg="missing on your system" - -case $1 in ---run) - # Try to run requested program, and just exit if it succeeds. - run= - shift - "$@" && exit 0 - # Exit code 63 means version mismatch. This often happens - # when the user try to use an ancient version of a tool on - # a file that requires a minimum version. In this case we - # we should proceed has if the program had been absent, or - # if --run hadn't been passed. - if test $? = 63; then - run=: - msg="probably too old" - fi - ;; - - -h|--h|--he|--hel|--help) - echo "\ -$0 [OPTION]... PROGRAM [ARGUMENT]... - -Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an -error status if there is no known handling for PROGRAM. - -Options: - -h, --help display this help and exit - -v, --version output version information and exit - --run try to run the given command, and emulate it if it fails - -Supported PROGRAM values: - aclocal touch file \`aclocal.m4' - autoconf touch file \`configure' - autoheader touch file \`config.h.in' - autom4te touch the output file, or create a stub one - automake touch all \`Makefile.in' files - bison create \`y.tab.[ch]', if possible, from existing .[ch] - flex create \`lex.yy.c', if possible, from existing .c - help2man touch the output file - lex create \`lex.yy.c', if possible, from existing .c - makeinfo touch the output file - 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 ." - 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-time-zone: "UTC" -# time-stamp-end: "; # UTC" -# End: diff --git a/impl/antlr/libantlr3c-3.4/src/antlr3baserecognizer.c b/impl/antlr/libantlr3c-3.4/src/antlr3baserecognizer.c deleted file mode 100644 index e2eccc6..0000000 --- a/impl/antlr/libantlr3c-3.4/src/antlr3baserecognizer.c +++ /dev/null @@ -1,2235 +0,0 @@ -/** \file - * Contains the base functions that all recognizers require. - * Any function can be overridden by a lexer/parser/tree parser or by the - * ANTLR3 programmer. - * - * \addtogroup pANTLR3_BASE_RECOGNIZER - * @{ - */ -#include - -// [The "BSD licence"] -// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC -// http://www.temporal-wave.com -// http://www.linkedin.com/in/jimidle -// -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions -// are met: -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// 3. The name of the author may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#ifdef ANTLR3_WINDOWS -#pragma warning( disable : 4100 ) -#endif - -/* Interface functions -standard implementations cover parser and treeparser - * almost completely but are overridden by the parser or tree parser as needed. Lexer overrides - * most of these functions. - */ -static void beginResync (pANTLR3_BASE_RECOGNIZER recognizer); -static pANTLR3_BITSET computeErrorRecoverySet (pANTLR3_BASE_RECOGNIZER recognizer); -static void endResync (pANTLR3_BASE_RECOGNIZER recognizer); -static void beginBacktrack (pANTLR3_BASE_RECOGNIZER recognizer, ANTLR3_UINT32 level); -static void endBacktrack (pANTLR3_BASE_RECOGNIZER recognizer, ANTLR3_UINT32 level, ANTLR3_BOOLEAN successful); - -static void * match (pANTLR3_BASE_RECOGNIZER recognizer, ANTLR3_UINT32 ttype, pANTLR3_BITSET_LIST follow); -static void matchAny (pANTLR3_BASE_RECOGNIZER recognizer); -static void mismatch (pANTLR3_BASE_RECOGNIZER recognizer, ANTLR3_UINT32 ttype, pANTLR3_BITSET_LIST follow); -static ANTLR3_BOOLEAN mismatchIsUnwantedToken (pANTLR3_BASE_RECOGNIZER recognizer, pANTLR3_INT_STREAM is, ANTLR3_UINT32 ttype); -static ANTLR3_BOOLEAN mismatchIsMissingToken (pANTLR3_BASE_RECOGNIZER recognizer, pANTLR3_INT_STREAM is, pANTLR3_BITSET_LIST follow); -static void reportError (pANTLR3_BASE_RECOGNIZER recognizer); -static pANTLR3_BITSET computeCSRuleFollow (pANTLR3_BASE_RECOGNIZER recognizer); -static pANTLR3_BITSET combineFollows (pANTLR3_BASE_RECOGNIZER recognizer, ANTLR3_BOOLEAN exact); -static void displayRecognitionError (pANTLR3_BASE_RECOGNIZER recognizer, pANTLR3_UINT8 * tokenNames); -static void recover (pANTLR3_BASE_RECOGNIZER recognizer); -static void * recoverFromMismatchedToken (pANTLR3_BASE_RECOGNIZER recognizer, ANTLR3_UINT32 ttype, pANTLR3_BITSET_LIST follow); -static void * recoverFromMismatchedSet (pANTLR3_BASE_RECOGNIZER recognizer, pANTLR3_BITSET_LIST follow); -static ANTLR3_BOOLEAN recoverFromMismatchedElement(pANTLR3_BASE_RECOGNIZER recognizer, pANTLR3_BITSET_LIST follow); -static void consumeUntil (pANTLR3_BASE_RECOGNIZER recognizer, ANTLR3_UINT32 tokenType); -static void consumeUntilSet (pANTLR3_BASE_RECOGNIZER recognizer, pANTLR3_BITSET set); -static pANTLR3_STACK getRuleInvocationStack (pANTLR3_BASE_RECOGNIZER recognizer); -static pANTLR3_STACK getRuleInvocationStackNamed (pANTLR3_BASE_RECOGNIZER recognizer, pANTLR3_UINT8 name); -static pANTLR3_HASH_TABLE toStrings (pANTLR3_BASE_RECOGNIZER recognizer, pANTLR3_HASH_TABLE); -static ANTLR3_MARKER getRuleMemoization (pANTLR3_BASE_RECOGNIZER recognizer, ANTLR3_INTKEY ruleIndex, ANTLR3_MARKER ruleParseStart); -static ANTLR3_BOOLEAN alreadyParsedRule (pANTLR3_BASE_RECOGNIZER recognizer, ANTLR3_MARKER ruleIndex); -static void memoize (pANTLR3_BASE_RECOGNIZER recognizer, ANTLR3_MARKER ruleIndex, ANTLR3_MARKER ruleParseStart); -static ANTLR3_BOOLEAN synpred (pANTLR3_BASE_RECOGNIZER recognizer, void * ctx, void (*predicate)(void * ctx)); -static void reset (pANTLR3_BASE_RECOGNIZER recognizer); -static void freeBR (pANTLR3_BASE_RECOGNIZER recognizer); -static void * getCurrentInputSymbol (pANTLR3_BASE_RECOGNIZER recognizer, pANTLR3_INT_STREAM istream); -static void * getMissingSymbol (pANTLR3_BASE_RECOGNIZER recognizer, pANTLR3_INT_STREAM istream, pANTLR3_EXCEPTION e, - ANTLR3_UINT32 expectedTokenType, pANTLR3_BITSET_LIST follow); -static ANTLR3_UINT32 getNumberOfSyntaxErrors (pANTLR3_BASE_RECOGNIZER recognizer); - -ANTLR3_API pANTLR3_BASE_RECOGNIZER -antlr3BaseRecognizerNew(ANTLR3_UINT32 type, ANTLR3_UINT32 sizeHint, pANTLR3_RECOGNIZER_SHARED_STATE state) -{ - pANTLR3_BASE_RECOGNIZER recognizer; - - // Allocate memory for the structure - // - recognizer = (pANTLR3_BASE_RECOGNIZER) ANTLR3_MALLOC((size_t)sizeof(ANTLR3_BASE_RECOGNIZER)); - - if (recognizer == NULL) - { - // Allocation failed - // - return NULL; - } - - - // If we have been supplied with a pre-existing recognizer state - // then we just install it, otherwise we must create one from scratch - // - if (state == NULL) - { - recognizer->state = (pANTLR3_RECOGNIZER_SHARED_STATE) ANTLR3_CALLOC(1, (size_t)sizeof(ANTLR3_RECOGNIZER_SHARED_STATE)); - - if (recognizer->state == NULL) - { - ANTLR3_FREE(recognizer); - return NULL; - } - - // Initialize any new recognizer state - // - recognizer->state->errorRecovery = ANTLR3_FALSE; - recognizer->state->lastErrorIndex = -1; - recognizer->state->failed = ANTLR3_FALSE; - recognizer->state->errorCount = 0; - recognizer->state->backtracking = 0; - recognizer->state->following = NULL; - recognizer->state->ruleMemo = NULL; - recognizer->state->tokenNames = NULL; - recognizer->state->sizeHint = sizeHint; - recognizer->state->tokSource = NULL; - recognizer->state->tokFactory = NULL; - - // Rather than check to see if we must initialize - // the stack every time we are asked for an new rewrite stream - // we just always create an empty stack and then just - // free it when the base recognizer is freed. - // - recognizer->state->rStreams = antlr3VectorNew(0); // We don't know the size. - - if (recognizer->state->rStreams == NULL) - { - // Out of memory - // - ANTLR3_FREE(recognizer->state); - ANTLR3_FREE(recognizer); - return NULL; - } - } - else - { - // Install the one we were given, and do not reset it here - // as it will either already have been initialized or will - // be in a state that needs to be preserved. - // - recognizer->state = state; - } - - // Install the BR API - // - recognizer->alreadyParsedRule = alreadyParsedRule; - recognizer->beginResync = beginResync; - recognizer->combineFollows = combineFollows; - recognizer->beginBacktrack = beginBacktrack; - recognizer->endBacktrack = endBacktrack; - recognizer->computeCSRuleFollow = computeCSRuleFollow; - recognizer->computeErrorRecoverySet = computeErrorRecoverySet; - recognizer->consumeUntil = consumeUntil; - recognizer->consumeUntilSet = consumeUntilSet; - recognizer->displayRecognitionError = displayRecognitionError; - recognizer->endResync = endResync; - recognizer->exConstruct = antlr3MTExceptionNew; - recognizer->getRuleInvocationStack = getRuleInvocationStack; - recognizer->getRuleInvocationStackNamed = getRuleInvocationStackNamed; - recognizer->getRuleMemoization = getRuleMemoization; - recognizer->match = match; - recognizer->matchAny = matchAny; - recognizer->memoize = memoize; - recognizer->mismatch = mismatch; - recognizer->mismatchIsUnwantedToken = mismatchIsUnwantedToken; - recognizer->mismatchIsMissingToken = mismatchIsMissingToken; - recognizer->recover = recover; - recognizer->recoverFromMismatchedElement= recoverFromMismatchedElement; - recognizer->recoverFromMismatchedSet = recoverFromMismatchedSet; - recognizer->recoverFromMismatchedToken = recoverFromMismatchedToken; - recognizer->getNumberOfSyntaxErrors = getNumberOfSyntaxErrors; - recognizer->reportError = reportError; - recognizer->reset = reset; - recognizer->synpred = synpred; - recognizer->toStrings = toStrings; - recognizer->getCurrentInputSymbol = getCurrentInputSymbol; - recognizer->getMissingSymbol = getMissingSymbol; - recognizer->debugger = NULL; - - recognizer->free = freeBR; - - /* Initialize variables - */ - recognizer->type = type; - - - return recognizer; -} -static void -freeBR (pANTLR3_BASE_RECOGNIZER recognizer) -{ - pANTLR3_EXCEPTION thisE; - - // Did we have a state allocated? - // - if (recognizer->state != NULL) - { - // Free any rule memoization we set up - // - if (recognizer->state->ruleMemo != NULL) - { - recognizer->state->ruleMemo->free(recognizer->state->ruleMemo); - recognizer->state->ruleMemo = NULL; - } - - // Free any exception space we have left around - // - thisE = recognizer->state->exception; - if (thisE != NULL) - { - thisE->freeEx(thisE); - } - - // Free any rewrite streams we have allocated - // - if (recognizer->state->rStreams != NULL) - { - recognizer->state->rStreams->free(recognizer->state->rStreams); - } - - // Free up any token factory we created (error recovery for instance) - // - if (recognizer->state->tokFactory != NULL) - { - recognizer->state->tokFactory->close(recognizer->state->tokFactory); - } - // Free the shared state memory - // - ANTLR3_FREE(recognizer->state); - } - - // Free the actual recognizer space - // - ANTLR3_FREE(recognizer); -} - -/** - * Creates a new Mismatched Token Exception and inserts in the recognizer - * exception stack. - * - * \param recognizer - * Context pointer for this recognizer - * - */ -ANTLR3_API void -antlr3MTExceptionNew(pANTLR3_BASE_RECOGNIZER recognizer) -{ - /* Create a basic recognition exception structure - */ - antlr3RecognitionExceptionNew(recognizer); - - /* Now update it to indicate this is a Mismatched token exception - */ - recognizer->state->exception->name = ANTLR3_MISMATCHED_EX_NAME; - recognizer->state->exception->type = ANTLR3_MISMATCHED_TOKEN_EXCEPTION; - - return; -} - -ANTLR3_API void -antlr3RecognitionExceptionNew(pANTLR3_BASE_RECOGNIZER recognizer) -{ - pANTLR3_EXCEPTION ex; - pANTLR3_LEXER lexer; - pANTLR3_PARSER parser; - pANTLR3_TREE_PARSER tparser; - - pANTLR3_INPUT_STREAM ins; - pANTLR3_INT_STREAM is; - pANTLR3_COMMON_TOKEN_STREAM cts; - pANTLR3_TREE_NODE_STREAM tns; - - ins = NULL; - cts = NULL; - tns = NULL; - is = NULL; - lexer = NULL; - parser = NULL; - tparser = NULL; - - switch (recognizer->type) - { - case ANTLR3_TYPE_LEXER: - - lexer = (pANTLR3_LEXER) (recognizer->super); - ins = lexer->input; - is = ins->istream; - - break; - - case ANTLR3_TYPE_PARSER: - - parser = (pANTLR3_PARSER) (recognizer->super); - cts = (pANTLR3_COMMON_TOKEN_STREAM)(parser->tstream->super); - is = parser->tstream->istream; - - break; - - case ANTLR3_TYPE_TREE_PARSER: - - tparser = (pANTLR3_TREE_PARSER) (recognizer->super); - tns = tparser->ctnstream->tnstream; - is = tns->istream; - - break; - - default: - - ANTLR3_FPRINTF(stderr, "Base recognizer function antlr3RecognitionExceptionNew called by unknown parser type - provide override for this function\n"); - return; - - break; - } - - /* Create a basic exception structure - */ - ex = antlr3ExceptionNew(ANTLR3_RECOGNITION_EXCEPTION, - (void *)ANTLR3_RECOGNITION_EX_NAME, - NULL, - ANTLR3_FALSE); - - /* Rest of information depends on the base type of the - * input stream. - */ - switch (is->type & ANTLR3_INPUT_MASK) - { - case ANTLR3_CHARSTREAM: - - ex->c = is->_LA (is, 1); /* Current input character */ - ex->line = ins->getLine (ins); /* Line number comes from stream */ - ex->charPositionInLine = ins->getCharPositionInLine (ins); /* Line offset also comes from the stream */ - ex->index = is->index (is); - ex->streamName = ins->fileName; - ex->message = "Unexpected character"; - break; - - case ANTLR3_TOKENSTREAM: - - ex->token = cts->tstream->_LT (cts->tstream, 1); /* Current input token */ - ex->line = ((pANTLR3_COMMON_TOKEN)(ex->token))->getLine (ex->token); - ex->charPositionInLine = ((pANTLR3_COMMON_TOKEN)(ex->token))->getCharPositionInLine (ex->token); - ex->index = cts->tstream->istream->index (cts->tstream->istream); - if (((pANTLR3_COMMON_TOKEN)(ex->token))->type == ANTLR3_TOKEN_EOF) - { - ex->streamName = NULL; - } - else - { - ex->streamName = ((pANTLR3_COMMON_TOKEN)(ex->token))->input->fileName; - } - ex->message = "Unexpected token"; - break; - - case ANTLR3_COMMONTREENODE: - - ex->token = tns->_LT (tns, 1); /* Current input tree node */ - ex->line = ((pANTLR3_BASE_TREE)(ex->token))->getLine (ex->token); - ex->charPositionInLine = ((pANTLR3_BASE_TREE)(ex->token))->getCharPositionInLine (ex->token); - ex->index = tns->istream->index (tns->istream); - - // Are you ready for this? Deep breath now... - // - { - pANTLR3_COMMON_TREE tnode; - - tnode = ((pANTLR3_COMMON_TREE)(((pANTLR3_BASE_TREE)(ex->token))->super)); - - if (tnode->token == NULL) - { - ex->streamName = ((pANTLR3_BASE_TREE)(ex->token))->strFactory->newStr(((pANTLR3_BASE_TREE)(ex->token))->strFactory, (pANTLR3_UINT8)"-unknown source-"); - } - else - { - if (tnode->token->input == NULL) - { - ex->streamName = NULL; - } - else - { - ex->streamName = tnode->token->input->fileName; - } - } - ex->message = "Unexpected node"; - } - break; - } - - ex->input = is; - ex->nextException = recognizer->state->exception; /* So we don't leak the memory */ - recognizer->state->exception = ex; - recognizer->state->error = ANTLR3_TRUE; /* Exception is outstanding */ - - return; -} - - -/// Match current input symbol against ttype. Upon error, do one token -/// insertion or deletion if possible. -/// To turn off single token insertion or deletion error -/// recovery, override mismatchRecover() and have it call -/// plain mismatch(), which does not recover. Then any error -/// in a rule will cause an exception and immediate exit from -/// rule. Rule would recover by resynchronizing to the set of -/// symbols that can follow rule ref. -/// -static void * -match( pANTLR3_BASE_RECOGNIZER recognizer, - ANTLR3_UINT32 ttype, pANTLR3_BITSET_LIST follow) -{ - pANTLR3_PARSER parser; - pANTLR3_TREE_PARSER tparser; - pANTLR3_INT_STREAM is; - void * matchedSymbol; - - switch (recognizer->type) - { - case ANTLR3_TYPE_PARSER: - - parser = (pANTLR3_PARSER) (recognizer->super); - tparser = NULL; - is = parser->tstream->istream; - - break; - - case ANTLR3_TYPE_TREE_PARSER: - - tparser = (pANTLR3_TREE_PARSER) (recognizer->super); - parser = NULL; - is = tparser->ctnstream->tnstream->istream; - - break; - - default: - - ANTLR3_FPRINTF(stderr, "Base recognizer function 'match' called by unknown parser type - provide override for this function\n"); - return ANTLR3_FALSE; - - break; - } - - // Pick up the current input token/node for assignment to labels - // - matchedSymbol = recognizer->getCurrentInputSymbol(recognizer, is); - - if (is->_LA(is, 1) == ttype) - { - // The token was the one we were told to expect - // - is->consume(is); // Consume that token from the stream - recognizer->state->errorRecovery = ANTLR3_FALSE; // Not in error recovery now (if we were) - recognizer->state->failed = ANTLR3_FALSE; // The match was a success - return matchedSymbol; // We are done - } - - // We did not find the expected token type, if we are backtracking then - // we just set the failed flag and return. - // - if (recognizer->state->backtracking > 0) - { - // Backtracking is going on - // - recognizer->state->failed = ANTLR3_TRUE; - return matchedSymbol; - } - - // We did not find the expected token and there is no backtracking - // going on, so we mismatch, which creates an exception in the recognizer exception - // stack. - // - matchedSymbol = recognizer->recoverFromMismatchedToken(recognizer, ttype, follow); - return matchedSymbol; -} - -/// Consumes the next token, whatever it is, and resets the recognizer state -/// so that it is not in error. -/// -/// \param recognizer -/// Recognizer context pointer -/// -static void -matchAny(pANTLR3_BASE_RECOGNIZER recognizer) -{ - pANTLR3_PARSER parser; - pANTLR3_TREE_PARSER tparser; - pANTLR3_INT_STREAM is; - - switch (recognizer->type) - { - case ANTLR3_TYPE_PARSER: - - parser = (pANTLR3_PARSER) (recognizer->super); - tparser = NULL; - is = parser->tstream->istream; - - break; - - case ANTLR3_TYPE_TREE_PARSER: - - tparser = (pANTLR3_TREE_PARSER) (recognizer->super); - parser = NULL; - is = tparser->ctnstream->tnstream->istream; - - break; - - default: - - ANTLR3_FPRINTF(stderr, "Base recognizer function 'matchAny' called by unknown parser type - provide override for this function\n"); - return; - - break; - } - recognizer->state->errorRecovery = ANTLR3_FALSE; - recognizer->state->failed = ANTLR3_FALSE; - is->consume(is); - - return; -} -/// -/// -static ANTLR3_BOOLEAN -mismatchIsUnwantedToken(pANTLR3_BASE_RECOGNIZER recognizer, pANTLR3_INT_STREAM is, ANTLR3_UINT32 ttype) -{ - ANTLR3_UINT32 nextt; - - nextt = is->_LA(is, 2); - - if (nextt == ttype) - { - if (recognizer->state->exception != NULL) - { - recognizer->state->exception->expecting = nextt; - } - return ANTLR3_TRUE; // This token is unknown, but the next one is the one we wanted - } - else - { - return ANTLR3_FALSE; // Neither this token, nor the one following is the one we wanted - } -} - -/// -/// -static ANTLR3_BOOLEAN -mismatchIsMissingToken(pANTLR3_BASE_RECOGNIZER recognizer, pANTLR3_INT_STREAM is, pANTLR3_BITSET_LIST follow) -{ - ANTLR3_BOOLEAN retcode; - pANTLR3_BITSET followClone; - pANTLR3_BITSET viableTokensFollowingThisRule; - - if (follow == NULL) - { - // There is no information about the tokens that can follow the last one - // hence we must say that the current one we found is not a member of the - // follow set and does not indicate a missing token. We will just consume this - // single token and see if the parser works it out from there. - // - return ANTLR3_FALSE; - } - - followClone = NULL; - viableTokensFollowingThisRule = NULL; - - // The C bitset maps are laid down at compile time by the - // C code generation. Hence we cannot remove things from them - // and so on. So, in order to remove EOR (if we need to) then - // we clone the static bitset. - // - followClone = antlr3BitsetLoad(follow); - if (followClone == NULL) - { - return ANTLR3_FALSE; - } - - // Compute what can follow this grammar reference - // - if (followClone->isMember(followClone, ANTLR3_EOR_TOKEN_TYPE)) - { - // EOR can follow, but if we are not the start symbol, we - // need to remove it. - // - if (recognizer->state->following->vector->count >= 0) - { - followClone->remove(followClone, ANTLR3_EOR_TOKEN_TYPE); - } - - // Now compute the visiable tokens that can follow this rule, according to context - // and make them part of the follow set. - // - viableTokensFollowingThisRule = recognizer->computeCSRuleFollow(recognizer); - followClone->borInPlace(followClone, viableTokensFollowingThisRule); - } - - /// if current token is consistent with what could come after set - /// then we know we're missing a token; error recovery is free to - /// "insert" the missing token - /// - /// BitSet cannot handle negative numbers like -1 (EOF) so I leave EOR - /// in follow set to indicate that the fall of the start symbol is - /// in the set (EOF can follow). - /// - if ( followClone->isMember(followClone, is->_LA(is, 1)) - || followClone->isMember(followClone, ANTLR3_EOR_TOKEN_TYPE) - ) - { - retcode = ANTLR3_TRUE; - } - else - { - retcode = ANTLR3_FALSE; - } - - if (viableTokensFollowingThisRule != NULL) - { - viableTokensFollowingThisRule->free(viableTokensFollowingThisRule); - } - if (followClone != NULL) - { - followClone->free(followClone); - } - - return retcode; - -} - -/// Factor out what to do upon token mismatch so tree parsers can behave -/// differently. Override and call mismatchRecover(input, ttype, follow) -/// to get single token insertion and deletion. Use this to turn off -/// single token insertion and deletion. Override mismatchRecover -/// to call this instead. -/// -/// \remark mismatch only works for parsers and must be overridden for anything else. -/// -static void -mismatch(pANTLR3_BASE_RECOGNIZER recognizer, ANTLR3_UINT32 ttype, pANTLR3_BITSET_LIST follow) -{ - pANTLR3_PARSER parser; - pANTLR3_TREE_PARSER tparser; - pANTLR3_INT_STREAM is; - - // Install a mismatched token exception in the exception stack - // - antlr3MTExceptionNew(recognizer); - recognizer->state->exception->expecting = ttype; - - switch (recognizer->type) - { - case ANTLR3_TYPE_PARSER: - - parser = (pANTLR3_PARSER) (recognizer->super); - tparser = NULL; - is = parser->tstream->istream; - - break; - - default: - - ANTLR3_FPRINTF(stderr, "Base recognizer function 'mismatch' called by unknown parser type - provide override for this function\n"); - return; - - break; - } - - if (mismatchIsUnwantedToken(recognizer, is, ttype)) - { - // Create a basic recognition exception structure - // - antlr3RecognitionExceptionNew(recognizer); - - // Now update it to indicate this is an unwanted token exception - // - recognizer->state->exception->name = ANTLR3_UNWANTED_TOKEN_EXCEPTION_NAME; - recognizer->state->exception->type = ANTLR3_UNWANTED_TOKEN_EXCEPTION; - - return; - } - - if (mismatchIsMissingToken(recognizer, is, follow)) - { - // Create a basic recognition exception structure - // - antlr3RecognitionExceptionNew(recognizer); - - // Now update it to indicate this is an unwanted token exception - // - recognizer->state->exception->name = ANTLR3_MISSING_TOKEN_EXCEPTION_NAME; - recognizer->state->exception->type = ANTLR3_MISSING_TOKEN_EXCEPTION; - - return; - } - - // Just a mismatched token is all we can dtermine - // - antlr3MTExceptionNew(recognizer); - - return; -} -/// Report a recognition problem. -/// -/// This method sets errorRecovery to indicate the parser is recovering -/// not parsing. Once in recovery mode, no errors are generated. -/// To get out of recovery mode, the parser must successfully match -/// a token (after a resync). So it will go: -/// -/// 1. error occurs -/// 2. enter recovery mode, report error -/// 3. consume until token found in resynch set -/// 4. try to resume parsing -/// 5. next match() will reset errorRecovery mode -/// -/// If you override, make sure to update errorCount if you care about that. -/// -static void -reportError (pANTLR3_BASE_RECOGNIZER recognizer) -{ - // Invoke the debugger event if there is a debugger listening to us - // - if (recognizer->debugger != NULL) - { - recognizer->debugger->recognitionException(recognizer->debugger, recognizer->state->exception); - } - - if (recognizer->state->errorRecovery == ANTLR3_TRUE) - { - // Already in error recovery so don't display another error while doing so - // - return; - } - - // Signal we are in error recovery now - // - recognizer->state->errorRecovery = ANTLR3_TRUE; - - // Indicate this recognizer had an error while processing. - // - recognizer->state->errorCount++; - - // Call the error display routine - // - recognizer->displayRecognitionError(recognizer, recognizer->state->tokenNames); -} - -static void -beginBacktrack (pANTLR3_BASE_RECOGNIZER recognizer, ANTLR3_UINT32 level) -{ - if (recognizer->debugger != NULL) - { - recognizer->debugger->beginBacktrack(recognizer->debugger, level); - } -} - -static void -endBacktrack (pANTLR3_BASE_RECOGNIZER recognizer, ANTLR3_UINT32 level, ANTLR3_BOOLEAN successful) -{ - if (recognizer->debugger != NULL) - { - recognizer->debugger->endBacktrack(recognizer->debugger, level, successful); - } -} -static void -beginResync (pANTLR3_BASE_RECOGNIZER recognizer) -{ - if (recognizer->debugger != NULL) - { - recognizer->debugger->beginResync(recognizer->debugger); - } -} - -static void -endResync (pANTLR3_BASE_RECOGNIZER recognizer) -{ - if (recognizer->debugger != NULL) - { - recognizer->debugger->endResync(recognizer->debugger); - } -} - -/// Compute the error recovery set for the current rule. -/// Documentation below is from the Java implementation. -/// -/// During rule invocation, the parser pushes the set of tokens that can -/// follow that rule reference on the stack; this amounts to -/// computing FIRST of what follows the rule reference in the -/// enclosing rule. This local follow set only includes tokens -/// from within the rule; i.e., the FIRST computation done by -/// ANTLR stops at the end of a rule. -// -/// EXAMPLE -// -/// When you find a "no viable alt exception", the input is not -/// consistent with any of the alternatives for rule r. The best -/// thing to do is to consume tokens until you see something that -/// can legally follow a call to r *or* any rule that called r. -/// You don't want the exact set of viable next tokens because the -/// input might just be missing a token--you might consume the -/// rest of the input looking for one of the missing tokens. -/// -/// Consider grammar: -/// -/// a : '[' b ']' -/// | '(' b ')' -/// ; -/// b : c '^' INT ; -/// c : ID -/// | INT -/// ; -/// -/// At each rule invocation, the set of tokens that could follow -/// that rule is pushed on a stack. Here are the various "local" -/// follow sets: -/// -/// FOLLOW(b1_in_a) = FIRST(']') = ']' -/// FOLLOW(b2_in_a) = FIRST(')') = ')' -/// FOLLOW(c_in_b) = FIRST('^') = '^' -/// -/// Upon erroneous input "[]", the call chain is -/// -/// a -> b -> c -/// -/// and, hence, the follow context stack is: -/// -/// depth local follow set after call to rule -/// 0 a (from main()) -/// 1 ']' b -/// 3 '^' c -/// -/// Notice that ')' is not included, because b would have to have -/// been called from a different context in rule a for ')' to be -/// included. -/// -/// For error recovery, we cannot consider FOLLOW(c) -/// (context-sensitive or otherwise). We need the combined set of -/// all context-sensitive FOLLOW sets--the set of all tokens that -/// could follow any reference in the call chain. We need to -/// resync to one of those tokens. Note that FOLLOW(c)='^' and if -/// we resync'd to that token, we'd consume until EOF. We need to -/// sync to context-sensitive FOLLOWs for a, b, and c: {']','^'}. -/// In this case, for input "[]", LA(1) is in this set so we would -/// not consume anything and after printing an error rule c would -/// return normally. It would not find the required '^' though. -/// At this point, it gets a mismatched token error and throws an -/// exception (since LA(1) is not in the viable following token -/// set). The rule exception handler tries to recover, but finds -/// the same recovery set and doesn't consume anything. Rule b -/// exits normally returning to rule a. Now it finds the ']' (and -/// with the successful match exits errorRecovery mode). -/// -/// So, you can see that the parser walks up call chain looking -/// for the token that was a member of the recovery set. -/// -/// Errors are not generated in errorRecovery mode. -/// -/// ANTLR's error recovery mechanism is based upon original ideas: -/// -/// "Algorithms + Data Structures = Programs" by Niklaus Wirth -/// -/// and -/// -/// "A note on error recovery in recursive descent parsers": -/// http://portal.acm.org/citation.cfm?id=947902.947905 -/// -/// Later, Josef Grosch had some good ideas: -/// -/// "Efficient and Comfortable Error Recovery in Recursive Descent -/// Parsers": -/// ftp://www.cocolab.com/products/cocktail/doca4.ps/ell.ps.zip -/// -/// Like Grosch I implemented local FOLLOW sets that are combined -/// at run-time upon error to avoid overhead during parsing. -/// -static pANTLR3_BITSET -computeErrorRecoverySet (pANTLR3_BASE_RECOGNIZER recognizer) -{ - return recognizer->combineFollows(recognizer, ANTLR3_FALSE); -} - -/// Compute the context-sensitive FOLLOW set for current rule. -/// Documentation below is from the Java runtime. -/// -/// This is the set of token types that can follow a specific rule -/// reference given a specific call chain. You get the set of -/// viable tokens that can possibly come next (look ahead depth 1) -/// given the current call chain. Contrast this with the -/// definition of plain FOLLOW for rule r: -/// -/// FOLLOW(r)={x | S=>*alpha r beta in G and x in FIRST(beta)} -/// -/// where x in T* and alpha, beta in V*; T is set of terminals and -/// V is the set of terminals and non terminals. In other words, -/// FOLLOW(r) is the set of all tokens that can possibly follow -/// references to r in///any* sentential form (context). At -/// runtime, however, we know precisely which context applies as -/// we have the call chain. We may compute the exact (rather -/// than covering superset) set of following tokens. -/// -/// For example, consider grammar: -/// -/// stat : ID '=' expr ';' // FOLLOW(stat)=={EOF} -/// | "return" expr '.' -/// ; -/// expr : atom ('+' atom)* ; // FOLLOW(expr)=={';','.',')'} -/// atom : INT // FOLLOW(atom)=={'+',')',';','.'} -/// | '(' expr ')' -/// ; -/// -/// The FOLLOW sets are all inclusive whereas context-sensitive -/// FOLLOW sets are precisely what could follow a rule reference. -/// For input input "i=(3);", here is the derivation: -/// -/// stat => ID '=' expr ';' -/// => ID '=' atom ('+' atom)* ';' -/// => ID '=' '(' expr ')' ('+' atom)* ';' -/// => ID '=' '(' atom ')' ('+' atom)* ';' -/// => ID '=' '(' INT ')' ('+' atom)* ';' -/// => ID '=' '(' INT ')' ';' -/// -/// At the "3" token, you'd have a call chain of -/// -/// stat -> expr -> atom -> expr -> atom -/// -/// What can follow that specific nested ref to atom? Exactly ')' -/// as you can see by looking at the derivation of this specific -/// input. Contrast this with the FOLLOW(atom)={'+',')',';','.'}. -/// -/// You want the exact viable token set when recovering from a -/// token mismatch. Upon token mismatch, if LA(1) is member of -/// the viable next token set, then you know there is most likely -/// a missing token in the input stream. "Insert" one by just not -/// throwing an exception. -/// -static pANTLR3_BITSET -computeCSRuleFollow (pANTLR3_BASE_RECOGNIZER recognizer) -{ - return recognizer->combineFollows(recognizer, ANTLR3_FALSE); -} - -/// Compute the current followset for the input stream. -/// -static pANTLR3_BITSET -combineFollows (pANTLR3_BASE_RECOGNIZER recognizer, ANTLR3_BOOLEAN exact) -{ - pANTLR3_BITSET followSet; - pANTLR3_BITSET localFollowSet; - ANTLR3_UINT32 top; - ANTLR3_UINT32 i; - - top = recognizer->state->following->size(recognizer->state->following); - - followSet = antlr3BitsetNew(0); - localFollowSet = NULL; - - for (i = top; i>0; i--) - { - localFollowSet = antlr3BitsetLoad((pANTLR3_BITSET_LIST) recognizer->state->following->get(recognizer->state->following, i-1)); - - if (localFollowSet != NULL) - { - followSet->borInPlace(followSet, localFollowSet); - - if (exact == ANTLR3_TRUE) - { - if (localFollowSet->isMember(localFollowSet, ANTLR3_EOR_TOKEN_TYPE) == ANTLR3_FALSE) - { - // Only leave EOR in the set if at top (start rule); this lets us know - // if we have to include the follow(start rule); I.E., EOF - // - if (i>1) - { - followSet->remove(followSet, ANTLR3_EOR_TOKEN_TYPE); - } - } - else - { - break; // Cannot see End Of Rule from here, just drop out - } - } - localFollowSet->free(localFollowSet); - localFollowSet = NULL; - } - } - - if (localFollowSet != NULL) - { - localFollowSet->free(localFollowSet); - } - return followSet; -} - -/// Standard/Example error display method. -/// No generic error message display funciton coudl possibly do everything correctly -/// for all possible parsers. Hence you are provided with this example routine, which -/// you should override in your parser/tree parser to do as you will. -/// -/// Here we depart somewhat from the Java runtime as that has now split up a lot -/// of the error display routines into spearate units. However, ther is little advantage -/// to this in the C version as you will probably implement all such routines as a -/// separate translation unit, rather than install them all as pointers to functions -/// in the base recognizer. -/// -static void -displayRecognitionError (pANTLR3_BASE_RECOGNIZER recognizer, pANTLR3_UINT8 * tokenNames) -{ - pANTLR3_PARSER parser; - pANTLR3_TREE_PARSER tparser; - pANTLR3_INT_STREAM is; - pANTLR3_STRING ttext; - pANTLR3_STRING ftext; - pANTLR3_EXCEPTION ex; - pANTLR3_COMMON_TOKEN theToken; - pANTLR3_BASE_TREE theBaseTree; - pANTLR3_COMMON_TREE theCommonTree; - - // Retrieve some info for easy reading. - // - ex = recognizer->state->exception; - ttext = NULL; - - // See if there is a 'filename' we can use - // - if (ex->streamName == NULL) - { - if (((pANTLR3_COMMON_TOKEN)(ex->token))->type == ANTLR3_TOKEN_EOF) - { - ANTLR3_FPRINTF(stderr, "-end of input-("); - } - else - { - ANTLR3_FPRINTF(stderr, "-unknown source-("); - } - } - else - { - ftext = ex->streamName->to8(ex->streamName); - ANTLR3_FPRINTF(stderr, "%s(", ftext->chars); - } - - // Next comes the line number - // - - ANTLR3_FPRINTF(stderr, "%d) ", recognizer->state->exception->line); - ANTLR3_FPRINTF(stderr, " : error %d : %s", - recognizer->state->exception->type, - (pANTLR3_UINT8) (recognizer->state->exception->message)); - - - // How we determine the next piece is dependent on which thing raised the - // error. - // - switch (recognizer->type) - { - case ANTLR3_TYPE_PARSER: - - // Prepare the knowledge we know we have - // - parser = (pANTLR3_PARSER) (recognizer->super); - tparser = NULL; - is = parser->tstream->istream; - theToken = (pANTLR3_COMMON_TOKEN)(recognizer->state->exception->token); - ttext = theToken->toString(theToken); - - ANTLR3_FPRINTF(stderr, ", at offset %d", recognizer->state->exception->charPositionInLine); - if (theToken != NULL) - { - if (theToken->type == ANTLR3_TOKEN_EOF) - { - ANTLR3_FPRINTF(stderr, ", at "); - } - else - { - // Guard against null text in a token - // - ANTLR3_FPRINTF(stderr, "\n near %s\n ", ttext == NULL ? (pANTLR3_UINT8)"" : ttext->chars); - } - } - break; - - case ANTLR3_TYPE_TREE_PARSER: - - tparser = (pANTLR3_TREE_PARSER) (recognizer->super); - parser = NULL; - is = tparser->ctnstream->tnstream->istream; - theBaseTree = (pANTLR3_BASE_TREE)(recognizer->state->exception->token); - ttext = theBaseTree->toStringTree(theBaseTree); - - if (theBaseTree != NULL) - { - theCommonTree = (pANTLR3_COMMON_TREE) theBaseTree->super; - - if (theCommonTree != NULL) - { - theToken = (pANTLR3_COMMON_TOKEN) theBaseTree->getToken(theBaseTree); - } - ANTLR3_FPRINTF(stderr, ", at offset %d", theBaseTree->getCharPositionInLine(theBaseTree)); - ANTLR3_FPRINTF(stderr, ", near %s", ttext->chars); - } - break; - - default: - - ANTLR3_FPRINTF(stderr, "Base recognizer function displayRecognitionError called by unknown parser type - provide override for this function\n"); - return; - break; - } - - // Although this function should generally be provided by the implementation, this one - // should be as helpful as possible for grammar developers and serve as an example - // of what you can do with each exception type. In general, when you make up your - // 'real' handler, you should debug the routine with all possible errors you expect - // which will then let you be as specific as possible about all circumstances. - // - // Note that in the general case, errors thrown by tree parsers indicate a problem - // with the output of the parser or with the tree grammar itself. The job of the parser - // is to produce a perfect (in traversal terms) syntactically correct tree, so errors - // at that stage should really be semantic errors that your own code determines and handles - // in whatever way is appropriate. - // - switch (ex->type) - { - case ANTLR3_UNWANTED_TOKEN_EXCEPTION: - - // Indicates that the recognizer was fed a token which seesm to be - // spurious input. We can detect this when the token that follows - // this unwanted token would normally be part of the syntactically - // correct stream. Then we can see that the token we are looking at - // is just something that should not be there and throw this exception. - // - if (tokenNames == NULL) - { - ANTLR3_FPRINTF(stderr, " : Extraneous input..."); - } - else - { - if (ex->expecting == ANTLR3_TOKEN_EOF) - { - ANTLR3_FPRINTF(stderr, " : Extraneous input - expected \n"); - } - else - { - ANTLR3_FPRINTF(stderr, " : Extraneous input - expected %s ...\n", tokenNames[ex->expecting]); - } - } - break; - - case ANTLR3_MISSING_TOKEN_EXCEPTION: - - // Indicates that the recognizer detected that the token we just - // hit would be valid syntactically if preceeded by a particular - // token. Perhaps a missing ';' at line end or a missing ',' in an - // expression list, and such like. - // - if (tokenNames == NULL) - { - ANTLR3_FPRINTF(stderr, " : Missing token (%d)...\n", ex->expecting); - } - else - { - if (ex->expecting == ANTLR3_TOKEN_EOF) - { - ANTLR3_FPRINTF(stderr, " : Missing \n"); - } - else - { - ANTLR3_FPRINTF(stderr, " : Missing %s \n", tokenNames[ex->expecting]); - } - } - break; - - case ANTLR3_RECOGNITION_EXCEPTION: - - // Indicates that the recognizer received a token - // in the input that was not predicted. This is the basic exception type - // from which all others are derived. So we assume it was a syntax error. - // You may get this if there are not more tokens and more are needed - // to complete a parse for instance. - // - ANTLR3_FPRINTF(stderr, " : syntax error...\n"); - break; - - case ANTLR3_MISMATCHED_TOKEN_EXCEPTION: - - // We were expecting to see one thing and got another. This is the - // most common error if we coudl not detect a missing or unwanted token. - // Here you can spend your efforts to - // derive more useful error messages based on the expected - // token set and the last token and so on. The error following - // bitmaps do a good job of reducing the set that we were looking - // for down to something small. Knowing what you are parsing may be - // able to allow you to be even more specific about an error. - // - if (tokenNames == NULL) - { - ANTLR3_FPRINTF(stderr, " : syntax error...\n"); - } - else - { - if (ex->expecting == ANTLR3_TOKEN_EOF) - { - ANTLR3_FPRINTF(stderr, " : expected \n"); - } - else - { - ANTLR3_FPRINTF(stderr, " : expected %s ...\n", tokenNames[ex->expecting]); - } - } - break; - - case ANTLR3_NO_VIABLE_ALT_EXCEPTION: - - // We could not pick any alt decision from the input given - // so god knows what happened - however when you examine your grammar, - // you should. It means that at the point where the current token occurred - // that the DFA indicates nowhere to go from here. - // - ANTLR3_FPRINTF(stderr, " : cannot match to any predicted input...\n"); - - break; - - case ANTLR3_MISMATCHED_SET_EXCEPTION: - - { - ANTLR3_UINT32 count; - ANTLR3_UINT32 bit; - ANTLR3_UINT32 size; - ANTLR3_UINT32 numbits; - pANTLR3_BITSET errBits; - - // This means we were able to deal with one of a set of - // possible tokens at this point, but we did not see any - // member of that set. - // - ANTLR3_FPRINTF(stderr, " : unexpected input...\n expected one of : "); - - // What tokens could we have accepted at this point in the - // parse? - // - count = 0; - errBits = antlr3BitsetLoad (ex->expectingSet); - numbits = errBits->numBits (errBits); - size = errBits->size (errBits); - - if (size > 0) - { - // However many tokens we could have dealt with here, it is usually - // not useful to print ALL of the set here. I arbitrarily chose 8 - // here, but you should do whatever makes sense for you of course. - // No token number 0, so look for bit 1 and on. - // - for (bit = 1; bit < numbits && count < 8 && count < size; bit++) - { - // TODO: This doesn;t look right - should be asking if the bit is set!! - // - if (tokenNames[bit]) - { - ANTLR3_FPRINTF(stderr, "%s%s", count > 0 ? ", " : "", tokenNames[bit]); - count++; - } - } - ANTLR3_FPRINTF(stderr, "\n"); - } - else - { - ANTLR3_FPRINTF(stderr, "Actually dude, we didn't seem to be expecting anything here, or at least\n"); - ANTLR3_FPRINTF(stderr, "I could not work out what I was expecting, like so many of us these days!\n"); - } - } - break; - - case ANTLR3_EARLY_EXIT_EXCEPTION: - - // We entered a loop requiring a number of token sequences - // but found a token that ended that sequence earlier than - // we should have done. - // - ANTLR3_FPRINTF(stderr, " : missing elements...\n"); - break; - - default: - - // We don't handle any other exceptions here, but you can - // if you wish. If we get an exception that hits this point - // then we are just going to report what we know about the - // token. - // - ANTLR3_FPRINTF(stderr, " : syntax not recognized...\n"); - break; - } - - // Here you have the token that was in error which if this is - // the standard implementation will tell you the line and offset - // and also record the address of the start of the line in the - // input stream. You could therefore print the source line and so on. - // Generally though, I would expect that your lexer/parser will keep - // its own map of lines and source pointers or whatever as there - // are a lot of specific things you need to know about the input - // to do something like that. - // Here is where you do it though :-). - // -} - -/// Return how many syntax errors were detected by this recognizer -/// -static ANTLR3_UINT32 -getNumberOfSyntaxErrors(pANTLR3_BASE_RECOGNIZER recognizer) -{ - return recognizer->state->errorCount; -} - -/// Recover from an error found on the input stream. Mostly this is -/// NoViableAlt exceptions, but could be a mismatched token that -/// the match() routine could not recover from. -/// -static void -recover (pANTLR3_BASE_RECOGNIZER recognizer) -{ - // Used to compute the follow set of tokens - // - pANTLR3_BITSET followSet; - pANTLR3_PARSER parser; - pANTLR3_TREE_PARSER tparser; - pANTLR3_INT_STREAM is; - - switch (recognizer->type) - { - case ANTLR3_TYPE_PARSER: - - parser = (pANTLR3_PARSER) (recognizer->super); - tparser = NULL; - is = parser->tstream->istream; - - break; - - case ANTLR3_TYPE_TREE_PARSER: - - tparser = (pANTLR3_TREE_PARSER) (recognizer->super); - parser = NULL; - is = tparser->ctnstream->tnstream->istream; - - break; - - default: - - ANTLR3_FPRINTF(stderr, "Base recognizer function recover called by unknown parser type - provide override for this function\n"); - return; - - break; - } - - // Are we about to repeat the same error? - // - if (recognizer->state->lastErrorIndex == is->index(is)) - { - // The last error was at the same token index point. This must be a case - // where LT(1) is in the recovery token set so nothing is - // consumed. Consume a single token so at least to prevent - // an infinite loop; this is a failsafe. - // - is->consume(is); - } - - // Record error index position - // - recognizer->state->lastErrorIndex = is->index(is); - - // Work out the follows set for error recovery - // - followSet = recognizer->computeErrorRecoverySet(recognizer); - - // Call resync hook (for debuggers and so on) - // - recognizer->beginResync(recognizer); - - // Consume tokens until we have resynced to something in the follows set - // - recognizer->consumeUntilSet(recognizer, followSet); - - // End resync hook - // - recognizer->endResync(recognizer); - - // Destroy the temporary bitset we produced. - // - followSet->free(followSet); - - // Reset the inError flag so we don't re-report the exception - // - recognizer->state->error = ANTLR3_FALSE; - recognizer->state->failed = ANTLR3_FALSE; -} - - -/// Attempt to recover from a single missing or extra token. -/// -/// EXTRA TOKEN -/// -/// LA(1) is not what we are looking for. If LA(2) has the right token, -/// however, then assume LA(1) is some extra spurious token. Delete it -/// and LA(2) as if we were doing a normal match(), which advances the -/// input. -/// -/// MISSING TOKEN -/// -/// If current token is consistent with what could come after -/// ttype then it is ok to "insert" the missing token, else throw -/// exception For example, Input "i=(3;" is clearly missing the -/// ')'. When the parser returns from the nested call to expr, it -/// will have call chain: -/// -/// stat -> expr -> atom -/// -/// and it will be trying to match the ')' at this point in the -/// derivation: -/// -/// => ID '=' '(' INT ')' ('+' atom)* ';' -/// ^ -/// match() will see that ';' doesn't match ')' and report a -/// mismatched token error. To recover, it sees that LA(1)==';' -/// is in the set of tokens that can follow the ')' token -/// reference in rule atom. It can assume that you forgot the ')'. -/// -/// The exception that was passed in, in the java implementation is -/// sorted in the recognizer exception stack in the C version. To 'throw' it we set the -/// error flag and rules cascade back when this is set. -/// -static void * -recoverFromMismatchedToken (pANTLR3_BASE_RECOGNIZER recognizer, ANTLR3_UINT32 ttype, pANTLR3_BITSET_LIST follow) -{ - pANTLR3_PARSER parser; - pANTLR3_TREE_PARSER tparser; - pANTLR3_INT_STREAM is; - void * matchedSymbol; - - - - switch (recognizer->type) - { - case ANTLR3_TYPE_PARSER: - - parser = (pANTLR3_PARSER) (recognizer->super); - tparser = NULL; - is = parser->tstream->istream; - - break; - - case ANTLR3_TYPE_TREE_PARSER: - - tparser = (pANTLR3_TREE_PARSER) (recognizer->super); - parser = NULL; - is = tparser->ctnstream->tnstream->istream; - - break; - - default: - - ANTLR3_FPRINTF(stderr, "Base recognizer function recoverFromMismatchedToken called by unknown parser type - provide override for this function\n"); - return NULL; - - break; - } - - // Create an exception if we need one - // - if (recognizer->state->exception == NULL) - { - antlr3RecognitionExceptionNew(recognizer); - } - - // If the next token after the one we are looking at in the input stream - // is what we are looking for then we remove the one we have discovered - // from the stream by consuming it, then consume this next one along too as - // if nothing had happened. - // - if ( recognizer->mismatchIsUnwantedToken(recognizer, is, ttype) == ANTLR3_TRUE) - { - recognizer->state->exception->type = ANTLR3_UNWANTED_TOKEN_EXCEPTION; - recognizer->state->exception->message = ANTLR3_UNWANTED_TOKEN_EXCEPTION_NAME; - - // Call resync hook (for debuggers and so on) - // - if (recognizer->debugger != NULL) - { - recognizer->debugger->beginResync(recognizer->debugger); - } - - // "delete" the extra token - // - recognizer->beginResync(recognizer); - is->consume(is); - recognizer->endResync(recognizer); - // End resync hook - // - if (recognizer->debugger != NULL) - { - recognizer->debugger->endResync(recognizer->debugger); - } - - // Print out the error after we consume so that ANTLRWorks sees the - // token in the exception. - // - recognizer->reportError(recognizer); - - // Return the token we are actually matching - // - matchedSymbol = recognizer->getCurrentInputSymbol(recognizer, is); - - // Consume the token that the rule actually expected to get as if everything - // was hunky dory. - // - is->consume(is); - - recognizer->state->error = ANTLR3_FALSE; // Exception is not outstanding any more - - return matchedSymbol; - } - - // Single token deletion (Unwanted above) did not work - // so we see if we can insert a token instead by calculating which - // token would be missing - // - if (mismatchIsMissingToken(recognizer, is, follow)) - { - // We can fake the missing token and proceed - // - matchedSymbol = recognizer->getMissingSymbol(recognizer, is, recognizer->state->exception, ttype, follow); - recognizer->state->exception->type = ANTLR3_MISSING_TOKEN_EXCEPTION; - recognizer->state->exception->message = ANTLR3_MISSING_TOKEN_EXCEPTION_NAME; - recognizer->state->exception->token = matchedSymbol; - recognizer->state->exception->expecting = ttype; - - // Print out the error after we insert so that ANTLRWorks sees the - // token in the exception. - // - recognizer->reportError(recognizer); - - recognizer->state->error = ANTLR3_FALSE; // Exception is not outstanding any more - - return matchedSymbol; - } - - - // Neither deleting nor inserting tokens allows recovery - // must just report the exception. - // - recognizer->state->error = ANTLR3_TRUE; - return NULL; -} - -static void * -recoverFromMismatchedSet (pANTLR3_BASE_RECOGNIZER recognizer, pANTLR3_BITSET_LIST follow) -{ - pANTLR3_PARSER parser; - pANTLR3_TREE_PARSER tparser; - pANTLR3_INT_STREAM is; - pANTLR3_COMMON_TOKEN matchedSymbol; - - switch (recognizer->type) - { - case ANTLR3_TYPE_PARSER: - - parser = (pANTLR3_PARSER) (recognizer->super); - tparser = NULL; - is = parser->tstream->istream; - - break; - - case ANTLR3_TYPE_TREE_PARSER: - - tparser = (pANTLR3_TREE_PARSER) (recognizer->super); - parser = NULL; - is = tparser->ctnstream->tnstream->istream; - - break; - - default: - - ANTLR3_FPRINTF(stderr, "Base recognizer function recoverFromMismatchedSet called by unknown parser type - provide override for this function\n"); - return NULL; - - break; - } - - if (recognizer->mismatchIsMissingToken(recognizer, is, follow) == ANTLR3_TRUE) - { - // We can fake the missing token and proceed - // - matchedSymbol = recognizer->getMissingSymbol(recognizer, is, recognizer->state->exception, ANTLR3_TOKEN_INVALID, follow); - recognizer->state->exception->type = ANTLR3_MISSING_TOKEN_EXCEPTION; - recognizer->state->exception->token = matchedSymbol; - - // Print out the error after we insert so that ANTLRWorks sees the - // token in the exception. - // - recognizer->reportError(recognizer); - - recognizer->state->error = ANTLR3_FALSE; // Exception is not outstanding any more - - return matchedSymbol; - } - - // TODO - Single token deletion like in recoverFromMismatchedToken() - // - recognizer->state->error = ANTLR3_TRUE; - recognizer->state->failed = ANTLR3_TRUE; - return NULL; -} - -/// This code is factored out from mismatched token and mismatched set -/// recovery. It handles "single token insertion" error recovery for -/// both. No tokens are consumed to recover from insertions. Return -/// true if recovery was possible else return false. -/// -static ANTLR3_BOOLEAN -recoverFromMismatchedElement (pANTLR3_BASE_RECOGNIZER recognizer, pANTLR3_BITSET_LIST followBits) -{ - pANTLR3_BITSET viableToksFollowingRule; - pANTLR3_BITSET follow; - pANTLR3_PARSER parser; - pANTLR3_TREE_PARSER tparser; - pANTLR3_INT_STREAM is; - - switch (recognizer->type) - { - case ANTLR3_TYPE_PARSER: - - parser = (pANTLR3_PARSER) (recognizer->super); - tparser = NULL; - is = parser->tstream->istream; - - break; - - case ANTLR3_TYPE_TREE_PARSER: - - tparser = (pANTLR3_TREE_PARSER) (recognizer->super); - parser = NULL; - is = tparser->ctnstream->tnstream->istream; - - break; - - default: - - ANTLR3_FPRINTF(stderr, "Base recognizer function recover called by unknown parser type - provide override for this function\n"); - return ANTLR3_FALSE; - - break; - } - - follow = antlr3BitsetLoad(followBits); - - if (follow == NULL) - { - /* The follow set is NULL, which means we don't know what can come - * next, so we "hit and hope" by just signifying that we cannot - * recover, which will just cause the next token to be consumed, - * which might dig us out. - */ - return ANTLR3_FALSE; - } - - /* We have a bitmap for the follow set, hence we can compute - * what can follow this grammar element reference. - */ - if (follow->isMember(follow, ANTLR3_EOR_TOKEN_TYPE) == ANTLR3_TRUE) - { - /* First we need to know which of the available tokens are viable - * to follow this reference. - */ - viableToksFollowingRule = recognizer->computeCSRuleFollow(recognizer); - - /* Remove the EOR token, which we do not wish to compute with - */ - follow->remove(follow, ANTLR3_EOR_TOKEN_TYPE); - viableToksFollowingRule->free(viableToksFollowingRule); - /* We now have the computed set of what can follow the current token - */ - } - - /* We can now see if the current token works with the set of tokens - * that could follow the current grammar reference. If it looks like it - * is consistent, then we can "insert" that token by not throwing - * an exception and assuming that we saw it. - */ - if ( follow->isMember(follow, is->_LA(is, 1)) == ANTLR3_TRUE) - { - /* report the error, but don't cause any rules to abort and stuff - */ - recognizer->reportError(recognizer); - if (follow != NULL) - { - follow->free(follow); - } - recognizer->state->error = ANTLR3_FALSE; - recognizer->state->failed = ANTLR3_FALSE; - return ANTLR3_TRUE; /* Success in recovery */ - } - - if (follow != NULL) - { - follow->free(follow); - } - - /* We could not find anything viable to do, so this is going to - * cause an exception. - */ - return ANTLR3_FALSE; -} - -/// Eat tokens from the input stream until we get one of JUST the right type -/// -static void -consumeUntil (pANTLR3_BASE_RECOGNIZER recognizer, ANTLR3_UINT32 tokenType) -{ - ANTLR3_UINT32 ttype; - pANTLR3_PARSER parser; - pANTLR3_TREE_PARSER tparser; - pANTLR3_INT_STREAM is; - - switch (recognizer->type) - { - case ANTLR3_TYPE_PARSER: - - parser = (pANTLR3_PARSER) (recognizer->super); - tparser = NULL; - is = parser->tstream->istream; - - break; - - case ANTLR3_TYPE_TREE_PARSER: - - tparser = (pANTLR3_TREE_PARSER) (recognizer->super); - parser = NULL; - is = tparser->ctnstream->tnstream->istream; - - break; - - default: - - ANTLR3_FPRINTF(stderr, "Base recognizer function 'consumeUntil' called by unknown parser type - provide override for this function\n"); - return; - - break; - } - - // What do have at the moment? - // - ttype = is->_LA(is, 1); - - // Start eating tokens until we get to the one we want. - // - while (ttype != ANTLR3_TOKEN_EOF && ttype != tokenType) - { - is->consume(is); - ttype = is->_LA(is, 1); - } -} - -/// Eat tokens from the input stream until we find one that -/// belongs to the supplied set. -/// -static void -consumeUntilSet (pANTLR3_BASE_RECOGNIZER recognizer, pANTLR3_BITSET set) -{ - ANTLR3_UINT32 ttype; - pANTLR3_PARSER parser; - pANTLR3_TREE_PARSER tparser; - pANTLR3_INT_STREAM is; - - switch (recognizer->type) - { - case ANTLR3_TYPE_PARSER: - - parser = (pANTLR3_PARSER) (recognizer->super); - tparser = NULL; - is = parser->tstream->istream; - - break; - - case ANTLR3_TYPE_TREE_PARSER: - - tparser = (pANTLR3_TREE_PARSER) (recognizer->super); - parser = NULL; - is = tparser->ctnstream->tnstream->istream; - - break; - - default: - - ANTLR3_FPRINTF(stderr, "Base recognizer function 'consumeUntilSet' called by unknown parser type - provide override for this function\n"); - return; - - break; - } - - // What do have at the moment? - // - ttype = is->_LA(is, 1); - - // Start eating tokens until we get to one we want. - // - while (ttype != ANTLR3_TOKEN_EOF && set->isMember(set, ttype) == ANTLR3_FALSE) - { - is->consume(is); - ttype = is->_LA(is, 1); - } -} - -/** Return the rule invocation stack (how we got here in the parse. - * In the java version Ter just asks the JVM for all the information - * but in C we don't get this information, so I am going to do nothing - * right now. - */ -static pANTLR3_STACK -getRuleInvocationStack (pANTLR3_BASE_RECOGNIZER recognizer) -{ - return NULL; -} - -static pANTLR3_STACK -getRuleInvocationStackNamed (pANTLR3_BASE_RECOGNIZER recognizer, pANTLR3_UINT8 name) -{ - return NULL; -} - -/** Convenience method for template rewrites - NYI. - */ -static pANTLR3_HASH_TABLE -toStrings (pANTLR3_BASE_RECOGNIZER recognizer, pANTLR3_HASH_TABLE tokens) -{ - return NULL; -} - -static void ANTLR3_CDECL -freeIntTrie (void * trie) -{ - ((pANTLR3_INT_TRIE)trie)->free((pANTLR3_INT_TRIE)trie); -} - - -/** Pointer to a function to return whether the rule has parsed input starting at the supplied - * start index before. If the rule has not parsed input starting from the supplied start index, - * then it will return ANTLR3_MEMO_RULE_UNKNOWN. If it has parsed from the suppled start point - * then it will return the point where it last stopped parsing after that start point. - * - * \remark - * The rule memos are an ANTLR3_LIST of ANTLR3_LISTS, however if this becomes any kind of performance - * issue (it probably won't, the hash tables are pretty quick) then we could make a special int only - * version of the table. - */ -static ANTLR3_MARKER -getRuleMemoization (pANTLR3_BASE_RECOGNIZER recognizer, ANTLR3_INTKEY ruleIndex, ANTLR3_MARKER ruleParseStart) -{ - /* The rule memos are an ANTLR3_LIST of ANTLR3_LIST. - */ - pANTLR3_INT_TRIE ruleList; - ANTLR3_MARKER stopIndex; - pANTLR3_TRIE_ENTRY entry; - - /* See if we have a list in the ruleMemos for this rule, and if not, then create one - * as we will need it eventually if we are being asked for the memo here. - */ - entry = recognizer->state->ruleMemo->get(recognizer->state->ruleMemo, (ANTLR3_INTKEY)ruleIndex); - - if (entry == NULL) - { - /* Did not find it, so create a new one for it, with a bit depth based on the - * size of the input stream. We need the bit depth to incorporate the number if - * bits required to represent the largest possible stop index in the input, which is the - * last character. An int stream is free to return the largest 64 bit offset if it has - * no idea of the size, but you should remember that this will cause the leftmost - * bit match algorithm to run to 63 bits, which will be the whole time spent in the trie ;-) - */ - ruleList = antlr3IntTrieNew(63); /* Depth is theoretically 64 bits, but probably not ;-) */ - - if (ruleList != NULL) - { - recognizer->state->ruleMemo->add(recognizer->state->ruleMemo, (ANTLR3_INTKEY)ruleIndex, ANTLR3_HASH_TYPE_STR, 0, ANTLR3_FUNC_PTR(ruleList), freeIntTrie); - } - - /* We cannot have a stopIndex in a trie we have just created of course - */ - return MEMO_RULE_UNKNOWN; - } - - ruleList = (pANTLR3_INT_TRIE) (entry->data.ptr); - - /* See if there is a stop index associated with the supplied start index. - */ - stopIndex = 0; - - entry = ruleList->get(ruleList, ruleParseStart); - if (entry != NULL) - { - stopIndex = (ANTLR3_MARKER)(entry->data.intVal); - } - - if (stopIndex == 0) - { - return MEMO_RULE_UNKNOWN; - } - - return stopIndex; -} - -/** Has this rule already parsed input at the current index in the - * input stream? Return ANTLR3_TRUE if we have and ANTLR3_FALSE - * if we have not. - * - * This method has a side-effect: if we have seen this input for - * this rule and successfully parsed before, then seek ahead to - * 1 past the stop token matched for this rule last time. - */ -static ANTLR3_BOOLEAN -alreadyParsedRule (pANTLR3_BASE_RECOGNIZER recognizer, ANTLR3_MARKER ruleIndex) -{ - ANTLR3_MARKER stopIndex; - pANTLR3_LEXER lexer; - pANTLR3_PARSER parser; - pANTLR3_TREE_PARSER tparser; - pANTLR3_INT_STREAM is; - - switch (recognizer->type) - { - case ANTLR3_TYPE_PARSER: - - parser = (pANTLR3_PARSER) (recognizer->super); - tparser = NULL; - lexer = NULL; - is = parser->tstream->istream; - - break; - - case ANTLR3_TYPE_TREE_PARSER: - - tparser = (pANTLR3_TREE_PARSER) (recognizer->super); - parser = NULL; - lexer = NULL; - is = tparser->ctnstream->tnstream->istream; - - break; - - case ANTLR3_TYPE_LEXER: - - lexer = (pANTLR3_LEXER) (recognizer->super); - parser = NULL; - tparser = NULL; - is = lexer->input->istream; - break; - - default: - - ANTLR3_FPRINTF(stderr, "Base recognizer function 'alreadyParsedRule' called by unknown parser type - provide override for this function\n"); - return ANTLR3_FALSE; - - break; - } - - /* See if we have a memo marker for this. - */ - stopIndex = recognizer->getRuleMemoization(recognizer, ruleIndex, is->index(is)); - - if (stopIndex == MEMO_RULE_UNKNOWN) - { - return ANTLR3_FALSE; - } - - if (stopIndex == MEMO_RULE_FAILED) - { - recognizer->state->failed = ANTLR3_TRUE; - } - else - { - is->seek(is, stopIndex+1); - } - - /* If here then the rule was executed for this input already - */ - return ANTLR3_TRUE; -} - -/** Record whether or not this rule parsed the input at this position - * successfully. - */ -static void -memoize (pANTLR3_BASE_RECOGNIZER recognizer, ANTLR3_MARKER ruleIndex, ANTLR3_MARKER ruleParseStart) -{ - /* The rule memos are an ANTLR3_LIST of ANTLR3_LIST. - */ - pANTLR3_INT_TRIE ruleList; - pANTLR3_TRIE_ENTRY entry; - ANTLR3_MARKER stopIndex; - pANTLR3_LEXER lexer; - pANTLR3_PARSER parser; - pANTLR3_TREE_PARSER tparser; - pANTLR3_INT_STREAM is; - - switch (recognizer->type) - { - case ANTLR3_TYPE_PARSER: - - parser = (pANTLR3_PARSER) (recognizer->super); - tparser = NULL; - is = parser->tstream->istream; - - break; - - case ANTLR3_TYPE_TREE_PARSER: - - tparser = (pANTLR3_TREE_PARSER) (recognizer->super); - parser = NULL; - is = tparser->ctnstream->tnstream->istream; - - break; - - case ANTLR3_TYPE_LEXER: - - lexer = (pANTLR3_LEXER) (recognizer->super); - parser = NULL; - tparser = NULL; - is = lexer->input->istream; - break; - - default: - - ANTLR3_FPRINTF(stderr, "Base recognizer function consumeUntilSet called by unknown parser type - provide override for this function\n"); - return; - - break; - } - - stopIndex = recognizer->state->failed == ANTLR3_TRUE ? MEMO_RULE_FAILED : is->index(is) - 1; - - entry = recognizer->state->ruleMemo->get(recognizer->state->ruleMemo, (ANTLR3_INTKEY)ruleIndex); - - if (entry != NULL) - { - ruleList = (pANTLR3_INT_TRIE)(entry->data.ptr); - - /* If we don't already have this entry, append it. The memoize trie does not - * accept duplicates so it won't add it if already there and we just ignore the - * return code as we don't care if it is there already. - */ - ruleList->add(ruleList, ruleParseStart, ANTLR3_HASH_TYPE_INT, stopIndex, NULL, NULL); - } -} -/** A syntactic predicate. Returns true/false depending on whether - * the specified grammar fragment matches the current input stream. - * This resets the failed instance var afterwards. - */ -static ANTLR3_BOOLEAN -synpred (pANTLR3_BASE_RECOGNIZER recognizer, void * ctx, void (*predicate)(void * ctx)) -{ - ANTLR3_MARKER start; - pANTLR3_PARSER parser; - pANTLR3_TREE_PARSER tparser; - pANTLR3_INT_STREAM is; - - switch (recognizer->type) - { - case ANTLR3_TYPE_PARSER: - - parser = (pANTLR3_PARSER) (recognizer->super); - tparser = NULL; - is = parser->tstream->istream; - - break; - - case ANTLR3_TYPE_TREE_PARSER: - - tparser = (pANTLR3_TREE_PARSER) (recognizer->super); - parser = NULL; - is = tparser->ctnstream->tnstream->istream; - - break; - - default: - - ANTLR3_FPRINTF(stderr, "Base recognizer function 'synPred' called by unknown parser type - provide override for this function\n"); - return ANTLR3_FALSE; - - break; - } - - /* Begin backtracking so we can get back to where we started after trying out - * the syntactic predicate. - */ - start = is->mark(is); - recognizer->state->backtracking++; - - /* Try the syntactical predicate - */ - predicate(ctx); - - /* Reset - */ - is->rewind(is, start); - recognizer->state->backtracking--; - - if (recognizer->state->failed == ANTLR3_TRUE) - { - /* Predicate failed - */ - recognizer->state->failed = ANTLR3_FALSE; - return ANTLR3_FALSE; - } - else - { - /* Predicate was successful - */ - recognizer->state->failed = ANTLR3_FALSE; - return ANTLR3_TRUE; - } -} - -static void -reset(pANTLR3_BASE_RECOGNIZER recognizer) -{ - if (recognizer->state->following != NULL) - { - recognizer->state->following->free(recognizer->state->following); - } - - // Reset the state flags - // - recognizer->state->errorRecovery = ANTLR3_FALSE; - recognizer->state->lastErrorIndex = -1; - recognizer->state->failed = ANTLR3_FALSE; - recognizer->state->errorCount = 0; - recognizer->state->backtracking = 0; - recognizer->state->following = NULL; - - if (recognizer->state != NULL) - { - if (recognizer->state->ruleMemo != NULL) - { - recognizer->state->ruleMemo->free(recognizer->state->ruleMemo); - recognizer->state->ruleMemo = antlr3IntTrieNew(15); /* 16 bit depth is enough for 32768 rules! */ - } - } - - - // Install a new following set - // - recognizer->state->following = antlr3StackNew(8); - -} - -// Default implementation is for parser and assumes a token stream as supplied by the runtime. -// You MAY need override this function if the standard TOKEN_STREAM is not what you are using. -// -static void * -getCurrentInputSymbol (pANTLR3_BASE_RECOGNIZER recognizer, pANTLR3_INT_STREAM istream) -{ - return ((pANTLR3_TOKEN_STREAM)istream->super)->_LT((pANTLR3_TOKEN_STREAM)istream->super, 1); -} - -// Default implementation is for parser and assumes a token stream as supplied by the runtime. -// You MAY need override this function if the standard COMMON_TOKEN_STREAM is not what you are using. -// -static void * -getMissingSymbol (pANTLR3_BASE_RECOGNIZER recognizer, pANTLR3_INT_STREAM istream, pANTLR3_EXCEPTION e, - ANTLR3_UINT32 expectedTokenType, pANTLR3_BITSET_LIST follow) -{ - pANTLR3_TOKEN_STREAM ts; - pANTLR3_COMMON_TOKEN_STREAM cts; - pANTLR3_COMMON_TOKEN token; - pANTLR3_COMMON_TOKEN current; - pANTLR3_STRING text; - - // Dereference the standard pointers - // - ts = (pANTLR3_TOKEN_STREAM)istream->super; - cts = (pANTLR3_COMMON_TOKEN_STREAM)ts->super; - - // Work out what to use as the current symbol to make a line and offset etc - // If we are at EOF, we use the token before EOF - // - current = ts->_LT(ts, 1); - if (current->getType(current) == ANTLR3_TOKEN_EOF) - { - current = ts->_LT(ts, -1); - } - - // Create a new empty token - // - if (recognizer->state->tokFactory == NULL) - { - // We don't yet have a token factory for making tokens - // we just need a fake one using the input stream of the current - // token. - // - recognizer->state->tokFactory = antlr3TokenFactoryNew(current->input); - } - token = recognizer->state->tokFactory->newToken(recognizer->state->tokFactory); - - // Set some of the token properties based on the current token - // - token->setLine (token, current->getLine(current)); - token->setCharPositionInLine (token, current->getCharPositionInLine(current)); - token->setChannel (token, ANTLR3_TOKEN_DEFAULT_CHANNEL); - token->setType (token, expectedTokenType); - token->user1 = current->user1; - token->user2 = current->user2; - token->user3 = current->user3; - token->custom = current->custom; - token->lineStart = current->lineStart; - - // Create the token text that shows it has been inserted - // - token->setText8(token, (pANTLR3_UINT8)"getText(token); - - if (text != NULL) - { - text->append8(text, (const char *)recognizer->state->tokenNames[expectedTokenType]); - text->append8(text, (const char *)">"); - } - - // Finally return the pointer to our new token - // - return token; -} - - -#ifdef ANTLR3_WINDOWS -#pragma warning( default : 4100 ) -#endif - -/// @} -/// - diff --git a/impl/antlr/libantlr3c-3.4/src/antlr3basetree.c b/impl/antlr/libantlr3c-3.4/src/antlr3basetree.c deleted file mode 100644 index bbc81e7..0000000 --- a/impl/antlr/libantlr3c-3.4/src/antlr3basetree.c +++ /dev/null @@ -1,489 +0,0 @@ -#include - -#ifdef ANTLR3_WINDOWS -#pragma warning( disable : 4100 ) -#endif - -// [The "BSD licence"] -// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC -// http://www.temporal-wave.com -// http://www.linkedin.com/in/jimidle -// -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions -// are met: -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// 3. The name of the author may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -static void * getChild (pANTLR3_BASE_TREE tree, ANTLR3_UINT32 i); -static ANTLR3_UINT32 getChildCount (pANTLR3_BASE_TREE tree); -static ANTLR3_UINT32 getCharPositionInLine -(pANTLR3_BASE_TREE tree); -static ANTLR3_UINT32 getLine (pANTLR3_BASE_TREE tree); -static pANTLR3_BASE_TREE -getFirstChildWithType -(pANTLR3_BASE_TREE tree, ANTLR3_UINT32 type); -static void addChild (pANTLR3_BASE_TREE tree, pANTLR3_BASE_TREE child); -static void addChildren (pANTLR3_BASE_TREE tree, pANTLR3_LIST kids); -static void replaceChildren (pANTLR3_BASE_TREE parent, ANTLR3_INT32 startChildIndex, ANTLR3_INT32 stopChildIndex, pANTLR3_BASE_TREE t); - -static void freshenPACIndexesAll(pANTLR3_BASE_TREE tree); -static void freshenPACIndexes (pANTLR3_BASE_TREE tree, ANTLR3_UINT32 offset); - -static void setChild (pANTLR3_BASE_TREE tree, ANTLR3_UINT32 i, void * child); -static void * deleteChild (pANTLR3_BASE_TREE tree, ANTLR3_UINT32 i); -static void * dupTree (pANTLR3_BASE_TREE tree); -static pANTLR3_STRING toStringTree (pANTLR3_BASE_TREE tree); - - -ANTLR3_API pANTLR3_BASE_TREE -antlr3BaseTreeNew(pANTLR3_BASE_TREE tree) -{ - /* api */ - tree->getChild = getChild; - tree->getChildCount = getChildCount; - tree->addChild = (void (*)(pANTLR3_BASE_TREE, void *))(addChild); - tree->addChildren = addChildren; - tree->setChild = setChild; - tree->deleteChild = deleteChild; - tree->dupTree = dupTree; - tree->toStringTree = toStringTree; - tree->getCharPositionInLine = getCharPositionInLine; - tree->getLine = getLine; - tree->replaceChildren = replaceChildren; - tree->freshenPACIndexesAll = freshenPACIndexesAll; - tree->freshenPACIndexes = freshenPACIndexes; - tree->getFirstChildWithType = (void *(*)(pANTLR3_BASE_TREE, ANTLR3_UINT32))(getFirstChildWithType); - tree->children = NULL; - tree->strFactory = NULL; - - /* Rest must be filled in by caller. - */ - return tree; -} - -static ANTLR3_UINT32 -getCharPositionInLine (pANTLR3_BASE_TREE tree) -{ - return 0; -} - -static ANTLR3_UINT32 -getLine (pANTLR3_BASE_TREE tree) -{ - return 0; -} -static pANTLR3_BASE_TREE -getFirstChildWithType (pANTLR3_BASE_TREE tree, ANTLR3_UINT32 type) -{ - ANTLR3_UINT32 i; - ANTLR3_UINT32 cs; - - pANTLR3_BASE_TREE t; - if (tree->children != NULL) - { - cs = tree->children->size(tree->children); - for (i = 0; i < cs; i++) - { - t = (pANTLR3_BASE_TREE) (tree->children->get(tree->children, i)); - if (tree->getType(t) == type) - { - return (pANTLR3_BASE_TREE)t; - } - } - } - return NULL; -} - - - -static void * -getChild (pANTLR3_BASE_TREE tree, ANTLR3_UINT32 i) -{ - if ( tree->children == NULL - || i >= tree->children->size(tree->children)) - { - return NULL; - } - return tree->children->get(tree->children, i); -} - - -static ANTLR3_UINT32 -getChildCount (pANTLR3_BASE_TREE tree) -{ - if (tree->children == NULL) - { - return 0; - } - else - { - return tree->children->size(tree->children); - } -} - -void -addChild (pANTLR3_BASE_TREE tree, pANTLR3_BASE_TREE child) -{ - ANTLR3_UINT32 n; - ANTLR3_UINT32 i; - - if (child == NULL) - { - return; - } - - if (child->isNilNode(child) == ANTLR3_TRUE) - { - if (child->children != NULL && child->children == tree->children) - { - // TODO: Change to exception rather than ANTLR3_FPRINTF? - // - ANTLR3_FPRINTF(stderr, "ANTLR3: An attempt was made to add a child list to itself!\n"); - return; - } - - // Add all of the children's children to this list - // - if (child->children != NULL) - { - if (tree->children == NULL) - { - // We are build ing the tree structure here, so we need not - // worry about duplication of pointers as the tree node - // factory will only clean up each node once. So we just - // copy in the child's children pointer as the child is - // a nil node (has not root itself). - // - tree->children = child->children; - child->children = NULL; - freshenPACIndexesAll(tree); - - } - else - { - // Need to copy the children - // - n = child->children->size(child->children); - - for (i = 0; i < n; i++) - { - pANTLR3_BASE_TREE entry; - entry = child->children->get(child->children, i); - - // ANTLR3 lists can be sparse, unlike Array Lists - // - if (entry != NULL) - { - tree->children->add(tree->children, entry, (void (ANTLR3_CDECL *) (void *))child->free); - } - } - } - } - } - else - { - // Tree we are adding is not a Nil and might have children to copy - // - if (tree->children == NULL) - { - // No children in the tree we are adding to, so create a new list on - // the fly to hold them. - // - tree->createChildrenList(tree); - } - - tree->children->add(tree->children, child, (void (ANTLR3_CDECL *)(void *))child->free); - - } -} - -/// Add all elements of the supplied list as children of this node -/// -static void -addChildren (pANTLR3_BASE_TREE tree, pANTLR3_LIST kids) -{ - ANTLR3_UINT32 i; - ANTLR3_UINT32 s; - - s = kids->size(kids); - for (i = 0; iaddChild(tree, (pANTLR3_BASE_TREE)(kids->get(kids, i+1))); - } -} - - -static void -setChild (pANTLR3_BASE_TREE tree, ANTLR3_UINT32 i, void * child) -{ - if (tree->children == NULL) - { - tree->createChildrenList(tree); - } - tree->children->set(tree->children, i, child, NULL, ANTLR3_FALSE); -} - -static void * -deleteChild (pANTLR3_BASE_TREE tree, ANTLR3_UINT32 i) -{ - if ( tree->children == NULL) - { - return NULL; - } - - return tree->children->remove(tree->children, i); -} - -static void * -dupTree (pANTLR3_BASE_TREE tree) -{ - pANTLR3_BASE_TREE newTree; - ANTLR3_UINT32 i; - ANTLR3_UINT32 s; - - newTree = tree->dupNode (tree); - - if (tree->children != NULL) - { - s = tree->children->size (tree->children); - - for (i = 0; i < s; i++) - { - pANTLR3_BASE_TREE t; - pANTLR3_BASE_TREE newNode; - - t = (pANTLR3_BASE_TREE) tree->children->get(tree->children, i); - - if (t!= NULL) - { - newNode = t->dupTree(t); - newTree->addChild(newTree, newNode); - } - } - } - - return newTree; -} - -static pANTLR3_STRING -toStringTree (pANTLR3_BASE_TREE tree) -{ - pANTLR3_STRING string; - ANTLR3_UINT32 i; - ANTLR3_UINT32 n; - pANTLR3_BASE_TREE t; - - if (tree->children == NULL || tree->children->size(tree->children) == 0) - { - return tree->toString(tree); - } - - /* Need a new string with nothing at all in it. - */ - string = tree->strFactory->newRaw(tree->strFactory); - - if (tree->isNilNode(tree) == ANTLR3_FALSE) - { - string->append8 (string, "("); - string->appendS (string, tree->toString(tree)); - string->append8 (string, " "); - } - if (tree->children != NULL) - { - n = tree->children->size(tree->children); - - for (i = 0; i < n; i++) - { - t = (pANTLR3_BASE_TREE) tree->children->get(tree->children, i); - - if (i > 0) - { - string->append8(string, " "); - } - string->appendS(string, t->toStringTree(t)); - } - } - if (tree->isNilNode(tree) == ANTLR3_FALSE) - { - string->append8(string,")"); - } - - return string; -} - -/// Delete children from start to stop and replace with t even if t is -/// a list (nil-root tree). Num of children can increase or decrease. -/// For huge child lists, inserting children can force walking rest of -/// children to set their child index; could be slow. -/// -static void -replaceChildren (pANTLR3_BASE_TREE parent, ANTLR3_INT32 startChildIndex, ANTLR3_INT32 stopChildIndex, pANTLR3_BASE_TREE newTree) -{ - ANTLR3_INT32 replacingHowMany; // How many nodes will go away - ANTLR3_INT32 replacingWithHowMany; // How many nodes will replace them - ANTLR3_INT32 numNewChildren; // Tracking variable - ANTLR3_INT32 delta; // Difference in new vs existing count - - ANTLR3_INT32 i; - ANTLR3_INT32 j; - - pANTLR3_VECTOR newChildren; // Iterator for whatever we are going to add in - ANTLR3_BOOLEAN freeNewChildren; // Whether we created the iterator locally or reused it - - if (parent->children == NULL) - { - ANTLR3_FPRINTF(stderr, "replaceChildren call: Indexes are invalid; no children in list for %s", parent->getText(parent)->chars); - return; - } - - // Either use the existing list of children in the supplied nil node, or build a vector of the - // tree we were given if it is not a nil node, then we treat both situations exactly the same - // - if (newTree->isNilNode(newTree)) - { - newChildren = newTree->children; - freeNewChildren = ANTLR3_FALSE; // We must NO free this memory - } - else - { - newChildren = antlr3VectorNew(1); - if (newChildren == NULL) - { - ANTLR3_FPRINTF(stderr, "replaceChildren: out of memory!!"); - exit(1); - } - newChildren->add(newChildren, (void *)newTree, NULL); - - freeNewChildren = ANTLR3_TRUE; // We must free this memory - } - - // Initialize - // - replacingHowMany = stopChildIndex - startChildIndex + 1; - replacingWithHowMany = newChildren->size(newChildren); - delta = replacingHowMany - replacingWithHowMany; - numNewChildren = newChildren->size(newChildren); - - // If it is the same number of nodes, then do a direct replacement - // - if (delta == 0) - { - pANTLR3_BASE_TREE child; - - // Same number of nodes - // - j = 0; - for (i = startChildIndex; i <= stopChildIndex; i++) - { - child = (pANTLR3_BASE_TREE) newChildren->get(newChildren, j); - parent->children->set(parent->children, i, child, NULL, ANTLR3_FALSE); - child->setParent(child, parent); - child->setChildIndex(child, i); - } - } - else if (delta > 0) - { - ANTLR3_UINT32 indexToDelete; - - // Less nodes than there were before - // reuse what we have then delete the rest - // - for (j = 0; j < numNewChildren; j++) - { - parent->children->set(parent->children, startChildIndex + j, newChildren->get(newChildren, j), NULL, ANTLR3_FALSE); - } - - // We just delete the same index position until done - // - indexToDelete = startChildIndex + numNewChildren; - - for (j = indexToDelete; j <= (ANTLR3_INT32)stopChildIndex; j++) - { - parent->children->remove(parent->children, indexToDelete); - } - - parent->freshenPACIndexes(parent, startChildIndex); - } - else - { - ANTLR3_UINT32 numToInsert; - - // More nodes than there were before - // Use what we can, then start adding - // - for (j = 0; j < replacingHowMany; j++) - { - parent->children->set(parent->children, startChildIndex + j, newChildren->get(newChildren, j), NULL, ANTLR3_FALSE); - } - - numToInsert = replacingWithHowMany - replacingHowMany; - - for (j = replacingHowMany; j < replacingWithHowMany; j++) - { - parent->children->add(parent->children, newChildren->get(newChildren, j), NULL); - } - - parent->freshenPACIndexes(parent, startChildIndex); - } - - if (freeNewChildren == ANTLR3_TRUE) - { - ANTLR3_FREE(newChildren->elements); - newChildren->elements = NULL; - newChildren->size = 0; - ANTLR3_FREE(newChildren); // Will not free the nodes - } -} - -/// Set the parent and child indexes for all children of the -/// supplied tree. -/// -static void -freshenPACIndexesAll(pANTLR3_BASE_TREE tree) -{ - tree->freshenPACIndexes(tree, 0); -} - -/// Set the parent and child indexes for some of the children of the -/// supplied tree, starting with the child at the supplied index. -/// -static void -freshenPACIndexes (pANTLR3_BASE_TREE tree, ANTLR3_UINT32 offset) -{ - ANTLR3_UINT32 count; - ANTLR3_UINT32 c; - - count = tree->getChildCount(tree); // How many children do we have - - // Loop from the supplied index and set the indexes and parent - // - for (c = offset; c < count; c++) - { - pANTLR3_BASE_TREE child; - - child = tree->getChild(tree, c); - - child->setChildIndex(child, c); - child->setParent(child, tree); - } -} - diff --git a/impl/antlr/libantlr3c-3.4/src/antlr3basetreeadaptor.c b/impl/antlr/libantlr3c-3.4/src/antlr3basetreeadaptor.c deleted file mode 100644 index e35878f..0000000 --- a/impl/antlr/libantlr3c-3.4/src/antlr3basetreeadaptor.c +++ /dev/null @@ -1,909 +0,0 @@ -/** \file - * Contains the base functions that all tree adaptors start with. - * this implementation can then be overridden by any higher implementation. - * - */ - -// [The "BSD licence"] -// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC -// http://www.temporal-wave.com -// http://www.linkedin.com/in/jimidle -// -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions -// are met: -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// 3. The name of the author may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include - -#ifdef ANTLR3_WINDOWS -#pragma warning( disable : 4100 ) -#endif - -/* Interface functions - */ -static pANTLR3_BASE_TREE nilNode (pANTLR3_BASE_TREE_ADAPTOR adaptor); -static pANTLR3_BASE_TREE dbgNil (pANTLR3_BASE_TREE_ADAPTOR adaptor); -static pANTLR3_BASE_TREE dupTree (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE t); -static pANTLR3_BASE_TREE dbgDupTree (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE t); -static pANTLR3_BASE_TREE dupTreeTT (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE t, pANTLR3_BASE_TREE parent); -static void addChild (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE t, pANTLR3_BASE_TREE child); -static void dbgAddChild (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE t, pANTLR3_BASE_TREE child); -static pANTLR3_BASE_TREE becomeRoot (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE newRoot, pANTLR3_BASE_TREE oldRoot); -static pANTLR3_BASE_TREE dbgBecomeRoot (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE newRoot, pANTLR3_BASE_TREE oldRoot); -static pANTLR3_BASE_TREE rulePostProcessing (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE root); -static void addChildToken (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE t, pANTLR3_COMMON_TOKEN child); -static void dbgAddChildToken (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE t, pANTLR3_COMMON_TOKEN child); -static pANTLR3_BASE_TREE becomeRootToken (pANTLR3_BASE_TREE_ADAPTOR adaptor, void * newRoot, pANTLR3_BASE_TREE oldRoot); -static pANTLR3_BASE_TREE dbgBecomeRootToken (pANTLR3_BASE_TREE_ADAPTOR adaptor, void * newRoot, pANTLR3_BASE_TREE oldRoot); -static pANTLR3_BASE_TREE createTypeToken (pANTLR3_BASE_TREE_ADAPTOR adaptor, ANTLR3_UINT32 tokenType, pANTLR3_COMMON_TOKEN fromToken); -static pANTLR3_BASE_TREE dbgCreateTypeToken (pANTLR3_BASE_TREE_ADAPTOR adaptor, ANTLR3_UINT32 tokenType, pANTLR3_COMMON_TOKEN fromToken); -static pANTLR3_BASE_TREE createTypeTokenText (pANTLR3_BASE_TREE_ADAPTOR adaptor, ANTLR3_UINT32 tokenType, pANTLR3_COMMON_TOKEN fromToken, pANTLR3_UINT8 text); -static pANTLR3_BASE_TREE dbgCreateTypeTokenText (pANTLR3_BASE_TREE_ADAPTOR adaptor, ANTLR3_UINT32 tokenType, pANTLR3_COMMON_TOKEN fromToken, pANTLR3_UINT8 text); -static pANTLR3_BASE_TREE createTypeText (pANTLR3_BASE_TREE_ADAPTOR adaptor, ANTLR3_UINT32 tokenType, pANTLR3_UINT8 text); -static pANTLR3_BASE_TREE dbgCreateTypeText (pANTLR3_BASE_TREE_ADAPTOR adaptor, ANTLR3_UINT32 tokenType, pANTLR3_UINT8 text); -static ANTLR3_UINT32 getType (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE t); -static void setType (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE t, ANTLR3_UINT32 type); -static pANTLR3_STRING getText (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE t); -static void setText (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_STRING t); -static void setText8 (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_UINT8 t); -static pANTLR3_BASE_TREE getChild (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE t, ANTLR3_UINT32 i); -static ANTLR3_UINT32 getChildCount (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE t); -static ANTLR3_UINT32 getUniqueID (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE t); -static ANTLR3_BOOLEAN isNilNode (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE t); -static pANTLR3_STRING makeDot (pANTLR3_BASE_TREE_ADAPTOR adaptor, void * theTree); - -/** Given a pointer to a base tree adaptor structure (which is usually embedded in the - * super class the implements the tree adaptor used in the parse), initialize its - * function pointers and so on. - */ -ANTLR3_API void -antlr3BaseTreeAdaptorInit(pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_DEBUG_EVENT_LISTENER debugger) -{ - // Initialize the interface - // - if (debugger == NULL) - { - adaptor->nilNode = (void * (*)(pANTLR3_BASE_TREE_ADAPTOR)) - nilNode; - adaptor->addChild = (void (*)(pANTLR3_BASE_TREE_ADAPTOR, void *, void *)) - addChild; - adaptor->becomeRoot = (void * (*)(pANTLR3_BASE_TREE_ADAPTOR, void *, void *)) - becomeRoot; - adaptor->addChildToken = (void (*)(pANTLR3_BASE_TREE_ADAPTOR, void *, pANTLR3_COMMON_TOKEN)) - addChildToken; - adaptor->becomeRootToken = (void * (*)(pANTLR3_BASE_TREE_ADAPTOR, void *, void *)) - becomeRootToken; - adaptor->createTypeToken = (void * (*)(pANTLR3_BASE_TREE_ADAPTOR, ANTLR3_UINT32, pANTLR3_COMMON_TOKEN)) - createTypeToken; - adaptor->createTypeTokenText = (void * (*)(pANTLR3_BASE_TREE_ADAPTOR, ANTLR3_UINT32, pANTLR3_COMMON_TOKEN, pANTLR3_UINT8)) - createTypeTokenText; - adaptor->createTypeText = (void * (*)(pANTLR3_BASE_TREE_ADAPTOR, ANTLR3_UINT32, pANTLR3_UINT8)) - createTypeText; - adaptor->dupTree = (void * (*)(pANTLR3_BASE_TREE_ADAPTOR, void *)) - dupTree; - } - else - { - adaptor->nilNode = (void * (*)(pANTLR3_BASE_TREE_ADAPTOR)) - dbgNil; - adaptor->addChild = (void (*)(pANTLR3_BASE_TREE_ADAPTOR, void *, void *)) - dbgAddChild; - adaptor->becomeRoot = (void * (*)(pANTLR3_BASE_TREE_ADAPTOR, void *, void *)) - dbgBecomeRoot; - adaptor->addChildToken = (void (*)(pANTLR3_BASE_TREE_ADAPTOR, void *, pANTLR3_COMMON_TOKEN)) - dbgAddChildToken; - adaptor->becomeRootToken = (void * (*)(pANTLR3_BASE_TREE_ADAPTOR, void *, void *)) - dbgBecomeRootToken; - adaptor->createTypeToken = (void * (*)(pANTLR3_BASE_TREE_ADAPTOR, ANTLR3_UINT32, pANTLR3_COMMON_TOKEN)) - dbgCreateTypeToken; - adaptor->createTypeTokenText = (void * (*)(pANTLR3_BASE_TREE_ADAPTOR, ANTLR3_UINT32, pANTLR3_COMMON_TOKEN, pANTLR3_UINT8)) - dbgCreateTypeTokenText; - adaptor->createTypeText = (void * (*)(pANTLR3_BASE_TREE_ADAPTOR, ANTLR3_UINT32, pANTLR3_UINT8)) - dbgCreateTypeText; - adaptor->dupTree = (void * (*)(pANTLR3_BASE_TREE_ADAPTOR, void *)) - dbgDupTree; - debugger->adaptor = adaptor; - } - - adaptor->dupTreeTT = (void * (*)(pANTLR3_BASE_TREE_ADAPTOR, void *, void *)) - dupTreeTT; - adaptor->rulePostProcessing = (void * (*)(pANTLR3_BASE_TREE_ADAPTOR, void *)) - rulePostProcessing; - adaptor->getType = (ANTLR3_UINT32 (*)(pANTLR3_BASE_TREE_ADAPTOR, void *)) - getType; - adaptor->setType = (void (*)(pANTLR3_BASE_TREE_ADAPTOR, void *, ANTLR3_UINT32)) - setType; - adaptor->getText = (pANTLR3_STRING (*) (pANTLR3_BASE_TREE_ADAPTOR, void *)) - getText; - adaptor->setText8 = (void (*)(pANTLR3_BASE_TREE_ADAPTOR, pANTLR3_UINT8)) - setText8; - adaptor->setText = (void (*)(pANTLR3_BASE_TREE_ADAPTOR, pANTLR3_STRING)) - setText; - adaptor->getChild = (void * (*)(pANTLR3_BASE_TREE_ADAPTOR, void *, ANTLR3_UINT32)) - getChild; - adaptor->getChildCount = (ANTLR3_UINT32 (*)(pANTLR3_BASE_TREE_ADAPTOR, void *)) - getChildCount; - adaptor->getUniqueID = (ANTLR3_UINT32 (*)(pANTLR3_BASE_TREE_ADAPTOR, void *)) - getUniqueID; - adaptor->isNilNode = (ANTLR3_BOOLEAN (*)(pANTLR3_BASE_TREE_ADAPTOR, void *)) - isNilNode; - - adaptor->makeDot = (pANTLR3_STRING (*)(pANTLR3_BASE_TREE_ADAPTOR, void *)) - makeDot; - - /* Remaining functions filled in by the caller. - */ - return; -} - -static void -defineDotNodes(pANTLR3_BASE_TREE_ADAPTOR adaptor, void * t, pANTLR3_STRING dotSpec ) -{ - // How many nodes are we talking about? - // - int nCount; - int i; - pANTLR3_BASE_TREE child; - char buff[64]; - pANTLR3_STRING text; - int j; - - - - - - // Count the nodes - // - nCount = adaptor->getChildCount(adaptor, t); - - if (nCount == 0) - { - // This will already have been included as a child of another node - // so there is nothing to add. - // - return; - } - - // For each child of the current tree, define a node using the - // memory address of the node to name it - // - for (i = 0; igetChild(adaptor, t, i); - - // Name the node - // - sprintf(buff, "\tn%p[label=\"", child); - dotSpec->append8(dotSpec, buff); - text = adaptor->getText(adaptor, child); - for (j = 0; j < (ANTLR3_INT32)(text->len); j++) - { - switch(text->charAt(text, j)) - { - case '"': - - dotSpec->append8(dotSpec, "\\\""); - break; - - case '\n': - - dotSpec->append8(dotSpec, "\\n"); - break; - - case '\r': - - dotSpec->append8(dotSpec, "\\r"); - break; - - default: - - dotSpec->addc(dotSpec, text->charAt(text, j)); - break; - } - } - dotSpec->append8(dotSpec, "\"]\n"); - - // And now define the children of this child (if any) - // - defineDotNodes(adaptor, child, dotSpec); - } - - // Done - // - return; -} - -static void -defineDotEdges(pANTLR3_BASE_TREE_ADAPTOR adaptor, void * t, pANTLR3_STRING dotSpec) -{ - // How many nodes are we talking about? - // - int nCount; - int i; - - if (t == NULL) - { - // No tree, so do nothing - // - return; - } - - // Count the nodes - // - nCount = adaptor->getChildCount(adaptor, t); - - if (nCount == 0) - { - // This will already have been included as a child of another node - // so there is nothing to add. - // - return; - } - - // For each child, define an edge from this parent, then process - // and children of this child in the same way - // - for (i=0; igetChild(adaptor, t, i); - - // Create the edge relation - // - sprintf(buff, "\t\tn%p -> n%p\t\t// ", t, child); - - dotSpec->append8(dotSpec, buff); - - // Document the relationship - // - text = adaptor->getText(adaptor, t); - for (j = 0; j < (ANTLR3_INT32)(text->len); j++) - { - switch(text->charAt(text, j)) - { - case '"': - - dotSpec->append8(dotSpec, "\\\""); - break; - - case '\n': - - dotSpec->append8(dotSpec, "\\n"); - break; - - case '\r': - - dotSpec->append8(dotSpec, "\\r"); - break; - - default: - - dotSpec->addc(dotSpec, text->charAt(text, j)); - break; - } - } - - dotSpec->append8(dotSpec, " -> "); - - text = adaptor->getText(adaptor, child); - for (j = 0; j < (ANTLR3_INT32)(text->len); j++) - { - switch(text->charAt(text, j)) - { - case '"': - - dotSpec->append8(dotSpec, "\\\""); - break; - - case '\n': - - dotSpec->append8(dotSpec, "\\n"); - break; - - case '\r': - - dotSpec->append8(dotSpec, "\\r"); - break; - - default: - - dotSpec->addc(dotSpec, text->charAt(text, j)); - break; - } - } - dotSpec->append8(dotSpec, "\n"); - - - // Define edges for this child - // - defineDotEdges(adaptor, child, dotSpec); - } - - // Done - // - return; -} - -/// Produce a DOT specification for graphviz -// -static pANTLR3_STRING -makeDot (pANTLR3_BASE_TREE_ADAPTOR adaptor, void * theTree) -{ - // The string we are building up - // - pANTLR3_STRING dotSpec; - char buff[64]; - pANTLR3_STRING text; - int j; - - dotSpec = adaptor->strFactory->newStr8 - - ( - adaptor->strFactory, - - // Default look and feel - // - (pANTLR3_UINT8) - "digraph {\n\n" - "\tordering=out;\n" - "\tranksep=.4;\n" - "\tbgcolor=\"lightgrey\"; node [shape=box, fixedsize=false, fontsize=12, fontname=\"Helvetica-bold\", fontcolor=\"blue\"\n" - "\twidth=.25, height=.25, color=\"black\", fillcolor=\"white\", style=\"filled, solid, bold\"];\n\n" - "\tedge [arrowsize=.5, color=\"black\", style=\"bold\"]\n\n" - ); - - if (theTree == NULL) - { - // No tree, so create a blank spec - // - dotSpec->append8(dotSpec, "n0[label=\"EMPTY TREE\"]\n"); - return dotSpec; - } - - sprintf(buff, "\tn%p[label=\"", theTree); - dotSpec->append8(dotSpec, buff); - text = adaptor->getText(adaptor, theTree); - for (j = 0; j < (ANTLR3_INT32)(text->len); j++) - { - switch(text->charAt(text, j)) - { - case '"': - - dotSpec->append8(dotSpec, "\\\""); - break; - - case '\n': - - dotSpec->append8(dotSpec, "\\n"); - break; - - case '\r': - - dotSpec->append8(dotSpec, "\\r"); - break; - - default: - - dotSpec->addc(dotSpec, text->charAt(text, j)); - break; - } - } - dotSpec->append8(dotSpec, "\"]\n"); - - // First produce the node defintions - // - defineDotNodes(adaptor, theTree, dotSpec); - dotSpec->append8(dotSpec, "\n"); - defineDotEdges(adaptor, theTree, dotSpec); - - // Terminate the spec - // - dotSpec->append8(dotSpec, "\n}"); - - // Result - // - return dotSpec; -} - - -/** Create and return a nil tree node (no token payload) - */ -static pANTLR3_BASE_TREE -nilNode (pANTLR3_BASE_TREE_ADAPTOR adaptor) -{ - return adaptor->create(adaptor, NULL); -} - -static pANTLR3_BASE_TREE -dbgNil (pANTLR3_BASE_TREE_ADAPTOR adaptor) -{ - pANTLR3_BASE_TREE t; - - t = adaptor->create (adaptor, NULL); - adaptor->debugger->createNode (adaptor->debugger, t); - - return t; -} - -/** Return a duplicate of the entire tree (implementation provided by the - * BASE_TREE interface.) - */ -static pANTLR3_BASE_TREE -dupTree (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE t) -{ - return adaptor->dupTreeTT(adaptor, t, NULL); -} - -pANTLR3_BASE_TREE -dupTreeTT (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE t, pANTLR3_BASE_TREE parent) -{ - pANTLR3_BASE_TREE newTree; - pANTLR3_BASE_TREE child; - pANTLR3_BASE_TREE newSubTree; - ANTLR3_UINT32 n; - ANTLR3_UINT32 i; - - if (t == NULL) - { - return NULL; - } - newTree = t->dupNode(t); - - // Ensure new subtree root has parent/child index set - // - adaptor->setChildIndex (adaptor, newTree, t->getChildIndex(t)); - adaptor->setParent (adaptor, newTree, parent); - n = adaptor->getChildCount (adaptor, t); - - for (i=0; i < n; i++) - { - child = adaptor->getChild (adaptor, t, i); - newSubTree = adaptor->dupTreeTT (adaptor, child, t); - adaptor->addChild (adaptor, newTree, newSubTree); - } - return newTree; -} - -/// Sends the required debugging events for duplicating a tree -/// to the debugger. -/// -static void -simulateTreeConstruction(pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE tree) -{ - ANTLR3_UINT32 n; - ANTLR3_UINT32 i; - pANTLR3_BASE_TREE child; - - // Send the create node event - // - adaptor->debugger->createNode(adaptor->debugger, tree); - - n = adaptor->getChildCount(adaptor, tree); - for (i = 0; i < n; i++) - { - child = adaptor->getChild(adaptor, tree, i); - simulateTreeConstruction(adaptor, child); - adaptor->debugger->addChild(adaptor->debugger, tree, child); - } -} - -pANTLR3_BASE_TREE -dbgDupTree (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE tree) -{ - pANTLR3_BASE_TREE t; - - // Call the normal dup tree mechanism first - // - t = adaptor->dupTreeTT(adaptor, tree, NULL); - - // In order to tell the debugger what we have just done, we now - // simulate the tree building mechanism. THis will fire - // lots of debugging events to the client and look like we - // duped the tree.. - // - simulateTreeConstruction(adaptor, t); - - return t; -} - -/** Add a child to the tree t. If child is a flat tree (a list), make all - * in list children of t. Warning: if t has no children, but child does - * and child isNilNode then it is ok to move children to t via - * t.children = child.children; i.e., without copying the array. This - * is for construction and I'm not sure it's completely general for - * a tree's addChild method to work this way. Make sure you differentiate - * between your tree's addChild and this parser tree construction addChild - * if it's not ok to move children to t with a simple assignment. - */ -static void -addChild (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE t, pANTLR3_BASE_TREE child) -{ - if (t != NULL && child != NULL) - { - t->addChild(t, child); - } -} -static void -dbgAddChild (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE t, pANTLR3_BASE_TREE child) -{ - if (t != NULL && child != NULL) - { - t->addChild(t, child); - adaptor->debugger->addChild(adaptor->debugger, t, child); - } -} -/** Use the adaptor implementation to add a child node with the supplied token - */ -static void -addChildToken (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE t, pANTLR3_COMMON_TOKEN child) -{ - if (t != NULL && child != NULL) - { - adaptor->addChild(adaptor, t, adaptor->create(adaptor, child)); - } -} -static void -dbgAddChildToken (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE t, pANTLR3_COMMON_TOKEN child) -{ - pANTLR3_BASE_TREE tc; - - if (t != NULL && child != NULL) - { - tc = adaptor->create(adaptor, child); - adaptor->addChild(adaptor, t, tc); - adaptor->debugger->addChild(adaptor->debugger, t, tc); - } -} - -/** If oldRoot is a nil root, just copy or move the children to newRoot. - * If not a nil root, make oldRoot a child of newRoot. - * - * \code - * old=^(nil a b c), new=r yields ^(r a b c) - * old=^(a b c), new=r yields ^(r ^(a b c)) - * \endcode - * - * If newRoot is a nil-rooted single child tree, use the single - * child as the new root node. - * - * \code - * old=^(nil a b c), new=^(nil r) yields ^(r a b c) - * old=^(a b c), new=^(nil r) yields ^(r ^(a b c)) - * \endcode - * - * If oldRoot was null, it's ok, just return newRoot (even if isNilNode). - * - * \code - * old=null, new=r yields r - * old=null, new=^(nil r) yields ^(nil r) - * \endcode - * - * Return newRoot. Throw an exception if newRoot is not a - * simple node or nil root with a single child node--it must be a root - * node. If newRoot is ^(nil x) return x as newRoot. - * - * Be advised that it's ok for newRoot to point at oldRoot's - * children; i.e., you don't have to copy the list. We are - * constructing these nodes so we should have this control for - * efficiency. - */ -static pANTLR3_BASE_TREE -becomeRoot (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE newRootTree, pANTLR3_BASE_TREE oldRootTree) -{ - pANTLR3_BASE_TREE saveRoot; - - /* Protect against tree rewrites if we are in some sort of error - * state, but have tried to recover. In C we can end up with a null pointer - * for a tree that was not produced. - */ - if (newRootTree == NULL) - { - return oldRootTree; - } - - /* root is just the new tree as is if there is no - * current root tree. - */ - if (oldRootTree == NULL) - { - return newRootTree; - } - - /* Produce ^(nil real-node) - */ - if (newRootTree->isNilNode(newRootTree)) - { - if (newRootTree->getChildCount(newRootTree) > 1) - { - /* TODO: Handle tree exceptions - */ - ANTLR3_FPRINTF(stderr, "More than one node as root! TODO: Create tree exception handling\n"); - return newRootTree; - } - - /* The new root is the first child, keep track of the original newRoot - * because if it was a Nil Node, then we can reuse it now. - */ - saveRoot = newRootTree; - newRootTree = newRootTree->getChild(newRootTree, 0); - - // Reclaim the old nilNode() - // - saveRoot->reuse(saveRoot); - } - - /* Add old root into new root. addChild takes care of the case where oldRoot - * is a flat list (nill rooted tree). All children of oldroot are added to - * new root. - */ - newRootTree->addChild(newRootTree, oldRootTree); - - // If the oldroot tree was a nil node, then we know at this point - // it has become orphaned by the rewrite logic, so we tell it to do - // whatever it needs to do to be reused. - // - if (oldRootTree->isNilNode(oldRootTree)) - { - // We have taken an old Root Tree and appended all its children to the new - // root. In addition though it was a nil node, which means the generated code - // will not reuse it again, so we will reclaim it here. First we want to zero out - // any pointers it was carrying around. We are just the baseTree handler so we - // don't know necessarilly know how to do this for the real node, we just ask the tree itself - // to do it. - // - oldRootTree->reuse(oldRootTree); - } - /* Always returns new root structure - */ - return newRootTree; - -} -static pANTLR3_BASE_TREE -dbgBecomeRoot (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE newRootTree, pANTLR3_BASE_TREE oldRootTree) -{ - pANTLR3_BASE_TREE t; - - t = becomeRoot(adaptor, newRootTree, oldRootTree); - - adaptor->debugger->becomeRoot(adaptor->debugger, newRootTree, oldRootTree); - - return t; -} -/** Transform ^(nil x) to x - */ -static pANTLR3_BASE_TREE - rulePostProcessing (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE root) -{ - pANTLR3_BASE_TREE saveRoot; - - // Keep track of the root we are given. If it is a nilNode, then we - // can reuse it rather than orphaning it! - // - saveRoot = root; - - if (root != NULL && root->isNilNode(root)) - { - if (root->getChildCount(root) == 0) - { - root = NULL; - } - else if (root->getChildCount(root) == 1) - { - root = root->getChild(root, 0); - root->setParent(root, NULL); - root->setChildIndex(root, -1); - - // The root we were given was a nil node, wiht one child, which means it has - // been abandoned and would be lost in the node factory. However - // nodes can be flagged as resuable to prevent this terrible waste - // - saveRoot->reuse(saveRoot); - } - } - - return root; -} - -/** Use the adaptor interface to set a new tree node with the supplied token - * to the root of the tree. - */ -static pANTLR3_BASE_TREE - becomeRootToken (pANTLR3_BASE_TREE_ADAPTOR adaptor, void * newRoot, pANTLR3_BASE_TREE oldRoot) -{ - return adaptor->becomeRoot(adaptor, adaptor->create(adaptor, newRoot), oldRoot); -} -static pANTLR3_BASE_TREE -dbgBecomeRootToken (pANTLR3_BASE_TREE_ADAPTOR adaptor, void * newRoot, pANTLR3_BASE_TREE oldRoot) -{ - pANTLR3_BASE_TREE t; - - t = adaptor->becomeRoot(adaptor, adaptor->create(adaptor, newRoot), oldRoot); - - adaptor->debugger->becomeRoot(adaptor->debugger,t, oldRoot); - - return t; -} - -/** Use the super class supplied create() method to create a new node - * from the supplied token. - */ -static pANTLR3_BASE_TREE -createTypeToken (pANTLR3_BASE_TREE_ADAPTOR adaptor, ANTLR3_UINT32 tokenType, pANTLR3_COMMON_TOKEN fromToken) -{ - /* Create the new token - */ - fromToken = adaptor->createTokenFromToken(adaptor, fromToken); - - /* Set the type of the new token to that supplied - */ - fromToken->setType(fromToken, tokenType); - - /* Return a new node based upon this token - */ - return adaptor->create(adaptor, fromToken); -} -static pANTLR3_BASE_TREE -dbgCreateTypeToken (pANTLR3_BASE_TREE_ADAPTOR adaptor, ANTLR3_UINT32 tokenType, pANTLR3_COMMON_TOKEN fromToken) -{ - pANTLR3_BASE_TREE t; - - t = createTypeToken(adaptor, tokenType, fromToken); - - adaptor->debugger->createNode(adaptor->debugger, t); - - return t; -} - -static pANTLR3_BASE_TREE -createTypeTokenText (pANTLR3_BASE_TREE_ADAPTOR adaptor, ANTLR3_UINT32 tokenType, pANTLR3_COMMON_TOKEN fromToken, pANTLR3_UINT8 text) -{ - /* Create the new token - */ - fromToken = adaptor->createTokenFromToken(adaptor, fromToken); - - /* Set the type of the new token to that supplied - */ - fromToken->setType(fromToken, tokenType); - - /* Set the text of the token accordingly - */ - fromToken->setText8(fromToken, text); - - /* Return a new node based upon this token - */ - return adaptor->create(adaptor, fromToken); -} -static pANTLR3_BASE_TREE -dbgCreateTypeTokenText (pANTLR3_BASE_TREE_ADAPTOR adaptor, ANTLR3_UINT32 tokenType, pANTLR3_COMMON_TOKEN fromToken, pANTLR3_UINT8 text) -{ - pANTLR3_BASE_TREE t; - - t = createTypeTokenText(adaptor, tokenType, fromToken, text); - - adaptor->debugger->createNode(adaptor->debugger, t); - - return t; -} - -static pANTLR3_BASE_TREE - createTypeText (pANTLR3_BASE_TREE_ADAPTOR adaptor, ANTLR3_UINT32 tokenType, pANTLR3_UINT8 text) -{ - pANTLR3_COMMON_TOKEN fromToken; - - /* Create the new token - */ - fromToken = adaptor->createToken(adaptor, tokenType, text); - - /* Return a new node based upon this token - */ - return adaptor->create(adaptor, fromToken); -} -static pANTLR3_BASE_TREE - dbgCreateTypeText (pANTLR3_BASE_TREE_ADAPTOR adaptor, ANTLR3_UINT32 tokenType, pANTLR3_UINT8 text) -{ - pANTLR3_BASE_TREE t; - - t = createTypeText(adaptor, tokenType, text); - - adaptor->debugger->createNode(adaptor->debugger, t); - - return t; - -} -/** Dummy implementation - will be supplied by super class - */ -static ANTLR3_UINT32 - getType (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE t) -{ - return 0; -} - -/** Dummy implementation - will be supplied by super class - */ -static void - setType (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE t, ANTLR3_UINT32 type) -{ - ANTLR3_FPRINTF(stderr, "Internal error - implementor of superclass containing ANTLR3_TREE_ADAPTOR did not implement setType()\n"); -} - -/** Dummy implementation - will be supplied by super class - */ -static pANTLR3_STRING - getText (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE t) -{ - ANTLR3_FPRINTF(stderr, "Internal error - implementor of superclass containing ANTLR3_TREE_ADAPTOR did not implement getText()\n"); - return NULL; -} - -/** Dummy implementation - will be supplied by super class - */ -static void - setText (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_STRING t) -{ - ANTLR3_FPRINTF(stderr, "Internal error - implementor of superclass containing ANTLR3_TREE_ADAPTOR did not implement setText()\n"); -} -/** Dummy implementation - will be supplied by super class - */ -static void -setText8 (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_UINT8 t) -{ - ANTLR3_FPRINTF(stderr, "Internal error - implementor of superclass containing ANTLR3_TREE_ADAPTOR did not implement setText()\n"); -} - -static pANTLR3_BASE_TREE - getChild (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE tree, ANTLR3_UINT32 i) -{ - ANTLR3_FPRINTF(stderr, "Internal error - implementor of superclass containing ANTLR3_TREE_ADAPTOR did not implement getChild()\n"); - return NULL; -} - -static ANTLR3_UINT32 - getChildCount (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE tree) -{ - ANTLR3_FPRINTF(stderr, "Internal error - implementor of superclass containing ANTLR3_TREE_ADAPTOR did not implement getChildCount()\n"); - return 0; -} - -/** Returns a uniqueID for the node. Because this is the C implementation - * we can just use its address suitably converted/cast to an integer. - */ -static ANTLR3_UINT32 - getUniqueID (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE node) -{ - return ANTLR3_UINT32_CAST(node); -} - -static ANTLR3_BOOLEAN -isNilNode (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE t) -{ - return t->isNilNode(t); -} diff --git a/impl/antlr/libantlr3c-3.4/src/antlr3bitset.c b/impl/antlr/libantlr3c-3.4/src/antlr3bitset.c deleted file mode 100644 index 4e63c79..0000000 --- a/impl/antlr/libantlr3c-3.4/src/antlr3bitset.c +++ /dev/null @@ -1,681 +0,0 @@ -/// -/// \file -/// Contains the C implementation of ANTLR3 bitsets as adapted from Terence Parr's -/// Java implementation. -/// - -// [The "BSD licence"] -// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC -// http://www.temporal-wave.com -// http://www.linkedin.com/in/jimidle -// -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions -// are met: -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// 3. The name of the author may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include - -// External interface -// - -static pANTLR3_BITSET antlr3BitsetClone (pANTLR3_BITSET inSet); -static pANTLR3_BITSET antlr3BitsetOR (pANTLR3_BITSET bitset1, pANTLR3_BITSET bitset2); -static void antlr3BitsetORInPlace (pANTLR3_BITSET bitset, pANTLR3_BITSET bitset2); -static ANTLR3_UINT32 antlr3BitsetSize (pANTLR3_BITSET bitset); -static void antlr3BitsetAdd (pANTLR3_BITSET bitset, ANTLR3_INT32 bit); -static ANTLR3_BOOLEAN antlr3BitsetEquals (pANTLR3_BITSET bitset1, pANTLR3_BITSET bitset2); -static ANTLR3_BOOLEAN antlr3BitsetMember (pANTLR3_BITSET bitset, ANTLR3_UINT32 bit); -static ANTLR3_UINT32 antlr3BitsetNumBits (pANTLR3_BITSET bitset); -static void antlr3BitsetRemove (pANTLR3_BITSET bitset, ANTLR3_UINT32 bit); -static ANTLR3_BOOLEAN antlr3BitsetIsNil (pANTLR3_BITSET bitset); -static pANTLR3_INT32 antlr3BitsetToIntList (pANTLR3_BITSET bitset); - -// Local functions -// -static void growToInclude (pANTLR3_BITSET bitset, ANTLR3_INT32 bit); -static void grow (pANTLR3_BITSET bitset, ANTLR3_INT32 newSize); -static ANTLR3_UINT64 bitMask (ANTLR3_UINT32 bitNumber); -static ANTLR3_UINT32 numWordsToHold (ANTLR3_UINT32 bit); -static ANTLR3_UINT32 wordNumber (ANTLR3_UINT32 bit); -static void antlr3BitsetFree (pANTLR3_BITSET bitset); - -static void -antlr3BitsetFree(pANTLR3_BITSET bitset) -{ - if (bitset->blist.bits != NULL) - { - ANTLR3_FREE(bitset->blist.bits); - bitset->blist.bits = NULL; - } - ANTLR3_FREE(bitset); - - return; -} - -ANTLR3_API pANTLR3_BITSET -antlr3BitsetNew(ANTLR3_UINT32 numBits) -{ - pANTLR3_BITSET bitset; - - ANTLR3_UINT32 numelements; - - // Allocate memory for the bitset structure itself - // - bitset = (pANTLR3_BITSET) ANTLR3_MALLOC((size_t)sizeof(ANTLR3_BITSET)); - - if (bitset == NULL) - { - return NULL; - } - - // Avoid memory thrashing at the up front expense of a few bytes - // - if (numBits < (8 * ANTLR3_BITSET_BITS)) - { - numBits = 8 * ANTLR3_BITSET_BITS; - } - - // No we need to allocate the memory for the number of bits asked for - // in multiples of ANTLR3_UINT64. - // - numelements = ((numBits -1) >> ANTLR3_BITSET_LOG_BITS) + 1; - - bitset->blist.bits = (pANTLR3_BITWORD) ANTLR3_MALLOC((size_t)(numelements * sizeof(ANTLR3_BITWORD))); - memset(bitset->blist.bits, 0, (size_t)(numelements * sizeof(ANTLR3_BITWORD))); - bitset->blist.length = numelements; - - if (bitset->blist.bits == NULL) - { - ANTLR3_FREE(bitset); - return NULL; - } - - antlr3BitsetSetAPI(bitset); - - - // All seems good - // - return bitset; -} - -ANTLR3_API void -antlr3BitsetSetAPI(pANTLR3_BITSET bitset) -{ - bitset->clone = antlr3BitsetClone; - bitset->bor = antlr3BitsetOR; - bitset->borInPlace = antlr3BitsetORInPlace; - bitset->size = antlr3BitsetSize; - bitset->add = antlr3BitsetAdd; - bitset->grow = grow; - bitset->equals = antlr3BitsetEquals; - bitset->isMember = antlr3BitsetMember; - bitset->numBits = antlr3BitsetNumBits; - bitset->remove = antlr3BitsetRemove; - bitset->isNilNode = antlr3BitsetIsNil; - bitset->toIntList = antlr3BitsetToIntList; - - bitset->free = antlr3BitsetFree; -} - -ANTLR3_API pANTLR3_BITSET -antlr3BitsetCopy(pANTLR3_BITSET_LIST blist) -{ - pANTLR3_BITSET bitset; - int numElements; - - // Allocate memory for the bitset structure itself - // - bitset = (pANTLR3_BITSET) ANTLR3_MALLOC((size_t)sizeof(ANTLR3_BITSET)); - - if (bitset == NULL) - { - return NULL; - } - - numElements = blist->length; - - // Avoid memory thrashing at the expense of a few more bytes - // - if (numElements < 8) - { - numElements = 8; - } - - // Install the length in ANTLR3_UINT64 units - // - bitset->blist.length = numElements; - - bitset->blist.bits = (pANTLR3_BITWORD)ANTLR3_MALLOC((size_t)(numElements * sizeof(ANTLR3_BITWORD))); - - if (bitset->blist.bits == NULL) - { - ANTLR3_FREE(bitset); - return NULL; - } - - ANTLR3_MEMCPY(bitset->blist.bits, blist->bits, (ANTLR3_UINT64)(numElements * sizeof(ANTLR3_BITWORD))); - - // All seems good - // - return bitset; -} - -static pANTLR3_BITSET -antlr3BitsetClone(pANTLR3_BITSET inSet) -{ - pANTLR3_BITSET bitset; - - // Allocate memory for the bitset structure itself - // - bitset = antlr3BitsetNew(ANTLR3_BITSET_BITS * inSet->blist.length); - - if (bitset == NULL) - { - return NULL; - } - - // Install the actual bits in the source set - // - ANTLR3_MEMCPY(bitset->blist.bits, inSet->blist.bits, (ANTLR3_UINT64)(inSet->blist.length * sizeof(ANTLR3_BITWORD))); - - // All seems good - // - return bitset; -} - - -ANTLR3_API pANTLR3_BITSET -antlr3BitsetList(pANTLR3_HASH_TABLE list) -{ - pANTLR3_BITSET bitSet; - pANTLR3_HASH_ENUM en; - pANTLR3_HASH_KEY key; - ANTLR3_UINT64 bit; - - // We have no idea what exactly is in the list - // so create a default bitset and then just add stuff - // as we enumerate. - // - bitSet = antlr3BitsetNew(0); - - en = antlr3EnumNew(list); - - while (en->next(en, &key, (void **)(&bit)) == ANTLR3_SUCCESS) - { - bitSet->add(bitSet, (ANTLR3_UINT32)bit); - } - en->free(en); - - return NULL; -} - -/// -/// \brief -/// Creates a new bitset with at least one 64 bit bset of bits, but as -/// many 64 bit sets as are required. -/// -/// \param[in] bset -/// A variable number of bits to add to the set, ending in -1 (impossible bit). -/// -/// \returns -/// A new bit set with all of the specified bitmaps in it and the API -/// initialized. -/// -/// Call as: -/// - pANTLR3_BITSET = antlrBitsetLoad(bset, bset11, ..., -1); -/// - pANTLR3_BITSET = antlrBitsetOf(-1); Create empty bitset -/// -/// \remarks -/// Stdargs function - must supply -1 as last paremeter, which is NOT -/// added to the set. -/// -/// -ANTLR3_API pANTLR3_BITSET -antlr3BitsetLoad(pANTLR3_BITSET_LIST inBits) -{ - pANTLR3_BITSET bitset; - ANTLR3_UINT32 count; - - // Allocate memory for the bitset structure itself - // the input parameter is the bit number (0 based) - // to include in the bitset, so we need at at least - // bit + 1 bits. If any arguments indicate a - // a bit higher than the default number of bits (0 means default size) - // then Add() will take care - // of it. - // - bitset = antlr3BitsetNew(0); - - if (bitset == NULL) - { - return NULL; - } - - if (inBits != NULL) - { - // Now we can add the element bits into the set - // - count=0; - while (count < inBits->length) - { - if (bitset->blist.length <= count) - { - bitset->grow(bitset, count+1); - } - - bitset->blist.bits[count] = *((inBits->bits)+count); - count++; - } - } - - // return the new bitset - // - return bitset; -} - -/// -/// \brief -/// Creates a new bitset with at least one element, but as -/// many elements are required. -/// -/// \param[in] bit -/// A variable number of bits to add to the set, ending in -1 (impossible bit). -/// -/// \returns -/// A new bit set with all of the specified elements added into it. -/// -/// Call as: -/// - pANTLR3_BITSET = antlrBitsetOf(n, n1, n2, -1); -/// - pANTLR3_BITSET = antlrBitsetOf(-1); Create empty bitset -/// -/// \remarks -/// Stdargs function - must supply -1 as last paremeter, which is NOT -/// added to the set. -/// -/// -ANTLR3_API pANTLR3_BITSET -antlr3BitsetOf(ANTLR3_INT32 bit, ...) -{ - pANTLR3_BITSET bitset; - - va_list ap; - - // Allocate memory for the bitset structure itself - // the input parameter is the bit number (0 based) - // to include in the bitset, so we need at at least - // bit + 1 bits. If any arguments indicate a - // a bit higher than the default number of bits (0 menas default size) - // then Add() will take care - // of it. - // - bitset = antlr3BitsetNew(0); - - if (bitset == NULL) - { - return NULL; - } - - // Now we can add the element bits into the set - // - va_start(ap, bit); - while (bit != -1) - { - antlr3BitsetAdd(bitset, bit); - bit = va_arg(ap, ANTLR3_UINT32); - } - va_end(ap); - - // return the new bitset - // - return bitset; -} - -static pANTLR3_BITSET -antlr3BitsetOR(pANTLR3_BITSET bitset1, pANTLR3_BITSET bitset2) -{ - pANTLR3_BITSET bitset; - - if (bitset1 == NULL) - { - return antlr3BitsetClone(bitset2); - } - - if (bitset2 == NULL) - { - return antlr3BitsetClone(bitset1); - } - - // Allocate memory for the newly ordered bitset structure itself. - // - bitset = antlr3BitsetClone(bitset1); - - antlr3BitsetORInPlace(bitset, bitset2); - - return bitset; - -} - -static void -antlr3BitsetAdd(pANTLR3_BITSET bitset, ANTLR3_INT32 bit) -{ - ANTLR3_UINT32 word; - - word = wordNumber(bit); - - if (word >= bitset->blist.length) - { - growToInclude(bitset, bit); - } - - bitset->blist.bits[word] |= bitMask(bit); - -} - -static void -grow(pANTLR3_BITSET bitset, ANTLR3_INT32 newSize) -{ - pANTLR3_BITWORD newBits; - - // Space for newly sized bitset - TODO: come back to this and use realloc?, it may - // be more efficient... - // - newBits = (pANTLR3_BITWORD) ANTLR3_CALLOC(1, (size_t)(newSize * sizeof(ANTLR3_BITWORD))); - if (bitset->blist.bits != NULL) - { - // Copy existing bits - // - ANTLR3_MEMCPY((void *)newBits, (const void *)bitset->blist.bits, (size_t)(bitset->blist.length * sizeof(ANTLR3_BITWORD))); - - // Out with the old bits... de de de derrr - // - ANTLR3_FREE(bitset->blist.bits); - } - - // In with the new bits... keerrrang. - // - bitset->blist.bits = newBits; - bitset->blist.length = newSize; -} - -static void -growToInclude(pANTLR3_BITSET bitset, ANTLR3_INT32 bit) -{ - ANTLR3_UINT32 bl; - ANTLR3_UINT32 nw; - - bl = (bitset->blist.length << 1); - nw = numWordsToHold(bit); - - if (bl > nw) - { - bitset->grow(bitset, bl); - } - else - { - bitset->grow(bitset, nw); - } -} - -static void -antlr3BitsetORInPlace(pANTLR3_BITSET bitset, pANTLR3_BITSET bitset2) -{ - ANTLR3_UINT32 minimum; - ANTLR3_UINT32 i; - - if (bitset2 == NULL) - { - return; - } - - - // First make sure that the target bitset is big enough - // for the new bits to be ored in. - // - if (bitset->blist.length < bitset2->blist.length) - { - growToInclude(bitset, (bitset2->blist.length * sizeof(ANTLR3_BITWORD))); - } - - // Or the miniimum number of bits after any resizing went on - // - if (bitset->blist.length < bitset2->blist.length) - { - minimum = bitset->blist.length; - } - else - { - minimum = bitset2->blist.length; - } - - for (i = minimum; i > 0; i--) - { - bitset->blist.bits[i-1] |= bitset2->blist.bits[i-1]; - } -} - -static ANTLR3_UINT64 -bitMask(ANTLR3_UINT32 bitNumber) -{ - return ((ANTLR3_UINT64)1) << (bitNumber & (ANTLR3_BITSET_MOD_MASK)); -} - -static ANTLR3_UINT32 -antlr3BitsetSize(pANTLR3_BITSET bitset) -{ - ANTLR3_UINT32 degree; - ANTLR3_INT32 i; - ANTLR3_INT8 bit; - - // TODO: Come back to this, it may be faster to & with 0x01 - // then shift right a copy of the 4 bits, than shift left a constant of 1. - // But then again, the optimizer might just work this out - // anyway. - // - degree = 0; - for (i = bitset->blist.length - 1; i>= 0; i--) - { - if (bitset->blist.bits[i] != 0) - { - for (bit = ANTLR3_BITSET_BITS - 1; bit >= 0; bit--) - { - if ((bitset->blist.bits[i] & (((ANTLR3_BITWORD)1) << bit)) != 0) - { - degree++; - } - } - } - } - return degree; -} - -static ANTLR3_BOOLEAN -antlr3BitsetEquals(pANTLR3_BITSET bitset1, pANTLR3_BITSET bitset2) -{ - ANTLR3_INT32 minimum; - ANTLR3_INT32 i; - - if (bitset1 == NULL || bitset2 == NULL) - { - return ANTLR3_FALSE; - } - - // Work out the minimum comparison set - // - if (bitset1->blist.length < bitset2->blist.length) - { - minimum = bitset1->blist.length; - } - else - { - minimum = bitset2->blist.length; - } - - // Make sure explict in common bits are equal - // - for (i = minimum - 1; i >=0 ; i--) - { - if (bitset1->blist.bits[i] != bitset2->blist.bits[i]) - { - return ANTLR3_FALSE; - } - } - - // Now make sure the bits of the larger set are all turned - // off. - // - if (bitset1->blist.length > (ANTLR3_UINT32)minimum) - { - for (i = minimum ; (ANTLR3_UINT32)i < bitset1->blist.length; i++) - { - if (bitset1->blist.bits[i] != 0) - { - return ANTLR3_FALSE; - } - } - } - else if (bitset2->blist.length > (ANTLR3_UINT32)minimum) - { - for (i = minimum; (ANTLR3_UINT32)i < bitset2->blist.length; i++) - { - if (bitset2->blist.bits[i] != 0) - { - return ANTLR3_FALSE; - } - } - } - - return ANTLR3_TRUE; -} - -static ANTLR3_BOOLEAN -antlr3BitsetMember(pANTLR3_BITSET bitset, ANTLR3_UINT32 bit) -{ - ANTLR3_UINT32 wordNo; - - wordNo = wordNumber(bit); - - if (wordNo >= bitset->blist.length) - { - return ANTLR3_FALSE; - } - - if ((bitset->blist.bits[wordNo] & bitMask(bit)) == 0) - { - return ANTLR3_FALSE; - } - else - { - return ANTLR3_TRUE; - } -} - -static void -antlr3BitsetRemove(pANTLR3_BITSET bitset, ANTLR3_UINT32 bit) -{ - ANTLR3_UINT32 wordNo; - - wordNo = wordNumber(bit); - - if (wordNo < bitset->blist.length) - { - bitset->blist.bits[wordNo] &= ~(bitMask(bit)); - } -} -static ANTLR3_BOOLEAN -antlr3BitsetIsNil(pANTLR3_BITSET bitset) -{ - ANTLR3_INT32 i; - - for (i = bitset->blist.length -1; i>= 0; i--) - { - if (bitset->blist.bits[i] != 0) - { - return ANTLR3_FALSE; - } - } - - return ANTLR3_TRUE; -} - -static ANTLR3_UINT32 -numWordsToHold(ANTLR3_UINT32 bit) -{ - return (bit >> ANTLR3_BITSET_LOG_BITS) + 1; -} - -static ANTLR3_UINT32 -wordNumber(ANTLR3_UINT32 bit) -{ - return bit >> ANTLR3_BITSET_LOG_BITS; -} - -static ANTLR3_UINT32 -antlr3BitsetNumBits(pANTLR3_BITSET bitset) -{ - return bitset->blist.length << ANTLR3_BITSET_LOG_BITS; -} - -/** Produce an integer list of all the bits that are turned on - * in this bitset. Used for error processing in the main as the bitset - * reresents a number of integer tokens which we use for follow sets - * and so on. - * - * The first entry is the number of elements following in the list. - */ -static pANTLR3_INT32 -antlr3BitsetToIntList (pANTLR3_BITSET bitset) -{ - ANTLR3_UINT32 numInts; // How many integers we will need - ANTLR3_UINT32 numBits; // How many bits are in the set - ANTLR3_UINT32 i; - ANTLR3_UINT32 index; - - pANTLR3_INT32 intList; - - numInts = bitset->size(bitset) + 1; - numBits = bitset->numBits(bitset); - - intList = (pANTLR3_INT32)ANTLR3_MALLOC(numInts * sizeof(ANTLR3_INT32)); - - if (intList == NULL) - { - return NULL; // Out of memory - } - - intList[0] = numInts; - - // Enumerate the bits that are turned on - // - for (i = 0, index = 1; iisMember(bitset, i) == ANTLR3_TRUE) - { - intList[index++] = i; - } - } - - // Result set - // - return intList; -} - diff --git a/impl/antlr/libantlr3c-3.4/src/antlr3collections.c b/impl/antlr/libantlr3c-3.4/src/antlr3collections.c deleted file mode 100644 index d9e22e9..0000000 --- a/impl/antlr/libantlr3c-3.4/src/antlr3collections.c +++ /dev/null @@ -1,2741 +0,0 @@ -/// \file -/// Provides a number of useful functions that are roughly equivalent -/// to java HashTable and List for the purposes of Antlr 3 C runtime. -/// Also useable by the C programmer for things like symbol tables pointers -/// and so on. -/// -/// - -// [The "BSD licence"] -// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC -// http://www.temporal-wave.com -// http://www.linkedin.com/in/jimidle -// -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions -// are met: -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// 3. The name of the author may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include - -#include "antlr3collections.h" - -// Interface functions for hash table -// - -// String based keys -// -static void antlr3HashDelete (pANTLR3_HASH_TABLE table, void * key); -static void * antlr3HashGet (pANTLR3_HASH_TABLE table, void * key); -static pANTLR3_HASH_ENTRY antlr3HashRemove (pANTLR3_HASH_TABLE table, void * key); -static ANTLR3_INT32 antlr3HashPut (pANTLR3_HASH_TABLE table, void * key, void * element, void (ANTLR3_CDECL *freeptr)(void *)); - -// Integer based keys (Lists and so on) -// -static void antlr3HashDeleteI (pANTLR3_HASH_TABLE table, ANTLR3_INTKEY key); -static void * antlr3HashGetI (pANTLR3_HASH_TABLE table, ANTLR3_INTKEY key); -static pANTLR3_HASH_ENTRY antlr3HashRemoveI (pANTLR3_HASH_TABLE table, ANTLR3_INTKEY key); -static ANTLR3_INT32 antlr3HashPutI (pANTLR3_HASH_TABLE table, ANTLR3_INTKEY key, void * element, void (ANTLR3_CDECL *freeptr)(void *)); - -static void antlr3HashFree (pANTLR3_HASH_TABLE table); -static ANTLR3_UINT32 antlr3HashSize (pANTLR3_HASH_TABLE table); - -// ----------- - -// Interface functions for enumeration -// -static int antlr3EnumNext (pANTLR3_HASH_ENUM en, pANTLR3_HASH_KEY * key, void ** data); -static void antlr3EnumFree (pANTLR3_HASH_ENUM en); - -// Interface functions for List -// -static void antlr3ListFree (pANTLR3_LIST list); -static void antlr3ListDelete(pANTLR3_LIST list, ANTLR3_INTKEY key); -static void * antlr3ListGet (pANTLR3_LIST list, ANTLR3_INTKEY key); -static ANTLR3_INT32 antlr3ListPut (pANTLR3_LIST list, ANTLR3_INTKEY key, void * element, void (ANTLR3_CDECL *freeptr)(void *)); -static ANTLR3_INT32 antlr3ListAdd (pANTLR3_LIST list, void * element, void (ANTLR3_CDECL *freeptr)(void *)); -static void * antlr3ListRemove(pANTLR3_LIST list, ANTLR3_INTKEY key); -static ANTLR3_UINT32 antlr3ListSize (pANTLR3_LIST list); - -// Interface functions for Stack -// -static void antlr3StackFree (pANTLR3_STACK stack); -static void * antlr3StackPop (pANTLR3_STACK stack); -static void * antlr3StackGet (pANTLR3_STACK stack, ANTLR3_INTKEY key); -static ANTLR3_BOOLEAN antlr3StackPush (pANTLR3_STACK stack, void * element, void (ANTLR3_CDECL *freeptr)(void *)); -static ANTLR3_UINT32 antlr3StackSize (pANTLR3_STACK stack); -static void * antlr3StackPeek (pANTLR3_STACK stack); - -// Interface functions for vectors -// -static void ANTLR3_CDECL antlr3VectorFree (pANTLR3_VECTOR vector); -static void antlr3VectorDel (pANTLR3_VECTOR vector, ANTLR3_UINT32 entry); -static void * antlr3VectorGet (pANTLR3_VECTOR vector, ANTLR3_UINT32 entry); -static void * antrl3VectorRemove (pANTLR3_VECTOR vector, ANTLR3_UINT32 entry); -static void antlr3VectorClear (pANTLR3_VECTOR vector); -static ANTLR3_UINT32 antlr3VectorAdd (pANTLR3_VECTOR vector, void * element, void (ANTLR3_CDECL *freeptr)(void *)); -static ANTLR3_UINT32 antlr3VectorSet (pANTLR3_VECTOR vector, ANTLR3_UINT32 entry, void * element, void (ANTLR3_CDECL *freeptr)(void *), ANTLR3_BOOLEAN freeExisting); -static ANTLR3_UINT32 antlr3VectorSize (pANTLR3_VECTOR vector); -static ANTLR3_BOOLEAN antlr3VectorSwap (pANTLR3_VECTOR vector, ANTLR3_UINT32 entry1, ANTLR3_UINT32 entry2); - -static void newPool (pANTLR3_VECTOR_FACTORY factory); -static void closeVectorFactory (pANTLR3_VECTOR_FACTORY factory); -static pANTLR3_VECTOR newVector (pANTLR3_VECTOR_FACTORY factory); -static void returnVector (pANTLR3_VECTOR_FACTORY factory, pANTLR3_VECTOR vector); - - -// Interface functions for int TRIE -// -static pANTLR3_TRIE_ENTRY intTrieGet (pANTLR3_INT_TRIE trie, ANTLR3_INTKEY key); -static ANTLR3_BOOLEAN intTrieDel (pANTLR3_INT_TRIE trie, ANTLR3_INTKEY key); -static ANTLR3_BOOLEAN intTrieAdd (pANTLR3_INT_TRIE trie, ANTLR3_INTKEY key, ANTLR3_UINT32 type, ANTLR3_INTKEY intType, void * data, void (ANTLR3_CDECL *freeptr)(void *)); -static void intTrieFree (pANTLR3_INT_TRIE trie); - - -// Interface functions for topological sorter -// -static void addEdge (pANTLR3_TOPO topo, ANTLR3_UINT32 edge, ANTLR3_UINT32 dependency); -static pANTLR3_UINT32 sortToArray (pANTLR3_TOPO topo); -static void sortVector (pANTLR3_TOPO topo, pANTLR3_VECTOR v); -static void freeTopo (pANTLR3_TOPO topo); - -// Local function to advance enumeration structure pointers -// -static void antlr3EnumNextEntry(pANTLR3_HASH_ENUM en); - -pANTLR3_HASH_TABLE -antlr3HashTableNew(ANTLR3_UINT32 sizeHint) -{ - // All we have to do is create the hashtable tracking structure - // and allocate memory for the requested number of buckets. - // - pANTLR3_HASH_TABLE table; - - ANTLR3_UINT32 bucket; // Used to traverse the buckets - - table = ANTLR3_MALLOC(sizeof(ANTLR3_HASH_TABLE)); - - // Error out if no memory left - if (table == NULL) - { - return NULL; - } - - // Allocate memory for the buckets - // - table->buckets = (pANTLR3_HASH_BUCKET) ANTLR3_MALLOC((size_t) (sizeof(ANTLR3_HASH_BUCKET) * sizeHint)); - - if (table->buckets == NULL) - { - ANTLR3_FREE((void *)table); - return NULL; - } - - // Modulo of the table, (bucket count). - // - table->modulo = sizeHint; - - table->count = 0; /* Nothing in there yet ( I hope) */ - - /* Initialize the buckets to empty - */ - for (bucket = 0; bucket < sizeHint; bucket++) - { - table->buckets[bucket].entries = NULL; - } - - /* Exclude duplicate entries by default - */ - table->allowDups = ANTLR3_FALSE; - - /* Assume that keys should by strduped before they are - * entered in the table. - */ - table->doStrdup = ANTLR3_TRUE; - - /* Install the interface - */ - - table->get = antlr3HashGet; - table->put = antlr3HashPut; - table->del = antlr3HashDelete; - table->remove = antlr3HashRemove; - - table->getI = antlr3HashGetI; - table->putI = antlr3HashPutI; - table->delI = antlr3HashDeleteI; - table->removeI = antlr3HashRemoveI; - - table->size = antlr3HashSize; - table->free = antlr3HashFree; - - return table; -} - -static void -antlr3HashFree(pANTLR3_HASH_TABLE table) -{ - ANTLR3_UINT32 bucket; /* Used to traverse the buckets */ - - pANTLR3_HASH_BUCKET thisBucket; - pANTLR3_HASH_ENTRY entry; - pANTLR3_HASH_ENTRY nextEntry; - - /* Free the table, all buckets and all entries, and all the - * keys and data (if the table exists) - */ - if (table != NULL) - { - for (bucket = 0; bucket < table->modulo; bucket++) - { - thisBucket = &(table->buckets[bucket]); - - /* Allow sparse tables, though we don't create them as such at present - */ - if ( thisBucket != NULL) - { - entry = thisBucket->entries; - - /* Search all entries in the bucket and free them up - */ - while (entry != NULL) - { - /* Save next entry - we do not want to access memory in entry after we - * have freed it. - */ - nextEntry = entry->nextEntry; - - /* Free any data pointer, this only happens if the user supplied - * a pointer to a routine that knwos how to free the structure they - * added to the table. - */ - if (entry->free != NULL) - { - entry->free(entry->data); - } - - /* Free the key memory - we know that we allocated this - */ - if (entry->keybase.type == ANTLR3_HASH_TYPE_STR && entry->keybase.key.sKey != NULL) - { - ANTLR3_FREE(entry->keybase.key.sKey); - } - - /* Free this entry - */ - ANTLR3_FREE(entry); - entry = nextEntry; /* Load next pointer to see if we shoud free it */ - } - /* Invalidate the current pointer - */ - thisBucket->entries = NULL; - } - } - - /* Now we can free the bucket memory - */ - ANTLR3_FREE(table->buckets); - } - - /* Now we free teh memory for the table itself - */ - ANTLR3_FREE(table); -} - -/** return the current size of the hash table - */ -static ANTLR3_UINT32 antlr3HashSize (pANTLR3_HASH_TABLE table) -{ - return table->count; -} - -/** Remove a numeric keyed entry from a hash table if it exists, - * no error if it does not exist. - */ -static pANTLR3_HASH_ENTRY antlr3HashRemoveI (pANTLR3_HASH_TABLE table, ANTLR3_INTKEY key) -{ - ANTLR3_UINT32 hash; - pANTLR3_HASH_BUCKET bucket; - pANTLR3_HASH_ENTRY entry; - pANTLR3_HASH_ENTRY * nextPointer; - - /* First we need to know the hash of the provided key - */ - hash = (ANTLR3_UINT32)(key % (ANTLR3_INTKEY)(table->modulo)); - - /* Knowing the hash, we can find the bucket - */ - bucket = table->buckets + hash; - - /* Now, we traverse the entries in the bucket until - * we find the key or the end of the entries in the bucket. - * We track the element prior to the one we are examining - * as we need to set its next pointer to the next pointer - * of the entry we are deleting (if we find it). - */ - entry = bucket->entries; /* Entry to examine */ - nextPointer = & bucket->entries; /* Where to put the next pointer of the deleted entry */ - - while (entry != NULL) - { - /* See if this is the entry we wish to delete - */ - if (entry->keybase.key.iKey == key) - { - /* It was the correct entry, so we set the next pointer - * of the previous entry to the next pointer of this - * located one, which takes it out of the chain. - */ - (*nextPointer) = entry->nextEntry; - - table->count--; - - return entry; - } - else - { - /* We found an entry but it wasn't the one that was wanted, so - * move to the next one, if any. - */ - nextPointer = & (entry->nextEntry); /* Address of the next pointer in the current entry */ - entry = entry->nextEntry; /* Address of the next element in the bucket (if any) */ - } - } - - return NULL; /* Not found */ -} - -/** Remove the element in the hash table for a particular - * key value, if it exists - no error if it does not. - */ -static pANTLR3_HASH_ENTRY -antlr3HashRemove(pANTLR3_HASH_TABLE table, void * key) -{ - ANTLR3_UINT32 hash; - pANTLR3_HASH_BUCKET bucket; - pANTLR3_HASH_ENTRY entry; - pANTLR3_HASH_ENTRY * nextPointer; - - /* First we need to know the hash of the provided key - */ - hash = antlr3Hash(key, (ANTLR3_UINT32)strlen((const char *)key)); - - /* Knowing the hash, we can find the bucket - */ - bucket = table->buckets + (hash % table->modulo); - - /* Now, we traverse the entries in the bucket until - * we find the key or the end of the entires in the bucket. - * We track the element prior to the one we are exmaining - * as we need to set its next pointer to the next pointer - * of the entry we are deleting (if we find it). - */ - entry = bucket->entries; /* Entry to examine */ - nextPointer = & bucket->entries; /* Where to put the next pointer of the deleted entry */ - - while (entry != NULL) - { - /* See if this is the entry we wish to delete - */ - if (strcmp((const char *)key, (const char *)entry->keybase.key.sKey) == 0) - { - /* It was the correct entry, so we set the next pointer - * of the previous entry to the next pointer of this - * located one, which takes it out of the chain. - */ - (*nextPointer) = entry->nextEntry; - - /* Release the key - if we allocated that - */ - if (table->doStrdup == ANTLR3_TRUE) - { - ANTLR3_FREE(entry->keybase.key.sKey); - } - entry->keybase.key.sKey = NULL; - - table->count--; - - return entry; - } - else - { - /* We found an entry but it wasn't the one that was wanted, so - * move to the next one, if any. - */ - nextPointer = & (entry->nextEntry); /* Address of the next pointer in the current entry */ - entry = entry->nextEntry; /* Address of the next element in the bucket (if any) */ - } - } - - return NULL; /* Not found */ -} - -/** Takes the element with the supplied key out of the list, and deletes the data - * calling the supplied free() routine if any. - */ -static void -antlr3HashDeleteI (pANTLR3_HASH_TABLE table, ANTLR3_INTKEY key) -{ - pANTLR3_HASH_ENTRY entry; - - entry = antlr3HashRemoveI(table, key); - - /* Now we can free the elements and the entry in order - */ - if (entry != NULL && entry->free != NULL) - { - /* Call programmer supplied function to release this entry data - */ - entry->free(entry->data); - entry->data = NULL; - } - /* Finally release the space for this entry block. - */ - ANTLR3_FREE(entry); -} - -/** Takes the element with the supplied key out of the list, and deletes the data - * calling the supplied free() routine if any. - */ -static void -antlr3HashDelete (pANTLR3_HASH_TABLE table, void * key) -{ - pANTLR3_HASH_ENTRY entry; - - entry = antlr3HashRemove(table, key); - - /* Now we can free the elements and the entry in order - */ - if (entry != NULL && entry->free != NULL) - { - /* Call programmer supplied function to release this entry data - */ - entry->free(entry->data); - entry->data = NULL; - } - /* Finally release the space for this entry block. - */ - ANTLR3_FREE(entry); -} - -/** Return the element pointer in the hash table for a particular - * key value, or NULL if it don't exist (or was itself NULL). - */ -static void * -antlr3HashGetI(pANTLR3_HASH_TABLE table, ANTLR3_INTKEY key) -{ - ANTLR3_UINT32 hash; - pANTLR3_HASH_BUCKET bucket; - pANTLR3_HASH_ENTRY entry; - - /* First we need to know the hash of the provided key - */ - hash = (ANTLR3_UINT32)(key % (ANTLR3_INTKEY)(table->modulo)); - - /* Knowing the hash, we can find the bucket - */ - bucket = table->buckets + hash; - - /* Now we can inspect the key at each entry in the bucket - * and see if we have a match. - */ - entry = bucket->entries; - - while (entry != NULL) - { - if (entry->keybase.key.iKey == key) - { - /* Match was found, return the data pointer for this entry - */ - return entry->data; - } - entry = entry->nextEntry; - } - - /* If we got here, then we did not find the key - */ - return NULL; -} - -/** Return the element pointer in the hash table for a particular - * key value, or NULL if it don't exist (or was itself NULL). - */ -static void * -antlr3HashGet(pANTLR3_HASH_TABLE table, void * key) -{ - ANTLR3_UINT32 hash; - pANTLR3_HASH_BUCKET bucket; - pANTLR3_HASH_ENTRY entry; - - - /* First we need to know the hash of the provided key - */ - hash = antlr3Hash(key, (ANTLR3_UINT32)strlen((const char *)key)); - - /* Knowing the hash, we can find the bucket - */ - bucket = table->buckets + (hash % table->modulo); - - /* Now we can inspect the key at each entry in the bucket - * and see if we have a match. - */ - entry = bucket->entries; - - while (entry != NULL) - { - if (strcmp((const char *)key, (const char *)entry->keybase.key.sKey) == 0) - { - /* Match was found, return the data pointer for this entry - */ - return entry->data; - } - entry = entry->nextEntry; - } - - /* If we got here, then we did not find the key - */ - return NULL; -} - -/** Add the element pointer in to the table, based upon the - * hash of the provided key. - */ -static ANTLR3_INT32 -antlr3HashPutI(pANTLR3_HASH_TABLE table, ANTLR3_INTKEY key, void * element, void (ANTLR3_CDECL *freeptr)(void *)) -{ - ANTLR3_UINT32 hash; - pANTLR3_HASH_BUCKET bucket; - pANTLR3_HASH_ENTRY entry; - pANTLR3_HASH_ENTRY * newPointer; - - /* First we need to know the hash of the provided key - */ - hash = (ANTLR3_UINT32)(key % (ANTLR3_INTKEY)(table->modulo)); - - /* Knowing the hash, we can find the bucket - */ - bucket = table->buckets + hash; - - /* Knowing the bucket, we can traverse the entries until we - * we find a NULL pointer or we find that this is already - * in the table and duplicates were not allowed. - */ - newPointer = &bucket->entries; - - while (*newPointer != NULL) - { - /* The value at new pointer is pointing to an existing entry. - * If duplicates are allowed then we don't care what it is, but - * must reject this add if the key is the same as the one we are - * supplied with. - */ - if (table->allowDups == ANTLR3_FALSE) - { - if ((*newPointer)->keybase.key.iKey == key) - { - return ANTLR3_ERR_HASHDUP; - } - } - - /* Point to the next entry pointer of the current entry we - * are traversing, if it is NULL we will create our new - * structure and point this to it. - */ - newPointer = &((*newPointer)->nextEntry); - } - - /* newPointer is now pointing at the pointer where we need to - * add our new entry, so let's crate the entry and add it in. - */ - entry = (pANTLR3_HASH_ENTRY)ANTLR3_MALLOC((size_t)sizeof(ANTLR3_HASH_ENTRY)); - - if (entry == NULL) - { - return ANTLR3_ERR_NOMEM; - } - - entry->data = element; /* Install the data element supplied */ - entry->free = freeptr; /* Function that knows how to release the entry */ - entry->keybase.type = ANTLR3_HASH_TYPE_INT; /* Indicate the key type stored here for when we free */ - entry->keybase.key.iKey = key; /* Record the key value */ - entry->nextEntry = NULL; /* Ensure that the forward pointer ends the chain */ - - *newPointer = entry; /* Install the next entry in this bucket */ - - table->count++; - - return ANTLR3_SUCCESS; -} - - -/** Add the element pointer in to the table, based upon the - * hash of the provided key. - */ -static ANTLR3_INT32 -antlr3HashPut(pANTLR3_HASH_TABLE table, void * key, void * element, void (ANTLR3_CDECL *freeptr)(void *)) -{ - ANTLR3_UINT32 hash; - pANTLR3_HASH_BUCKET bucket; - pANTLR3_HASH_ENTRY entry; - pANTLR3_HASH_ENTRY * newPointer; - - /* First we need to know the hash of the provided key - */ - hash = antlr3Hash(key, (ANTLR3_UINT32)strlen((const char *)key)); - - /* Knowing the hash, we can find the bucket - */ - bucket = table->buckets + (hash % table->modulo); - - /* Knowign the bucket, we can traverse the entries until we - * we find a NULL pointer ofr we find that this is already - * in the table and duplicates were not allowed. - */ - newPointer = &bucket->entries; - - while (*newPointer != NULL) - { - /* The value at new pointer is pointing to an existing entry. - * If duplicates are allowed then we don't care what it is, but - * must reject this add if the key is the same as the one we are - * supplied with. - */ - if (table->allowDups == ANTLR3_FALSE) - { - if (strcmp((const char*) key, (const char *)(*newPointer)->keybase.key.sKey) == 0) - { - return ANTLR3_ERR_HASHDUP; - } - } - - /* Point to the next entry pointer of the current entry we - * are traversing, if it is NULL we will create our new - * structure and point this to it. - */ - newPointer = &((*newPointer)->nextEntry); - } - - /* newPointer is now poiting at the pointer where we need to - * add our new entry, so let's crate the entry and add it in. - */ - entry = (pANTLR3_HASH_ENTRY)ANTLR3_MALLOC((size_t)sizeof(ANTLR3_HASH_ENTRY)); - - if (entry == NULL) - { - return ANTLR3_ERR_NOMEM; - } - - entry->data = element; /* Install the data element supplied */ - entry->free = freeptr; /* Function that knows how to release the entry */ - entry->keybase.type = ANTLR3_HASH_TYPE_STR; /* Indicate the key type stored here for free() */ - if (table->doStrdup == ANTLR3_TRUE) - { - entry->keybase.key.sKey = ANTLR3_STRDUP(key); /* Record the key value */ - } - else - { - entry->keybase.key.sKey = key; /* Record the key value */ - } - entry->nextEntry = NULL; /* Ensure that the forward pointer ends the chain */ - - *newPointer = entry; /* Install the next entry in this bucket */ - - table->count++; - - return ANTLR3_SUCCESS; -} - -/** \brief Creates an enumeration structure to traverse the hash table. - * - * \param table Table to enumerate - * \return Pointer to enumeration structure. - */ -pANTLR3_HASH_ENUM -antlr3EnumNew (pANTLR3_HASH_TABLE table) -{ - pANTLR3_HASH_ENUM en; - - /* Allocate structure memory - */ - en = (pANTLR3_HASH_ENUM) ANTLR3_MALLOC((size_t)sizeof(ANTLR3_HASH_ENUM)); - - /* Check that the allocation was good - */ - if (en == NULL) - { - return (pANTLR3_HASH_ENUM) ANTLR3_FUNC_PTR(ANTLR3_ERR_NOMEM); - } - - /* Initialize the start pointers - */ - en->table = table; - en->bucket = 0; /* First bucket */ - en->entry = en->table->buckets->entries; /* First entry to return */ - - /* Special case in that the first bucket may not have anything in it - * but the antlr3EnumNext() function expects that the en->entry is - * set to the next valid pointer. Hence if it is not a valid element - * pointer, attempt to find the next one that is, (table may be empty - * of course. - */ - if (en->entry == NULL) - { - antlr3EnumNextEntry(en); - } - - /* Install the interface - */ - en->free = antlr3EnumFree; - en->next = antlr3EnumNext; - - /* All is good - */ - return en; -} - -/** \brief Return the next entry in the hashtable being traversed by the supplied - * enumeration. - * - * \param[in] en Pointer to the enumeration tracking structure - * \param key Pointer to void pointer, where the key pointer is returned. - * \param data Pointer to void pointer where the data pointer is returned. - * \return - * - ANTLR3_SUCCESS if there was a next key - * - ANTLR3_FAIL if there were no more keys - * - * \remark - * No checking of input structure is performed! - */ -static int -antlr3EnumNext (pANTLR3_HASH_ENUM en, pANTLR3_HASH_KEY * key, void ** data) -{ - /* If the current entry is valid, then use it - */ - if (en->bucket >= en->table->modulo) - { - /* Already exhausted the table - */ - return ANTLR3_FAIL; - } - - /* Pointers are already set to the current entry to return, or - * we would not be at this point in the logic flow. - */ - *key = &(en->entry->keybase); - *data = en->entry->data; - - /* Return pointers are set up, so now we move the element - * pointer to the next in the table (if any). - */ - antlr3EnumNextEntry(en); - - return ANTLR3_SUCCESS; -} - -/** \brief Local function to advance the entry pointer of an enumeration - * structure to the next valid entry (if there is one). - * - * \param[in] enum Pointer to ANTLR3 enumeration structure returned by antlr3EnumNew() - * - * \remark - * - The function always leaves the pointers pointing at a valid entry if there - * is one, so if the entry pointer is NULL when this function exits, there were - * no more entries in the table. - */ -static void -antlr3EnumNextEntry(pANTLR3_HASH_ENUM en) -{ - pANTLR3_HASH_BUCKET bucket; - - /* See if the current entry pointer is valid first of all - */ - if (en->entry != NULL) - { - /* Current entry was a valid point, see if there is another - * one in the chain. - */ - if (en->entry->nextEntry != NULL) - { - /* Next entry in the enumeration is just the next entry - * in the chain. - */ - en->entry = en->entry->nextEntry; - return; - } - } - - /* There were no more entries in the current bucket, if there are - * more buckets then chase them until we find an entry. - */ - en->bucket++; - - while (en->bucket < en->table->modulo) - { - /* There was one more bucket, see if it has any elements in it - */ - bucket = en->table->buckets + en->bucket; - - if (bucket->entries != NULL) - { - /* There was an entry in this bucket, so we can use it - * for the next entry in the enumeration. - */ - en->entry = bucket->entries; - return; - } - - /* There was nothing in the bucket we just examined, move to the - * next one. - */ - en->bucket++; - } - - /* Here we have exhausted all buckets and the enumeration pointer will - * have its bucket count = table->modulo which signifies that we are done. - */ -} - -/** \brief Frees up the memory structures that represent a hash table - * enumeration. - * \param[in] enum Pointer to ANTLR3 enumeration structure returned by antlr3EnumNew() - */ -static void -antlr3EnumFree (pANTLR3_HASH_ENUM en) -{ - /* Nothing to check, we just free it. - */ - ANTLR3_FREE(en); -} - -/** Given an input key of arbitrary length, return a hash value of - * it. This can then be used (with suitable modulo) to index other - * structures. - */ -ANTLR3_API ANTLR3_UINT32 -antlr3Hash(void * key, ANTLR3_UINT32 keylen) -{ - /* Accumulate the hash value of the key - */ - ANTLR3_UINT32 hash; - pANTLR3_UINT8 keyPtr; - ANTLR3_UINT32 i1; - - hash = 0; - keyPtr = (pANTLR3_UINT8) key; - - /* Iterate the key and accumulate the hash - */ - while(keylen > 0) - { - hash = (hash << 4) + (*(keyPtr++)); - - if ((i1=hash&0xf0000000) != 0) - { - hash = hash ^ (i1 >> 24); - hash = hash ^ i1; - } - keylen--; - } - - return hash; -} - -ANTLR3_API pANTLR3_LIST -antlr3ListNew (ANTLR3_UINT32 sizeHint) -{ - pANTLR3_LIST list; - - /* Allocate memory - */ - list = (pANTLR3_LIST)ANTLR3_MALLOC((size_t)sizeof(ANTLR3_LIST)); - - if (list == NULL) - { - return (pANTLR3_LIST)ANTLR3_FUNC_PTR(ANTLR3_ERR_NOMEM); - } - - /* Now we need to add a new table - */ - list->table = antlr3HashTableNew(sizeHint); - - if (list->table == (pANTLR3_HASH_TABLE)ANTLR3_FUNC_PTR(ANTLR3_ERR_NOMEM)) - { - return (pANTLR3_LIST)ANTLR3_FUNC_PTR(ANTLR3_ERR_NOMEM); - } - - /* Allocation was good, install interface - */ - list->free = antlr3ListFree; - list->del = antlr3ListDelete; - list->get = antlr3ListGet; - list->add = antlr3ListAdd; - list->remove = antlr3ListRemove; - list->put = antlr3ListPut; - list->size = antlr3ListSize; - - return list; -} - -static ANTLR3_UINT32 antlr3ListSize (pANTLR3_LIST list) -{ - return list->table->size(list->table); -} - -static void -antlr3ListFree (pANTLR3_LIST list) -{ - /* Free the hashtable that stores the list - */ - list->table->free(list->table); - - /* Free the allocation for the list itself - */ - ANTLR3_FREE(list); -} - -static void -antlr3ListDelete (pANTLR3_LIST list, ANTLR3_INTKEY key) -{ - list->table->delI(list->table, key); -} - -static void * -antlr3ListGet (pANTLR3_LIST list, ANTLR3_INTKEY key) -{ - return list->table->getI(list->table, key); -} - -/** Add the supplied element to the list, at the next available key - */ -static ANTLR3_INT32 antlr3ListAdd (pANTLR3_LIST list, void * element, void (ANTLR3_CDECL *freeptr)(void *)) -{ - ANTLR3_INTKEY key; - - key = list->table->size(list->table) + 1; - return list->put(list, key, element, freeptr); -} - -/** Remove from the list, but don't free the element, just send it back to the - * caller. - */ -static void * -antlr3ListRemove (pANTLR3_LIST list, ANTLR3_INTKEY key) -{ - pANTLR3_HASH_ENTRY entry; - - entry = list->table->removeI(list->table, key); - - if (entry != NULL) - { - return entry->data; - } - else - { - return NULL; - } -} - -static ANTLR3_INT32 -antlr3ListPut (pANTLR3_LIST list, ANTLR3_INTKEY key, void * element, void (ANTLR3_CDECL *freeptr)(void *)) -{ - return list->table->putI(list->table, key, element, freeptr); -} - -ANTLR3_API pANTLR3_STACK -antlr3StackNew (ANTLR3_UINT32 sizeHint) -{ - pANTLR3_STACK stack; - - /* Allocate memory - */ - stack = (pANTLR3_STACK)ANTLR3_MALLOC((size_t)sizeof(ANTLR3_STACK)); - - if (stack == NULL) - { - return (pANTLR3_STACK)ANTLR3_FUNC_PTR(ANTLR3_ERR_NOMEM); - } - - /* Now we need to add a new table - */ - stack->vector = antlr3VectorNew(sizeHint); - stack->top = NULL; - - if (stack->vector == (pANTLR3_VECTOR)ANTLR3_FUNC_PTR(ANTLR3_ERR_NOMEM)) - { - return (pANTLR3_STACK)ANTLR3_FUNC_PTR(ANTLR3_ERR_NOMEM); - } - - /* Looks good, now add the interface - */ - stack->get = antlr3StackGet; - stack->free = antlr3StackFree; - stack->pop = antlr3StackPop; - stack->push = antlr3StackPush; - stack->size = antlr3StackSize; - stack->peek = antlr3StackPeek; - - return stack; -} - -static ANTLR3_UINT32 antlr3StackSize (pANTLR3_STACK stack) -{ - return stack->vector->count; -} - - -static void -antlr3StackFree (pANTLR3_STACK stack) -{ - /* Free the list that supports the stack - */ - stack->vector->free(stack->vector); - stack->vector = NULL; - stack->top = NULL; - - ANTLR3_FREE(stack); -} - -static void * -antlr3StackPop (pANTLR3_STACK stack) -{ - // Delete the element that is currently at the top of the stack - // - stack->vector->del(stack->vector, stack->vector->count - 1); - - // And get the element that is the now the top of the stack (if anything) - // NOTE! This is not quite like a 'real' stack, which would normally return you - // the current top of the stack, then remove it from the stack. - // TODO: Review this, it is correct for follow sets which is what this was done for - // but is not as obvious when using it as a 'real'stack. - // - stack->top = stack->vector->get(stack->vector, stack->vector->count - 1); - return stack->top; -} - -static void * -antlr3StackGet (pANTLR3_STACK stack, ANTLR3_INTKEY key) -{ - return stack->vector->get(stack->vector, (ANTLR3_UINT32)key); -} - -static void * -antlr3StackPeek (pANTLR3_STACK stack) -{ - return stack->top; -} - -static ANTLR3_BOOLEAN -antlr3StackPush (pANTLR3_STACK stack, void * element, void (ANTLR3_CDECL *freeptr)(void *)) -{ - stack->top = element; - return (ANTLR3_BOOLEAN)(stack->vector->add(stack->vector, element, freeptr)); -} - -ANTLR3_API pANTLR3_VECTOR -antlr3VectorNew (ANTLR3_UINT32 sizeHint) -{ - pANTLR3_VECTOR vector; - - - // Allocate memory for the vector structure itself - // - vector = (pANTLR3_VECTOR) ANTLR3_MALLOC((size_t)(sizeof(ANTLR3_VECTOR))); - - if (vector == NULL) - { - return (pANTLR3_VECTOR)ANTLR3_FUNC_PTR(ANTLR3_ERR_NOMEM); - } - - // Now fill in the defaults - // - antlr3SetVectorApi(vector, sizeHint); - - // And everything is hunky dory - // - return vector; -} - -ANTLR3_API void -antlr3SetVectorApi (pANTLR3_VECTOR vector, ANTLR3_UINT32 sizeHint) -{ - ANTLR3_UINT32 initialSize; - - // Allow vectors to be guessed by ourselves, so input size can be zero - // - if (sizeHint > ANTLR3_VECTOR_INTERNAL_SIZE) - { - initialSize = sizeHint; - } - else - { - initialSize = ANTLR3_VECTOR_INTERNAL_SIZE; - } - - if (sizeHint > ANTLR3_VECTOR_INTERNAL_SIZE) - { - vector->elements = (pANTLR3_VECTOR_ELEMENT)ANTLR3_MALLOC((size_t)(sizeof(ANTLR3_VECTOR_ELEMENT) * initialSize)); - } - else - { - vector->elements = vector->internal; - } - - if (vector->elements == NULL) - { - ANTLR3_FREE(vector); - return; - } - - // Memory allocated successfully - // - vector->count = 0; // No entries yet of course - vector->elementsSize = initialSize; // Available entries - - // Now we can install the API - // - vector->add = antlr3VectorAdd; - vector->del = antlr3VectorDel; - vector->get = antlr3VectorGet; - vector->free = antlr3VectorFree; - vector->set = antlr3VectorSet; - vector->remove = antrl3VectorRemove; - vector->clear = antlr3VectorClear; - vector->size = antlr3VectorSize; - vector->swap = antlr3VectorSwap; - - // Assume that this is not a factory made vector - // - vector->factoryMade = ANTLR3_FALSE; -} - -// Clear the entries in a vector. -// Clearing the vector leaves its capacity the same but -// it walks the entries first to see if any of them -// have a free routine that must be called. -// -static void -antlr3VectorClear (pANTLR3_VECTOR vector) -{ - ANTLR3_UINT32 entry; - - // We must traverse every entry in the vector and if it has - // a pointer to a free function then we call it with the - // the entry pointer - // - for (entry = 0; entry < vector->count; entry++) - { - if (vector->elements[entry].freeptr != NULL) - { - vector->elements[entry].freeptr(vector->elements[entry].element); - } - vector->elements[entry].freeptr = NULL; - vector->elements[entry].element = NULL; - } - - // Having called any free pointers, we just reset the entry count - // back to zero. - // - vector->count = 0; -} - -static -void ANTLR3_CDECL antlr3VectorFree (pANTLR3_VECTOR vector) -{ - ANTLR3_UINT32 entry; - - // We must traverse every entry in the vector and if it has - // a pointer to a free function then we call it with the - // the entry pointer - // - for (entry = 0; entry < vector->count; entry++) - { - if (vector->elements[entry].freeptr != NULL) - { - vector->elements[entry].freeptr(vector->elements[entry].element); - } - vector->elements[entry].freeptr = NULL; - vector->elements[entry].element = NULL; - } - - if (vector->factoryMade == ANTLR3_FALSE) - { - // The entries are freed, so free the element allocation - // - if (vector->elementsSize > ANTLR3_VECTOR_INTERNAL_SIZE) - { - ANTLR3_FREE(vector->elements); - } - vector->elements = NULL; - - // Finally, free the allocation for the vector itself - // - ANTLR3_FREE(vector); - } -} - -static void antlr3VectorDel (pANTLR3_VECTOR vector, ANTLR3_UINT32 entry) -{ - // Check this is a valid request first - // - if (entry >= vector->count) - { - return; - } - - // Valid request, check for free pointer and call it if present - // - if (vector->elements[entry].freeptr != NULL) - { - vector->elements[entry].freeptr(vector->elements[entry].element); - vector->elements[entry].freeptr = NULL; - } - - if (entry == vector->count - 1) - { - // Ensure the pointer is never reused by accident, but otherwise just - // decrement the pointer. - // - vector->elements[entry].element = NULL; - } - else - { - // Need to shuffle trailing pointers back over the deleted entry - // - ANTLR3_MEMMOVE(vector->elements + entry, vector->elements + entry + 1, sizeof(ANTLR3_VECTOR_ELEMENT) * (vector->count - entry - 1)); - } - - // One less entry in the vector now - // - vector->count--; -} - -static void * antlr3VectorGet (pANTLR3_VECTOR vector, ANTLR3_UINT32 entry) -{ - // Ensure this is a valid request - // - if (entry < vector->count) - { - return vector->elements[entry].element; - } - else - { - // I know nothing, Mr. Fawlty! - // - return NULL; - } -} - -/// Remove the entry from the vector, but do not free any entry, even if it has -/// a free pointer. -/// -static void * antrl3VectorRemove (pANTLR3_VECTOR vector, ANTLR3_UINT32 entry) -{ - void * element; - - // Check this is a valid request first - // - if (entry >= vector->count) - { - return NULL; - } - - // Valid request, return the sorted pointer - // - - element = vector->elements[entry].element; - - if (entry == vector->count - 1) - { - // Ensure the pointer is never reused by accident, but otherwise just - // decrement the pointer. - /// - vector->elements[entry].element = NULL; - vector->elements[entry].freeptr = NULL; - } - else - { - // Need to shuffle trailing pointers back over the deleted entry - // - ANTLR3_MEMMOVE(vector->elements + entry, vector->elements + entry + 1, sizeof(ANTLR3_VECTOR_ELEMENT) * (vector->count - entry - 1)); - } - - // One less entry in the vector now - // - vector->count--; - - return element; -} - -static void -antlr3VectorResize (pANTLR3_VECTOR vector, ANTLR3_UINT32 hint) -{ - ANTLR3_UINT32 newSize; - - // Need to resize the element pointers. We double the allocation - // we already have unless asked for a specific increase. - // - if (hint == 0 || hint < vector->elementsSize) - { - newSize = vector->elementsSize * 2; - } - else - { - newSize = hint * 2; - } - - // Now we know how many we need, so we see if we have just expanded - // past the built in vector elements or were already past that - // - if (vector->elementsSize > ANTLR3_VECTOR_INTERNAL_SIZE) - { - // We were already larger than the internal size, so we just - // use realloc so that the pointers are copied for us - // - vector->elements = (pANTLR3_VECTOR_ELEMENT)ANTLR3_REALLOC(vector->elements, (sizeof(ANTLR3_VECTOR_ELEMENT)* newSize)); - } - else - { - // The current size was less than or equal to the internal array size and as we always start - // with a size that is at least the maximum internal size, then we must need to allocate new memory - // for external pointers. We don't want to take the time to calculate if a requested element - // is part of the internal or external entries, so we copy the internal ones to the new space - // - vector->elements = (pANTLR3_VECTOR_ELEMENT)ANTLR3_MALLOC((sizeof(ANTLR3_VECTOR_ELEMENT)* newSize)); - ANTLR3_MEMCPY(vector->elements, vector->internal, ANTLR3_VECTOR_INTERNAL_SIZE * sizeof(ANTLR3_VECTOR_ELEMENT)); - } - - vector->elementsSize = newSize; -} - -/// Add the supplied pointer and freeing function pointer to the list, -/// expanding the vector if needed. -/// -static ANTLR3_UINT32 antlr3VectorAdd (pANTLR3_VECTOR vector, void * element, void (ANTLR3_CDECL *freeptr)(void *)) -{ - // Do we need to resize the vector table? - // - if (vector->count == vector->elementsSize) - { - antlr3VectorResize(vector, 0); // Give no hint, we let it add 1024 or double it - } - - // Insert the new entry - // - vector->elements[vector->count].element = element; - vector->elements[vector->count].freeptr = freeptr; - - vector->count++; // One more element counted - - return (ANTLR3_UINT32)(vector->count); - -} - -/// Replace the element at the specified entry point with the supplied -/// entry. -/// -static ANTLR3_UINT32 -antlr3VectorSet (pANTLR3_VECTOR vector, ANTLR3_UINT32 entry, void * element, void (ANTLR3_CDECL *freeptr)(void *), ANTLR3_BOOLEAN freeExisting) -{ - - // If the vector is currently not big enough, then we expand it - // - if (entry >= vector->elementsSize) - { - antlr3VectorResize(vector, entry); // We will get at least this many - } - - // Valid request, replace the current one, freeing any prior entry if told to - // - if ( entry < vector->count // If actually replacing an element - && freeExisting // And told to free any existing element - && vector->elements[entry].freeptr != NULL // And the existing element has a free pointer - ) - { - vector->elements[entry].freeptr(vector->elements[entry].element); - } - - // Install the new pointers - // - vector->elements[entry].freeptr = freeptr; - vector->elements[entry].element = element; - - if (entry >= vector->count) - { - vector->count = entry + 1; - } - return (ANTLR3_UINT32)(entry); // Indicates the replacement was successful - -} - -/// Replace the element at the specified entry point with the supplied -/// entry. -/// -static ANTLR3_BOOLEAN -antlr3VectorSwap (pANTLR3_VECTOR vector, ANTLR3_UINT32 entry1, ANTLR3_UINT32 entry2) -{ - - void * tempEntry; - void (ANTLR3_CDECL *freeptr)(void *); - - // If the vector is currently not big enough, then we do nothing - // - if (entry1 >= vector->elementsSize || entry2 >= vector->elementsSize) - { - return ANTLR3_FALSE; - } - - // Valid request, swap them - // - tempEntry = vector->elements[entry1].element; - freeptr = vector->elements[entry1].freeptr; - - // Install the new pointers - // - vector->elements[entry1].freeptr = vector->elements[entry2].freeptr; - vector->elements[entry1].element = vector->elements[entry2].element; - - vector->elements[entry2].freeptr = freeptr; - vector->elements[entry2].element = tempEntry; - - return ANTLR3_TRUE; - -} - -static ANTLR3_UINT32 antlr3VectorSize (pANTLR3_VECTOR vector) -{ - return vector->count; -} - -#ifdef ANTLR3_WINDOWS -#pragma warning (push) -#pragma warning (disable : 4100) -#endif -/// Vector factory creation -/// -ANTLR3_API pANTLR3_VECTOR_FACTORY -antlr3VectorFactoryNew (ANTLR3_UINT32 sizeHint) -{ - pANTLR3_VECTOR_FACTORY factory; - - // Allocate memory for the factory - // - factory = (pANTLR3_VECTOR_FACTORY)ANTLR3_MALLOC((size_t)(sizeof(ANTLR3_VECTOR_FACTORY))); - - if (factory == NULL) - { - return NULL; - } - - // Factory memory is good, so create a new vector pool - // - factory->pools = NULL; - factory->thisPool = -1; - - newPool(factory); - - // Initialize the API, ignore the hint as this algorithm does - // a better job really. - // - antlr3SetVectorApi(&(factory->unTruc), ANTLR3_VECTOR_INTERNAL_SIZE); - - factory->unTruc.factoryMade = ANTLR3_TRUE; - - // Install the factory API - // - factory->close = closeVectorFactory; - factory->newVector = newVector; - factory->returnVector = returnVector; - - // Create a stack to accumulate reusable vectors - // - factory->freeStack = antlr3StackNew(16); - return factory; -} -#ifdef ANTLR3_WINDOWS -#pragma warning (pop) -#endif - -static void -returnVector (pANTLR3_VECTOR_FACTORY factory, pANTLR3_VECTOR vector) -{ - // First we need to clear out anything that is still in the vector - // - vector->clear(vector); - - // We have a free stack available so we can add the vector we were - // given into the free chain. The vector has to have come from this - // factory, so we already know how to release its memory when it - // dies by virtue of the factory being closed. - // - factory->freeStack->push(factory->freeStack, vector, NULL); - - // TODO: remove this line once happy printf("Returned vector %08X to the pool, stack size is %d\n", vector, factory->freeStack->size(factory->freeStack)); -} - -static void -newPool(pANTLR3_VECTOR_FACTORY factory) -{ - /* Increment factory count - */ - factory->thisPool++; - - /* Ensure we have enough pointers allocated - */ - factory->pools = (pANTLR3_VECTOR *) - ANTLR3_REALLOC( (void *)factory->pools, /* Current pools pointer (starts at NULL) */ - (ANTLR3_UINT32)((factory->thisPool + 1) * sizeof(pANTLR3_VECTOR *)) /* Memory for new pool pointers */ - ); - - /* Allocate a new pool for the factory - */ - factory->pools[factory->thisPool] = - (pANTLR3_VECTOR) - ANTLR3_MALLOC((size_t)(sizeof(ANTLR3_VECTOR) * ANTLR3_FACTORY_VPOOL_SIZE)); - - - /* Reset the counters - */ - factory->nextVector = 0; - - /* Done - */ - return; -} - -static void -closeVectorFactory (pANTLR3_VECTOR_FACTORY factory) -{ - pANTLR3_VECTOR pool; - ANTLR3_INT32 poolCount; - ANTLR3_UINT32 limit; - ANTLR3_UINT32 vector; - pANTLR3_VECTOR check; - - // First see if we have a free chain stack to release? - // - if (factory->freeStack != NULL) - { - factory->freeStack->free(factory->freeStack); - } - - /* We iterate the vector pools one at a time - */ - for (poolCount = 0; poolCount <= factory->thisPool; poolCount++) - { - /* Pointer to current pool - */ - pool = factory->pools[poolCount]; - - /* Work out how many tokens we need to check in this pool. - */ - limit = (poolCount == factory->thisPool ? factory->nextVector : ANTLR3_FACTORY_VPOOL_SIZE); - - /* Marginal condition, we might be at the start of a brand new pool - * where the nextToken is 0 and nothing has been allocated. - */ - if (limit > 0) - { - /* We have some vectors allocated from this pool - */ - for (vector = 0; vector < limit; vector++) - { - /* Next one in the chain - */ - check = pool + vector; - - // Call the free function on each of the vectors in the pool, - // which in turn will cause any elements it holds that also have a free - // pointer to be freed. However, because any vector may be in any other - // vector, we don't free the element allocations yet. We do that in a - // a specific pass, coming up next. The vector free function knows that - // this is a factory allocated pool vector and so it won't free things it - // should not. - // - check->free(check); - } - } - } - - /* We iterate the vector pools one at a time once again, but this time - * we are going to free up any allocated element pointers. Note that we are doing this - * so that we do not try to release vectors twice. When building ASTs we just copy - * the vectors all over the place and they may be embedded in this vector pool - * numerous times. - */ - for (poolCount = 0; poolCount <= factory->thisPool; poolCount++) - { - /* Pointer to current pool - */ - pool = factory->pools[poolCount]; - - /* Work out how many tokens we need to check in this pool. - */ - limit = (poolCount == factory->thisPool ? factory->nextVector : ANTLR3_FACTORY_VPOOL_SIZE); - - /* Marginal condition, we might be at the start of a brand new pool - * where the nextToken is 0 and nothing has been allocated. - */ - if (limit > 0) - { - /* We have some vectors allocated from this pool - */ - for (vector = 0; vector < limit; vector++) - { - /* Next one in the chain - */ - check = pool + vector; - - // Anything in here should be factory made, but we do this just - // to triple check. We just free up the elements if they were - // allocated beyond the internal size. - // - if (check->factoryMade == ANTLR3_TRUE && check->elementsSize > ANTLR3_VECTOR_INTERNAL_SIZE) - { - ANTLR3_FREE(check->elements); - check->elements = NULL; - } - } - } - - // We can now free this pool allocation as we have called free on every element in every vector - // and freed any memory for pointers the grew beyond the internal size limit. - // - ANTLR3_FREE(factory->pools[poolCount]); - factory->pools[poolCount] = NULL; - } - - /* All the pools are deallocated we can free the pointers to the pools - * now. - */ - ANTLR3_FREE(factory->pools); - - /* Finally, we can free the space for the factory itself - */ - ANTLR3_FREE(factory); - -} - -static pANTLR3_VECTOR -newVector(pANTLR3_VECTOR_FACTORY factory) -{ - pANTLR3_VECTOR vector; - - // If we have anything on the re claim stack, reuse it - // - vector = factory->freeStack->peek(factory->freeStack); - - if (vector != NULL) - { - // Cool we got something we could reuse - // - factory->freeStack->pop(factory->freeStack); - - // TODO: remove this line once happy printf("Reused vector %08X from stack, size is now %d\n", vector, factory->freeStack->size(factory->freeStack)); - return vector; - - } - - // See if we need a new vector pool before allocating a new - // one - // - if (factory->nextVector >= ANTLR3_FACTORY_VPOOL_SIZE) - { - // We ran out of vectors in the current pool, so we need a new pool - // - newPool(factory); - } - - // Assuming everything went well (we are trying for performance here so doing minimal - // error checking. Then we can work out what the pointer is to the next vector. - // - vector = factory->pools[factory->thisPool] + factory->nextVector; - factory->nextVector++; - - // We have our token pointer now, so we can initialize it to the predefined model. - // - antlr3SetVectorApi(vector, ANTLR3_VECTOR_INTERNAL_SIZE); - vector->factoryMade = ANTLR3_TRUE; - - // We know that the pool vectors are created at the default size, which means they - // will start off using their internal entry pointers. We must intialize our pool vector - // to point to its own internal entry table and not the pre-made one. - // - vector->elements = vector->internal; - - // TODO: remove this line once happy printf("Used a new vector at %08X from the pools as nothing on the reusue stack\n", vector); - - // And we are done - // - return vector; -} - -/** Array of left most significant bit positions for an 8 bit - * element provides an efficient way to find the highest bit - * that is set in an n byte value (n>0). Assuming the values will all hit the data cache, - * coding without conditional elements should allow branch - * prediction to work well and of course a parallel instruction cache - * will whip through this. Otherwise we must loop shifting a one - * bit and masking. The values we tend to be placing in out integer - * patricia trie are usually a lot lower than the 64 bits we - * allow for the key allows. Hence there is a lot of redundant looping and - * shifting in a while loop. Whereas, the lookup table is just - * a few ands and indirect lookups, while testing for 0. This - * is likely to be done in parallel on many processors available - * when I wrote this. If this code survives as long as yacc, then - * I may already be dead by the time you read this and maybe there is - * a single machine instruction to perform the operation. What - * else are you going to do with all those transistors? Jim 2007 - * - * The table is probably obvious but it is just the number 0..7 - * of the MSB in each integer value 0..256 - */ -static ANTLR3_UINT8 bitIndex[256] = -{ - 0, // 0 - Just for padding - 0, // 1 - 1, 1, // 2..3 - 2, 2, 2, 2, // 4..7 - 3, 3, 3, 3, 3, 3, 3, 3, // 8+ - 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, // 16+ - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, // 32+ - 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, // 64+ - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, // 128+ - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7 -}; - -/** Rather than use the bit index of a trie node to shift - * 0x01 left that many times, then & with the result, it is - * faster to use the bit index as an index into this table - * which holds precomputed masks for any of the 64 bits - * we need to mask off singly. The data values will stay in - * cache while ever a trie is in heavy use, such as in - * memoization. It is also pretty enough to be ASCII art. - */ -static ANTLR3_UINT64 bitMask[64] = -{ - 0x0000000000000001ULL, 0x0000000000000002ULL, 0x0000000000000004ULL, 0x0000000000000008ULL, - 0x0000000000000010ULL, 0x0000000000000020ULL, 0x0000000000000040ULL, 0x0000000000000080ULL, - 0x0000000000000100ULL, 0x0000000000000200ULL, 0x0000000000000400ULL, 0x0000000000000800ULL, - 0x0000000000001000ULL, 0x0000000000002000ULL, 0x0000000000004000ULL, 0x0000000000008000ULL, - 0x0000000000010000ULL, 0x0000000000020000ULL, 0x0000000000040000ULL, 0x0000000000080000ULL, - 0x0000000000100000ULL, 0x0000000000200000ULL, 0x0000000000400000ULL, 0x0000000000800000ULL, - 0x0000000001000000ULL, 0x0000000002000000ULL, 0x0000000004000000ULL, 0x0000000008000000ULL, - 0x0000000010000000ULL, 0x0000000020000000ULL, 0x0000000040000000ULL, 0x0000000080000000ULL, - 0x0000000100000000ULL, 0x0000000200000000ULL, 0x0000000400000000ULL, 0x0000000800000000ULL, - 0x0000001000000000ULL, 0x0000002000000000ULL, 0x0000004000000000ULL, 0x0000008000000000ULL, - 0x0000010000000000ULL, 0x0000020000000000ULL, 0x0000040000000000ULL, 0x0000080000000000ULL, - 0x0000100000000000ULL, 0x0000200000000000ULL, 0x0000400000000000ULL, 0x0000800000000000ULL, - 0x0001000000000000ULL, 0x0002000000000000ULL, 0x0004000000000000ULL, 0x0008000000000000ULL, - 0x0010000000000000ULL, 0x0020000000000000ULL, 0x0040000000000000ULL, 0x0080000000000000ULL, - 0x0100000000000000ULL, 0x0200000000000000ULL, 0x0400000000000000ULL, 0x0800000000000000ULL, - 0x1000000000000000ULL, 0x2000000000000000ULL, 0x4000000000000000ULL, 0x8000000000000000ULL -}; - -/* INT TRIE Implementation of depth 64 bits, being the number of bits - * in a 64 bit integer. - */ - -pANTLR3_INT_TRIE -antlr3IntTrieNew(ANTLR3_UINT32 depth) -{ - pANTLR3_INT_TRIE trie; - - trie = (pANTLR3_INT_TRIE) ANTLR3_CALLOC(1, sizeof(ANTLR3_INT_TRIE)); /* Base memory required */ - - if (trie == NULL) - { - return (pANTLR3_INT_TRIE) ANTLR3_FUNC_PTR(ANTLR3_ERR_NOMEM); - } - - /* Now we need to allocate the root node. This makes it easier - * to use the tree as we don't have to do anything special - * for the root node. - */ - trie->root = (pANTLR3_INT_TRIE_NODE) ANTLR3_CALLOC(1, sizeof(ANTLR3_INT_TRIE)); - - if (trie->root == NULL) - { - ANTLR3_FREE(trie); - return (pANTLR3_INT_TRIE) ANTLR3_FUNC_PTR(ANTLR3_ERR_NOMEM); - } - - trie->add = intTrieAdd; - trie->del = intTrieDel; - trie->free = intTrieFree; - trie->get = intTrieGet; - - /* Now we seed the root node with the index being the - * highest left most bit we want to test, which limits the - * keys in the trie. This is the trie 'depth'. The limit for - * this implementation is 63 (bits 0..63). - */ - trie->root->bitNum = depth; - - /* And as we have nothing in here yet, we set both child pointers - * of the root node to point back to itself. - */ - trie->root->leftN = trie->root; - trie->root->rightN = trie->root; - trie->count = 0; - - /* Finally, note that the key for this root node is 0 because - * we use calloc() to initialise it. - */ - - return trie; -} - -/** Search the int Trie and return a pointer to the first bucket indexed - * by the key if it is contained in the trie, otherwise NULL. - */ -static pANTLR3_TRIE_ENTRY -intTrieGet (pANTLR3_INT_TRIE trie, ANTLR3_INTKEY key) -{ - pANTLR3_INT_TRIE_NODE thisNode; - pANTLR3_INT_TRIE_NODE nextNode; - - if (trie->count == 0) - { - return NULL; /* Nothing in this trie yet */ - } - /* Starting at the root node in the trie, compare the bit index - * of the current node with its next child node (starts left from root). - * When the bit index of the child node is greater than the bit index of the current node - * then by definition (as the bit index decreases as we descent the trie) - * we have reached a 'backward' pointer. A backward pointer means we - * have reached the only node that can be reached by the bits given us so far - * and it must either be the key we are looking for, or if not then it - * means the entry was not in the trie, and we return NULL. A backward pointer - * points back in to the tree structure rather than down (deeper) within the - * tree branches. - */ - thisNode = trie->root; /* Start at the root node */ - nextNode = thisNode->leftN; /* Examine the left node from the root */ - - /* While we are descending the tree nodes... - */ - while (thisNode->bitNum > nextNode->bitNum) - { - /* Next node now becomes the new 'current' node - */ - thisNode = nextNode; - - /* We now test the bit indicated by the bitmap in the next node - * in the key we are searching for. The new next node is the - * right node if that bit is set and the left node it is not. - */ - if (key & bitMask[nextNode->bitNum]) - { - nextNode = nextNode->rightN; /* 1 is right */ - } - else - { - nextNode = nextNode->leftN; /* 0 is left */ - } - } - - /* Here we have reached a node where the bitMap index is lower than - * its parent. This means it is pointing backward in the tree and - * must therefore be a terminal node, being the only point than can - * be reached with the bits seen so far. It is either the actual key - * we wanted, or if that key is not in the trie it is another key - * that is currently the only one that can be reached by those bits. - * That situation would obviously change if the key was to be added - * to the trie. - * - * Hence it only remains to test whether this is actually the key or not. - */ - if (nextNode->key == key) - { - /* This was the key, so return the entry pointer - */ - return nextNode->buckets; - } - else - { - return NULL; /* That key is not in the trie (note that we set the pointer to -1 if no payload) */ - } -} - - -static ANTLR3_BOOLEAN -intTrieDel (pANTLR3_INT_TRIE trie, ANTLR3_INTKEY key) -{ - pANTLR3_INT_TRIE_NODE p; - - p=trie->root; - key = key; - - return ANTLR3_FALSE; -} - -/** Add an entry into the INT trie. - * Basically we descend the trie as we do when searching it, which will - * locate the only node in the trie that can be reached by the bit pattern of the - * key. If the key is actually at that node, then if the trie accepts duplicates - * we add the supplied data in a new chained bucket to that data node. If it does - * not accept duplicates then we merely return FALSE in case the caller wants to know - * whether the key was already in the trie. - * If the node we locate is not the key we are looking to add, then we insert a new node - * into the trie with a bit index of the leftmost differing bit and the left or right - * node pointing to itself or the data node we are inserting 'before'. - */ -static ANTLR3_BOOLEAN -intTrieAdd (pANTLR3_INT_TRIE trie, ANTLR3_INTKEY key, ANTLR3_UINT32 type, ANTLR3_INTKEY intVal, void * data, void (ANTLR3_CDECL *freeptr)(void *)) -{ - pANTLR3_INT_TRIE_NODE thisNode; - pANTLR3_INT_TRIE_NODE nextNode; - pANTLR3_INT_TRIE_NODE entNode; - ANTLR3_UINT32 depth; - pANTLR3_TRIE_ENTRY newEnt; - pANTLR3_TRIE_ENTRY nextEnt; - ANTLR3_INTKEY xorKey; - - /* Cache the bit depth of this trie, which is always the highest index, - * which is in the root node - */ - depth = trie->root->bitNum; - - thisNode = trie->root; /* Start with the root node */ - nextNode = trie->root->leftN; /* And assume we start to the left */ - - /* Now find the only node that can be currently reached by the bits in the - * key we are being asked to insert. - */ - while (thisNode->bitNum > nextNode->bitNum) - { - /* Still descending the structure, next node becomes current. - */ - thisNode = nextNode; - - if (key & bitMask[nextNode->bitNum]) - { - /* Bit at the required index was 1, so travers the right node from here - */ - nextNode = nextNode->rightN; - } - else - { - /* Bit at the required index was 0, so we traverse to the left - */ - nextNode = nextNode->leftN; - } - } - /* Here we have located the only node that can be reached by the - * bits in the requested key. It could in fact be that key or the node - * we need to use to insert the new key. - */ - if (nextNode->key == key) - { - /* We have located an exact match, but we will only append to the bucket chain - * if this trie accepts duplicate keys. - */ - if (trie->allowDups ==ANTLR3_TRUE) - { - /* Yes, we are accepting duplicates - */ - newEnt = (pANTLR3_TRIE_ENTRY)ANTLR3_CALLOC(1, sizeof(ANTLR3_TRIE_ENTRY)); - - if (newEnt == NULL) - { - /* Out of memory, all we can do is return the fact that the insert failed. - */ - return ANTLR3_FALSE; - } - - /* Otherwise insert this in the chain - */ - newEnt->type = type; - newEnt->freeptr = freeptr; - if (type == ANTLR3_HASH_TYPE_STR) - { - newEnt->data.ptr = data; - } - else - { - newEnt->data.intVal = intVal; - } - - /* We want to be able to traverse the stored elements in the order that they were - * added as duplicate keys. We might need to revise this opinion if we end up having many duplicate keys - * as perhaps reverse order is just as good, so long as it is ordered. - */ - nextEnt = nextNode->buckets; - while (nextEnt->next != NULL) - { - nextEnt = nextEnt->next; - } - nextEnt->next = newEnt; - - trie->count++; - return ANTLR3_TRUE; - } - else - { - /* We found the key is already there and we are not allowed duplicates in this - * trie. - */ - return ANTLR3_FALSE; - } - } - - /* Here we have discovered the only node that can be reached by the bits in the key - * but we have found that this node is not the key we need to insert. We must find the - * the leftmost bit by which the current key for that node and the new key we are going - * to insert, differ. While this nested series of ifs may look a bit strange, experimentation - * showed that it allows a machine code path that works well with predicated execution - */ - xorKey = (key ^ nextNode->key); /* Gives 1 bits only where they differ then we find the left most 1 bit*/ - - /* Most common case is a 32 bit key really - */ -#ifdef ANTLR3_USE_64BIT - if (xorKey & 0xFFFFFFFF00000000) - { - if (xorKey & 0xFFFF000000000000) - { - if (xorKey & 0xFF00000000000000) - { - depth = 56 + bitIndex[((xorKey & 0xFF00000000000000)>>56)]; - } - else - { - depth = 48 + bitIndex[((xorKey & 0x00FF000000000000)>>48)]; - } - } - else - { - if (xorKey & 0x0000FF0000000000) - { - depth = 40 + bitIndex[((xorKey & 0x0000FF0000000000)>>40)]; - } - else - { - depth = 32 + bitIndex[((xorKey & 0x000000FF00000000)>>32)]; - } - } - } - else -#endif - { - if (xorKey & 0x00000000FFFF0000) - { - if (xorKey & 0x00000000FF000000) - { - depth = 24 + bitIndex[((xorKey & 0x00000000FF000000)>>24)]; - } - else - { - depth = 16 + bitIndex[((xorKey & 0x0000000000FF0000)>>16)]; - } - } - else - { - if (xorKey & 0x000000000000FF00) - { - depth = 8 + bitIndex[((xorKey & 0x0000000000000FF00)>>8)]; - } - else - { - depth = bitIndex[xorKey & 0x00000000000000FF]; - } - } - } - - /* We have located the leftmost differing bit, indicated by the depth variable. So, we know what - * bit index we are to insert the new entry at. There are two cases, being where the two keys - * differ at a bit position that is not currently part of the bit testing, where they differ on a bit - * that is currently being skipped in the indexed comparisons, and where they differ on a bit - * that is merely lower down in the current bit search. If the bit index went bit 4, bit 2 and they differ - * at bit 3, then we have the "skipped" bit case. But if that chain was Bit 4, Bit 2 and they differ at bit 1 - * then we have the easy bit . - * - * So, set up to descend the tree again, but this time looking for the insert point - * according to whether we skip the bit that differs or not. - */ - thisNode = trie->root; - entNode = trie->root->leftN; - - /* Note the slight difference in the checks here to cover both cases - */ - while (thisNode->bitNum > entNode->bitNum && entNode->bitNum > depth) - { - /* Still descending the structure, next node becomes current. - */ - thisNode = entNode; - - if (key & bitMask[entNode->bitNum]) - { - /* Bit at the required index was 1, so traverse the right node from here - */ - entNode = entNode->rightN; - } - else - { - /* Bit at the required index was 0, so we traverse to the left - */ - entNode = entNode->leftN; - } - } - - /* We have located the correct insert point for this new key, so we need - * to allocate our entry and insert it etc. - */ - nextNode = (pANTLR3_INT_TRIE_NODE)ANTLR3_CALLOC(1, sizeof(ANTLR3_INT_TRIE_NODE)); - if (nextNode == NULL) - { - /* All that work and no memory - bummer. - */ - return ANTLR3_FALSE; - } - - /* Build a new entry block for the new node - */ - newEnt = (pANTLR3_TRIE_ENTRY)ANTLR3_CALLOC(1, sizeof(ANTLR3_TRIE_ENTRY)); - - if (newEnt == NULL) - { - /* Out of memory, all we can do is return the fact that the insert failed. - */ - return ANTLR3_FALSE; - } - - /* Otherwise enter this in our new node - */ - newEnt->type = type; - newEnt->freeptr = freeptr; - if (type == ANTLR3_HASH_TYPE_STR) - { - newEnt->data.ptr = data; - } - else - { - newEnt->data.intVal = intVal; - } - /* Install it - */ - nextNode->buckets = newEnt; - nextNode->key = key; - nextNode->bitNum = depth; - - /* Work out the right and left pointers for this new node, which involve - * terminating with the current found node either right or left according - * to whether the current index bit is 1 or 0 - */ - if (key & bitMask[depth]) - { - nextNode->leftN = entNode; /* Terminates at previous position */ - nextNode->rightN = nextNode; /* Terminates with itself */ - } - else - { - nextNode->rightN = entNode; /* Terminates at previous position */ - nextNode->leftN = nextNode; /* Terminates with itself */ - } - - /* Finally, we need to change the pointers at the node we located - * for inserting. If the key bit at its index is set then the right - * pointer for that node becomes the newly created node, otherwise the left - * pointer does. - */ - if (key & bitMask[thisNode->bitNum] ) - { - thisNode->rightN = nextNode; - } - else - { - thisNode->leftN = nextNode; - } - - /* Et voila - */ - trie->count++; - return ANTLR3_TRUE; - -} -/** Release memory allocated to this tree. - * Basic algorithm is that we do a depth first left descent and free - * up any nodes that are not backward pointers. - */ -static void -freeIntNode(pANTLR3_INT_TRIE_NODE node) -{ - pANTLR3_TRIE_ENTRY thisEntry; - pANTLR3_TRIE_ENTRY nextEntry; - - /* If this node has a left pointer that is not a back pointer - * then recursively call to free this - */ - if (node->bitNum > node->leftN->bitNum) - { - /* We have a left node that needs descending, so do it. - */ - freeIntNode(node->leftN); - } - - /* The left nodes from here should now be dealt with, so - * we need to descend any right nodes that are not back pointers - */ - if (node->bitNum > node->rightN->bitNum) - { - /* There are some right nodes to descend and deal with. - */ - freeIntNode(node->rightN); - } - - /* Now all the children are dealt with, we can destroy - * this node too - */ - thisEntry = node->buckets; - - while (thisEntry != NULL) - { - nextEntry = thisEntry->next; - - /* Do we need to call a custom free pointer for this string entry? - */ - if (thisEntry->type == ANTLR3_HASH_TYPE_STR && thisEntry->freeptr != NULL) - { - thisEntry->freeptr(thisEntry->data.ptr); - } - - /* Now free the data for this bucket entry - */ - ANTLR3_FREE(thisEntry); - thisEntry = nextEntry; /* See if there are any more to free */ - } - - /* The bucket entry is now gone, so we can free the memory for - * the entry itself. - */ - ANTLR3_FREE(node); - - /* And that should be it for everything under this node and itself - */ -} - -/** Called to free all nodes and the structure itself. - */ -static void -intTrieFree (pANTLR3_INT_TRIE trie) -{ - /* Descend from the root and free all the nodes - */ - freeIntNode(trie->root); - - /* the nodes are all gone now, so we need only free the memory - * for the structure itself - */ - ANTLR3_FREE(trie); -} - - -/** - * Allocate and initialize a new ANTLR3 topological sorter, which can be - * used to define edges that identify numerical node indexes that depend on other - * numerical node indexes, which can then be sorted topologically such that - * any node is sorted after all its dependent nodes. - * - * Use: - * - * /verbatim - - pANTLR3_TOPO topo; - topo = antlr3NewTopo(); - - if (topo == NULL) { out of memory } - - topo->addEdge(topo, 3, 0); // Node 3 depends on node 0 - topo->addEdge(topo, 0, 1); // Node - depends on node 1 - topo->sortVector(topo, myVector); // Sort the vector in place (node numbers are the vector entry numbers) - - * /verbatim - */ -ANTLR3_API pANTLR3_TOPO -antlr3TopoNew() -{ - pANTLR3_TOPO topo = (pANTLR3_TOPO)ANTLR3_MALLOC(sizeof(ANTLR3_TOPO)); - - if (topo == NULL) - { - return NULL; - } - - // Initialize variables - // - - topo->visited = NULL; // Don't know how big it is yet - topo->limit = 1; // No edges added yet - topo->edges = NULL; // No edges added yet - topo->sorted = NULL; // Nothing sorted at the start - topo->cycle = NULL; // No cycles at the start - topo->cycleMark = 0; // No cycles at the start - topo->hasCycle = ANTLR3_FALSE; // No cycle at the start - - // API - // - topo->addEdge = addEdge; - topo->sortToArray = sortToArray; - topo->sortVector = sortVector; - topo->free = freeTopo; - - return topo; -} -// Topological sorter -// -static void -addEdge (pANTLR3_TOPO topo, ANTLR3_UINT32 edge, ANTLR3_UINT32 dependency) -{ - ANTLR3_UINT32 i; - ANTLR3_UINT32 maxEdge; - pANTLR3_BITSET edgeDeps; - - if (edge>dependency) - { - maxEdge = edge; - } - else - { - maxEdge = dependency; - } - // We need to add an edge to says that the node indexed by 'edge' is - // dependent on the node indexed by 'dependency' - // - - // First see if we have enough room in the edges array to add the edge? - // - if (topo->edges == NULL) - { - // We don't have any edges yet, so create an array to hold them - // - topo->edges = ANTLR3_CALLOC(sizeof(pANTLR3_BITSET) * (maxEdge + 1), 1); - if (topo->edges == NULL) - { - return; - } - - // Set the limit to what we have now - // - topo->limit = maxEdge + 1; - } - else if (topo->limit <= maxEdge) - { - // WE have some edges but not enough - // - topo->edges = ANTLR3_REALLOC(topo->edges, sizeof(pANTLR3_BITSET) * (maxEdge + 1)); - if (topo->edges == NULL) - { - return; - } - - // Initialize the new bitmaps to ;indicate we have no edges defined yet - // - for (i = topo->limit; i <= maxEdge; i++) - { - *((topo->edges) + i) = NULL; - } - - // Set the limit to what we have now - // - topo->limit = maxEdge + 1; - } - - // If the edge was flagged as depending on itself, then we just - // do nothing as it means this routine was just called to add it - // in to the list of nodes. - // - if (edge == dependency) - { - return; - } - - // Pick up the bit map for the requested edge - // - edgeDeps = *((topo->edges) + edge); - - if (edgeDeps == NULL) - { - // No edges are defined yet for this node - // - edgeDeps = antlr3BitsetNew(0); - *((topo->edges) + edge) = edgeDeps; - if (edgeDeps == NULL ) - { - return; // Out of memory - } - } - - // Set the bit in the bitmap that corresponds to the requested - // dependency. - // - edgeDeps->add(edgeDeps, dependency); - - // And we are all set - // - return; -} - - -/** - * Given a starting node, descend its dependent nodes (ones that it has edges - * to) until we find one without edges. Having found a node without edges, we have - * discovered the bottom of a depth first search, which we can then ascend, adding - * the nodes in order from the bottom, which gives us the dependency order. - */ -static void -DFS(pANTLR3_TOPO topo, ANTLR3_UINT32 node) -{ - pANTLR3_BITSET edges; - - // Guard against a revisit and check for cycles - // - if (topo->hasCycle == ANTLR3_TRUE) - { - return; // We don't do anything else if we found a cycle - } - - if (topo->visited->isMember(topo->visited, node)) - { - // Check to see if we found a cycle. To do this we search the - // current cycle stack and see if we find this node already in the stack. - // - ANTLR3_UINT32 i; - - for (i=0; icycleMark; i++) - { - if (topo->cycle[i] == node) - { - // Stop! We found a cycle in the input, so rejig the cycle - // stack so that it only contains the cycle and set the cycle flag - // which will tell the caller what happened - // - ANTLR3_UINT32 l; - - for (l = i; l < topo->cycleMark; l++) - { - topo->cycle[l - i] = topo->cycle[l]; // Move to zero base in the cycle list - } - - // Recalculate the limit - // - topo->cycleMark -= i; - - // Signal disaster - // - topo->hasCycle = ANTLR3_TRUE; - } - } - return; - } - - // So far, no cycles have been found and we have not visited this node yet, - // so this node needs to go into the cycle stack before we continue - // then we will take it out of the stack once we have descended all its - // dependencies. - // - topo->cycle[topo->cycleMark++] = node; - - // First flag that we have visited this node - // - topo->visited->add(topo->visited, node); - - // Now, if this node has edges, then we want to ensure we visit - // them all before we drop through and add this node into the sorted - // list. - // - edges = *((topo->edges) + node); - if (edges != NULL) - { - // We have some edges, so visit each of the edge nodes - // that have not already been visited. - // - ANTLR3_UINT32 numBits; // How many bits are in the set - ANTLR3_UINT32 i; - ANTLR3_UINT32 range; - - numBits = edges->numBits(edges); - range = edges->size(edges); // Number of set bits - - // Stop if we exahust the bit list or have checked the - // number of edges that this node refers to (so we don't - // check bits at the end that cannot possibly be set). - // - for (i=0; i<= numBits && range > 0; i++) - { - if (edges->isMember(edges, i)) - { - range--; // About to check another one - - // Found an edge, make sure we visit and descend it - // - DFS(topo, i); - } - } - } - - // At this point we will have visited all the dependencies - // of this node and they will be ordered (even if there are cycles) - // So we just add the node into the sorted list at the - // current index position. - // - topo->sorted[topo->limit++] = node; - - // Remove this node from the cycle list if we have not detected a cycle - // - if (topo->hasCycle == ANTLR3_FALSE) - { - topo->cycleMark--; - } - - return; -} - -static pANTLR3_UINT32 -sortToArray (pANTLR3_TOPO topo) -{ - ANTLR3_UINT32 v; - ANTLR3_UINT32 oldLimit; - - // Guard against being called with no edges defined - // - if (topo->edges == NULL) - { - return 0; - } - // First we need a vector to populate with enough - // entries to accomodate the sorted list and another to accomodate - // the maximum cycle we could detect which is all nodes such as 0->1->2->3->0 - // - topo->sorted = ANTLR3_MALLOC(topo->limit * sizeof(ANTLR3_UINT32)); - topo->cycle = ANTLR3_MALLOC(topo->limit * sizeof(ANTLR3_UINT32)); - - // Next we need an empty bitset to show whether we have visited a node - // or not. This is the bit that gives us linear time of course as we are essentially - // dropping through the nodes in depth first order and when we get to a node that - // has no edges, we pop back up the stack adding the nodes we traversed in reverse - // order. - // - topo->visited = antlr3BitsetNew(0); - - // Now traverse the nodes as if we were just going left to right, but - // then descend each node unless it has already been visited. - // - oldLimit = topo->limit; // Number of nodes to traverse linearly - topo->limit = 0; // Next entry in the sorted table - - for (v = 0; v < oldLimit; v++) - { - // If we did not already visit this node, then descend it until we - // get a node without edges or arrive at a node we have already visited. - // - if (topo->visited->isMember(topo->visited, v) == ANTLR3_FALSE) - { - // We have not visited this one so descend it - // - DFS(topo, v); - } - - // Break the loop if we detect a cycle as we have no need to go any - // further - // - if (topo->hasCycle == ANTLR3_TRUE) - { - break; - } - } - - // Reset the limit to the number we recorded as if we hit a - // cycle, then limit will have stopped at the node where we - // discovered the cycle, but in order to free the edge bitmaps - // we need to know how many we may have allocated and traverse them all. - // - topo->limit = oldLimit; - - // Having traversed all the nodes we were given, we - // are guaranteed to have ordered all the nodes or detected a - // cycle. - // - return topo->sorted; -} - -static void -sortVector (pANTLR3_TOPO topo, pANTLR3_VECTOR v) -{ - // To sort a vector, we first perform the - // sort to an array, then use the results to reorder the vector - // we are given. This is just a convenience routine that allows you to - // sort the children of a tree node into topological order before or - // during an AST walk. This can be useful for optimizations that require - // dag reorders and also when the input stream defines thigns that are - // interdependent and you want to walk the list of the generated trees - // for those things in topological order so you can ignore the interdependencies - // at that point. - // - ANTLR3_UINT32 i; - - // Used as a lookup index to find the current location in the vector of - // the vector entry that was originally at position [0], [1], [2] etc - // - pANTLR3_UINT32 vIndex; - - // Sort into an array, then we can use the array that is - // stored in the topo - // - if (topo->sortToArray(topo) == 0) - { - return; // There were no edges - } - - if (topo->hasCycle == ANTLR3_TRUE) - { - return; // Do nothing if we detected a cycle - } - - // Ensure that the vector we are sorting is at least as big as the - // the input sequence we were adsked to sort. It does not matter if it is - // bigger as thaat probably just means that nodes numbered higher than the - // limit had no dependencies and so can be left alone. - // - if (topo->limit > v->count) - { - // We can only sort the entries that we have dude! The caller is - // responsible for ensuring the vector is the correct one and is the - // correct size etc. - // - topo->limit = v->count; - } - // We need to know the locations of each of the entries - // in the vector as we don't want to duplicate them in a new vector. We - // just use an indirection table to get the vector entry for a particular sequence - // acording to where we moved it last. Then we can just swap vector entries until - // we are done :-) - // - vIndex = ANTLR3_MALLOC(topo->limit * sizeof(ANTLR3_UINT32)); - - // Start index, each vector entry is located where you think it is - // - for (i = 0; i < topo->limit; i++) - { - vIndex[i] = i; - } - - // Now we traverse the sorted array and moved the entries of - // the vector around according to the sort order and the indirection - // table we just created. The index telsl us where in the vector the - // original element entry n is now located via vIndex[n]. - // - for (i=0; i < topo->limit; i++) - { - ANTLR3_UINT32 ind; - - // If the vector entry at i is already the one that it - // should be, then we skip moving it of course. - // - if (vIndex[topo->sorted[i]] == i) - { - continue; - } - - // The vector entry at i, should be replaced with the - // vector entry indicated by topo->sorted[i]. The vector entry - // at topo->sorted[i] may have already been swapped out though, so we - // find where it is now and move it from there to i. - // - ind = vIndex[topo->sorted[i]]; - v->swap(v, i, ind); - - // Update our index. The element at i is now the one we wanted - // to be sorted here and the element we swapped out is now the - // element that was at i just before we swapped it. If you are lost now - // don't worry about it, we are just reindexing on the fly is all. - // - vIndex[topo->sorted[i]] = i; - vIndex[i] = ind; - } - - // Having traversed all the entries, we have sorted the vector in place. - // - ANTLR3_FREE(vIndex); - return; -} - -static void -freeTopo (pANTLR3_TOPO topo) -{ - ANTLR3_UINT32 i; - - // Free the result vector - // - if (topo->sorted != NULL) - { - ANTLR3_FREE(topo->sorted); - topo->sorted = NULL; - } - - // Free the visited map - // - if (topo->visited != NULL) - { - - topo->visited->free(topo->visited); - topo->visited = NULL; - } - - // Free any edgemaps - // - if (topo->edges != NULL) - { - pANTLR3_BITSET edgeList; - - - for (i=0; ilimit; i++) - { - edgeList = *((topo->edges) + i); - if (edgeList != NULL) - { - edgeList->free(edgeList); - } - } - - ANTLR3_FREE(topo->edges); - } - topo->edges = NULL; - - // Free any cycle map - // - if (topo->cycle != NULL) - { - ANTLR3_FREE(topo->cycle); - } - - ANTLR3_FREE(topo); -} diff --git a/impl/antlr/libantlr3c-3.4/src/antlr3commontoken.c b/impl/antlr/libantlr3c-3.4/src/antlr3commontoken.c deleted file mode 100644 index 2627431..0000000 --- a/impl/antlr/libantlr3c-3.4/src/antlr3commontoken.c +++ /dev/null @@ -1,586 +0,0 @@ -/** - * Contains the default implementation of the common token used within - * java. Custom tokens should create this structure and then append to it using the - * custom pointer to install their own structure and API. - */ - -// [The "BSD licence"] -// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC -// http://www.temporal-wave.com -// http://www.linkedin.com/in/jimidle -// -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions -// are met: -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// 3. The name of the author may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include - -/* Token API - */ -static pANTLR3_STRING getText (pANTLR3_COMMON_TOKEN token); -static void setText (pANTLR3_COMMON_TOKEN token, pANTLR3_STRING text); -static void setText8 (pANTLR3_COMMON_TOKEN token, pANTLR3_UINT8 text); -static ANTLR3_UINT32 getType (pANTLR3_COMMON_TOKEN token); -static void setType (pANTLR3_COMMON_TOKEN token, ANTLR3_UINT32 type); -static ANTLR3_UINT32 getLine (pANTLR3_COMMON_TOKEN token); -static void setLine (pANTLR3_COMMON_TOKEN token, ANTLR3_UINT32 line); -static ANTLR3_INT32 getCharPositionInLine (pANTLR3_COMMON_TOKEN token); -static void setCharPositionInLine (pANTLR3_COMMON_TOKEN token, ANTLR3_INT32 pos); -static ANTLR3_UINT32 getChannel (pANTLR3_COMMON_TOKEN token); -static void setChannel (pANTLR3_COMMON_TOKEN token, ANTLR3_UINT32 channel); -static ANTLR3_MARKER getTokenIndex (pANTLR3_COMMON_TOKEN token); -static void setTokenIndex (pANTLR3_COMMON_TOKEN token, ANTLR3_MARKER); -static ANTLR3_MARKER getStartIndex (pANTLR3_COMMON_TOKEN token); -static void setStartIndex (pANTLR3_COMMON_TOKEN token, ANTLR3_MARKER index); -static ANTLR3_MARKER getStopIndex (pANTLR3_COMMON_TOKEN token); -static void setStopIndex (pANTLR3_COMMON_TOKEN token, ANTLR3_MARKER index); -static pANTLR3_STRING toString (pANTLR3_COMMON_TOKEN token); - -/* Factory API - */ -static void factoryClose (pANTLR3_TOKEN_FACTORY factory); -static pANTLR3_COMMON_TOKEN newToken (void); -static void setInputStream (pANTLR3_TOKEN_FACTORY factory, pANTLR3_INPUT_STREAM input); -static void factoryReset (pANTLR3_TOKEN_FACTORY factory); - -/* Internal management functions - */ -static void newPool (pANTLR3_TOKEN_FACTORY factory); -static pANTLR3_COMMON_TOKEN newPoolToken (pANTLR3_TOKEN_FACTORY factory); - - -ANTLR3_API pANTLR3_COMMON_TOKEN -antlr3CommonTokenNew(ANTLR3_UINT32 ttype) -{ - pANTLR3_COMMON_TOKEN token; - - // Create a raw token with the interface installed - // - token = newToken(); - - if (token != NULL) - { - token->setType(token, ttype); - } - - // All good - // - return token; -} - -ANTLR3_API pANTLR3_TOKEN_FACTORY -antlr3TokenFactoryNew(pANTLR3_INPUT_STREAM input) -{ - pANTLR3_TOKEN_FACTORY factory; - - /* allocate memory - */ - factory = (pANTLR3_TOKEN_FACTORY) ANTLR3_MALLOC((size_t)sizeof(ANTLR3_TOKEN_FACTORY)); - - if (factory == NULL) - { - return NULL; - } - - /* Install factory API - */ - factory->newToken = newPoolToken; - factory->close = factoryClose; - factory->setInputStream = setInputStream; - factory->reset = factoryReset; - - /* Allocate the initial pool - */ - factory->thisPool = -1; - factory->pools = NULL; - factory->maxPool = -1; - newPool(factory); - - /* Factory space is good, we now want to initialize our cheating token - * which one it is initialized is the model for all tokens we manufacture - */ - antlr3SetTokenAPI(&factory->unTruc); - - /* Set some initial variables for future copying - */ - factory->unTruc.factoryMade = ANTLR3_TRUE; - - // Input stream - // - setInputStream(factory, input); - - return factory; - -} - -static void -setInputStream (pANTLR3_TOKEN_FACTORY factory, pANTLR3_INPUT_STREAM input) -{ - factory->input = input; - factory->unTruc.input = input; - if (input != NULL) - { - factory->unTruc.strFactory = input->strFactory; - } - else - { - factory->unTruc.strFactory = NULL; - } -} - -static void -newPool(pANTLR3_TOKEN_FACTORY factory) -{ - /* Increment factory count - */ - factory->thisPool++; - - // If we were reusing this token factory then we may already have a pool - // allocated. If we exceeded the max avaible then we must allocate a new - // one. - if (factory->thisPool > factory->maxPool) - { - /* Ensure we have enough pointers allocated - */ - factory->pools = (pANTLR3_COMMON_TOKEN *) - ANTLR3_REALLOC( (void *)factory->pools, /* Current pools pointer (starts at NULL) */ - (ANTLR3_UINT32)((factory->thisPool + 1) * sizeof(pANTLR3_COMMON_TOKEN *)) /* Memory for new pool pointers */ - ); - - /* Allocate a new pool for the factory - */ - factory->pools[factory->thisPool] = - (pANTLR3_COMMON_TOKEN) - ANTLR3_CALLOC(1, (size_t)(sizeof(ANTLR3_COMMON_TOKEN) * ANTLR3_FACTORY_POOL_SIZE)); - - // We now have a new pool and can track it as the maximum we have created so far - // - factory->maxPool = factory->thisPool; - } - - /* Reset the counters - */ - factory->nextToken = 0; - - /* Done - */ - return; -} - -static pANTLR3_COMMON_TOKEN -newPoolToken(pANTLR3_TOKEN_FACTORY factory) -{ - pANTLR3_COMMON_TOKEN token; - - /* See if we need a new token pool before allocating a new - * one - */ - if (factory->nextToken >= ANTLR3_FACTORY_POOL_SIZE) - { - /* We ran out of tokens in the current pool, so we need a new pool - */ - newPool(factory); - } - - /* Assuming everything went well (we are trying for performance here so doing minimal - * error checking. Then we can work out what the pointer is to the next token. - */ - token = factory->pools[factory->thisPool] + factory->nextToken; - factory->nextToken++; - - /* We have our token pointer now, so we can initialize it to the predefined model. - * We only need do this though if the token is not already initialized, we just check - * an api function pointer for this as they are allocated via calloc. - */ - if (token->setStartIndex == NULL) - { - antlr3SetTokenAPI(token); - - // It is factory made, and we need to copy the string factory pointer - // - token->factoryMade = ANTLR3_TRUE; - token->strFactory = factory->input == NULL ? NULL : factory->input->strFactory; - token->input = factory->input; - } - - /* And we are done - */ - return token; -} - -static void -factoryReset (pANTLR3_TOKEN_FACTORY factory) -{ - // Just start again with pool #0 when we are - // called. - // - factory->thisPool = -1; - newPool(factory); -} - -static void -factoryClose (pANTLR3_TOKEN_FACTORY factory) -{ - pANTLR3_COMMON_TOKEN pool; - ANTLR3_INT32 poolCount; - ANTLR3_UINT32 limit; - ANTLR3_UINT32 token; - pANTLR3_COMMON_TOKEN check; - - /* We iterate the token pools one at a time - */ - for (poolCount = 0; poolCount <= factory->thisPool; poolCount++) - { - /* Pointer to current pool - */ - pool = factory->pools[poolCount]; - - /* Work out how many tokens we need to check in this pool. - */ - limit = (poolCount == factory->thisPool ? factory->nextToken : ANTLR3_FACTORY_POOL_SIZE); - - /* Marginal condition, we might be at the start of a brand new pool - * where the nextToken is 0 and nothing has been allocated. - */ - if (limit > 0) - { - /* We have some tokens allocated from this pool - */ - for (token = 0; token < limit; token++) - { - /* Next one in the chain - */ - check = pool + token; - - /* If the programmer made this a custom token, then - * see if we need to call their free routine. - */ - if (check->custom != NULL && check->freeCustom != NULL) - { - check->freeCustom(check->custom); - check->custom = NULL; - } - } - } - - /* We can now free this pool allocation - */ - ANTLR3_FREE(factory->pools[poolCount]); - factory->pools[poolCount] = NULL; - } - - /* All the pools are deallocated we can free the pointers to the pools - * now. - */ - ANTLR3_FREE(factory->pools); - - /* Finally, we can free the space for the factory itself - */ - ANTLR3_FREE(factory); -} - - -static pANTLR3_COMMON_TOKEN -newToken(void) -{ - pANTLR3_COMMON_TOKEN token; - - /* Allocate memory for this - */ - token = (pANTLR3_COMMON_TOKEN) ANTLR3_CALLOC(1, (size_t)(sizeof(ANTLR3_COMMON_TOKEN))); - - if (token == NULL) - { - return NULL; - } - - // Install the API - // - antlr3SetTokenAPI(token); - token->factoryMade = ANTLR3_FALSE; - - return token; -} - -ANTLR3_API void -antlr3SetTokenAPI(pANTLR3_COMMON_TOKEN token) -{ - token->getText = getText; - token->setText = setText; - token->setText8 = setText8; - token->getType = getType; - token->setType = setType; - token->getLine = getLine; - token->setLine = setLine; - token->setLine = setLine; - token->getCharPositionInLine = getCharPositionInLine; - token->setCharPositionInLine = setCharPositionInLine; - token->getChannel = getChannel; - token->setChannel = setChannel; - token->getTokenIndex = getTokenIndex; - token->setTokenIndex = setTokenIndex; - token->getStartIndex = getStartIndex; - token->setStartIndex = setStartIndex; - token->getStopIndex = getStopIndex; - token->setStopIndex = setStopIndex; - token->toString = toString; - - return; -} - -static pANTLR3_STRING getText (pANTLR3_COMMON_TOKEN token) -{ - switch (token->textState) - { - case ANTLR3_TEXT_STRING: - - // Someone already created a string for this token, so we just - // use it. - // - return token->tokText.text; - break; - - case ANTLR3_TEXT_CHARP: - - // We had a straight text pointer installed, now we - // must convert it to a string. Note we have to do this here - // or otherwise setText8() will just install the same char* - // - if (token->strFactory != NULL) - { - token->tokText.text = token->strFactory->newStr8(token->strFactory, (pANTLR3_UINT8)token->tokText.chars); - token->textState = ANTLR3_TEXT_STRING; - return token->tokText.text; - } - else - { - // We cannot do anything here - // - return NULL; - } - break; - - default: - - // EOF is a special case - // - if (token->type == ANTLR3_TOKEN_EOF) - { - token->tokText.text = token->strFactory->newStr8(token->strFactory, (pANTLR3_UINT8)""); - token->textState = ANTLR3_TEXT_STRING; - token->tokText.text->factory = token->strFactory; - return token->tokText.text; - } - - - // We had nothing installed in the token, create a new string - // from the input stream - // - - if (token->input != NULL) - { - - return token->input->substr( token->input, - token->getStartIndex(token), - token->getStopIndex(token) - ); - } - - // Nothing to return, there is no input stream - // - return NULL; - break; - } -} -static void setText8 (pANTLR3_COMMON_TOKEN token, pANTLR3_UINT8 text) -{ - // No text to set, so ignore - // - if (text == NULL) return; - - switch (token->textState) - { - case ANTLR3_TEXT_NONE: - case ANTLR3_TEXT_CHARP: // Caller must free before setting again, if it needs to be freed - - // Nothing in there yet, or just a char *, so just set the - // text as a pointer - // - token->textState = ANTLR3_TEXT_CHARP; - token->tokText.chars = (pANTLR3_UCHAR)text; - break; - - default: - - // It was already a pANTLR3_STRING, so just override it - // - token->tokText.text->set8(token->tokText.text, (const char *)text); - break; - } - - // We are done - // - return; -} - -/** \brief Install the supplied text string as teh text for the token. - * The method assumes that the existing text (if any) was created by a factory - * and so does not attempt to release any memory it is using.Text not created - * by a string fctory (not advised) should be released prior to this call. - */ -static void setText (pANTLR3_COMMON_TOKEN token, pANTLR3_STRING text) -{ - // Merely replaces and existing pre-defined text with the supplied - // string - // - token->textState = ANTLR3_TEXT_STRING; - token->tokText.text = text; - - /* We are done - */ - return; -} - -static ANTLR3_UINT32 getType (pANTLR3_COMMON_TOKEN token) -{ - return token->type; -} - -static void setType (pANTLR3_COMMON_TOKEN token, ANTLR3_UINT32 type) -{ - token->type = type; -} - -static ANTLR3_UINT32 getLine (pANTLR3_COMMON_TOKEN token) -{ - return token->line; -} - -static void setLine (pANTLR3_COMMON_TOKEN token, ANTLR3_UINT32 line) -{ - token->line = line; -} - -static ANTLR3_INT32 getCharPositionInLine (pANTLR3_COMMON_TOKEN token) -{ - return token->charPosition; -} - -static void setCharPositionInLine (pANTLR3_COMMON_TOKEN token, ANTLR3_INT32 pos) -{ - token->charPosition = pos; -} - -static ANTLR3_UINT32 getChannel (pANTLR3_COMMON_TOKEN token) -{ - return token->channel; -} - -static void setChannel (pANTLR3_COMMON_TOKEN token, ANTLR3_UINT32 channel) -{ - token->channel = channel; -} - -static ANTLR3_MARKER getTokenIndex (pANTLR3_COMMON_TOKEN token) -{ - return token->index; -} - -static void setTokenIndex (pANTLR3_COMMON_TOKEN token, ANTLR3_MARKER index) -{ - token->index = index; -} - -static ANTLR3_MARKER getStartIndex (pANTLR3_COMMON_TOKEN token) -{ - return token->start == -1 ? (ANTLR3_MARKER)(token->input->data) : token->start; -} - -static void setStartIndex (pANTLR3_COMMON_TOKEN token, ANTLR3_MARKER start) -{ - token->start = start; -} - -static ANTLR3_MARKER getStopIndex (pANTLR3_COMMON_TOKEN token) -{ - return token->stop; -} - -static void setStopIndex (pANTLR3_COMMON_TOKEN token, ANTLR3_MARKER stop) -{ - token->stop = stop; -} - -static pANTLR3_STRING toString (pANTLR3_COMMON_TOKEN token) -{ - pANTLR3_STRING text; - pANTLR3_STRING outtext; - - text = token->getText(token); - - if (text == NULL) - { - return NULL; - } - - if (text->factory == NULL) - { - return text; // This usally means it is the EOF token - } - - /* A new empty string to assemble all the stuff in - */ - outtext = text->factory->newRaw(text->factory); - - /* Now we use our handy dandy string utility to assemble the - * the reporting string - * return "[@"+getTokenIndex()+","+start+":"+stop+"='"+txt+"',<"+type+">"+channelStr+","+line+":"+getCharPositionInLine()+"]"; - */ - outtext->append8(outtext, "[Index: "); - outtext->addi (outtext, (ANTLR3_INT32)token->getTokenIndex(token)); - outtext->append8(outtext, " (Start: "); - outtext->addi (outtext, (ANTLR3_INT32)token->getStartIndex(token)); - outtext->append8(outtext, "-Stop: "); - outtext->addi (outtext, (ANTLR3_INT32)token->getStopIndex(token)); - outtext->append8(outtext, ") ='"); - outtext->appendS(outtext, text); - outtext->append8(outtext, "', type<"); - outtext->addi (outtext, token->type); - outtext->append8(outtext, "> "); - - if (token->getChannel(token) > ANTLR3_TOKEN_DEFAULT_CHANNEL) - { - outtext->append8(outtext, "(channel = "); - outtext->addi (outtext, (ANTLR3_INT32)token->getChannel(token)); - outtext->append8(outtext, ") "); - } - - outtext->append8(outtext, "Line: "); - outtext->addi (outtext, (ANTLR3_INT32)token->getLine(token)); - outtext->append8(outtext, " LinePos:"); - outtext->addi (outtext, token->getCharPositionInLine(token)); - outtext->addc (outtext, ']'); - - return outtext; -} - diff --git a/impl/antlr/libantlr3c-3.4/src/antlr3commontree.c b/impl/antlr/libantlr3c-3.4/src/antlr3commontree.c deleted file mode 100644 index 65de38f..0000000 --- a/impl/antlr/libantlr3c-3.4/src/antlr3commontree.c +++ /dev/null @@ -1,547 +0,0 @@ -// \file -// -// Implementation of ANTLR3 CommonTree, which you can use as a -// starting point for your own tree. Though it is often easier just to tag things on -// to the user pointer in the tree unless you are building a different type -// of structure. -// - -// [The "BSD licence"] -// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC -// http://www.temporal-wave.com -// http://www.linkedin.com/in/jimidle -// -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions -// are met: -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// 3. The name of the author may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include - - -static pANTLR3_COMMON_TOKEN getToken (pANTLR3_BASE_TREE tree); -static pANTLR3_BASE_TREE dupNode (pANTLR3_BASE_TREE tree); -static ANTLR3_BOOLEAN isNilNode (pANTLR3_BASE_TREE tree); -static ANTLR3_UINT32 getType (pANTLR3_BASE_TREE tree); -static pANTLR3_STRING getText (pANTLR3_BASE_TREE tree); -static ANTLR3_UINT32 getLine (pANTLR3_BASE_TREE tree); -static ANTLR3_UINT32 getCharPositionInLine (pANTLR3_BASE_TREE tree); -static pANTLR3_STRING toString (pANTLR3_BASE_TREE tree); -static pANTLR3_BASE_TREE getParent (pANTLR3_BASE_TREE tree); -static void setParent (pANTLR3_BASE_TREE tree, pANTLR3_BASE_TREE parent); -static void setChildIndex (pANTLR3_BASE_TREE tree, ANTLR3_INT32 i); -static ANTLR3_INT32 getChildIndex (pANTLR3_BASE_TREE tree); -static void createChildrenList (pANTLR3_BASE_TREE tree); -static void reuse (pANTLR3_BASE_TREE tree); - -// Factory functions for the Arboretum -// -static void newPool (pANTLR3_ARBORETUM factory); -static pANTLR3_BASE_TREE newPoolTree (pANTLR3_ARBORETUM factory); -static pANTLR3_BASE_TREE newFromTree (pANTLR3_ARBORETUM factory, pANTLR3_COMMON_TREE tree); -static pANTLR3_BASE_TREE newFromToken (pANTLR3_ARBORETUM factory, pANTLR3_COMMON_TOKEN token); -static void factoryClose (pANTLR3_ARBORETUM factory); - -ANTLR3_API pANTLR3_ARBORETUM -antlr3ArboretumNew(pANTLR3_STRING_FACTORY strFactory) -{ - pANTLR3_ARBORETUM factory; - - // Allocate memory - // - factory = (pANTLR3_ARBORETUM) ANTLR3_MALLOC((size_t)sizeof(ANTLR3_ARBORETUM)); - if (factory == NULL) - { - return NULL; - } - - // Install a vector factory to create, track and free() any child - // node lists. - // - factory->vFactory = antlr3VectorFactoryNew(0); - if (factory->vFactory == NULL) - { - free(factory); - return NULL; - } - - // We also keep a reclaim stack, so that any Nil nodes that are - // orphaned are not just left in the pool but are reused, other wise - // we create 6 times as many nilNodes as ordinary nodes and use loads of - // memory. Perhaps at some point, the analysis phase will generate better - // code and we won't need to do this here. - // - factory->nilStack = antlr3StackNew(0); - - // Install factory API - // - factory->newTree = newPoolTree; - factory->newFromTree = newFromTree; - factory->newFromToken = newFromToken; - factory->close = factoryClose; - - // Allocate the initial pool - // - factory->thisPool = -1; - factory->pools = NULL; - newPool(factory); - - // Factory space is good, we now want to initialize our cheating token - // which one it is initialized is the model for all tokens we manufacture - // - antlr3SetCTAPI(&factory->unTruc); - - // Set some initial variables for future copying, including a string factory - // that we can use later for converting trees to strings. - // - factory->unTruc.factory = factory; - factory->unTruc.baseTree.strFactory = strFactory; - - return factory; - -} - -static void -newPool(pANTLR3_ARBORETUM factory) -{ - // Increment factory count - // - factory->thisPool++; - - // Ensure we have enough pointers allocated - // - factory->pools = (pANTLR3_COMMON_TREE *) - ANTLR3_REALLOC( (void *)factory->pools, // Current pools pointer (starts at NULL) - (ANTLR3_UINT32)((factory->thisPool + 1) * sizeof(pANTLR3_COMMON_TREE *)) // Memory for new pool pointers - ); - - // Allocate a new pool for the factory - // - factory->pools[factory->thisPool] = - (pANTLR3_COMMON_TREE) - ANTLR3_MALLOC((size_t)(sizeof(ANTLR3_COMMON_TREE) * ANTLR3_FACTORY_POOL_SIZE)); - - - // Reset the counters - // - factory->nextTree = 0; - - // Done - // - return; -} - -static pANTLR3_BASE_TREE -newPoolTree (pANTLR3_ARBORETUM factory) -{ - pANTLR3_COMMON_TREE tree; - - // If we have anything on the re claim stack, reuse that sucker first - // - tree = factory->nilStack->peek(factory->nilStack); - - if (tree != NULL) - { - // Cool we got something we could reuse, it will have been cleaned up by - // whatever put it back on the stack (for instance if it had a child vector, - // that will have been cleared to hold zero entries and that vector will get reused too. - // It is the basetree pointer that is placed on the stack of course - // - factory->nilStack->pop(factory->nilStack); - return (pANTLR3_BASE_TREE)tree; - - } - // See if we need a new tree pool before allocating a new tree - // - if (factory->nextTree >= ANTLR3_FACTORY_POOL_SIZE) - { - // We ran out of tokens in the current pool, so we need a new pool - // - newPool(factory); - } - - // Assuming everything went well - we are trying for performance here so doing minimal - // error checking - then we can work out what the pointer is to the next commontree. - // - tree = factory->pools[factory->thisPool] + factory->nextTree; - factory->nextTree++; - - // We have our token pointer now, so we can initialize it to the predefined model. - // - antlr3SetCTAPI(tree); - - // Set some initial variables for future copying, including a string factory - // that we can use later for converting trees to strings. - // - tree->factory = factory; - tree->baseTree.strFactory = factory->unTruc.baseTree.strFactory; - - // The super points to the common tree so we must override the one used by - // by the pre-built tree as otherwise we will always poitn to the same initial - // common tree and we might spend 3 hours trying to debug why - this would never - // happen to me of course! :-( - // - tree->baseTree.super = tree; - - - // And we are done - // - return &(tree->baseTree); -} - - -static pANTLR3_BASE_TREE -newFromTree(pANTLR3_ARBORETUM factory, pANTLR3_COMMON_TREE tree) -{ - pANTLR3_BASE_TREE newTree; - - newTree = factory->newTree(factory); - - if (newTree == NULL) - { - return NULL; - } - - // Pick up the payload we had in the supplied tree - // - ((pANTLR3_COMMON_TREE)(newTree->super))->token = tree->token; - newTree->u = tree->baseTree.u; // Copy any user pointer - - return newTree; -} - -static pANTLR3_BASE_TREE -newFromToken(pANTLR3_ARBORETUM factory, pANTLR3_COMMON_TOKEN token) -{ - pANTLR3_BASE_TREE newTree; - - newTree = factory->newTree(factory); - - if (newTree == NULL) - { - return NULL; - } - - // Pick up the payload we had in the supplied tree - // - ((pANTLR3_COMMON_TREE)(newTree->super))->token = token; - - return newTree; -} - -static void -factoryClose (pANTLR3_ARBORETUM factory) -{ - ANTLR3_INT32 poolCount; - - // First close the vector factory that supplied all the child pointer - // vectors. - // - factory->vFactory->close(factory->vFactory); - - if (factory->nilStack != NULL) - { - factory->nilStack->free(factory->nilStack); - } - - // We now JUST free the pools because the C runtime CommonToken based tree - // cannot contain anything that was not made by this factory. - // - for (poolCount = 0; poolCount <= factory->thisPool; poolCount++) - { - // We can now free this pool allocation - // - ANTLR3_FREE(factory->pools[poolCount]); - factory->pools[poolCount] = NULL; - } - - // All the pools are deallocated we can free the pointers to the pools - // now. - // - ANTLR3_FREE(factory->pools); - - // Finally, we can free the space for the factory itself - // - ANTLR3_FREE(factory); -} - - -ANTLR3_API void -antlr3SetCTAPI(pANTLR3_COMMON_TREE tree) -{ - // Init base tree - // - antlr3BaseTreeNew(&(tree->baseTree)); - - // We need a pointer to ourselves for - // the payload and few functions that we - // provide. - // - tree->baseTree.super = tree; - - // Common tree overrides - - tree->baseTree.isNilNode = isNilNode; - tree->baseTree.toString = toString; - tree->baseTree.dupNode = (void *(*)(pANTLR3_BASE_TREE))(dupNode); - tree->baseTree.getLine = getLine; - tree->baseTree.getCharPositionInLine = getCharPositionInLine; - tree->baseTree.toString = toString; - tree->baseTree.getType = getType; - tree->baseTree.getText = getText; - tree->baseTree.getToken = getToken; - tree->baseTree.getParent = getParent; - tree->baseTree.setParent = setParent; - tree->baseTree.setChildIndex = setChildIndex; - tree->baseTree.getChildIndex = getChildIndex; - tree->baseTree.createChildrenList = createChildrenList; - tree->baseTree.reuse = reuse; - tree->baseTree.free = NULL; // Factory trees have no free function - tree->baseTree.u = NULL; // Initialize user pointer - - tree->baseTree.children = NULL; - - tree->token = NULL; // No token as yet - tree->startIndex = 0; - tree->stopIndex = 0; - tree->parent = NULL; // No parent yet - tree->childIndex = -1; - - return; -} - -// -------------------------------------- -// Non factory node constructors. -// - -ANTLR3_API pANTLR3_COMMON_TREE -antlr3CommonTreeNew() -{ - pANTLR3_COMMON_TREE tree; - tree = ANTLR3_CALLOC(1, sizeof(ANTLR3_COMMON_TREE)); - - if (tree == NULL) - { - return NULL; - } - - antlr3SetCTAPI(tree); - - return tree; -} - -ANTLR3_API pANTLR3_COMMON_TREE -antlr3CommonTreeNewFromToken(pANTLR3_COMMON_TOKEN token) -{ - pANTLR3_COMMON_TREE newTree; - - newTree = antlr3CommonTreeNew(); - - if (newTree == NULL) - { - return NULL; - } - - //Pick up the payload we had in the supplied tree - // - newTree->token = token; - return newTree; -} - -/// Create a new vector for holding child nodes using the inbuilt -/// vector factory. -/// -static void -createChildrenList (pANTLR3_BASE_TREE tree) -{ - tree->children = ((pANTLR3_COMMON_TREE)(tree->super))->factory->vFactory->newVector(((pANTLR3_COMMON_TREE)(tree->super))->factory->vFactory); -} - - -static pANTLR3_COMMON_TOKEN -getToken (pANTLR3_BASE_TREE tree) -{ - // The token is the payload of the common tree or other implementor - // so it is stored within ourselves, which is the super pointer.Note - // that whatever the actual token is, it is passed around by its pointer - // to the common token implementation, which it may of course surround - // with its own super structure. - // - return ((pANTLR3_COMMON_TREE)(tree->super))->token; -} - -static pANTLR3_BASE_TREE -dupNode (pANTLR3_BASE_TREE tree) -{ - // The node we are duplicating is in fact the common tree (that's why we are here) - // so we use the super pointer to duplicate. - // - pANTLR3_COMMON_TREE theOld; - - theOld = (pANTLR3_COMMON_TREE)(tree->super); - - // The pointer we return is the base implementation of course - // - return theOld->factory->newFromTree(theOld->factory, theOld); -} - -static ANTLR3_BOOLEAN -isNilNode (pANTLR3_BASE_TREE tree) -{ - // This is a Nil tree if it has no payload (Token in our case) - // - if (((pANTLR3_COMMON_TREE)(tree->super))->token == NULL) - { - return ANTLR3_TRUE; - } - else - { - return ANTLR3_FALSE; - } -} - -static ANTLR3_UINT32 -getType (pANTLR3_BASE_TREE tree) -{ - pANTLR3_COMMON_TREE theTree; - - theTree = (pANTLR3_COMMON_TREE)(tree->super); - - if (theTree->token == NULL) - { - return 0; - } - else - { - return theTree->token->getType(theTree->token); - } -} - -static pANTLR3_STRING -getText (pANTLR3_BASE_TREE tree) -{ - return tree->toString(tree); -} - -static ANTLR3_UINT32 getLine (pANTLR3_BASE_TREE tree) -{ - pANTLR3_COMMON_TREE cTree; - pANTLR3_COMMON_TOKEN token; - - cTree = (pANTLR3_COMMON_TREE)(tree->super); - - token = cTree->token; - - if (token == NULL || token->getLine(token) == 0) - { - if (tree->getChildCount(tree) > 0) - { - pANTLR3_BASE_TREE child; - - child = (pANTLR3_BASE_TREE)tree->getChild(tree, 0); - return child->getLine(child); - } - return 0; - } - return token->getLine(token); -} - -static ANTLR3_UINT32 getCharPositionInLine (pANTLR3_BASE_TREE tree) -{ - pANTLR3_COMMON_TOKEN token; - - token = ((pANTLR3_COMMON_TREE)(tree->super))->token; - - if (token == NULL || token->getCharPositionInLine(token) == -1) - { - if (tree->getChildCount(tree) > 0) - { - pANTLR3_BASE_TREE child; - - child = (pANTLR3_BASE_TREE)tree->getChild(tree, 0); - - return child->getCharPositionInLine(child); - } - return 0; - } - return token->getCharPositionInLine(token); -} - -static pANTLR3_STRING toString (pANTLR3_BASE_TREE tree) -{ - if (tree->isNilNode(tree) == ANTLR3_TRUE) - { - pANTLR3_STRING nilNode; - - nilNode = tree->strFactory->newPtr(tree->strFactory, (pANTLR3_UINT8)"nil", 3); - - return nilNode; - } - - return ((pANTLR3_COMMON_TREE)(tree->super))->token->getText(((pANTLR3_COMMON_TREE)(tree->super))->token); -} - -static pANTLR3_BASE_TREE -getParent (pANTLR3_BASE_TREE tree) -{ - return & (((pANTLR3_COMMON_TREE)(tree->super))->parent->baseTree); -} - -static void -setParent (pANTLR3_BASE_TREE tree, pANTLR3_BASE_TREE parent) -{ - ((pANTLR3_COMMON_TREE)(tree->super))->parent = parent == NULL ? NULL : ((pANTLR3_COMMON_TREE)(parent->super))->parent; -} - -static void -setChildIndex (pANTLR3_BASE_TREE tree, ANTLR3_INT32 i) -{ - ((pANTLR3_COMMON_TREE)(tree->super))->childIndex = i; -} -static ANTLR3_INT32 -getChildIndex (pANTLR3_BASE_TREE tree ) -{ - return ((pANTLR3_COMMON_TREE)(tree->super))->childIndex; -} - -/** Clean up any child vector that the tree might have, so it can be reused, - * then add it into the reuse stack. - */ -static void -reuse (pANTLR3_BASE_TREE tree) -{ - pANTLR3_COMMON_TREE cTree; - - cTree = (pANTLR3_COMMON_TREE)(tree->super); - - if (cTree->factory != NULL) - { - - if (cTree->baseTree.children != NULL) - { - - cTree->baseTree.children->clear(cTree->baseTree.children); - } - cTree->factory->nilStack->push(cTree->factory->nilStack, tree, NULL); - - } -} diff --git a/impl/antlr/libantlr3c-3.4/src/antlr3commontreeadaptor.c b/impl/antlr/libantlr3c-3.4/src/antlr3commontreeadaptor.c deleted file mode 100644 index abce6f0..0000000 --- a/impl/antlr/libantlr3c-3.4/src/antlr3commontreeadaptor.c +++ /dev/null @@ -1,496 +0,0 @@ -/** \file - * This is the standard tree adaptor used by the C runtime unless the grammar - * source file says to use anything different. It embeds a BASE_TREE to which - * it adds its own implementation of anything that the base tree is not - * good for, plus a number of methods that any other adaptor type - * needs to implement too. - * \ingroup pANTLR3_COMMON_TREE_ADAPTOR - */ - -// [The "BSD licence"] -// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC -// http://www.temporal-wave.com -// http://www.linkedin.com/in/jimidle -// -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions -// are met: -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// 3. The name of the author may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include - -#ifdef ANTLR3_WINDOWS -#pragma warning( disable : 4100 ) -#endif - -/* BASE_TREE_ADAPTOR overrides... */ -static pANTLR3_BASE_TREE dupNode (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE treeNode); -static pANTLR3_BASE_TREE create (pANTLR3_BASE_TREE_ADAPTOR adpator, pANTLR3_COMMON_TOKEN payload); -static pANTLR3_BASE_TREE dbgCreate (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_COMMON_TOKEN payload); -static pANTLR3_COMMON_TOKEN createToken (pANTLR3_BASE_TREE_ADAPTOR adaptor, ANTLR3_UINT32 tokenType, pANTLR3_UINT8 text); -static pANTLR3_COMMON_TOKEN createTokenFromToken (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_COMMON_TOKEN fromToken); -static pANTLR3_COMMON_TOKEN getToken (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE t); -static pANTLR3_STRING getText (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE t); -static ANTLR3_UINT32 getType (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE t); -static pANTLR3_BASE_TREE getChild (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE t, ANTLR3_UINT32 i); -static ANTLR3_UINT32 getChildCount (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE t); -static void replaceChildren (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE parent, ANTLR3_INT32 startChildIndex, ANTLR3_INT32 stopChildIndex, pANTLR3_BASE_TREE t); -static void setDebugEventListener (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_DEBUG_EVENT_LISTENER debugger); -static void setChildIndex (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE t, ANTLR3_INT32 i); -static ANTLR3_INT32 getChildIndex (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE t); -static void setParent (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE child, pANTLR3_BASE_TREE parent); -static pANTLR3_BASE_TREE getParent (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE child); -static void setChild (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE t, ANTLR3_UINT32 i, pANTLR3_BASE_TREE child); -static void deleteChild (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE t, ANTLR3_UINT32 i); -static pANTLR3_BASE_TREE errorNode (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_TOKEN_STREAM ctnstream, pANTLR3_COMMON_TOKEN startToken, pANTLR3_COMMON_TOKEN stopToken, pANTLR3_EXCEPTION e); -/* Methods specific to each tree adaptor - */ -static void setTokenBoundaries (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE t, pANTLR3_COMMON_TOKEN startToken, pANTLR3_COMMON_TOKEN stopToken); -static void dbgSetTokenBoundaries (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE t, pANTLR3_COMMON_TOKEN startToken, pANTLR3_COMMON_TOKEN stopToken); -static ANTLR3_MARKER getTokenStartIndex (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE t); -static ANTLR3_MARKER getTokenStopIndex (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE t); - -static void ctaFree (pANTLR3_BASE_TREE_ADAPTOR adaptor); - -/** Create a new tree adaptor. Note that despite the fact that this is - * creating a new COMMON_TREE adaptor, we return the address of the - * BASE_TREE interface, as should any other adaptor that wishes to be - * used as the tree element of a tree parse/build. It needs to be given the - * address of a valid string factory as we do not know what the originating - * input stream encoding type was. This way we can rely on just using - * the original input stream's string factory or one of the correct type - * which the user supplies us. - */ -ANTLR3_API pANTLR3_BASE_TREE_ADAPTOR -ANTLR3_TREE_ADAPTORNew(pANTLR3_STRING_FACTORY strFactory) -{ - pANTLR3_COMMON_TREE_ADAPTOR cta; - - // First job is to create the memory we need for the tree adaptor interface. - // - cta = (pANTLR3_COMMON_TREE_ADAPTOR) ANTLR3_MALLOC((size_t)(sizeof(ANTLR3_COMMON_TREE_ADAPTOR))); - - if (cta == NULL) - { - return NULL; - } - - // Memory is initialized, so initialize the base tree adaptor - // - antlr3BaseTreeAdaptorInit(&(cta->baseAdaptor), NULL); - - // Install our interface overrides. Strangeness is to allow generated code to treat them - // as returning void * - // - cta->baseAdaptor.dupNode = (void * (*) (pANTLR3_BASE_TREE_ADAPTOR, void *)) - dupNode; - cta->baseAdaptor.create = (void * (*) (pANTLR3_BASE_TREE_ADAPTOR, pANTLR3_COMMON_TOKEN)) - create; - cta->baseAdaptor.createToken = - createToken; - cta->baseAdaptor.createTokenFromToken = - createTokenFromToken; - cta->baseAdaptor.setTokenBoundaries = (void (*) (pANTLR3_BASE_TREE_ADAPTOR, void *, pANTLR3_COMMON_TOKEN, pANTLR3_COMMON_TOKEN)) - setTokenBoundaries; - cta->baseAdaptor.getTokenStartIndex = (ANTLR3_MARKER (*) (pANTLR3_BASE_TREE_ADAPTOR, void *)) - getTokenStartIndex; - cta->baseAdaptor.getTokenStopIndex = (ANTLR3_MARKER (*) (pANTLR3_BASE_TREE_ADAPTOR, void *)) - getTokenStopIndex; - cta->baseAdaptor.getText = (pANTLR3_STRING (*) (pANTLR3_BASE_TREE_ADAPTOR, void *)) - getText; - cta->baseAdaptor.getType = (ANTLR3_UINT32 (*) (pANTLR3_BASE_TREE_ADAPTOR, void *)) - getType; - cta->baseAdaptor.getChild = (void * (*) (pANTLR3_BASE_TREE_ADAPTOR, void *, ANTLR3_UINT32)) - getChild; - cta->baseAdaptor.setChild = (void (*) (pANTLR3_BASE_TREE_ADAPTOR, void *, ANTLR3_UINT32, void *)) - setChild; - cta->baseAdaptor.setParent = (void (*) (pANTLR3_BASE_TREE_ADAPTOR, void *, void *)) - setParent; - cta->baseAdaptor.getParent = (void * (*) (pANTLR3_BASE_TREE_ADAPTOR, void *)) - getParent; - cta->baseAdaptor.setChildIndex = (void (*) (pANTLR3_BASE_TREE_ADAPTOR, void *, ANTLR3_UINT32)) - setChildIndex; - cta->baseAdaptor.deleteChild = (void (*) (pANTLR3_BASE_TREE_ADAPTOR, void *, ANTLR3_UINT32)) - deleteChild; - cta->baseAdaptor.getChildCount = (ANTLR3_UINT32 (*) (pANTLR3_BASE_TREE_ADAPTOR, void *)) - getChildCount; - cta->baseAdaptor.getChildIndex = (ANTLR3_INT32 (*) (pANTLR3_BASE_TREE_ADAPTOR, void *)) - getChildIndex; - cta->baseAdaptor.free = (void (*) (pANTLR3_BASE_TREE_ADAPTOR)) - ctaFree; - cta->baseAdaptor.setDebugEventListener = - setDebugEventListener; - cta->baseAdaptor.replaceChildren = (void (*) (pANTLR3_BASE_TREE_ADAPTOR, void *, ANTLR3_INT32, ANTLR3_INT32, void *)) - replaceChildren; - cta->baseAdaptor.errorNode = (void * (*) (pANTLR3_BASE_TREE_ADAPTOR, pANTLR3_TOKEN_STREAM, pANTLR3_COMMON_TOKEN, pANTLR3_COMMON_TOKEN, pANTLR3_EXCEPTION)) - errorNode; - - // Install the super class pointer - // - cta->baseAdaptor.super = cta; - - // Install a tree factory for creating new tree nodes - // - cta->arboretum = antlr3ArboretumNew(strFactory); - - // Install a token factory for imaginary tokens, these imaginary - // tokens do not require access to the input stream so we can - // dummy the creation of it, but they will need a string factory. - // - cta->baseAdaptor.tokenFactory = antlr3TokenFactoryNew(NULL); - cta->baseAdaptor.tokenFactory->unTruc.strFactory = strFactory; - - // Allow the base tree adaptor to share the tree factory's string factory. - // - cta->baseAdaptor.strFactory = strFactory; - - // Return the address of the base adaptor interface. - // - return &(cta->baseAdaptor); -} - -/// Debugging version of the tree adaptor (not normally called as generated code -/// calls setDebugEventListener instead which changes a normal token stream to -/// a debugging stream and means that a user's instantiation code does not need -/// to be changed just to debug with AW. -/// -ANTLR3_API pANTLR3_BASE_TREE_ADAPTOR -ANTLR3_TREE_ADAPTORDebugNew(pANTLR3_STRING_FACTORY strFactory, pANTLR3_DEBUG_EVENT_LISTENER debugger) -{ - pANTLR3_BASE_TREE_ADAPTOR ta; - - // Create a normal one first - // - ta = ANTLR3_TREE_ADAPTORNew(strFactory); - - if (ta != NULL) - { - // Reinitialize as a debug version - // - antlr3BaseTreeAdaptorInit(ta, debugger); - ta->create = (void * (*) (pANTLR3_BASE_TREE_ADAPTOR, pANTLR3_COMMON_TOKEN)) - dbgCreate; - ta->setTokenBoundaries = (void (*) (pANTLR3_BASE_TREE_ADAPTOR, void *, pANTLR3_COMMON_TOKEN, pANTLR3_COMMON_TOKEN)) - dbgSetTokenBoundaries; - } - - return ta; -} - -/// Causes an existing common tree adaptor to become a debug version -/// -static void -setDebugEventListener (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_DEBUG_EVENT_LISTENER debugger) -{ - // Reinitialize as a debug version - // - antlr3BaseTreeAdaptorInit(adaptor, debugger); - - adaptor->create = (void * (*) (pANTLR3_BASE_TREE_ADAPTOR, pANTLR3_COMMON_TOKEN)) - dbgCreate; - adaptor->setTokenBoundaries = (void (*) (pANTLR3_BASE_TREE_ADAPTOR, void *, pANTLR3_COMMON_TOKEN, pANTLR3_COMMON_TOKEN)) - dbgSetTokenBoundaries; - -} - -static void -ctaFree(pANTLR3_BASE_TREE_ADAPTOR adaptor) -{ - pANTLR3_COMMON_TREE_ADAPTOR cta; - - cta = (pANTLR3_COMMON_TREE_ADAPTOR)(adaptor->super); - - /* Free the tree factory we created - */ - cta->arboretum->close(((pANTLR3_COMMON_TREE_ADAPTOR)(adaptor->super))->arboretum); - - /* Free the token factory we created - */ - adaptor->tokenFactory->close(adaptor->tokenFactory); - - /* Free the super pointer, as it is this that was allocated - * and is the common tree structure. - */ - ANTLR3_FREE(adaptor->super); -} - -/* BASE_TREE_ADAPTOR overrides */ - -static pANTLR3_BASE_TREE -errorNode (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_TOKEN_STREAM ctnstream, pANTLR3_COMMON_TOKEN startToken, pANTLR3_COMMON_TOKEN stopToken, pANTLR3_EXCEPTION e) -{ - // Use the supplied common tree node stream to get another tree from the factory - // TODO: Look at creating the erronode as in Java, but this is complicated by the - // need to track and free the memory allocated to it, so for now, we just - // want something in the tree that isn't a NULL pointer. - // - return adaptor->createTypeText(adaptor, ANTLR3_TOKEN_INVALID, (pANTLR3_UINT8)"Tree Error Node"); - -} - -/** Duplicate the supplied node. - */ -static pANTLR3_BASE_TREE -dupNode (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE treeNode) -{ - return treeNode == NULL ? NULL : treeNode->dupNode(treeNode); -} - -static pANTLR3_BASE_TREE -create (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_COMMON_TOKEN payload) -{ - pANTLR3_BASE_TREE ct; - - /* Create a new common tree as this is what this adaptor deals with - */ - ct = ((pANTLR3_COMMON_TREE_ADAPTOR)(adaptor->super))->arboretum->newFromToken(((pANTLR3_COMMON_TREE_ADAPTOR)(adaptor->super))->arboretum, payload); - - /* But all adaptors return the pointer to the base interface. - */ - return ct; -} -static pANTLR3_BASE_TREE -dbgCreate (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_COMMON_TOKEN payload) -{ - pANTLR3_BASE_TREE ct; - - ct = create(adaptor, payload); - adaptor->debugger->createNode(adaptor->debugger, ct); - - return ct; -} - -/** Tell me how to create a token for use with imaginary token nodes. - * For example, there is probably no input symbol associated with imaginary - * token DECL, but you need to create it as a payload or whatever for - * the DECL node as in ^(DECL type ID). - * - * If you care what the token payload objects' type is, you should - * override this method and any other createToken variant. - */ -static pANTLR3_COMMON_TOKEN -createToken (pANTLR3_BASE_TREE_ADAPTOR adaptor, ANTLR3_UINT32 tokenType, pANTLR3_UINT8 text) -{ - pANTLR3_COMMON_TOKEN newToken; - - newToken = adaptor->tokenFactory->newToken(adaptor->tokenFactory); - - if (newToken != NULL) - { - newToken->textState = ANTLR3_TEXT_CHARP; - newToken->tokText.chars = (pANTLR3_UCHAR)text; - newToken->setType(newToken, tokenType); - newToken->input = adaptor->tokenFactory->input; - newToken->strFactory = adaptor->strFactory; - } - return newToken; -} - -/** Tell me how to create a token for use with imaginary token nodes. - * For example, there is probably no input symbol associated with imaginary - * token DECL, but you need to create it as a payload or whatever for - * the DECL node as in ^(DECL type ID). - * - * This is a variant of createToken where the new token is derived from - * an actual real input token. Typically this is for converting '{' - * tokens to BLOCK etc... You'll see - * - * r : lc='{' ID+ '}' -> ^(BLOCK[$lc] ID+) ; - * - * If you care what the token payload objects' type is, you should - * override this method and any other createToken variant. - * - * NB: this being C it is not so easy to extend the types of creaeteToken. - * We will have to see if anyone needs to do this and add any variants to - * this interface. - */ -static pANTLR3_COMMON_TOKEN -createTokenFromToken (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_COMMON_TOKEN fromToken) -{ - pANTLR3_COMMON_TOKEN newToken; - - newToken = adaptor->tokenFactory->newToken(adaptor->tokenFactory); - - if (newToken != NULL) - { - // Create the text using our own string factory to avoid complicating - // commontoken. - // - pANTLR3_STRING text; - - newToken->toString = fromToken->toString; - - if (fromToken->textState == ANTLR3_TEXT_CHARP) - { - newToken->textState = ANTLR3_TEXT_CHARP; - newToken->tokText.chars = fromToken->tokText.chars; - } - else - { - text = fromToken->getText(fromToken); - newToken->textState = ANTLR3_TEXT_STRING; - newToken->tokText.text = adaptor->strFactory->newPtr(adaptor->strFactory, text->chars, text->len); - } - - newToken->setLine (newToken, fromToken->getLine(fromToken)); - newToken->setTokenIndex (newToken, fromToken->getTokenIndex(fromToken)); - newToken->setCharPositionInLine (newToken, fromToken->getCharPositionInLine(fromToken)); - newToken->setChannel (newToken, fromToken->getChannel(fromToken)); - newToken->setType (newToken, fromToken->getType(fromToken)); - } - - return newToken; -} - -/* Specific methods for a TreeAdaptor */ - -/** Track start/stop token for subtree root created for a rule. - * Only works with CommonTree nodes. For rules that match nothing, - * seems like this will yield start=i and stop=i-1 in a nil node. - * Might be useful info so I'll not force to be i..i. - */ -static void -setTokenBoundaries (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE t, pANTLR3_COMMON_TOKEN startToken, pANTLR3_COMMON_TOKEN stopToken) -{ - ANTLR3_MARKER start; - ANTLR3_MARKER stop; - - pANTLR3_COMMON_TREE ct; - - if (t == NULL) - { - return; - } - - if ( startToken != NULL) - { - start = startToken->getTokenIndex(startToken); - } - else - { - start = 0; - } - - if ( stopToken != NULL) - { - stop = stopToken->getTokenIndex(stopToken); - } - else - { - stop = 0; - } - - ct = (pANTLR3_COMMON_TREE)(t->super); - - ct->startIndex = start; - ct->stopIndex = stop; - -} -static void -dbgSetTokenBoundaries (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE t, pANTLR3_COMMON_TOKEN startToken, pANTLR3_COMMON_TOKEN stopToken) -{ - setTokenBoundaries(adaptor, t, startToken, stopToken); - - if (t != NULL && startToken != NULL && stopToken != NULL) - { - adaptor->debugger->setTokenBoundaries(adaptor->debugger, t, startToken->getTokenIndex(startToken), stopToken->getTokenIndex(stopToken)); - } -} - -static ANTLR3_MARKER -getTokenStartIndex (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE t) -{ - return ((pANTLR3_COMMON_TREE)(t->super))->startIndex; -} - -static ANTLR3_MARKER -getTokenStopIndex (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE t) -{ - return ((pANTLR3_COMMON_TREE)(t->super))->stopIndex; -} - -static pANTLR3_STRING -getText (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE t) -{ - return t->getText(t); -} - -static ANTLR3_UINT32 -getType (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE t) -{ - return t->getType(t); -} - -static void -replaceChildren -(pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE parent, ANTLR3_INT32 startChildIndex, ANTLR3_INT32 stopChildIndex, pANTLR3_BASE_TREE t) -{ - if (parent != NULL) - { - parent->replaceChildren(parent, startChildIndex, stopChildIndex, t); - } -} - -static pANTLR3_BASE_TREE -getChild (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE t, ANTLR3_UINT32 i) -{ - return t->getChild(t, i); -} -static void -setChild (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE t, ANTLR3_UINT32 i, pANTLR3_BASE_TREE child) -{ - t->setChild(t, i, child); -} - -static void -deleteChild (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE t, ANTLR3_UINT32 i) -{ - t->deleteChild(t, i); -} - -static ANTLR3_UINT32 -getChildCount (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE t) -{ - return t->getChildCount(t); -} - -static void -setChildIndex (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE t, ANTLR3_INT32 i) -{ - t->setChildIndex(t, i); -} - -static ANTLR3_INT32 -getChildIndex (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE t) -{ - return t->getChildIndex(t); -} -static void -setParent (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE child, pANTLR3_BASE_TREE parent) -{ - child->setParent(child, parent); -} -static pANTLR3_BASE_TREE -getParent (pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_TREE child) -{ - return child->getParent(child); -} diff --git a/impl/antlr/libantlr3c-3.4/src/antlr3commontreenodestream.c b/impl/antlr/libantlr3c-3.4/src/antlr3commontreenodestream.c deleted file mode 100644 index a759d34..0000000 --- a/impl/antlr/libantlr3c-3.4/src/antlr3commontreenodestream.c +++ /dev/null @@ -1,968 +0,0 @@ -/// \file -/// Defines the implementation of the common node stream the default -/// tree node stream used by ANTLR. -/// - -// [The "BSD licence"] -// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC -// http://www.temporal-wave.com -// http://www.linkedin.com/in/jimidle -// -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions -// are met: -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// 3. The name of the author may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include - -#ifdef ANTLR3_WINDOWS -#pragma warning( disable : 4100 ) -#endif - -// COMMON TREE STREAM API -// -static void addNavigationNode (pANTLR3_COMMON_TREE_NODE_STREAM ctns, ANTLR3_UINT32 ttype); -static ANTLR3_BOOLEAN hasUniqueNavigationNodes (pANTLR3_COMMON_TREE_NODE_STREAM ctns); -static pANTLR3_BASE_TREE newDownNode (pANTLR3_COMMON_TREE_NODE_STREAM ctns); -static pANTLR3_BASE_TREE newUpNode (pANTLR3_COMMON_TREE_NODE_STREAM ctns); -static void reset (pANTLR3_COMMON_TREE_NODE_STREAM ctns); -static void push (pANTLR3_COMMON_TREE_NODE_STREAM ctns, ANTLR3_INT32 index); -static ANTLR3_INT32 pop (pANTLR3_COMMON_TREE_NODE_STREAM ctns); -//static ANTLR3_INT32 index (pANTLR3_COMMON_TREE_NODE_STREAM ctns); -static ANTLR3_UINT32 getLookaheadSize (pANTLR3_COMMON_TREE_NODE_STREAM ctns); -// TREE NODE STREAM API -// -static pANTLR3_BASE_TREE_ADAPTOR getTreeAdaptor (pANTLR3_TREE_NODE_STREAM tns); -static pANTLR3_BASE_TREE getTreeSource (pANTLR3_TREE_NODE_STREAM tns); -static pANTLR3_BASE_TREE _LT (pANTLR3_TREE_NODE_STREAM tns, ANTLR3_INT32 k); -static pANTLR3_BASE_TREE get (pANTLR3_TREE_NODE_STREAM tns, ANTLR3_INT32 k); -static void setUniqueNavigationNodes (pANTLR3_TREE_NODE_STREAM tns, ANTLR3_BOOLEAN uniqueNavigationNodes); -static pANTLR3_STRING toString (pANTLR3_TREE_NODE_STREAM tns); -static pANTLR3_STRING toStringSS (pANTLR3_TREE_NODE_STREAM tns, pANTLR3_BASE_TREE start, pANTLR3_BASE_TREE stop); -static void toStringWork (pANTLR3_TREE_NODE_STREAM tns, pANTLR3_BASE_TREE start, pANTLR3_BASE_TREE stop, pANTLR3_STRING buf); -static void replaceChildren (pANTLR3_TREE_NODE_STREAM tns, pANTLR3_BASE_TREE parent, ANTLR3_INT32 startChildIndex, ANTLR3_INT32 stopChildIndex, pANTLR3_BASE_TREE t); - -// INT STREAM API -// -static void consume (pANTLR3_INT_STREAM is); -static ANTLR3_MARKER tindex (pANTLR3_INT_STREAM is); -static ANTLR3_UINT32 _LA (pANTLR3_INT_STREAM is, ANTLR3_INT32 i); -static ANTLR3_MARKER mark (pANTLR3_INT_STREAM is); -static void release (pANTLR3_INT_STREAM is, ANTLR3_MARKER marker); -static void rewindMark (pANTLR3_INT_STREAM is, ANTLR3_MARKER marker); -static void rewindLast (pANTLR3_INT_STREAM is); -static void seek (pANTLR3_INT_STREAM is, ANTLR3_MARKER index); -static ANTLR3_UINT32 size (pANTLR3_INT_STREAM is); - - -// Helper functions -// -static void fillBuffer (pANTLR3_COMMON_TREE_NODE_STREAM ctns, pANTLR3_BASE_TREE t); -static void fillBufferRoot (pANTLR3_COMMON_TREE_NODE_STREAM ctns); - -// Constructors -// -static void antlr3TreeNodeStreamFree (pANTLR3_TREE_NODE_STREAM tns); -static void antlr3CommonTreeNodeStreamFree (pANTLR3_COMMON_TREE_NODE_STREAM ctns); - -ANTLR3_API pANTLR3_TREE_NODE_STREAM -antlr3TreeNodeStreamNew() -{ - pANTLR3_TREE_NODE_STREAM stream; - - // Memory for the interface structure - // - stream = (pANTLR3_TREE_NODE_STREAM) ANTLR3_CALLOC(1, sizeof(ANTLR3_TREE_NODE_STREAM)); - - if (stream == NULL) - { - return NULL; - } - - // Install basic API - // - stream->replaceChildren = replaceChildren; - stream->free = antlr3TreeNodeStreamFree; - - return stream; -} - -static void -antlr3TreeNodeStreamFree(pANTLR3_TREE_NODE_STREAM stream) -{ - ANTLR3_FREE(stream); -} - -ANTLR3_API pANTLR3_COMMON_TREE_NODE_STREAM -antlr3CommonTreeNodeStreamNewTree(pANTLR3_BASE_TREE tree, ANTLR3_UINT32 hint) -{ - pANTLR3_COMMON_TREE_NODE_STREAM stream; - - stream = antlr3CommonTreeNodeStreamNew(tree->strFactory, hint); - - if (stream == NULL) - { - return NULL; - } - stream->root = tree; - - return stream; -} - -ANTLR3_API pANTLR3_COMMON_TREE_NODE_STREAM -antlr3CommonTreeNodeStreamNewStream(pANTLR3_COMMON_TREE_NODE_STREAM inStream) -{ - pANTLR3_COMMON_TREE_NODE_STREAM stream; - - // Memory for the interface structure - // - stream = (pANTLR3_COMMON_TREE_NODE_STREAM) ANTLR3_CALLOC(1, sizeof(ANTLR3_COMMON_TREE_NODE_STREAM)); - - if (stream == NULL) - { - return NULL; - } - - // Copy in all the reusable parts of the originating stream and create new - // pieces where necessary. - // - - // String factory for tree walker - // - stream->stringFactory = inStream->stringFactory; - - // Create an adaptor for the common tree node stream - // - stream->adaptor = inStream->adaptor; - - // Create space for the tree node stream interface - // - stream->tnstream = antlr3TreeNodeStreamNew(); - - if (stream->tnstream == NULL) - { - stream->free (stream); - - return NULL; - } - - // Create space for the INT_STREAM interface - // - stream->tnstream->istream = antlr3IntStreamNew(); - - if (stream->tnstream->istream == NULL) - { - stream->tnstream->free (stream->tnstream); - stream->free (stream); - - return NULL; - } - - // Install the common tree node stream API - // - stream->addNavigationNode = addNavigationNode; - stream->hasUniqueNavigationNodes = hasUniqueNavigationNodes; - stream->newDownNode = newDownNode; - stream->newUpNode = newUpNode; - stream->reset = reset; - stream->push = push; - stream->pop = pop; - stream->getLookaheadSize = getLookaheadSize; - - stream->free = antlr3CommonTreeNodeStreamFree; - - // Install the tree node stream API - // - stream->tnstream->getTreeAdaptor = getTreeAdaptor; - stream->tnstream->getTreeSource = getTreeSource; - stream->tnstream->_LT = _LT; - stream->tnstream->setUniqueNavigationNodes = setUniqueNavigationNodes; - stream->tnstream->toString = toString; - stream->tnstream->toStringSS = toStringSS; - stream->tnstream->toStringWork = toStringWork; - stream->tnstream->get = get; - - // Install INT_STREAM interface - // - stream->tnstream->istream->consume = consume; - stream->tnstream->istream->index = tindex; - stream->tnstream->istream->_LA = _LA; - stream->tnstream->istream->mark = mark; - stream->tnstream->istream->release = release; - stream->tnstream->istream->rewind = rewindMark; - stream->tnstream->istream->rewindLast = rewindLast; - stream->tnstream->istream->seek = seek; - stream->tnstream->istream->size = size; - - // Initialize data elements of INT stream - // - stream->tnstream->istream->type = ANTLR3_COMMONTREENODE; - stream->tnstream->istream->super = (stream->tnstream); - - // Initialize data elements of TREE stream - // - stream->tnstream->ctns = stream; - - // Initialize data elements of the COMMON TREE NODE stream - // - stream->super = NULL; - stream->uniqueNavigationNodes = ANTLR3_FALSE; - stream->markers = NULL; - stream->nodeStack = inStream->nodeStack; - - // Create the node list map - // - stream->nodes = antlr3VectorNew(DEFAULT_INITIAL_BUFFER_SIZE); - stream->p = -1; - - // Install the navigation nodes - // - - // Install the navigation nodes - // - antlr3SetCTAPI(&(stream->UP)); - antlr3SetCTAPI(&(stream->DOWN)); - antlr3SetCTAPI(&(stream->EOF_NODE)); - antlr3SetCTAPI(&(stream->INVALID_NODE)); - - stream->UP.token = inStream->UP.token; - inStream->UP.token->strFactory = stream->stringFactory; - stream->DOWN.token = inStream->DOWN.token; - inStream->DOWN.token->strFactory = stream->stringFactory; - stream->EOF_NODE.token = inStream->EOF_NODE.token; - inStream->EOF_NODE.token->strFactory = stream->stringFactory; - stream->INVALID_NODE.token = inStream->INVALID_NODE.token; - inStream->INVALID_NODE.token->strFactory= stream->stringFactory; - - // Reuse the root tree of the originating stream - // - stream->root = inStream->root; - - // Signal that this is a rewriting stream so we don't - // free the originating tree. Anything that we rewrite or - // duplicate here will be done through the adaptor or - // the original tree factory. - // - stream->isRewriter = ANTLR3_TRUE; - return stream; -} - -ANTLR3_API pANTLR3_COMMON_TREE_NODE_STREAM -antlr3CommonTreeNodeStreamNew(pANTLR3_STRING_FACTORY strFactory, ANTLR3_UINT32 hint) -{ - pANTLR3_COMMON_TREE_NODE_STREAM stream; - pANTLR3_COMMON_TOKEN token; - - // Memory for the interface structure - // - stream = (pANTLR3_COMMON_TREE_NODE_STREAM) ANTLR3_CALLOC(1, sizeof(ANTLR3_COMMON_TREE_NODE_STREAM)); - - if (stream == NULL) - { - return NULL; - } - - // String factory for tree walker - // - stream->stringFactory = strFactory; - - // Create an adaptor for the common tree node stream - // - stream->adaptor = ANTLR3_TREE_ADAPTORNew(strFactory); - - if (stream->adaptor == NULL) - { - stream->free(stream); - return NULL; - } - - // Create space for the tree node stream interface - // - stream->tnstream = antlr3TreeNodeStreamNew(); - - if (stream->tnstream == NULL) - { - stream->adaptor->free (stream->adaptor); - stream->free (stream); - - return NULL; - } - - // Create space for the INT_STREAM interface - // - stream->tnstream->istream = antlr3IntStreamNew(); - - if (stream->tnstream->istream == NULL) - { - stream->adaptor->free (stream->adaptor); - stream->tnstream->free (stream->tnstream); - stream->free (stream); - - return NULL; - } - - // Install the common tree node stream API - // - stream->addNavigationNode = addNavigationNode; - stream->hasUniqueNavigationNodes = hasUniqueNavigationNodes; - stream->newDownNode = newDownNode; - stream->newUpNode = newUpNode; - stream->reset = reset; - stream->push = push; - stream->pop = pop; - - stream->free = antlr3CommonTreeNodeStreamFree; - - // Install the tree node stream API - // - stream->tnstream->getTreeAdaptor = getTreeAdaptor; - stream->tnstream->getTreeSource = getTreeSource; - stream->tnstream->_LT = _LT; - stream->tnstream->setUniqueNavigationNodes = setUniqueNavigationNodes; - stream->tnstream->toString = toString; - stream->tnstream->toStringSS = toStringSS; - stream->tnstream->toStringWork = toStringWork; - stream->tnstream->get = get; - - // Install INT_STREAM interface - // - stream->tnstream->istream->consume = consume; - stream->tnstream->istream->index = tindex; - stream->tnstream->istream->_LA = _LA; - stream->tnstream->istream->mark = mark; - stream->tnstream->istream->release = release; - stream->tnstream->istream->rewind = rewindMark; - stream->tnstream->istream->rewindLast = rewindLast; - stream->tnstream->istream->seek = seek; - stream->tnstream->istream->size = size; - - // Initialize data elements of INT stream - // - stream->tnstream->istream->type = ANTLR3_COMMONTREENODE; - stream->tnstream->istream->super = (stream->tnstream); - - // Initialize data elements of TREE stream - // - stream->tnstream->ctns = stream; - - // Initialize data elements of the COMMON TREE NODE stream - // - stream->super = NULL; - stream->uniqueNavigationNodes = ANTLR3_FALSE; - stream->markers = NULL; - stream->nodeStack = antlr3StackNew(INITIAL_CALL_STACK_SIZE); - - // Create the node list map - // - if (hint == 0) - { - hint = DEFAULT_INITIAL_BUFFER_SIZE; - } - stream->nodes = antlr3VectorNew(hint); - stream->p = -1; - - // Install the navigation nodes - // - antlr3SetCTAPI(&(stream->UP)); - antlr3SetCTAPI(&(stream->DOWN)); - antlr3SetCTAPI(&(stream->EOF_NODE)); - antlr3SetCTAPI(&(stream->INVALID_NODE)); - - token = antlr3CommonTokenNew(ANTLR3_TOKEN_UP); - token->strFactory = strFactory; - token->textState = ANTLR3_TEXT_CHARP; - token->tokText.chars = (pANTLR3_UCHAR)"UP"; - stream->UP.token = token; - - token = antlr3CommonTokenNew(ANTLR3_TOKEN_DOWN); - token->strFactory = strFactory; - token->textState = ANTLR3_TEXT_CHARP; - token->tokText.chars = (pANTLR3_UCHAR)"DOWN"; - stream->DOWN.token = token; - - token = antlr3CommonTokenNew(ANTLR3_TOKEN_EOF); - token->strFactory = strFactory; - token->textState = ANTLR3_TEXT_CHARP; - token->tokText.chars = (pANTLR3_UCHAR)"EOF"; - stream->EOF_NODE.token = token; - - token = antlr3CommonTokenNew(ANTLR3_TOKEN_INVALID); - token->strFactory = strFactory; - token->textState = ANTLR3_TEXT_CHARP; - token->tokText.chars = (pANTLR3_UCHAR)"INVALID"; - stream->INVALID_NODE.token = token; - - - return stream; -} - -/// Free up any resources that belong to this common tree node stream. -/// -static void antlr3CommonTreeNodeStreamFree (pANTLR3_COMMON_TREE_NODE_STREAM ctns) -{ - - // If this is a rewrting stream, then certain resources - // belong to the originating node stream and we do not - // free them here. - // - if (ctns->isRewriter != ANTLR3_TRUE) - { - ctns->adaptor ->free (ctns->adaptor); - - if (ctns->nodeStack != NULL) - { - ctns->nodeStack->free(ctns->nodeStack); - } - - ANTLR3_FREE(ctns->INVALID_NODE.token); - ANTLR3_FREE(ctns->EOF_NODE.token); - ANTLR3_FREE(ctns->DOWN.token); - ANTLR3_FREE(ctns->UP.token); - } - - if (ctns->nodes != NULL) - { - ctns->nodes ->free (ctns->nodes); - } - ctns->tnstream->istream ->free (ctns->tnstream->istream); - ctns->tnstream ->free (ctns->tnstream); - - - ANTLR3_FREE(ctns); -} - -// ------------------------------------------------------------------------------ -// Local helpers -// - -/// Walk and fill the tree node buffer from the root tree -/// -static void -fillBufferRoot(pANTLR3_COMMON_TREE_NODE_STREAM ctns) -{ - // Call the generic buffer routine with the root as the - // argument - // - fillBuffer(ctns, ctns->root); - ctns->p = 0; // Indicate we are at buffer start -} - -/// Walk tree with depth-first-search and fill nodes buffer. -/// Don't add in DOWN, UP nodes if the supplied tree is a list (t is isNilNode) -// such as the root tree is. -/// -static void -fillBuffer(pANTLR3_COMMON_TREE_NODE_STREAM ctns, pANTLR3_BASE_TREE t) -{ - ANTLR3_BOOLEAN nilNode; - ANTLR3_UINT32 nCount; - ANTLR3_UINT32 c; - - nilNode = ctns->adaptor->isNilNode(ctns->adaptor, t); - - // If the supplied node is not a nil (list) node then we - // add in the node itself to the vector - // - if (nilNode == ANTLR3_FALSE) - { - ctns->nodes->add(ctns->nodes, t, NULL); - } - - // Only add a DOWN node if the tree is not a nil tree and - // the tree does have children. - // - nCount = t->getChildCount(t); - - if (nilNode == ANTLR3_FALSE && nCount>0) - { - ctns->addNavigationNode(ctns, ANTLR3_TOKEN_DOWN); - } - - // We always add any children the tree contains, which is - // a recursive call to this function, which will cause similar - // recursion and implement a depth first addition - // - for (c = 0; c < nCount; c++) - { - fillBuffer(ctns, ctns->adaptor->getChild(ctns->adaptor, t, c)); - } - - // If the tree had children and was not a nil (list) node, then we - // we need to add an UP node here to match the DOWN node - // - if (nilNode == ANTLR3_FALSE && nCount > 0) - { - ctns->addNavigationNode(ctns, ANTLR3_TOKEN_UP); - } -} - - -// ------------------------------------------------------------------------------ -// Interface functions -// - -/// Reset the input stream to the start of the input nodes. -/// -static void -reset (pANTLR3_COMMON_TREE_NODE_STREAM ctns) -{ - if (ctns->p != -1) - { - ctns->p = 0; - } - ctns->tnstream->istream->lastMarker = 0; - - - // Free and reset the node stack only if this is not - // a rewriter, which is going to reuse the originating - // node streams node stack - // - if (ctns->isRewriter != ANTLR3_TRUE) - { - if (ctns->nodeStack != NULL) - { - ctns->nodeStack->free(ctns->nodeStack); - ctns->nodeStack = antlr3StackNew(INITIAL_CALL_STACK_SIZE); - } - } -} - - -static pANTLR3_BASE_TREE -LB(pANTLR3_TREE_NODE_STREAM tns, ANTLR3_INT32 k) -{ - if ( k==0) - { - return &(tns->ctns->INVALID_NODE.baseTree); - } - - if ( (tns->ctns->p - k) < 0) - { - return &(tns->ctns->INVALID_NODE.baseTree); - } - - return tns->ctns->nodes->get(tns->ctns->nodes, tns->ctns->p - k); -} - -/// Get tree node at current input pointer + i ahead where i=1 is next node. -/// i<0 indicates nodes in the past. So -1 is previous node and -2 is -/// two nodes ago. LT(0) is undefined. For i>=n, return null. -/// Return null for LT(0) and any index that results in an absolute address -/// that is negative. -/// -/// This is analogous to the _LT() method of the TokenStream, but this -/// returns a tree node instead of a token. Makes code gen identical -/// for both parser and tree grammars. :) -/// -static pANTLR3_BASE_TREE -_LT (pANTLR3_TREE_NODE_STREAM tns, ANTLR3_INT32 k) -{ - if (tns->ctns->p == -1) - { - fillBufferRoot(tns->ctns); - } - - if (k < 0) - { - return LB(tns, -k); - } - else if (k == 0) - { - return &(tns->ctns->INVALID_NODE.baseTree); - } - - // k was a legitimate request, - // - if (( tns->ctns->p + k - 1) >= (ANTLR3_INT32)(tns->ctns->nodes->count)) - { - return &(tns->ctns->EOF_NODE.baseTree); - } - - return tns->ctns->nodes->get(tns->ctns->nodes, tns->ctns->p + k - 1); -} - -/// Where is this stream pulling nodes from? This is not the name, but -/// the object that provides node objects. -/// -static pANTLR3_BASE_TREE -getTreeSource (pANTLR3_TREE_NODE_STREAM tns) -{ - return tns->ctns->root; -} - -/// Consume the next node from the input stream -/// -static void -consume (pANTLR3_INT_STREAM is) -{ - pANTLR3_TREE_NODE_STREAM tns; - pANTLR3_COMMON_TREE_NODE_STREAM ctns; - - tns = (pANTLR3_TREE_NODE_STREAM)(is->super); - ctns = tns->ctns; - - if (ctns->p == -1) - { - fillBufferRoot(ctns); - } - ctns->p++; -} - -static ANTLR3_UINT32 -_LA (pANTLR3_INT_STREAM is, ANTLR3_INT32 i) -{ - pANTLR3_TREE_NODE_STREAM tns; - pANTLR3_BASE_TREE t; - - tns = (pANTLR3_TREE_NODE_STREAM)(is->super); - - // Ask LT for the 'token' at that position - // - t = tns->_LT(tns, i); - - if (t == NULL) - { - return ANTLR3_TOKEN_INVALID; - } - - // Token node was there so return the type of it - // - return t->getType(t); -} - -/// Mark the state of the input stream so that we can come back to it -/// after a syntactic predicate and so on. -/// -static ANTLR3_MARKER -mark (pANTLR3_INT_STREAM is) -{ - pANTLR3_TREE_NODE_STREAM tns; - pANTLR3_COMMON_TREE_NODE_STREAM ctns; - - tns = (pANTLR3_TREE_NODE_STREAM)(is->super); - ctns = tns->ctns; - - if (tns->ctns->p == -1) - { - fillBufferRoot(tns->ctns); - } - - // Return the current mark point - // - ctns->tnstream->istream->lastMarker = ctns->tnstream->istream->index(ctns->tnstream->istream); - - return ctns->tnstream->istream->lastMarker; -} - -static void -release (pANTLR3_INT_STREAM is, ANTLR3_MARKER marker) -{ -} - -/// Rewind the current state of the tree walk to the state it -/// was in when mark() was called and it returned marker. Also, -/// wipe out the lookahead which will force reloading a few nodes -/// but it is better than making a copy of the lookahead buffer -/// upon mark(). -/// -static void -rewindMark (pANTLR3_INT_STREAM is, ANTLR3_MARKER marker) -{ - is->seek(is, marker); -} - -static void -rewindLast (pANTLR3_INT_STREAM is) -{ - is->seek(is, is->lastMarker); -} - -/// consume() ahead until we hit index. Can't just jump ahead--must -/// spit out the navigation nodes. -/// -static void -seek (pANTLR3_INT_STREAM is, ANTLR3_MARKER index) -{ - pANTLR3_TREE_NODE_STREAM tns; - pANTLR3_COMMON_TREE_NODE_STREAM ctns; - - tns = (pANTLR3_TREE_NODE_STREAM)(is->super); - ctns = tns->ctns; - - ctns->p = ANTLR3_UINT32_CAST(index); -} - -static ANTLR3_MARKER -tindex (pANTLR3_INT_STREAM is) -{ - pANTLR3_TREE_NODE_STREAM tns; - pANTLR3_COMMON_TREE_NODE_STREAM ctns; - - tns = (pANTLR3_TREE_NODE_STREAM)(is->super); - ctns = tns->ctns; - - return (ANTLR3_MARKER)(ctns->p); -} - -/// Expensive to compute the size of the whole tree while parsing. -/// This method only returns how much input has been seen so far. So -/// after parsing it returns true size. -/// -static ANTLR3_UINT32 -size (pANTLR3_INT_STREAM is) -{ - pANTLR3_TREE_NODE_STREAM tns; - pANTLR3_COMMON_TREE_NODE_STREAM ctns; - - tns = (pANTLR3_TREE_NODE_STREAM)(is->super); - ctns = tns->ctns; - - if (ctns->p == -1) - { - fillBufferRoot(ctns); - } - - return ctns->nodes->size(ctns->nodes); -} - -/// As we flatten the tree, we use UP, DOWN nodes to represent -/// the tree structure. When debugging we need unique nodes -/// so instantiate new ones when uniqueNavigationNodes is true. -/// -static void -addNavigationNode (pANTLR3_COMMON_TREE_NODE_STREAM ctns, ANTLR3_UINT32 ttype) -{ - pANTLR3_BASE_TREE node; - - node = NULL; - - if (ttype == ANTLR3_TOKEN_DOWN) - { - if (ctns->hasUniqueNavigationNodes(ctns) == ANTLR3_TRUE) - { - node = ctns->newDownNode(ctns); - } - else - { - node = &(ctns->DOWN.baseTree); - } - } - else - { - if (ctns->hasUniqueNavigationNodes(ctns) == ANTLR3_TRUE) - { - node = ctns->newUpNode(ctns); - } - else - { - node = &(ctns->UP.baseTree); - } - } - - // Now add the node we decided upon. - // - ctns->nodes->add(ctns->nodes, node, NULL); -} - - -static pANTLR3_BASE_TREE_ADAPTOR -getTreeAdaptor (pANTLR3_TREE_NODE_STREAM tns) -{ - return tns->ctns->adaptor; -} - -static ANTLR3_BOOLEAN -hasUniqueNavigationNodes (pANTLR3_COMMON_TREE_NODE_STREAM ctns) -{ - return ctns->uniqueNavigationNodes; -} - -static void -setUniqueNavigationNodes (pANTLR3_TREE_NODE_STREAM tns, ANTLR3_BOOLEAN uniqueNavigationNodes) -{ - tns->ctns->uniqueNavigationNodes = uniqueNavigationNodes; -} - - -/// Print out the entire tree including DOWN/UP nodes. Uses -/// a recursive walk. Mostly useful for testing as it yields -/// the token types not text. -/// -static pANTLR3_STRING -toString (pANTLR3_TREE_NODE_STREAM tns) -{ - - return tns->toStringSS(tns, tns->ctns->root, NULL); -} - -static pANTLR3_STRING -toStringSS (pANTLR3_TREE_NODE_STREAM tns, pANTLR3_BASE_TREE start, pANTLR3_BASE_TREE stop) -{ - pANTLR3_STRING buf; - - buf = tns->ctns->stringFactory->newRaw(tns->ctns->stringFactory); - - tns->toStringWork(tns, start, stop, buf); - - return buf; -} - -static void -toStringWork (pANTLR3_TREE_NODE_STREAM tns, pANTLR3_BASE_TREE p, pANTLR3_BASE_TREE stop, pANTLR3_STRING buf) -{ - - ANTLR3_UINT32 n; - ANTLR3_UINT32 c; - - if (!p->isNilNode(p) ) - { - pANTLR3_STRING text; - - text = p->toString(p); - - if (text == NULL) - { - text = tns->ctns->stringFactory->newRaw(tns->ctns->stringFactory); - - text->addc (text, ' '); - text->addi (text, p->getType(p)); - } - - buf->appendS(buf, text); - } - - if (p == stop) - { - return; /* Finished */ - } - - n = p->getChildCount(p); - - if (n > 0 && ! p->isNilNode(p) ) - { - buf->addc (buf, ' '); - buf->addi (buf, ANTLR3_TOKEN_DOWN); - } - - for (c = 0; cgetChild(p, c); - tns->toStringWork(tns, child, stop, buf); - } - - if (n > 0 && ! p->isNilNode(p) ) - { - buf->addc (buf, ' '); - buf->addi (buf, ANTLR3_TOKEN_UP); - } -} - -static ANTLR3_UINT32 -getLookaheadSize (pANTLR3_COMMON_TREE_NODE_STREAM ctns) -{ - return ctns->tail < ctns->head - ? (ctns->lookAheadLength - ctns->head + ctns->tail) - : (ctns->tail - ctns->head); -} - -static pANTLR3_BASE_TREE -newDownNode (pANTLR3_COMMON_TREE_NODE_STREAM ctns) -{ - pANTLR3_COMMON_TREE dNode; - pANTLR3_COMMON_TOKEN token; - - token = antlr3CommonTokenNew(ANTLR3_TOKEN_DOWN); - token->textState = ANTLR3_TEXT_CHARP; - token->tokText.chars = (pANTLR3_UCHAR)"DOWN"; - dNode = antlr3CommonTreeNewFromToken(token); - - return &(dNode->baseTree); -} - -static pANTLR3_BASE_TREE -newUpNode (pANTLR3_COMMON_TREE_NODE_STREAM ctns) -{ - pANTLR3_COMMON_TREE uNode; - pANTLR3_COMMON_TOKEN token; - - token = antlr3CommonTokenNew(ANTLR3_TOKEN_UP); - token->textState = ANTLR3_TEXT_CHARP; - token->tokText.chars = (pANTLR3_UCHAR)"UP"; - uNode = antlr3CommonTreeNewFromToken(token); - - return &(uNode->baseTree); -} - -/// Replace from start to stop child index of parent with t, which might -/// be a list. Number of children may be different -/// after this call. The stream is notified because it is walking the -/// tree and might need to know you are monkey-ing with the underlying -/// tree. Also, it might be able to modify the node stream to avoid -/// re-streaming for future phases. -/// -/// If parent is null, don't do anything; must be at root of overall tree. -/// Can't replace whatever points to the parent externally. Do nothing. -/// -static void -replaceChildren (pANTLR3_TREE_NODE_STREAM tns, pANTLR3_BASE_TREE parent, ANTLR3_INT32 startChildIndex, ANTLR3_INT32 stopChildIndex, pANTLR3_BASE_TREE t) -{ - if (parent != NULL) - { - pANTLR3_BASE_TREE_ADAPTOR adaptor; - pANTLR3_COMMON_TREE_ADAPTOR cta; - - adaptor = tns->getTreeAdaptor(tns); - cta = (pANTLR3_COMMON_TREE_ADAPTOR)(adaptor->super); - - adaptor->replaceChildren(adaptor, parent, startChildIndex, stopChildIndex, t); - } -} - -static pANTLR3_BASE_TREE -get (pANTLR3_TREE_NODE_STREAM tns, ANTLR3_INT32 k) -{ - if (tns->ctns->p == -1) - { - fillBufferRoot(tns->ctns); - } - - return tns->ctns->nodes->get(tns->ctns->nodes, k); -} - -static void -push (pANTLR3_COMMON_TREE_NODE_STREAM ctns, ANTLR3_INT32 index) -{ - ctns->nodeStack->push(ctns->nodeStack, ANTLR3_FUNC_PTR(ctns->p), NULL); // Save current index - ctns->tnstream->istream->seek(ctns->tnstream->istream, index); -} - -static ANTLR3_INT32 -pop (pANTLR3_COMMON_TREE_NODE_STREAM ctns) -{ - ANTLR3_INT32 retVal; - - retVal = ANTLR3_UINT32_CAST(ctns->nodeStack->pop(ctns->nodeStack)); - ctns->tnstream->istream->seek(ctns->tnstream->istream, retVal); - return retVal; -} diff --git a/impl/antlr/libantlr3c-3.4/src/antlr3convertutf.c b/impl/antlr/libantlr3c-3.4/src/antlr3convertutf.c deleted file mode 100644 index 7c2f060..0000000 --- a/impl/antlr/libantlr3c-3.4/src/antlr3convertutf.c +++ /dev/null @@ -1,532 +0,0 @@ -/* - * Copyright 2001-2004 Unicode, Inc. - * - * Disclaimer - * - * This source code is provided as is by Unicode, Inc. No claims are - * made as to fitness for any particular purpose. No warranties of any - * kind are expressed or implied. The recipient agrees to determine - * applicability of information provided. If this file has been - * purchased on magnetic or optical media from Unicode, Inc., the - * sole remedy for any claim will be exchange of defective media - * within 90 days of receipt. - * - * Limitations on Rights to Redistribute This Code - * - * Unicode, Inc. hereby grants the right to freely use the information - * supplied in this file in the creation of products supporting the - * Unicode Standard, and to make copies of this file in any form - * for internal or external distribution as long as this notice - * remains attached. - */ - -/* --------------------------------------------------------------------- - - Conversions between UTF32, UTF-16, and UTF-8. Source code file. - Author: Mark E. Davis, 1994. - Rev History: Rick McGowan, fixes & updates May 2001. - Sept 2001: fixed const & error conditions per - mods suggested by S. Parent & A. Lillich. - June 2002: Tim Dodd added detection and handling of incomplete - source sequences, enhanced error detection, added casts - to eliminate compiler warnings. - July 2003: slight mods to back out aggressive FFFE detection. - Jan 2004: updated switches in from-UTF8 conversions. - Oct 2004: updated to use UNI_MAX_LEGAL_UTF32 in UTF-32 conversions. - - See the header file "ConvertUTF.h" for complete documentation. - ------------------------------------------------------------------------- */ - - -#include "antlr3convertutf.h" - -#ifdef CVTUTF_DEBUG -#include -#endif - - - -/* --------------------------------------------------------------------- */ - -ConversionResult ConvertUTF32toUTF16 ( - const UTF32** sourceStart, const UTF32* sourceEnd, - UTF16** targetStart, UTF16* targetEnd, ConversionFlags flags) { - ConversionResult result = conversionOK; - const UTF32* source = *sourceStart; - UTF16* target = *targetStart; - while (source < sourceEnd) { - UTF32 ch; - if (target >= targetEnd) { - result = targetExhausted; break; - } - ch = *source++; - if (ch <= UNI_MAX_BMP) { /* Target is a character <= 0xFFFF */ - /* UTF-16 surrogate values are illegal in UTF-32; 0xffff or 0xfffe are both reserved values */ - if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_LOW_END) { - if (flags == strictConversion) { - --source; /* return to the illegal value itself */ - result = sourceIllegal; - break; - } else { - *target++ = UNI_REPLACEMENT_CHAR; - } - } else { - *target++ = (UTF16)ch; /* normal case */ - } - } else if (ch > UNI_MAX_LEGAL_UTF32) { - if (flags == strictConversion) { - result = sourceIllegal; - } else { - *target++ = UNI_REPLACEMENT_CHAR; - } - } else { - /* target is a character in range 0xFFFF - 0x10FFFF. */ - if (target + 1 >= targetEnd) { - --source; /* Back up source pointer! */ - result = targetExhausted; break; - } - ch -= halfBase; - *target++ = (UTF16)((ch >> halfShift) + UNI_SUR_HIGH_START); - *target++ = (UTF16)((ch & halfMask) + UNI_SUR_LOW_START); - } - } - *sourceStart = source; - *targetStart = target; - return result; -} - -/* --------------------------------------------------------------------- */ - -ConversionResult ConvertUTF16toUTF32 ( - const UTF16** sourceStart, const UTF16* sourceEnd, - UTF32** targetStart, UTF32* targetEnd, ConversionFlags flags) { - ConversionResult result = conversionOK; - const UTF16* source = *sourceStart; - UTF32* target = *targetStart; - UTF32 ch, ch2; - while (source < sourceEnd) { - const UTF16* oldSource = source; /* In case we have to back up because of target overflow. */ - ch = *source++; - /* If we have a surrogate pair, convert to UTF32 first. */ - if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_HIGH_END) { - /* If the 16 bits following the high surrogate are in the source buffer... */ - if (source < sourceEnd) { - ch2 = *source; - /* If it's a low surrogate, convert to UTF32. */ - if (ch2 >= UNI_SUR_LOW_START && ch2 <= UNI_SUR_LOW_END) { - ch = ((ch - UNI_SUR_HIGH_START) << halfShift) - + (ch2 - UNI_SUR_LOW_START) + halfBase; - ++source; - } else if (flags == strictConversion) { /* it's an unpaired high surrogate */ - --source; /* return to the illegal value itself */ - result = sourceIllegal; - break; - } - } else { /* We don't have the 16 bits following the high surrogate. */ - --source; /* return to the high surrogate */ - result = sourceExhausted; - break; - } - } else if (flags == strictConversion) { - /* UTF-16 surrogate values are illegal in UTF-32 */ - if (ch >= UNI_SUR_LOW_START && ch <= UNI_SUR_LOW_END) { - --source; /* return to the illegal value itself */ - result = sourceIllegal; - break; - } - } - if (target >= targetEnd) { - source = oldSource; /* Back up source pointer! */ - result = targetExhausted; break; - } - *target++ = ch; - } - *sourceStart = source; - *targetStart = target; -#ifdef CVTUTF_DEBUG -if (result == sourceIllegal) { - ANTLR3_FPRINTF(stderr, "ConvertUTF16toUTF32 illegal seq 0x%04x,%04x\n", ch, ch2); - fflush(stderr); -} -#endif - return result; -} - -/* --------------------------------------------------------------------- */ - -/* - * Index into the table below with the first byte of a UTF-8 sequence to - * get the number of trailing bytes that are supposed to follow it. - * Note that *legal* UTF-8 values can't have 4 or 5-bytes. The table is - * left as-is for anyone who may want to do such conversion, which was - * allowed in earlier algorithms. - */ -static const char trailingBytesForUTF8[256] = { - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, - 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, 3,3,3,3,3,3,3,3,4,4,4,4,5,5,5,5 -}; - -/* - * Magic values subtracted from a buffer value during UTF8 conversion. - * This table contains as many values as there might be trailing bytes - * in a UTF-8 sequence. - */ -static const UTF32 offsetsFromUTF8[6] = { 0x00000000UL, 0x00003080UL, 0x000E2080UL, - 0x03C82080UL, 0xFA082080UL, 0x82082080UL }; - -/* - * Once the bits are split out into bytes of UTF-8, this is a mask OR-ed - * into the first byte, depending on how many bytes follow. There are - * as many entries in this table as there are UTF-8 sequence types. - * (I.e., one byte sequence, two byte... etc.). Remember that sequencs - * for *legal* UTF-8 will be 4 or fewer bytes total. - */ -static const UTF8 firstByteMark[7] = { 0x00, 0x00, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC }; - -/* --------------------------------------------------------------------- */ - -/* The interface converts a whole buffer to avoid function-call overhead. - * Constants have been gathered. Loops & conditionals have been removed as - * much as possible for efficiency, in favor of drop-through switches. - * (See "Note A" at the bottom of the file for equivalent code.) - * If your compiler supports it, the "isLegalUTF8" call can be turned - * into an inline function. - */ - -/* --------------------------------------------------------------------- */ - -ConversionResult ConvertUTF16toUTF8 ( - const UTF16** sourceStart, const UTF16* sourceEnd, - UTF8** targetStart, UTF8* targetEnd, ConversionFlags flags) { - ConversionResult result = conversionOK; - const UTF16* source = *sourceStart; - UTF8* target = *targetStart; - while (source < sourceEnd) { - UTF32 ch; - unsigned short bytesToWrite = 0; - const UTF32 byteMask = 0xBF; - const UTF32 byteMark = 0x80; - const UTF16* oldSource = source; /* In case we have to back up because of target overflow. */ - ch = *source++; - /* If we have a surrogate pair, convert to UTF32 first. */ - if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_HIGH_END) { - /* If the 16 bits following the high surrogate are in the source buffer... */ - if (source < sourceEnd) { - UTF32 ch2 = *source; - /* If it's a low surrogate, convert to UTF32. */ - if (ch2 >= UNI_SUR_LOW_START && ch2 <= UNI_SUR_LOW_END) { - ch = ((ch - UNI_SUR_HIGH_START) << halfShift) - + (ch2 - UNI_SUR_LOW_START) + halfBase; - ++source; - } else if (flags == strictConversion) { /* it's an unpaired high surrogate */ - --source; /* return to the illegal value itself */ - result = sourceIllegal; - break; - } - } else { /* We don't have the 16 bits following the high surrogate. */ - --source; /* return to the high surrogate */ - result = sourceExhausted; - break; - } - } else if (flags == strictConversion) { - /* UTF-16 surrogate values are illegal in UTF-32 */ - if (ch >= UNI_SUR_LOW_START && ch <= UNI_SUR_LOW_END) { - --source; /* return to the illegal value itself */ - result = sourceIllegal; - break; - } - } - /* Figure out how many bytes the result will require */ - if (ch < (UTF32)0x80) { bytesToWrite = 1; - } else if (ch < (UTF32)0x800) { bytesToWrite = 2; - } else if (ch < (UTF32)0x10000) { bytesToWrite = 3; - } else if (ch < (UTF32)0x110000) { bytesToWrite = 4; - } else { bytesToWrite = 3; - ch = UNI_REPLACEMENT_CHAR; - } - - target += bytesToWrite; - if (target > targetEnd) { - source = oldSource; /* Back up source pointer! */ - target -= bytesToWrite; result = targetExhausted; break; - } - switch (bytesToWrite) { /* note: everything falls through. */ - case 4: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6; - case 3: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6; - case 2: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6; - case 1: *--target = (UTF8)(ch | firstByteMark[bytesToWrite]); - } - target += bytesToWrite; - } - *sourceStart = source; - *targetStart = target; - return result; -} - -/* --------------------------------------------------------------------- */ - -/* - * Utility routine to tell whether a sequence of bytes is legal UTF-8. - * This must be called with the length pre-determined by the first byte. - * If not calling this from ConvertUTF8to*, then the length can be set by: - * length = trailingBytesForUTF8[*source]+1; - * and the sequence is illegal right away if there aren't that many bytes - * available. - * If presented with a length > 4, this returns false. The Unicode - * definition of UTF-8 goes up to 4-byte sequences. - */ - -static ANTLR3_BOOLEAN -isLegalUTF8(const UTF8 *source, int length) { - UTF8 a; - const UTF8 *srcptr = source+length; - switch (length) { - default: return false; - /* Everything else falls through when "true"... */ - case 4: if ((a = (*--srcptr)) < 0x80 || a > 0xBF) return false; - case 3: if ((a = (*--srcptr)) < 0x80 || a > 0xBF) return false; - case 2: if ((a = (*--srcptr)) > 0xBF) return false; - - switch (*source) { - /* no fall-through in this inner switch */ - case 0xE0: if (a < 0xA0) return false; break; - case 0xED: if (a > 0x9F) return false; break; - case 0xF0: if (a < 0x90) return false; break; - case 0xF4: if (a > 0x8F) return false; break; - default: if (a < 0x80) return false; - } - - case 1: if (*source >= 0x80 && *source < 0xC2) return false; - } - if (*source > 0xF4) return false; - return true; -} - -/* --------------------------------------------------------------------- */ - -/* - * Exported function to return whether a UTF-8 sequence is legal or not. - * This is not used here; it's just exported. - */ -ANTLR3_BOOLEAN -isLegalUTF8Sequence(const UTF8 *source, const UTF8 *sourceEnd) { - int length = trailingBytesForUTF8[*source]+1; - if (source+length > sourceEnd) { - return false; - } - return isLegalUTF8(source, length); -} - -/* --------------------------------------------------------------------- */ - -ConversionResult ConvertUTF8toUTF16 ( - const UTF8** sourceStart, const UTF8* sourceEnd, - UTF16** targetStart, UTF16* targetEnd, ConversionFlags flags) { - ConversionResult result = conversionOK; - const UTF8* source = *sourceStart; - UTF16* target = *targetStart; - while (source < sourceEnd) { - UTF32 ch = 0; - unsigned short extraBytesToRead = trailingBytesForUTF8[*source]; - if (source + extraBytesToRead >= sourceEnd) { - result = sourceExhausted; break; - } - /* Do this check whether lenient or strict */ - if (! isLegalUTF8(source, extraBytesToRead+1)) { - result = sourceIllegal; - break; - } - /* - * The cases all fall through. See "Note A" below. - */ - switch (extraBytesToRead) { - case 5: ch += *source++; ch <<= 6; /* remember, illegal UTF-8 */ - case 4: ch += *source++; ch <<= 6; /* remember, illegal UTF-8 */ - case 3: ch += *source++; ch <<= 6; - case 2: ch += *source++; ch <<= 6; - case 1: ch += *source++; ch <<= 6; - case 0: ch += *source++; - } - ch -= offsetsFromUTF8[extraBytesToRead]; - - if (target >= targetEnd) { - source -= (extraBytesToRead+1); /* Back up source pointer! */ - result = targetExhausted; break; - } - if (ch <= UNI_MAX_BMP) { /* Target is a character <= 0xFFFF */ - /* UTF-16 surrogate values are illegal in UTF-32 */ - if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_LOW_END) { - if (flags == strictConversion) { - source -= (extraBytesToRead+1); /* return to the illegal value itself */ - result = sourceIllegal; - break; - } else { - *target++ = UNI_REPLACEMENT_CHAR; - } - } else { - *target++ = (UTF16)ch; /* normal case */ - } - } else if (ch > UNI_MAX_UTF16) { - if (flags == strictConversion) { - result = sourceIllegal; - source -= (extraBytesToRead+1); /* return to the start */ - break; /* Bail out; shouldn't continue */ - } else { - *target++ = UNI_REPLACEMENT_CHAR; - } - } else { - /* target is a character in range 0xFFFF - 0x10FFFF. */ - if (target + 1 >= targetEnd) { - source -= (extraBytesToRead+1); /* Back up source pointer! */ - result = targetExhausted; break; - } - ch -= halfBase; - *target++ = (UTF16)((ch >> halfShift) + UNI_SUR_HIGH_START); - *target++ = (UTF16)((ch & halfMask) + UNI_SUR_LOW_START); - } - } - *sourceStart = source; - *targetStart = target; - return result; -} - -/* --------------------------------------------------------------------- */ - -ConversionResult ConvertUTF32toUTF8 ( - const UTF32** sourceStart, const UTF32* sourceEnd, - UTF8** targetStart, UTF8* targetEnd, ConversionFlags flags) { - ConversionResult result = conversionOK; - const UTF32* source = *sourceStart; - UTF8* target = *targetStart; - while (source < sourceEnd) { - UTF32 ch; - unsigned short bytesToWrite = 0; - const UTF32 byteMask = 0xBF; - const UTF32 byteMark = 0x80; - ch = *source++; - if (flags == strictConversion ) { - /* UTF-16 surrogate values are illegal in UTF-32 */ - if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_LOW_END) { - --source; /* return to the illegal value itself */ - result = sourceIllegal; - break; - } - } - /* - * Figure out how many bytes the result will require. Turn any - * illegally large UTF32 things (> Plane 17) into replacement chars. - */ - if (ch < (UTF32)0x80) { bytesToWrite = 1; - } else if (ch < (UTF32)0x800) { bytesToWrite = 2; - } else if (ch < (UTF32)0x10000) { bytesToWrite = 3; - } else if (ch <= UNI_MAX_LEGAL_UTF32) { bytesToWrite = 4; - } else { bytesToWrite = 3; - ch = UNI_REPLACEMENT_CHAR; - result = sourceIllegal; - } - - target += bytesToWrite; - if (target > targetEnd) { - --source; /* Back up source pointer! */ - target -= bytesToWrite; result = targetExhausted; break; - } - switch (bytesToWrite) { /* note: everything falls through. */ - case 4: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6; - case 3: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6; - case 2: *--target = (UTF8)((ch | byteMark) & byteMask); ch >>= 6; - case 1: *--target = (UTF8) (ch | firstByteMark[bytesToWrite]); - } - target += bytesToWrite; - } - *sourceStart = source; - *targetStart = target; - return result; -} - -/* --------------------------------------------------------------------- */ - -ConversionResult ConvertUTF8toUTF32 ( - const UTF8** sourceStart, const UTF8* sourceEnd, - UTF32** targetStart, UTF32* targetEnd, ConversionFlags flags) { - ConversionResult result = conversionOK; - const UTF8* source = *sourceStart; - UTF32* target = *targetStart; - while (source < sourceEnd) { - UTF32 ch = 0; - unsigned short extraBytesToRead = trailingBytesForUTF8[*source]; - if (source + extraBytesToRead >= sourceEnd) { - result = sourceExhausted; break; - } - /* Do this check whether lenient or strict */ - if (! isLegalUTF8(source, extraBytesToRead+1)) { - result = sourceIllegal; - break; - } - /* - * The cases all fall through. See "Note A" below. - */ - switch (extraBytesToRead) { - case 5: ch += *source++; ch <<= 6; - case 4: ch += *source++; ch <<= 6; - case 3: ch += *source++; ch <<= 6; - case 2: ch += *source++; ch <<= 6; - case 1: ch += *source++; ch <<= 6; - case 0: ch += *source++; - } - ch -= offsetsFromUTF8[extraBytesToRead]; - - if (target >= targetEnd) { - source -= (extraBytesToRead+1); /* Back up the source pointer! */ - result = targetExhausted; break; - } - if (ch <= UNI_MAX_LEGAL_UTF32) { - /* - * UTF-16 surrogate values are illegal in UTF-32, and anything - * over Plane 17 (> 0x10FFFF) is illegal. - */ - if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_LOW_END) { - if (flags == strictConversion) { - source -= (extraBytesToRead+1); /* return to the illegal value itself */ - result = sourceIllegal; - break; - } else { - *target++ = UNI_REPLACEMENT_CHAR; - } - } else { - *target++ = ch; - } - } else { /* i.e., ch > UNI_MAX_LEGAL_UTF32 */ - result = sourceIllegal; - *target++ = UNI_REPLACEMENT_CHAR; - } - } - *sourceStart = source; - *targetStart = target; - return result; -} - -/* --------------------------------------------------------------------- - - Note A. - The fall-through switches in UTF-8 reading code save a - temp variable, some decrements & conditionals. The switches - are equivalent to the following loop: - { - int tmpBytesToRead = extraBytesToRead+1; - do { - ch += *source++; - --tmpBytesToRead; - if (tmpBytesToRead) ch <<= 6; - } while (tmpBytesToRead > 0); - } - In UTF-8 writing code, the switches on "bytesToWrite" are - similarly unrolled loops. - - --------------------------------------------------------------------- */ diff --git a/impl/antlr/libantlr3c-3.4/src/antlr3cyclicdfa.c b/impl/antlr/libantlr3c-3.4/src/antlr3cyclicdfa.c deleted file mode 100644 index 82e7222..0000000 --- a/impl/antlr/libantlr3c-3.4/src/antlr3cyclicdfa.c +++ /dev/null @@ -1,204 +0,0 @@ -/** Support functions for traversing cyclic DFA states as laid - * out in static initialized structures by the code generator. - * - * A DFA implemented as a set of transition tables. - * - * Any state that has a semantic predicate edge is special; those states - * are generated with if-then-else structures in a ->specialStateTransition() - * which is generated by cyclicDFA template. - * - * There are at most 32767 states (16-bit signed short). - * Could get away with byte sometimes but would have to generate different - * types and the simulation code too. For a point of reference, the Java - * lexer's Tokens rule DFA has 326 states roughly. - */ - -// [The "BSD licence"] -// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC -// http://www.temporal-wave.com -// http://www.linkedin.com/in/jimidle -// -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions -// are met: -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// 3. The name of the author may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include -#include - -#ifdef ANTLR3_WINDOWS -#pragma warning( disable : 4100 ) -#endif - -static void -noViableAlt(pANTLR3_BASE_RECOGNIZER rec, pANTLR3_CYCLIC_DFA cdfa, ANTLR3_UINT32 s) -{ - // In backtracking mode, we just set the failed flag so that the - // alt can just exit right now. If we are parsing though, then - // we want the exception to be raised. - // - if (rec->state->backtracking > 0) - { - rec->state->failed = ANTLR3_TRUE; - } - else - { - rec->exConstruct(rec); - rec->state->exception->type = ANTLR3_NO_VIABLE_ALT_EXCEPTION; - rec->state->exception->message = cdfa->description; - rec->state->exception->decisionNum = cdfa->decisionNumber; - rec->state->exception->state = s; - } -} - -/** From the input stream, predict what alternative will succeed - * using this DFA (representing the covering regular approximation - * to the underlying CFL). Return an alternative number 1..n. Throw - * an exception upon error. - */ -ANTLR3_API ANTLR3_INT32 -antlr3dfapredict (void * ctx, pANTLR3_BASE_RECOGNIZER rec, pANTLR3_INT_STREAM is, pANTLR3_CYCLIC_DFA cdfa) -{ - ANTLR3_MARKER mark; - ANTLR3_INT32 s; - ANTLR3_INT32 specialState; - ANTLR3_INT32 c; - - mark = is->mark(is); /* Store where we are right now */ - s = 0; /* Always start with state 0 */ - - for (;;) - { - /* Pick out any special state entry for this state - */ - specialState = cdfa->special[s]; - - /* Transition the special state and consume an input token - */ - if (specialState >= 0) - { - s = cdfa->specialStateTransition(ctx, rec, is, cdfa, specialState); - - // Error? - // - if (s<0) - { - // If the predicate/rule raised an exception then we leave it - // in tact, else we have an NVA. - // - if (rec->state->error != ANTLR3_TRUE) - { - noViableAlt(rec,cdfa, s); - } - is->rewind(is, mark); - return 0; - } - is->consume(is); - continue; - } - - /* Accept state? - */ - if (cdfa->accept[s] >= 1) - { - is->rewind(is, mark); - return cdfa->accept[s]; - } - - /* Look for a normal transition state based upon the input token element - */ - c = is->_LA(is, 1); - - /* Check against min and max for this state - */ - if (c>= cdfa->min[s] && c <= cdfa->max[s]) - { - ANTLR3_INT32 snext; - - /* What is the next state? - */ - snext = cdfa->transition[s][c - cdfa->min[s]]; - - if (snext < 0) - { - /* Was in range but not a normal transition - * must check EOT, which is like the else clause. - * eot[s]>=0 indicates that an EOT edge goes to another - * state. - */ - if (cdfa->eot[s] >= 0) - { - s = cdfa->eot[s]; - is->consume(is); - continue; - } - noViableAlt(rec,cdfa, s); - is->rewind(is, mark); - return 0; - } - - /* New current state - move to it - */ - s = snext; - is->consume(is); - continue; - } - /* EOT Transition? - */ - if (cdfa->eot[s] >= 0) - { - s = cdfa->eot[s]; - is->consume(is); - continue; - } - /* EOF transition to accept state? - */ - if ( c == ANTLR3_TOKEN_EOF && cdfa->eof[s] >= 0) - { - is->rewind(is, mark); - return cdfa->accept[cdfa->eof[s]]; - } - - /* No alt, so bomb - */ - noViableAlt(rec, cdfa, s); - is->rewind(is, mark); - return 0; - } - -} - -/** Default special state implementation - */ -ANTLR3_API ANTLR3_INT32 -antlr3dfaspecialStateTransition (void * ctx, pANTLR3_BASE_RECOGNIZER recognizer, pANTLR3_INT_STREAM is, pANTLR3_CYCLIC_DFA dfa, ANTLR3_INT32 s) -{ - return -1; -} - -/* Default special transition implementation - */ -ANTLR3_API ANTLR3_INT32 -antlr3dfaspecialTransition (void * ctx, pANTLR3_BASE_RECOGNIZER recognizer, pANTLR3_INT_STREAM is, pANTLR3_CYCLIC_DFA dfa, ANTLR3_INT32 s) -{ - return 0; -} diff --git a/impl/antlr/libantlr3c-3.4/src/antlr3debughandlers.c b/impl/antlr/libantlr3c-3.4/src/antlr3debughandlers.c deleted file mode 100644 index d5f177a..0000000 --- a/impl/antlr/libantlr3c-3.4/src/antlr3debughandlers.c +++ /dev/null @@ -1,1047 +0,0 @@ -/// \file -/// Provides the debugging functions invoked by a recognizer -/// built using the debug generator mode of the antlr tool. -/// See antlr3debugeventlistener.h for documentation. -/// - -// [The "BSD licence"] -// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC -// http://www.temporal-wave.com -// http://www.linkedin.com/in/jimidle -// -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions -// are met: -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// 3. The name of the author may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include - -// Not everyone wishes to include the debugger stuff in their final deployment because -// it will then rely on being linked with the socket libraries. Hence if the programmer turns -// off the debugging, we do some dummy stuff that satifies compilers etc but means there is -// no debugger and no reliance on the socket librarires. If you set this flag, then using the -debug -// option to generate your code will produce code that just crashes, but then I presme you are smart -// enough to realize that building the libraries without debugger support means you can't call the -// debugger ;-) -// -#ifdef ANTLR3_NODEBUGGER -ANTLR3_API pANTLR3_DEBUG_EVENT_LISTENER -antlr3DebugListenerNew() -{ - ANTLR3_PRINTF("C runtime was compiled without debugger support. This program will crash!!"); - return NULL; -} -#else - -static ANTLR3_BOOLEAN handshake (pANTLR3_DEBUG_EVENT_LISTENER delboy); -static void enterRule (pANTLR3_DEBUG_EVENT_LISTENER delboy, const char * grammarFileName, const char * ruleName); -static void enterAlt (pANTLR3_DEBUG_EVENT_LISTENER delboy, int alt); -static void exitRule (pANTLR3_DEBUG_EVENT_LISTENER delboy, const char * grammarFileName, const char * ruleName); -static void enterSubRule (pANTLR3_DEBUG_EVENT_LISTENER delboy, int decisionNumber); -static void exitSubRule (pANTLR3_DEBUG_EVENT_LISTENER delboy, int decisionNumber); -static void enterDecision (pANTLR3_DEBUG_EVENT_LISTENER delboy, int decisionNumber); -static void exitDecision (pANTLR3_DEBUG_EVENT_LISTENER delboy, int decisionNumber); -static void consumeToken (pANTLR3_DEBUG_EVENT_LISTENER delboy, pANTLR3_COMMON_TOKEN t); -static void consumeHiddenToken (pANTLR3_DEBUG_EVENT_LISTENER delboy, pANTLR3_COMMON_TOKEN t); -static void LT (pANTLR3_DEBUG_EVENT_LISTENER delboy, int i, pANTLR3_COMMON_TOKEN t); -static void mark (pANTLR3_DEBUG_EVENT_LISTENER delboy, ANTLR3_MARKER marker); -static void rewindMark (pANTLR3_DEBUG_EVENT_LISTENER delboy, ANTLR3_MARKER marker); -static void rewindLast (pANTLR3_DEBUG_EVENT_LISTENER delboy); -static void beginBacktrack (pANTLR3_DEBUG_EVENT_LISTENER delboy, int level); -static void endBacktrack (pANTLR3_DEBUG_EVENT_LISTENER delboy, int level, ANTLR3_BOOLEAN successful); -static void location (pANTLR3_DEBUG_EVENT_LISTENER delboy, int line, int pos); -static void recognitionException (pANTLR3_DEBUG_EVENT_LISTENER delboy, pANTLR3_EXCEPTION e); -static void beginResync (pANTLR3_DEBUG_EVENT_LISTENER delboy); -static void endResync (pANTLR3_DEBUG_EVENT_LISTENER delboy); -static void semanticPredicate (pANTLR3_DEBUG_EVENT_LISTENER delboy, ANTLR3_BOOLEAN result, const char * predicate); -static void commence (pANTLR3_DEBUG_EVENT_LISTENER delboy); -static void terminate (pANTLR3_DEBUG_EVENT_LISTENER delboy); -static void consumeNode (pANTLR3_DEBUG_EVENT_LISTENER delboy, pANTLR3_BASE_TREE t); -static void LTT (pANTLR3_DEBUG_EVENT_LISTENER delboy, int i, pANTLR3_BASE_TREE t); -static void nilNode (pANTLR3_DEBUG_EVENT_LISTENER delboy, pANTLR3_BASE_TREE t); -static void errorNode (pANTLR3_DEBUG_EVENT_LISTENER delboy, pANTLR3_BASE_TREE t); -static void createNode (pANTLR3_DEBUG_EVENT_LISTENER delboy, pANTLR3_BASE_TREE t); -static void createNodeTok (pANTLR3_DEBUG_EVENT_LISTENER delboy, pANTLR3_BASE_TREE node, pANTLR3_COMMON_TOKEN token); -static void becomeRoot (pANTLR3_DEBUG_EVENT_LISTENER delboy, pANTLR3_BASE_TREE newRoot, pANTLR3_BASE_TREE oldRoot); -static void addChild (pANTLR3_DEBUG_EVENT_LISTENER delboy, pANTLR3_BASE_TREE root, pANTLR3_BASE_TREE child); -static void setTokenBoundaries (pANTLR3_DEBUG_EVENT_LISTENER delboy, pANTLR3_BASE_TREE t, ANTLR3_MARKER tokenStartIndex, ANTLR3_MARKER tokenStopIndex); -static void ack (pANTLR3_DEBUG_EVENT_LISTENER delboy); - -/// Create and initialize a new debug event listener that can be connected to -/// by ANTLRWorks and any other debugger via a socket. -/// -ANTLR3_API pANTLR3_DEBUG_EVENT_LISTENER -antlr3DebugListenerNew() -{ - pANTLR3_DEBUG_EVENT_LISTENER delboy; - - delboy = ANTLR3_CALLOC(1, sizeof(ANTLR3_DEBUG_EVENT_LISTENER)); - - if (delboy == NULL) - { - return NULL; - } - - // Initialize the API - // - delboy->addChild = addChild; - delboy->becomeRoot = becomeRoot; - delboy->beginBacktrack = beginBacktrack; - delboy->beginResync = beginResync; - delboy->commence = commence; - delboy->consumeHiddenToken = consumeHiddenToken; - delboy->consumeNode = consumeNode; - delboy->consumeToken = consumeToken; - delboy->createNode = createNode; - delboy->createNodeTok = createNodeTok; - delboy->endBacktrack = endBacktrack; - delboy->endResync = endResync; - delboy->enterAlt = enterAlt; - delboy->enterDecision = enterDecision; - delboy->enterRule = enterRule; - delboy->enterSubRule = enterSubRule; - delboy->exitDecision = exitDecision; - delboy->exitRule = exitRule; - delboy->exitSubRule = exitSubRule; - delboy->handshake = handshake; - delboy->location = location; - delboy->LT = LT; - delboy->LTT = LTT; - delboy->mark = mark; - delboy->nilNode = nilNode; - delboy->recognitionException = recognitionException; - delboy->rewind = rewindMark; - delboy->rewindLast = rewindLast; - delboy->semanticPredicate = semanticPredicate; - delboy->setTokenBoundaries = setTokenBoundaries; - delboy->terminate = terminate; - delboy->errorNode = errorNode; - - delboy->PROTOCOL_VERSION = 2; // ANTLR 3.1 is at protocol version 2 - - delboy->port = DEFAULT_DEBUGGER_PORT; - - return delboy; -} - -pANTLR3_DEBUG_EVENT_LISTENER -antlr3DebugListenerNewPort(ANTLR3_UINT32 port) -{ - pANTLR3_DEBUG_EVENT_LISTENER delboy; - - delboy = antlr3DebugListenerNew(); - - if (delboy != NULL) - { - delboy->port = port; - } - - return delboy; -} - -//-------------------------------------------------------------------------------- -// Support functions for sending stuff over the socket interface -// -static int -sockSend(SOCKET sock, const char * ptr, int len) -{ - int sent; - int thisSend; - - sent = 0; - - while (sent < len) - { - // Send as many bytes as we can - // - thisSend = send(sock, ptr, len - sent, 0); - - // Check for errors and tell the user if we got one - // - if (thisSend == -1) - { - return ANTLR3_FALSE; - } - - // Increment our offset by how many we were able to send - // - ptr += thisSend; - sent += thisSend; - } - return ANTLR3_TRUE; -} - -static ANTLR3_BOOLEAN -handshake (pANTLR3_DEBUG_EVENT_LISTENER delboy) -{ - /// Connection structure with which to wait and accept a connection from - /// a debugger. - /// - SOCKET serverSocket; - - // Connection structures to deal with the client after we accept the connection - // and the server while we accept a connection. - // - ANTLR3_SOCKADDRT client; - ANTLR3_SOCKADDRT server; - - // Buffer to construct our message in - // - char message[256]; - - // Specifies the length of the connection structure to accept() - // Windows use int, everyone else uses size_t - // - ANTLR3_SALENT sockaddr_len; - - // Option holder for setsockopt() - // - int optVal; - - if (delboy->initialized == ANTLR3_FALSE) - { - // Windows requires us to initialize WinSock. - // -#ifdef ANTLR3_WINDOWS - { - WORD wVersionRequested; - WSADATA wsaData; - int err; // Return code from WSAStartup - - // We must initialise the Windows socket system when the DLL is loaded. - // We are asking for Winsock 1.1 or better as we don't need anything - // too complicated for this. - // - wVersionRequested = MAKEWORD( 1, 1); - - err = WSAStartup( wVersionRequested, &wsaData ); - - if ( err != 0 ) - { - // Tell the user that we could not find a usable - // WinSock DLL - // - return FALSE; - } - } -#endif - - // Create the server socket, we are the server because we just wait until - // a debugger connects to the port we are listening on. - // - serverSocket = socket(AF_INET, SOCK_STREAM, 0); - - if (serverSocket == INVALID_SOCKET) - { - return ANTLR3_FALSE; - } - - // Set the listening port - // - server.sin_port = htons((unsigned short)delboy->port); - server.sin_family = AF_INET; - server.sin_addr.s_addr = htonl (INADDR_ANY); - - // We could allow a rebind on the same addr/port pair I suppose, but - // I imagine that most people will just want to start debugging one parser at once. - // Maybe change this at some point, but rejecting the bind at this point will ensure - // that people realize they have left something running in the background. - // - if (bind(serverSocket, (pANTLR3_SOCKADDRC)&server, sizeof(server)) == -1) - { - return ANTLR3_FALSE; - } - - // We have bound the socket to the port and address so we now ask the TCP subsystem - // to start listening on that address/port - // - if (listen(serverSocket, 1) == -1) - { - // Some error, just fail - // - return ANTLR3_FALSE; - } - - // Now we can try to accept a connection on the port - // - sockaddr_len = sizeof(client); - delboy->socket = accept(serverSocket, (pANTLR3_SOCKADDRC)&client, &sockaddr_len); - - // Having accepted a connection, we can stop listening and close down the socket - // - shutdown (serverSocket, 0x02); - ANTLR3_CLOSESOCKET (serverSocket); - - if (delboy->socket == -1) - { - return ANTLR3_FALSE; - } - - // Disable Nagle as this is essentially a chat exchange - // - optVal = 1; - setsockopt(delboy->socket, SOL_SOCKET, TCP_NODELAY, (const void *)&optVal, sizeof(optVal)); - - } - - // We now have a good socket connection with the debugging client, so we - // send it the protocol version we are using and what the name of the grammar - // is that we represent. - // - sprintf (message, "ANTLR %d\n", delboy->PROTOCOL_VERSION); - sockSend (delboy->socket, message, (int)strlen(message)); - sprintf (message, "grammar \"%s\n", delboy->grammarFileName->chars); - sockSend (delboy->socket, message, (int)strlen(message)); - ack (delboy); - - delboy->initialized = ANTLR3_TRUE; - - return ANTLR3_TRUE; -} - -// Send the supplied text and wait for an ack from the client -static void -transmit(pANTLR3_DEBUG_EVENT_LISTENER delboy, const char * ptr) -{ - sockSend(delboy->socket, ptr, (int)strlen(ptr)); - ack(delboy); -} - -static void -ack (pANTLR3_DEBUG_EVENT_LISTENER delboy) -{ - // Local buffer to read the next character in to - // - char buffer; - int rCount; - - // Ack terminates in a line feed, so we just wait for - // one of those. Speed is not of the essence so we don't need - // to buffer the input or anything. - // - do - { - rCount = recv(delboy->socket, &buffer, 1, 0); - } - while (rCount == 1 && buffer != '\n'); - - // If the socket ws closed on us, then we will get an error or - // (with a graceful close), 0. We can assume the the debugger stopped for some reason - // (such as Java crashing again). Therefore we just exit the program - // completely if we don't get the terminating '\n' for the ack. - // - if (rCount != 1) - { - ANTLR3_PRINTF("Exiting debugger as remote client closed the socket\n"); - ANTLR3_PRINTF("Received char count was %d, and last char received was %02X\n", rCount, buffer); - exit(0); - } -} - -// Given a buffer string and a source string, serialize the -// text, escaping any newlines and linefeeds. We have no need -// for speed here, this is the debugger. -// -void -serializeText(pANTLR3_STRING buffer, pANTLR3_STRING text) -{ - ANTLR3_UINT32 c; - ANTLR3_UCHAR character; - - // strings lead in with a " - // - buffer->append(buffer, "\t\""); - - if (text == NULL) - { - return; - } - - // Now we replace linefeeds, newlines and the escape - // leadin character '%' with their hex equivalents - // prefixed by '%' - // - for (c = 0; c < text->len; c++) - { - switch (character = text->charAt(text, c)) - { - case '\n': - - buffer->append(buffer, "%0A"); - break; - - case '\r': - - buffer->append(buffer, "%0D"); - break; - - case '\\': - - buffer->append(buffer, "%25"); - break; - - // Other characters: The Song Remains the Same. - // - default: - - buffer->addc(buffer, character); - break; - } - } -} - -// Given a token, create a stringified version of it, in the supplied -// buffer. We create a string for this in the debug 'object', if there -// is not one there already, and then reuse it here if asked to do this -// again. -// -pANTLR3_STRING -serializeToken(pANTLR3_DEBUG_EVENT_LISTENER delboy, pANTLR3_COMMON_TOKEN t) -{ - // Do we already have a serialization buffer? - // - if (delboy->tokenString == NULL) - { - // No, so create one, using the string factory that - // the grammar name used, which is guaranteed to exist. - // 64 bytes will do us here for starters. - // - delboy->tokenString = delboy->grammarFileName->factory->newSize(delboy->grammarFileName->factory, 64); - } - - // Empty string - // - delboy->tokenString->set(delboy->tokenString, (const char *)""); - - // Now we serialize the elements of the token.Note that the debugger only - // uses 32 bits. - // - delboy->tokenString->addi(delboy->tokenString, (ANTLR3_INT32)(t->getTokenIndex(t))); - delboy->tokenString->addc(delboy->tokenString, '\t'); - delboy->tokenString->addi(delboy->tokenString, (ANTLR3_INT32)(t->getType(t))); - delboy->tokenString->addc(delboy->tokenString, '\t'); - delboy->tokenString->addi(delboy->tokenString, (ANTLR3_INT32)(t->getChannel(t))); - delboy->tokenString->addc(delboy->tokenString, '\t'); - delboy->tokenString->addi(delboy->tokenString, (ANTLR3_INT32)(t->getLine(t))); - delboy->tokenString->addc(delboy->tokenString, '\t'); - delboy->tokenString->addi(delboy->tokenString, (ANTLR3_INT32)(t->getCharPositionInLine(t))); - - // Now send the text that the token represents. - // - serializeText(delboy->tokenString, t->getText(t)); - - // Finally, as the debugger is a Java program it will expect to get UTF-8 - // encoded strings. We don't use UTF-8 internally to the C runtime, so we - // must force encode it. We have a method to do this in the string class, but - // it returns malloc space that we must free afterwards. - // - return delboy->tokenString->toUTF8(delboy->tokenString); -} - -// Given a tree node, create a stringified version of it in the supplied -// buffer. -// -pANTLR3_STRING -serializeNode(pANTLR3_DEBUG_EVENT_LISTENER delboy, pANTLR3_BASE_TREE node) -{ - pANTLR3_COMMON_TOKEN token; - - - // Do we already have a serialization buffer? - // - if (delboy->tokenString == NULL) - { - // No, so create one, using the string factory that - // the grammar name used, which is guaranteed to exist. - // 64 bytes will do us here for starters. - // - delboy->tokenString = delboy->grammarFileName->factory->newSize(delboy->grammarFileName->factory, 64); - } - - // Empty string - // - delboy->tokenString->set(delboy->tokenString, (const char *)""); - - // Protect against bugs/errors etc - // - if (node == NULL) - { - return delboy->tokenString; - } - - // Now we serialize the elements of the node.Note that the debugger only - // uses 32 bits. - // - delboy->tokenString->addc(delboy->tokenString, '\t'); - - // Adaptor ID - // - delboy->tokenString->addi(delboy->tokenString, delboy->adaptor->getUniqueID(delboy->adaptor, node)); - delboy->tokenString->addc(delboy->tokenString, '\t'); - - // Type of the current token (which may be imaginary) - // - delboy->tokenString->addi(delboy->tokenString, delboy->adaptor->getType(delboy->adaptor, node)); - - // See if we have an actual token or just an imaginary - // - token = delboy->adaptor->getToken(delboy->adaptor, node); - - delboy->tokenString->addc(delboy->tokenString, '\t'); - if (token != NULL) - { - // Real token - // - delboy->tokenString->addi(delboy->tokenString, (ANTLR3_INT32)(token->getLine(token))); - delboy->tokenString->addc(delboy->tokenString, ' '); - delboy->tokenString->addi(delboy->tokenString, (ANTLR3_INT32)(token->getCharPositionInLine(token))); - } - else - { - // Imaginary tokens have no location - // - delboy->tokenString->addi(delboy->tokenString, -1); - delboy->tokenString->addc(delboy->tokenString, '\t'); - delboy->tokenString->addi(delboy->tokenString, -1); - } - - // Start Index of the node - // - delboy->tokenString->addc(delboy->tokenString, '\t'); - delboy->tokenString->addi(delboy->tokenString, (ANTLR3_UINT32)(delboy->adaptor->getTokenStartIndex(delboy->adaptor, node))); - - // Now send the text that the node represents. - // - serializeText(delboy->tokenString, delboy->adaptor->getText(delboy->adaptor, node)); - - // Finally, as the debugger is a Java program it will expect to get UTF-8 - // encoded strings. We don't use UTF-8 internally to the C runtime, so we - // must force encode it. We have a method to do this in the string class, but - // there is no utf8 string implementation as of yet - // - return delboy->tokenString->toUTF8(delboy->tokenString); -} - -//------------------------------------------------------------------------------------------------------------------ -// EVENTS -// -static void -enterRule (pANTLR3_DEBUG_EVENT_LISTENER delboy, const char * grammarFileName, const char * ruleName) -{ - char buffer[512]; - - // Create the message (speed is not of the essence) - // - sprintf(buffer, "enterRule\t%s\t%s\n", grammarFileName, ruleName); - transmit(delboy, buffer); -} - -static void -enterAlt (pANTLR3_DEBUG_EVENT_LISTENER delboy, int alt) -{ - char buffer[512]; - - // Create the message (speed is not of the essence) - // - sprintf(buffer, "enterAlt\t%d\n", alt); - transmit(delboy, buffer); -} - -static void -exitRule (pANTLR3_DEBUG_EVENT_LISTENER delboy, const char * grammarFileName, const char * ruleName) -{ - char buffer[512]; - - // Create the message (speed is not of the essence) - // - sprintf(buffer, "exitRule\t%s\t%s\n", grammarFileName, ruleName); - transmit(delboy, buffer); -} - -static void -enterSubRule (pANTLR3_DEBUG_EVENT_LISTENER delboy, int decisionNumber) -{ - char buffer[512]; - - // Create the message (speed is not of the essence) - // - sprintf(buffer, "enterSubRule\t%d\n", decisionNumber); - transmit(delboy, buffer); -} - -static void -exitSubRule (pANTLR3_DEBUG_EVENT_LISTENER delboy, int decisionNumber) -{ - char buffer[512]; - - // Create the message (speed is not of the essence) - // - sprintf(buffer, "exitSubRule\t%d\n", decisionNumber); - transmit(delboy, buffer); -} - -static void -enterDecision (pANTLR3_DEBUG_EVENT_LISTENER delboy, int decisionNumber) -{ - char buffer[512]; - - // Create the message (speed is not of the essence) - // - sprintf(buffer, "enterDecision\t%d\n", decisionNumber); - transmit(delboy, buffer); - -} - -static void -exitDecision (pANTLR3_DEBUG_EVENT_LISTENER delboy, int decisionNumber) -{ - char buffer[512]; - - // Create the message (speed is not of the essence) - // - sprintf(buffer, "exitDecision\t%d\n", decisionNumber); - transmit(delboy, buffer); -} - -static void -consumeToken (pANTLR3_DEBUG_EVENT_LISTENER delboy, pANTLR3_COMMON_TOKEN t) -{ - pANTLR3_STRING msg; - - // Create the serialized token - // - msg = serializeToken(delboy, t); - - // Insert the debug event indicator - // - msg->insert8(msg, 0, "consumeToken\t"); - - msg->addc(msg, '\n'); - - // Transmit the message and wait for ack - // - transmit(delboy, (const char *)(msg->chars)); -} - -static void -consumeHiddenToken (pANTLR3_DEBUG_EVENT_LISTENER delboy, pANTLR3_COMMON_TOKEN t) -{ - pANTLR3_STRING msg; - - // Create the serialized token - // - msg = serializeToken(delboy, t); - - // Insert the debug event indicator - // - msg->insert8(msg, 0, "consumeHiddenToken\t"); - - msg->addc(msg, '\n'); - - // Transmit the message and wait for ack - // - transmit(delboy, (const char *)(msg->chars)); -} - -// Looking at the next token event. -// -static void -LT (pANTLR3_DEBUG_EVENT_LISTENER delboy, int i, pANTLR3_COMMON_TOKEN t) -{ - pANTLR3_STRING msg; - - if (t != NULL) - { - // Create the serialized token - // - msg = serializeToken(delboy, t); - - // Insert the index parameter - // - msg->insert8(msg, 0, "\t"); - msg->inserti(msg, 0, i); - - // Insert the debug event indicator - // - msg->insert8(msg, 0, "LT\t"); - - msg->addc(msg, '\n'); - - // Transmit the message and wait for ack - // - transmit(delboy, (const char *)(msg->chars)); - } -} - -static void -mark (pANTLR3_DEBUG_EVENT_LISTENER delboy, ANTLR3_MARKER marker) -{ - char buffer[128]; - - sprintf(buffer, "mark\t%d\n", (ANTLR3_UINT32)(marker & 0xFFFFFFFF)); - - // Transmit the message and wait for ack - // - transmit(delboy, buffer); -} - -static void -rewindMark (pANTLR3_DEBUG_EVENT_LISTENER delboy, ANTLR3_MARKER marker) -{ - char buffer[128]; - - sprintf(buffer, "rewind\t%d\n", (ANTLR3_UINT32)(marker & 0xFFFFFFFF)); - - // Transmit the message and wait for ack - // - transmit(delboy, buffer); - -} - -static void -rewindLast (pANTLR3_DEBUG_EVENT_LISTENER delboy) -{ - transmit(delboy, (const char *)"rewind\n"); -} - -static void -beginBacktrack (pANTLR3_DEBUG_EVENT_LISTENER delboy, int level) -{ - char buffer[128]; - - sprintf(buffer, "beginBacktrack\t%d\n", (ANTLR3_UINT32)(level & 0xFFFFFFFF)); - - // Transmit the message and wait for ack - // - transmit(delboy, buffer); -} - -static void -endBacktrack (pANTLR3_DEBUG_EVENT_LISTENER delboy, int level, ANTLR3_BOOLEAN successful) -{ - char buffer[128]; - - sprintf(buffer, "endBacktrack\t%d\t%d\n", level, successful); - - // Transmit the message and wait for ack - // - transmit(delboy, buffer); -} - -static void -location (pANTLR3_DEBUG_EVENT_LISTENER delboy, int line, int pos) -{ - char buffer[128]; - - sprintf(buffer, "location\t%d\t%d\n", line, pos); - - // Transmit the message and wait for ack - // - transmit(delboy, buffer); -} - -static void -recognitionException (pANTLR3_DEBUG_EVENT_LISTENER delboy, pANTLR3_EXCEPTION e) -{ - char buffer[256]; - - sprintf(buffer, "exception\t%s\t%d\t%d\t%d\n", (char *)(e->name), (ANTLR3_INT32)(e->index), e->line, e->charPositionInLine); - - // Transmit the message and wait for ack - // - transmit(delboy, buffer); -} - -static void -beginResync (pANTLR3_DEBUG_EVENT_LISTENER delboy) -{ - transmit(delboy, (const char *)"beginResync\n"); -} - -static void -endResync (pANTLR3_DEBUG_EVENT_LISTENER delboy) -{ - transmit(delboy, (const char *)"endResync\n"); -} - -static void -semanticPredicate (pANTLR3_DEBUG_EVENT_LISTENER delboy, ANTLR3_BOOLEAN result, const char * predicate) -{ - unsigned char * buffer; - unsigned char * out; - - if (predicate != NULL) - { - buffer = (unsigned char *)ANTLR3_MALLOC(64 + 2*strlen(predicate)); - - if (buffer != NULL) - { - out = buffer + sprintf((char *)buffer, "semanticPredicate\t%s\t", result == ANTLR3_TRUE ? "true" : "false"); - - while (*predicate != '\0') - { - switch(*predicate) - { - case '\n': - - *out++ = '%'; - *out++ = '0'; - *out++ = 'A'; - break; - - case '\r': - - *out++ = '%'; - *out++ = '0'; - *out++ = 'D'; - break; - - case '%': - - *out++ = '%'; - *out++ = '0'; - *out++ = 'D'; - break; - - - default: - - *out++ = *predicate; - break; - } - - predicate++; - } - *out++ = '\n'; - *out++ = '\0'; - } - - // Send it and wait for the ack - // - transmit(delboy, (const char *)buffer); - } -} - -#ifdef ANTLR3_WINDOWS -#pragma warning (push) -#pragma warning (disable : 4100) -#endif - -static void -commence (pANTLR3_DEBUG_EVENT_LISTENER delboy) -{ - // Nothing to see here - // -} - -#ifdef ANTLR3_WINDOWS -#pragma warning (pop) -#endif - -static void -terminate (pANTLR3_DEBUG_EVENT_LISTENER delboy) -{ - // Terminate sequence - // - sockSend(delboy->socket, "terminate\n", 10); // Send out the command -} - -//---------------------------------------------------------------- -// Tree parsing events -// -static void -consumeNode (pANTLR3_DEBUG_EVENT_LISTENER delboy, pANTLR3_BASE_TREE t) -{ - pANTLR3_STRING buffer; - - buffer = serializeNode (delboy, t); - - // Now prepend the command - // - buffer->insert8 (buffer, 0, "consumeNode\t"); - buffer->addc (buffer, '\n'); - - // Send to the debugger and wait for the ack - // - transmit (delboy, (const char *)(delboy->tokenString->toUTF8(delboy->tokenString)->chars)); -} - -static void -LTT (pANTLR3_DEBUG_EVENT_LISTENER delboy, int i, pANTLR3_BASE_TREE t) -{ - pANTLR3_STRING buffer; - - buffer = serializeNode (delboy, t); - - // Now prepend the command - // - buffer->insert8 (buffer, 0, "\t"); - buffer->inserti (buffer, 0, i); - buffer->insert8 (buffer, 0, "LN\t"); - buffer->addc (buffer, '\n'); - - // Send to the debugger and wait for the ack - // - transmit (delboy, (const char *)(delboy->tokenString->toUTF8(delboy->tokenString)->chars)); -} - -static void -nilNode (pANTLR3_DEBUG_EVENT_LISTENER delboy, pANTLR3_BASE_TREE t) -{ - char buffer[128]; - sprintf(buffer, "nilNode\t%d\n", delboy->adaptor->getUniqueID(delboy->adaptor, t)); - transmit(delboy, buffer); -} - -static void -createNode (pANTLR3_DEBUG_EVENT_LISTENER delboy, pANTLR3_BASE_TREE t) -{ - // Do we already have a serialization buffer? - // - if (delboy->tokenString == NULL) - { - // No, so create one, using the string factory that - // the grammar name used, which is guaranteed to exist. - // 64 bytes will do us here for starters. - // - delboy->tokenString = delboy->grammarFileName->factory->newSize(delboy->grammarFileName->factory, 64); - } - - // Empty string - // - delboy->tokenString->set8(delboy->tokenString, (const char *)"createNodeFromTokenElements "); - - // Now we serialize the elements of the node.Note that the debugger only - // uses 32 bits. - // - // Adaptor ID - // - delboy->tokenString->addi(delboy->tokenString, delboy->adaptor->getUniqueID(delboy->adaptor, t)); - delboy->tokenString->addc(delboy->tokenString, '\t'); - - // Type of the current token (which may be imaginary) - // - delboy->tokenString->addi(delboy->tokenString, delboy->adaptor->getType(delboy->adaptor, t)); - - // The text that this node represents - // - serializeText(delboy->tokenString, delboy->adaptor->getText(delboy->adaptor, t)); - delboy->tokenString->addc(delboy->tokenString, '\n'); - - // Finally, as the debugger is a Java program it will expect to get UTF-8 - // encoded strings. We don't use UTF-8 internally to the C runtime, so we - // must force encode it. We have a method to do this in the string class, but - // there is no utf8 string implementation as of yet - // - transmit(delboy, (const char *)(delboy->tokenString->toUTF8(delboy->tokenString)->chars)); - -} -static void -errorNode (pANTLR3_DEBUG_EVENT_LISTENER delboy, pANTLR3_BASE_TREE t) -{ - // Do we already have a serialization buffer? - // - if (delboy->tokenString == NULL) - { - // No, so create one, using the string factory that - // the grammar name used, which is guaranteed to exist. - // 64 bytes will do us here for starters. - // - delboy->tokenString = delboy->grammarFileName->factory->newSize(delboy->grammarFileName->factory, 64); - } - - // Empty string - // - delboy->tokenString->set8(delboy->tokenString, (const char *)"errorNode\t"); - - // Now we serialize the elements of the node.Note that the debugger only - // uses 32 bits. - // - // Adaptor ID - // - delboy->tokenString->addi(delboy->tokenString, delboy->adaptor->getUniqueID(delboy->adaptor, t)); - delboy->tokenString->addc(delboy->tokenString, '\t'); - - // Type of the current token (which is an error) - // - delboy->tokenString->addi(delboy->tokenString, ANTLR3_TOKEN_INVALID); - - // The text that this node represents - // - serializeText(delboy->tokenString, delboy->adaptor->getText(delboy->adaptor, t)); - delboy->tokenString->addc(delboy->tokenString, '\n'); - - // Finally, as the debugger is a Java program it will expect to get UTF-8 - // encoded strings. We don't use UTF-8 internally to the C runtime, so we - // must force encode it. We have a method to do this in the string class, but - // there is no utf8 string implementation as of yet - // - transmit(delboy, (const char *)(delboy->tokenString->toUTF8(delboy->tokenString)->chars)); - -} - -static void -createNodeTok (pANTLR3_DEBUG_EVENT_LISTENER delboy, pANTLR3_BASE_TREE node, pANTLR3_COMMON_TOKEN token) -{ - char buffer[128]; - - sprintf(buffer, "createNode\t%d\t%d\n", delboy->adaptor->getUniqueID(delboy->adaptor, node), (ANTLR3_UINT32)token->getTokenIndex(token)); - - transmit(delboy, buffer); -} - -static void -becomeRoot (pANTLR3_DEBUG_EVENT_LISTENER delboy, pANTLR3_BASE_TREE newRoot, pANTLR3_BASE_TREE oldRoot) -{ - char buffer[128]; - - sprintf(buffer, "becomeRoot\t%d\t%d\n", delboy->adaptor->getUniqueID(delboy->adaptor, newRoot), - delboy->adaptor->getUniqueID(delboy->adaptor, oldRoot) - ); - transmit(delboy, buffer); -} - - -static void -addChild (pANTLR3_DEBUG_EVENT_LISTENER delboy, pANTLR3_BASE_TREE root, pANTLR3_BASE_TREE child) -{ - char buffer[128]; - - sprintf(buffer, "addChild\t%d\t%d\n", delboy->adaptor->getUniqueID(delboy->adaptor, root), - delboy->adaptor->getUniqueID(delboy->adaptor, child) - ); - transmit(delboy, buffer); -} - -static void -setTokenBoundaries (pANTLR3_DEBUG_EVENT_LISTENER delboy, pANTLR3_BASE_TREE t, ANTLR3_MARKER tokenStartIndex, ANTLR3_MARKER tokenStopIndex) -{ - char buffer[128]; - - sprintf(buffer, "becomeRoot\t%d\t%d\t%d\n", delboy->adaptor->getUniqueID(delboy->adaptor, t), - (ANTLR3_UINT32)tokenStartIndex, - (ANTLR3_UINT32)tokenStopIndex - ); - transmit(delboy, buffer); -} -#endif - diff --git a/impl/antlr/libantlr3c-3.4/src/antlr3encodings.c b/impl/antlr/libantlr3c-3.4/src/antlr3encodings.c deleted file mode 100644 index c7a4b77..0000000 --- a/impl/antlr/libantlr3c-3.4/src/antlr3encodings.c +++ /dev/null @@ -1,50 +0,0 @@ -/** \File - * Provides basic utility functions to convert between - * the various Unicode character conversions. There are of - * course various packages that could be used instead of these - * functions, but then the Antlr 3 C runtime would be dependant - * on the particular package. Using ICU for this is a good idea if - * your project is already dependant on it. - */ - -// [The "BSD licence"] -// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC -// http://www.temporal-wave.com -// http://www.linkedin.com/in/jimidle -// -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions -// are met: -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// 3. The name of the author may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include - -/// Convert 8 bit character to ANTLR char form. -/// -/// \param[in] inc Input character to transform from 8 bit form. -/// \return ANTLR3_UCHAR encoding of the character. -/// -ANTLR3_API -ANTLR3_UCHAR antlr3c8toAntlrc(ANTLR3_INT8 inc) -{ - return (ANTLR3_UCHAR)(inc); -} diff --git a/impl/antlr/libantlr3c-3.4/src/antlr3exception.c b/impl/antlr/libantlr3c-3.4/src/antlr3exception.c deleted file mode 100644 index 339721c..0000000 --- a/impl/antlr/libantlr3c-3.4/src/antlr3exception.c +++ /dev/null @@ -1,190 +0,0 @@ -/** \file - * Contains default functions for creating and destroying as well as - * otherwise handling ANTLR3 standard exception structures. - */ - -// [The "BSD licence"] -// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC -// http://www.temporal-wave.com -// http://www.linkedin.com/in/jimidle -// -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions -// are met: -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// 3. The name of the author may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include - -static void antlr3ExceptionPrint(pANTLR3_EXCEPTION ex); -static void antlr3ExceptionFree (pANTLR3_EXCEPTION ex); - -/** - * \brief - * Creates a new ANTLR3 exception structure - * - * \param[in] exception - * One of the ANTLR3_xxx_EXCEPTION indicators such as #ANTLR3_RECOGNITION_EXCEPTION - * - * \param[in] message - * Pointer to message string - * - * \param[in] freeMessage - * Set to ANTLR3_TRUE if the message parameter should be freed by a call to - * ANTLR3_FREE() when the exception is destroyed. - * - * \returns - * Pointer to newly initialized exception structure, or an ANTLR3_ERR_xx defined value - * upon failure. - * - * An exception is 'thrown' by a recognizer when input is seen that is not predicted by - * the grammar productions or when some other error condition occurs. In C we do not have - * the luxury of try and catch blocks, so exceptions are added in the order they occur to - * a list in the baserecognizer structure. The last one to be thrown is inserted at the head of - * the list and the one currently installed is pointed to by the newly installed exception. - * - * \remarks - * After an exception is created, you may add a pointer to your own structure and a pointer - * to a function to free this structure when the exception is destroyed. - * - * \see - * ANTLR3_EXCEPTION - */ -pANTLR3_EXCEPTION -antlr3ExceptionNew(ANTLR3_UINT32 exception, void * name, void * message, ANTLR3_BOOLEAN freeMessage) -{ - pANTLR3_EXCEPTION ex; - - /* Allocate memory for the structure - */ - ex = (pANTLR3_EXCEPTION) ANTLR3_CALLOC(1, sizeof(ANTLR3_EXCEPTION)); - - /* Check for memory allocation - */ - if (ex == NULL) - { - return NULL; - } - - ex->name = name; /* Install exception name */ - ex->type = exception; /* Install the exception number */ - ex->message = message; /* Install message string */ - - /* Indicate whether the string should be freed if exception is destroyed - */ - ex->freeMessage = freeMessage; - - /* Install the API - */ - ex->print = antlr3ExceptionPrint; - ex->freeEx = antlr3ExceptionFree; - - return ex; -} - -/** - * \brief - * Prints out the message in all the exceptions in the supplied chain. - * - * \param[in] ex - * Pointer to the exception structure to print. - * - * \remarks - * You may wish to override this function by installing a pointer to a new function - * in the base recognizer context structure. - * - * \see - * ANTLR3_BASE_RECOGNIZER - */ -static void -antlr3ExceptionPrint(pANTLR3_EXCEPTION ex) -{ - /* Ensure valid pointer - */ - while (ex != NULL) - { - /* Number if no message, else the message - */ - if (ex->message == NULL) - { - ANTLR3_FPRINTF(stderr, "ANTLR3_EXCEPTION number %d (%08X).\n", ex->type, ex->type); - } - else - { - ANTLR3_FPRINTF(stderr, "ANTLR3_EXCEPTION: %s\n", (char *)(ex->message)); - } - - /* Move to next in the chain (if any) - */ - ex = ex->nextException; - } - - return; -} - -/** - * \brief - * Frees up a chain of ANTLR3 exceptions - * - * \param[in] ex - * Pointer to the first exception in the chain to free. - * - * \see - * ANTLR3_EXCEPTION - */ -static void -antlr3ExceptionFree(pANTLR3_EXCEPTION ex) -{ - pANTLR3_EXCEPTION next; - - /* Ensure valid pointer - */ - while (ex != NULL) - { - /* Pick up anythign following now, before we free the - * current memory block. - */ - next = ex->nextException; - - /* Free the message pointer if advised to - */ - if (ex->freeMessage == ANTLR3_TRUE) - { - ANTLR3_FREE(ex->message); - } - - /* Call the programmer's custom free routine if advised to - */ - if (ex->freeCustom != NULL) - { - ex->freeCustom(ex->custom); - } - - /* Free the actual structure itself - */ - ANTLR3_FREE(ex); - - ex = next; - } - - return; -} - diff --git a/impl/antlr/libantlr3c-3.4/src/antlr3filestream.c b/impl/antlr/libantlr3c-3.4/src/antlr3filestream.c deleted file mode 100644 index 4430ffe..0000000 --- a/impl/antlr/libantlr3c-3.4/src/antlr3filestream.c +++ /dev/null @@ -1,474 +0,0 @@ -/** \file - * \brief The ANTLR3 C filestream is used when the source character stream - * is a filesystem based input set and all the characters in the filestream - * can be loaded at once into memory and away the lexer goes. - * - * A number of initializers are provided in order that various character - * sets can be supported from input files. The ANTLR3 C runtime expects - * to deal with UTF32 characters only (the reasons for this are to - * do with the simplification of C code when using this form of Unicode - * encoding, though this is not a panacea. More information can be - * found on this by consulting: - * - http://www.unicode.org/versions/Unicode4.0.0/ch02.pdf#G11178 - * Where a well grounded discussion of the encoding formats available - * may be found. - * - */ - -// [The "BSD licence"] -// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC -// http://www.temporal-wave.com -// http://www.linkedin.com/in/jimidle -// -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions -// are met: -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// 3. The name of the author may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include - -static void setupInputStream (pANTLR3_INPUT_STREAM input); -static pANTLR3_INPUT_STREAM antlr3CreateFileStream (pANTLR3_UINT8 fileName); -static pANTLR3_INPUT_STREAM antlr3CreateStringStream (pANTLR3_UINT8 data); - -ANTLR3_API pANTLR3_INPUT_STREAM -antlr3FileStreamNew(pANTLR3_UINT8 fileName, ANTLR3_UINT32 encoding) -{ - pANTLR3_INPUT_STREAM input; - - // First order of business is to read the file into some buffer space - // as just straight 8 bit bytes. Then we will work out the encoding and - // byte order and adjust the API functions that are installed for the - // default 8Bit stream accordingly. - // - input = antlr3CreateFileStream(fileName); - if (input == NULL) - { - return NULL; - } - - // We have the data in memory now so we can deal with it according to - // the encoding scheme we were given by the user. - // - input->encoding = encoding; - - // Now we need to work out the endian type and install any - // API functions that differ from 8Bit - // - setupInputStream(input); - - // Now we can set up the file name - // - input->istream->streamName = input->strFactory->newStr8(input->strFactory, fileName); - input->fileName = input->istream->streamName; - - return input; -} - - -ANTLR3_API pANTLR3_INPUT_STREAM -antlr3StringStreamNew(pANTLR3_UINT8 data, ANTLR3_UINT32 encoding, ANTLR3_UINT32 size, pANTLR3_UINT8 name) -{ - pANTLR3_INPUT_STREAM input; - - // First order of business is to set up the stream and install the data pointer. - // Then we will work out the encoding and byte order and adjust the API functions that are installed for the - // default 8Bit stream accordingly. - // - input = antlr3CreateStringStream(data); - if (input == NULL) - { - return NULL; - } - - // Size (in bytes) of the given 'string' - // - input->sizeBuf = size; - - // We have the data in memory now so we can deal with it according to - // the encoding scheme we were given by the user. - // - input->encoding = encoding; - - // Now we need to work out the endian type and install any - // API functions that differ from 8Bit - // - setupInputStream(input); - - // Now we can set up the file name - // - input->istream->streamName = input->strFactory->newStr8(input->strFactory, name); - input->fileName = input->istream->streamName; - - return input; -} - - -/// Determine endianess of the input stream and install the -/// API required for the encoding in that format. -/// -static void -setupInputStream(pANTLR3_INPUT_STREAM input) -{ - ANTLR3_BOOLEAN isBigEndian; - - // Used to determine the endianness of the machine we are currently - // running on. - // - ANTLR3_UINT16 bomTest = 0xFEFF; - - // What endianess is the machine we are running on? If the incoming - // encoding endianess is the same as this machine's natural byte order - // then we can use more efficient API calls. - // - if (*((pANTLR3_UINT8)(&bomTest)) == 0xFE) - { - isBigEndian = ANTLR3_TRUE; - } - else - { - isBigEndian = ANTLR3_FALSE; - } - - // What encoding did the user tell us {s}he thought it was? I am going - // to get sick of the questions on antlr-interest, I know I am. - // - switch (input->encoding) - { - case ANTLR3_ENC_UTF8: - - // See if there is a BOM at the start of this UTF-8 sequence - // and just eat it if there is. Windows .TXT files have this for instance - // as it identifies UTF-8 even though it is of no consequence for byte order - // as UTF-8 does not have a byte order. - // - if ( (ANTLR3_UINT8)(*((pANTLR3_UINT8)input->nextChar)) == 0xEF - && (ANTLR3_UINT8)(*((pANTLR3_UINT8)input->nextChar+1)) == 0xBB - && (ANTLR3_UINT8)(*((pANTLR3_UINT8)input->nextChar+2)) == 0xBF - ) - { - // The UTF8 BOM is present so skip it - // - input->nextChar = (void *)((pANTLR3_UINT8)input->nextChar + 3); - } - - // Install the UTF8 input routines - // - antlr3UTF8SetupStream(input); - break; - - case ANTLR3_ENC_UTF16: - - // See if there is a BOM at the start of the input. If not then - // we assume that the byte order is the natural order of this - // machine (or it is really UCS2). If there is a BOM we determine if the encoding - // is the same as the natural order of this machine. - // - if ( (ANTLR3_UINT8)(*((pANTLR3_UINT8)input->nextChar)) == 0xFE - && (ANTLR3_UINT8)(*((pANTLR3_UINT8)input->nextChar+1)) == 0xFF - ) - { - // BOM Present, indicates Big Endian - // - input->nextChar = (void *)((pANTLR3_UINT8)input->nextChar + 2); - - antlr3UTF16SetupStream(input, isBigEndian, ANTLR3_TRUE); - } - else if ( (ANTLR3_UINT8)(*((pANTLR3_UINT8)input->nextChar)) == 0xFF - && (ANTLR3_UINT8)(*((pANTLR3_UINT8)input->nextChar+1)) == 0xFE - ) - { - // BOM present, indicates Little Endian - // - input->nextChar = (void *)((pANTLR3_UINT8)input->nextChar + 2); - - antlr3UTF16SetupStream(input, isBigEndian, ANTLR3_FALSE); - } - else - { - // No BOM present, assume local computer byte order - // - antlr3UTF16SetupStream(input, isBigEndian, isBigEndian); - } - break; - - case ANTLR3_ENC_UTF32: - - // See if there is a BOM at the start of the input. If not then - // we assume that the byte order is the natural order of this - // machine. If there is we determine if the encoding - // is the same as the natural order of this machine. - // - if ( (ANTLR3_UINT8)(*((pANTLR3_UINT8)input->nextChar)) == 0x00 - && (ANTLR3_UINT8)(*((pANTLR3_UINT8)input->nextChar+1)) == 0x00 - && (ANTLR3_UINT8)(*((pANTLR3_UINT8)input->nextChar+2)) == 0xFE - && (ANTLR3_UINT8)(*((pANTLR3_UINT8)input->nextChar+3)) == 0xFF - ) - { - // BOM Present, indicates Big Endian - // - input->nextChar = (void *)((pANTLR3_UINT8)input->nextChar + 4); - - antlr3UTF32SetupStream(input, isBigEndian, ANTLR3_TRUE); - } - else if ( (ANTLR3_UINT8)(*((pANTLR3_UINT8)input->nextChar)) == 0xFF - && (ANTLR3_UINT8)(*((pANTLR3_UINT8)input->nextChar+1)) == 0xFE - && (ANTLR3_UINT8)(*((pANTLR3_UINT8)input->nextChar+1)) == 0x00 - && (ANTLR3_UINT8)(*((pANTLR3_UINT8)input->nextChar+1)) == 0x00 - ) - { - // BOM present, indicates Little Endian - // - input->nextChar = (void *)((pANTLR3_UINT8)input->nextChar + 4); - - antlr3UTF32SetupStream(input, isBigEndian, ANTLR3_FALSE); - } - else - { - // No BOM present, assume local computer byte order - // - antlr3UTF32SetupStream(input, isBigEndian, isBigEndian); - } - break; - - case ANTLR3_ENC_UTF16BE: - - // Encoding is definately Big Endian with no BOM - // - antlr3UTF16SetupStream(input, isBigEndian, ANTLR3_TRUE); - break; - - case ANTLR3_ENC_UTF16LE: - - // Encoding is definately Little Endian with no BOM - // - antlr3UTF16SetupStream(input, isBigEndian, ANTLR3_FALSE); - break; - - case ANTLR3_ENC_UTF32BE: - - // Encoding is definately Big Endian with no BOM - // - antlr3UTF32SetupStream(input, isBigEndian, ANTLR3_TRUE); - break; - - case ANTLR3_ENC_UTF32LE: - - // Encoding is definately Little Endian with no BOM - // - antlr3UTF32SetupStream(input, isBigEndian, ANTLR3_FALSE); - break; - - case ANTLR3_ENC_EBCDIC: - - // EBCDIC is basically the same as ASCII but with an on the - // fly translation to ASCII - // - antlr3EBCDICSetupStream(input); - break; - - case ANTLR3_ENC_8BIT: - default: - - // Standard 8bit/ASCII - // - antlr38BitSetupStream(input); - break; - } -} - -/** \brief Use the contents of an operating system file as the input - * for an input stream. - * - * \param fileName Name of operating system file to read. - * \return - * - Pointer to new input stream context upon success - * - One of the ANTLR3_ERR_ defines on error. - */ -static pANTLR3_INPUT_STREAM -antlr3CreateFileStream(pANTLR3_UINT8 fileName) -{ - // Pointer to the input stream we are going to create - // - pANTLR3_INPUT_STREAM input; - ANTLR3_UINT32 status; - - if (fileName == NULL) - { - return NULL; - } - - // Allocate memory for the input stream structure - // - input = (pANTLR3_INPUT_STREAM) - ANTLR3_CALLOC(1, sizeof(ANTLR3_INPUT_STREAM)); - - if (input == NULL) - { - return NULL; - } - - // Structure was allocated correctly, now we can read the file. - // - status = antlr3read8Bit(input, fileName); - - // Call the common 8 bit input stream handler - // initialization. - // - antlr3GenericSetupStream(input); - - // However if the file was not there or something then we - // need to close. Have to wait until here as we cannot call - // close until the API is installed of course. - // - if (status != ANTLR3_SUCCESS) - { - input->close(input); - return NULL; - } - - return input; -} - -ANTLR3_API ANTLR3_UINT32 -antlr3read8Bit(pANTLR3_INPUT_STREAM input, pANTLR3_UINT8 fileName) -{ - ANTLR3_FDSC infile; - ANTLR3_UINT32 fSize; - - /* Open the OS file in read binary mode - */ - infile = antlr3Fopen(fileName, "rb"); - - /* Check that it was there - */ - if (infile == NULL) - { - return (ANTLR3_UINT32)ANTLR3_ERR_NOFILE; - } - - /* It was there, so we can read the bytes now - */ - fSize = antlr3Fsize(fileName); /* Size of input file */ - - /* Allocate buffer for this input set - */ - input->data = ANTLR3_MALLOC((size_t)fSize); - input->sizeBuf = fSize; - - if (input->data == NULL) - { - return (ANTLR3_UINT32)ANTLR3_ERR_NOMEM; - } - - input->isAllocated = ANTLR3_TRUE; - - /* Now we read the file. Characters are not converted to - * the internal ANTLR encoding until they are read from the buffer - */ - antlr3Fread(infile, fSize, input->data); - - /* And close the file handle - */ - antlr3Fclose(infile); - - return ANTLR3_SUCCESS; -} - -/** \brief Open an operating system file and return the descriptor - * We just use the common open() and related functions here. - * Later we might find better ways on systems - * such as Windows and OpenVMS for instance. But the idea is to read the - * while file at once anyway, so it may be irrelevant. - */ -ANTLR3_API ANTLR3_FDSC -antlr3Fopen(pANTLR3_UINT8 filename, const char * mode) -{ - return (ANTLR3_FDSC)fopen((const char *)filename, mode); -} - -/** \brief Close an operating system file and free any handles - * etc. - */ -ANTLR3_API void -antlr3Fclose(ANTLR3_FDSC fd) -{ - fclose(fd); -} -ANTLR3_API ANTLR3_UINT32 -antlr3Fsize(pANTLR3_UINT8 fileName) -{ - struct _stat statbuf; - - _stat((const char *)fileName, &statbuf); - - return (ANTLR3_UINT32)statbuf.st_size; -} - -ANTLR3_API ANTLR3_UINT32 -antlr3Fread(ANTLR3_FDSC fdsc, ANTLR3_UINT32 count, void * data) -{ - return (ANTLR3_UINT32)fread(data, (size_t)count, 1, fdsc); -} - - -/** \brief Use the supplied 'string' as input to the stream - * - * \param data Pointer to the input data - * \return - * - Pointer to new input stream context upon success - * - NULL defines on error. - */ -static pANTLR3_INPUT_STREAM -antlr3CreateStringStream(pANTLR3_UINT8 data) -{ - // Pointer to the input stream we are going to create - // - pANTLR3_INPUT_STREAM input; - - if (data == NULL) - { - return NULL; - } - - // Allocate memory for the input stream structure - // - input = (pANTLR3_INPUT_STREAM) - ANTLR3_CALLOC(1, sizeof(ANTLR3_INPUT_STREAM)); - - if (input == NULL) - { - return NULL; - } - - // Structure was allocated correctly, now we can install the pointer - // - input->data = data; - input->isAllocated = ANTLR3_FALSE; - - // Call the common 8 bit input stream handler - // initialization. - // - antlr3GenericSetupStream(input); - - return input; -} \ No newline at end of file diff --git a/impl/antlr/libantlr3c-3.4/src/antlr3inputstream.c b/impl/antlr/libantlr3c-3.4/src/antlr3inputstream.c deleted file mode 100644 index e3f1c26..0000000 --- a/impl/antlr/libantlr3c-3.4/src/antlr3inputstream.c +++ /dev/null @@ -1,2050 +0,0 @@ -/// \file -/// Base functions to initialize and manipulate any input stream -/// - -// [The "BSD licence"] -// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC -// http://www.temporal-wave.com -// http://www.linkedin.com/in/jimidle -// -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions -// are met: -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// 3. The name of the author may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include - -// ----------------------------------- -// Generic 8 bit input such as latin-1 -// - -// 8Bit INT Stream API -// -static void antlr38BitConsume (pANTLR3_INT_STREAM is); -static ANTLR3_UCHAR antlr38BitLA (pANTLR3_INT_STREAM is, ANTLR3_INT32 la); -static ANTLR3_UCHAR antlr38BitLA_ucase (pANTLR3_INT_STREAM is, ANTLR3_INT32 la); -static ANTLR3_MARKER antlr38BitIndex (pANTLR3_INT_STREAM is); -static ANTLR3_MARKER antlr38BitMark (pANTLR3_INT_STREAM is); -static void antlr38BitRewind (pANTLR3_INT_STREAM is, ANTLR3_MARKER mark); -static void antlr38BitRewindLast (pANTLR3_INT_STREAM is); -static void antlr38BitRelease (pANTLR3_INT_STREAM is, ANTLR3_MARKER mark); -static void antlr38BitSeek (pANTLR3_INT_STREAM is, ANTLR3_MARKER seekPoint); -static pANTLR3_STRING antlr38BitGetSourceName (pANTLR3_INT_STREAM is); - -// 8Bit Charstream API functions -// -static void antlr3InputClose (pANTLR3_INPUT_STREAM input); -static void antlr3InputReset (pANTLR3_INPUT_STREAM input); -static void antlr38BitReuse (pANTLR3_INPUT_STREAM input, pANTLR3_UINT8 inString, ANTLR3_UINT32 size, pANTLR3_UINT8 name); -static void * antlr38BitLT (pANTLR3_INPUT_STREAM input, ANTLR3_INT32 lt); -static ANTLR3_UINT32 antlr38BitSize (pANTLR3_INPUT_STREAM input); -static pANTLR3_STRING antlr38BitSubstr (pANTLR3_INPUT_STREAM input, ANTLR3_MARKER start, ANTLR3_MARKER stop); -static ANTLR3_UINT32 antlr38BitGetLine (pANTLR3_INPUT_STREAM input); -static void * antlr38BitGetLineBuf (pANTLR3_INPUT_STREAM input); -static ANTLR3_UINT32 antlr38BitGetCharPosition (pANTLR3_INPUT_STREAM input); -static void antlr38BitSetLine (pANTLR3_INPUT_STREAM input, ANTLR3_UINT32 line); -static void antlr38BitSetCharPosition (pANTLR3_INPUT_STREAM input, ANTLR3_UINT32 position); -static void antlr38BitSetNewLineChar (pANTLR3_INPUT_STREAM input, ANTLR3_UINT32 newlineChar); -static void antlr38BitSetUcaseLA (pANTLR3_INPUT_STREAM input, ANTLR3_BOOLEAN flag); - -// ----------------------------------- -// UTF16 (also covers UCS2) -// -// INT Stream API -// -static void antlr3UTF16Consume (pANTLR3_INT_STREAM is); -static ANTLR3_UCHAR antlr3UTF16LA (pANTLR3_INT_STREAM is, ANTLR3_INT32 la); -static void antlr3UTF16ConsumeLE (pANTLR3_INT_STREAM is); -static ANTLR3_UCHAR antlr3UTF16LALE (pANTLR3_INT_STREAM is, ANTLR3_INT32 la); -static void antlr3UTF16ConsumeBE (pANTLR3_INT_STREAM is); -static ANTLR3_UCHAR antlr3UTF16LABE (pANTLR3_INT_STREAM is, ANTLR3_INT32 la); -static ANTLR3_MARKER antlr3UTF16Index (pANTLR3_INT_STREAM is); -static void antlr3UTF16Seek (pANTLR3_INT_STREAM is, ANTLR3_MARKER seekPoint); - -// UTF16 Charstream API functions -// -static pANTLR3_STRING antlr3UTF16Substr (pANTLR3_INPUT_STREAM input, ANTLR3_MARKER start, ANTLR3_MARKER stop); - -// ----------------------------------- -// UTF32 (also covers UCS2) -// -// INT Stream API -// -static void antlr3UTF32Consume (pANTLR3_INT_STREAM is); -static ANTLR3_UCHAR antlr3UTF32LA (pANTLR3_INT_STREAM is, ANTLR3_INT32 la); -static ANTLR3_UCHAR antlr3UTF32LALE (pANTLR3_INT_STREAM is, ANTLR3_INT32 la); -static ANTLR3_UCHAR antlr3UTF32LABE (pANTLR3_INT_STREAM is, ANTLR3_INT32 la); -static ANTLR3_MARKER antlr3UTF32Index (pANTLR3_INT_STREAM is); -static void antlr3UTF32Seek (pANTLR3_INT_STREAM is, ANTLR3_MARKER seekPoint); - -// UTF16 Charstream API functions -// -static pANTLR3_STRING antlr3UTF32Substr (pANTLR3_INPUT_STREAM input, ANTLR3_MARKER start, ANTLR3_MARKER stop); - -// ------------------------------------ -// UTF-8 -// -static void antlr3UTF8Consume (pANTLR3_INT_STREAM is); -static ANTLR3_UCHAR antlr3UTF8LA (pANTLR3_INT_STREAM is, ANTLR3_INT32 la); - -// ------------------------------------ -// EBCDIC -// -static ANTLR3_UCHAR antlr3EBCDICLA (pANTLR3_INT_STREAM is, ANTLR3_INT32 la); - -/// \brief Common function to setup function interface for an 8 bit input stream. -/// -/// \param input Input stream context pointer -/// -/// \remark -/// - Many of the 8 bit oriented file stream handling functions will be usable -/// by any or at least some, other input streams. Therefore it is perfectly acceptable -/// to call this function to install the 8Bit handler then override just those functions -/// that would not work for the particular input encoding, such as consume for instance. -/// -void -antlr38BitSetupStream (pANTLR3_INPUT_STREAM input) -{ - // Build a string factory for this stream - // - input->strFactory = antlr3StringFactoryNew(input->encoding); - - // Default stream API set up is for 8Bit, so we are done - // -} - -void -antlr3GenericSetupStream (pANTLR3_INPUT_STREAM input) -{ - /* Install function pointers for an 8 bit input - */ - - /* Allocate stream interface - */ - input->istream = antlr3IntStreamNew(); - input->istream->type = ANTLR3_CHARSTREAM; - input->istream->super = input; - - /* Intstream API - */ - input->istream->consume = antlr38BitConsume; // Consume the next 8 bit character in the buffer - input->istream->_LA = antlr38BitLA; // Return the UTF32 character at offset n (1 based) - input->istream->index = antlr38BitIndex; // Current index (offset from first character - input->istream->mark = antlr38BitMark; // Record the current lex state for later restore - input->istream->rewind = antlr38BitRewind; // How to rewind the input - input->istream->rewindLast = antlr38BitRewindLast; // How to rewind the input - input->istream->seek = antlr38BitSeek; // How to seek to a specific point in the stream - input->istream->release = antlr38BitRelease; // Reset marks after mark n - input->istream->getSourceName = antlr38BitGetSourceName; // Return a string that names the input source - - /* Charstream API - */ - input->close = antlr3InputClose; // Close down the stream completely - input->free = antlr3InputClose; // Synonym for free - input->reset = antlr3InputReset; // Reset input to start - input->reuse = antlr38BitReuse; // Install a new input string and reset - input->_LT = antlr38BitLT; // Same as _LA for 8 bit file - input->size = antlr38BitSize; // Return the size of the input buffer - input->substr = antlr38BitSubstr; // Return a string from the input stream - input->getLine = antlr38BitGetLine; // Return the current line number in the input stream - input->getLineBuf = antlr38BitGetLineBuf; // Return a pointer to the start of the current line being consumed - input->getCharPositionInLine = antlr38BitGetCharPosition; // Return the offset into the current line of input - input->setLine = antlr38BitSetLine; // Set the input stream line number (does not set buffer pointers) - input->setCharPositionInLine = antlr38BitSetCharPosition; // Set the offset in to the current line (does not set any pointers) - input->SetNewLineChar = antlr38BitSetNewLineChar; // Set the value of the newline trigger character - input->setUcaseLA = antlr38BitSetUcaseLA; // Changes the LA function to return upper case always - - input->charByteSize = 1; // Size in bytes of characters in this stream. - - /* Initialize entries for tables etc - */ - input->markers = NULL; - - /* Set up the input stream brand new - */ - input->reset(input); - - /* Install default line separator character (it can be replaced - * by the grammar programmer later) - */ - input->SetNewLineChar(input, (ANTLR3_UCHAR)'\n'); -} - -static pANTLR3_STRING -antlr38BitGetSourceName(pANTLR3_INT_STREAM is) -{ - return is->streamName; -} - -/** \brief Close down an input stream and free any memory allocated by it. - * - * \param input Input stream context pointer - */ -static void -antlr3InputClose(pANTLR3_INPUT_STREAM input) -{ - // Close any markers in the input stream - // - if (input->markers != NULL) - { - input->markers->free(input->markers); - input->markers = NULL; - } - - // Close the string factory - // - if (input->strFactory != NULL) - { - input->strFactory->close(input->strFactory); - } - - // Free the input stream buffer if we allocated it - // - if (input->isAllocated && input->data != NULL) - { - ANTLR3_FREE(input->data); - input->data = NULL; - } - - input->istream->free(input->istream); - - // Finally, free the space for the structure itself - // - ANTLR3_FREE(input); - - // Done - // -} - -static void -antlr38BitSetUcaseLA (pANTLR3_INPUT_STREAM input, ANTLR3_BOOLEAN flag) -{ - if (flag) - { - // Return the upper case version of the characters - // - input->istream->_LA = antlr38BitLA_ucase; - } - else - { - // Return the raw characters as they are in the buffer - // - input->istream->_LA = antlr38BitLA; - } -} - - -/** \brief Reset a re-startable input stream to the start - * - * \param input Input stream context pointer - */ -static void -antlr3InputReset(pANTLR3_INPUT_STREAM input) -{ - - input->nextChar = input->data; /* Input at first character */ - input->line = 1; /* starts at line 1 */ - input->charPositionInLine = -1; - input->currentLine = input->data; - input->markDepth = 0; /* Reset markers */ - - /* Clear out up the markers table if it is there - */ - if (input->markers != NULL) - { - input->markers->clear(input->markers); - } - else - { - /* Install a new markers table - */ - input->markers = antlr3VectorNew(0); - } -} - -/** Install a new source code in to a working input stream so that the - * input stream can be reused. - */ -static void -antlr38BitReuse(pANTLR3_INPUT_STREAM input, pANTLR3_UINT8 inString, ANTLR3_UINT32 size, pANTLR3_UINT8 name) -{ - input->isAllocated = ANTLR3_FALSE; - input->data = inString; - input->sizeBuf = size; - - // Now we can set up the file name. As we are reusing the stream, there may already - // be a string that we can reuse for holding the filename. - // - if (input->istream->streamName == NULL) - { - input->istream->streamName = input->strFactory->newStr(input->strFactory, name == NULL ? (pANTLR3_UINT8)"-memory-" : name); - input->fileName = input->istream->streamName; - } - else - { - input->istream->streamName->set(input->istream->streamName, (name == NULL ? (const char *)"-memory-" : (const char *)name)); - } - - input->reset(input); -} - -/** \brief Consume the next character in an 8 bit input stream - * - * \param input Input stream context pointer - */ -static void -antlr38BitConsume(pANTLR3_INT_STREAM is) -{ - pANTLR3_INPUT_STREAM input; - - input = ((pANTLR3_INPUT_STREAM) (is->super)); - - if ((pANTLR3_UINT8)(input->nextChar) < (((pANTLR3_UINT8)input->data) + input->sizeBuf)) - { - /* Indicate one more character in this line - */ - input->charPositionInLine++; - - if ((ANTLR3_UCHAR)(*((pANTLR3_UINT8)input->nextChar)) == input->newlineChar) - { - /* Reset for start of a new line of input - */ - input->line++; - input->charPositionInLine = 0; - input->currentLine = (void *)(((pANTLR3_UINT8)input->nextChar) + 1); - } - - /* Increment to next character position - */ - input->nextChar = (void *)(((pANTLR3_UINT8)input->nextChar) + 1); - } -} - -/** \brief Return the input element assuming an 8 bit ascii input - * - * \param[in] input Input stream context pointer - * \param[in] la 1 based offset of next input stream element - * - * \return Next input character in internal ANTLR3 encoding (UTF32) - */ -static ANTLR3_UCHAR -antlr38BitLA(pANTLR3_INT_STREAM is, ANTLR3_INT32 la) -{ - pANTLR3_INPUT_STREAM input; - - input = ((pANTLR3_INPUT_STREAM) (is->super)); - - if (( ((pANTLR3_UINT8)input->nextChar) + la - 1) >= (((pANTLR3_UINT8)input->data) + input->sizeBuf)) - { - return ANTLR3_CHARSTREAM_EOF; - } - else - { - return (ANTLR3_UCHAR)(*((pANTLR3_UINT8)input->nextChar + la - 1)); - } -} - -/** \brief Return the input element assuming an 8 bit input and - * always return the UPPER CASE character. - * Note that this is 8 bit and so we assume that the toupper - * function will use the correct locale for 8 bits. - * - * \param[in] input Input stream context pointer - * \param[in] la 1 based offset of next input stream element - * - * \return Next input character in internal ANTLR3 encoding (UTF32) - */ -static ANTLR3_UCHAR -antlr38BitLA_ucase (pANTLR3_INT_STREAM is, ANTLR3_INT32 la) -{ - pANTLR3_INPUT_STREAM input; - - input = ((pANTLR3_INPUT_STREAM) (is->super)); - - if (( ((pANTLR3_UINT8)input->nextChar) + la - 1) >= (((pANTLR3_UINT8)input->data) + input->sizeBuf)) - { - return ANTLR3_CHARSTREAM_EOF; - } - else - { - return (ANTLR3_UCHAR)toupper((*((pANTLR3_UINT8)input->nextChar + la - 1))); - } -} - - -/** \brief Return the input element assuming an 8 bit ascii input - * - * \param[in] input Input stream context pointer - * \param[in] lt 1 based offset of next input stream element - * - * \return Next input character in internal ANTLR3 encoding (UTF32) - */ -static void * -antlr38BitLT(pANTLR3_INPUT_STREAM input, ANTLR3_INT32 lt) -{ - /* Casting is horrible but it means no warnings and LT should never be called - * on a character stream anyway I think. If it is then, the void * will need to be - * cast back in a similar manner. Yuck! But this means that LT for Token streams and - * tree streams is correct. - */ - return (ANTLR3_FUNC_PTR(input->istream->_LA(input->istream, lt))); -} - -/** \brief Calculate the current index in the output stream. - * \param[in] input Input stream context pointer - */ -static ANTLR3_MARKER -antlr38BitIndex(pANTLR3_INT_STREAM is) -{ - pANTLR3_INPUT_STREAM input; - - input = ((pANTLR3_INPUT_STREAM) (is->super)); - - return (ANTLR3_MARKER)(((pANTLR3_UINT8)input->nextChar)); -} - -/** \brief Return the size of the current input stream, as an 8Bit file - * which in this case is the total input. Other implementations may provide - * more sophisticated implementations to deal with non-recoverable streams - * and so on. - * - * \param[in] input Input stream context pointer - */ -static ANTLR3_UINT32 -antlr38BitSize(pANTLR3_INPUT_STREAM input) -{ - return input->sizeBuf; -} - -/** \brief Mark the current input point in an 8Bit 8 bit stream - * such as a file stream, where all the input is available in the - * buffer. - * - * \param[in] is Input stream context pointer - */ -static ANTLR3_MARKER -antlr38BitMark (pANTLR3_INT_STREAM is) -{ - pANTLR3_LEX_STATE state; - pANTLR3_INPUT_STREAM input; - - input = ((pANTLR3_INPUT_STREAM) (is->super)); - - /* New mark point - */ - input->markDepth++; - - /* See if we are revisiting a mark as we can just reuse the vector - * entry if we are, otherwise, we need a new one - */ - if (input->markDepth > input->markers->count) - { - state = ANTLR3_MALLOC(sizeof(ANTLR3_LEX_STATE)); - - /* Add it to the table - */ - input->markers->add(input->markers, state, ANTLR3_FREE_FUNC); /* No special structure, just free() on delete */ - } - else - { - state = (pANTLR3_LEX_STATE)input->markers->get(input->markers, input->markDepth - 1); - - /* Assume no errors for speed, it will just blow up if the table failed - * for some reasons, hence lots of unit tests on the tables ;-) - */ - } - - /* We have created or retrieved the state, so update it with the current - * elements of the lexer state. - */ - state->charPositionInLine = input->charPositionInLine; - state->currentLine = input->currentLine; - state->line = input->line; - state->nextChar = input->nextChar; - - is->lastMarker = input->markDepth; - - /* And that's it - */ - return input->markDepth; -} -/** \brief Rewind the lexer input to the state specified by the last produced mark. - * - * \param[in] input Input stream context pointer - * - * \remark - * Assumes 8 Bit input stream. - */ -static void -antlr38BitRewindLast (pANTLR3_INT_STREAM is) -{ - is->rewind(is, is->lastMarker); -} - -/** \brief Rewind the lexer input to the state specified by the supplied mark. - * - * \param[in] input Input stream context pointer - * - * \remark - * Assumes 8 Bit input stream. - */ -static void -antlr38BitRewind (pANTLR3_INT_STREAM is, ANTLR3_MARKER mark) -{ - pANTLR3_LEX_STATE state; - pANTLR3_INPUT_STREAM input; - - input = ((pANTLR3_INPUT_STREAM) is->super); - - /* Perform any clean up of the marks - */ - input->istream->release(input->istream, mark); - - /* Find the supplied mark state - */ - state = (pANTLR3_LEX_STATE)input->markers->get(input->markers, (ANTLR3_UINT32)(mark - 1)); - - /* Seek input pointer to the requested point (note we supply the void *pointer - * to whatever is implementing the int stream to seek). - */ - antlr38BitSeek(is, (ANTLR3_MARKER)(state->nextChar)); - - /* Reset to the reset of the information in the mark - */ - input->charPositionInLine = state->charPositionInLine; - input->currentLine = state->currentLine; - input->line = state->line; - input->nextChar = state->nextChar; - - /* And we are done - */ -} - -/** \brief Rewind the lexer input to the state specified by the supplied mark. - * - * \param[in] input Input stream context pointer - * - * \remark - * Assumes 8 Bit input stream. - */ -static void -antlr38BitRelease (pANTLR3_INT_STREAM is, ANTLR3_MARKER mark) -{ - pANTLR3_INPUT_STREAM input; - - input = ((pANTLR3_INPUT_STREAM) (is->super)); - - /* We don't do much here in fact as we never free any higher marks in - * the hashtable as we just resuse any memory allocated for them. - */ - input->markDepth = (ANTLR3_UINT32)(mark - 1); -} - -/** \brief Rewind the lexer input to the state specified by the supplied mark. - * - * \param[in] input Input stream context pointer - * - * \remark - * Assumes 8 Bit input stream. - */ -static void -antlr38BitSeek (pANTLR3_INT_STREAM is, ANTLR3_MARKER seekPoint) -{ - ANTLR3_INT32 count; - pANTLR3_INPUT_STREAM input; - - input = ANTLR3_FUNC_PTR(((pANTLR3_INPUT_STREAM) is->super)); - - /* If the requested seek point is less than the current - * input point, then we assume that we are resetting from a mark - * and do not need to scan, but can just set to there. - */ - if (seekPoint <= (ANTLR3_MARKER)(input->nextChar)) - { - input->nextChar = ((pANTLR3_UINT8) seekPoint); - } - else - { - count = (ANTLR3_UINT32)(seekPoint - (ANTLR3_MARKER)(input->nextChar)); - - while (count--) - { - is->consume(is); - } - } -} -/** Return a substring of the 8 bit input stream in - * newly allocated memory. - * - * \param input Input stream context pointer - * \param start Offset in input stream where the string starts - * \param stop Offset in the input stream where the string ends. - */ -static pANTLR3_STRING -antlr38BitSubstr (pANTLR3_INPUT_STREAM input, ANTLR3_MARKER start, ANTLR3_MARKER stop) -{ - return input->strFactory->newPtr(input->strFactory, (pANTLR3_UINT8)start, (ANTLR3_UINT32)(stop - start + 1)); -} - -/** \brief Return the line number as understood by the 8 bit input stream. - * - * \param input Input stream context pointer - * \return Line number in input stream that we believe we are working on. - */ -static ANTLR3_UINT32 -antlr38BitGetLine (pANTLR3_INPUT_STREAM input) -{ - return input->line; -} - -/** Return a pointer into the input stream that points at the start - * of the current input line as triggered by the end of line character installed - * for the stream ('\n' unless told differently). - * - * \param[in] input - */ -static void * -antlr38BitGetLineBuf (pANTLR3_INPUT_STREAM input) -{ - return input->currentLine; -} - -/** Return the current offset in to the current line in the input stream. - * - * \param input Input stream context pointer - * \return Current line offset - */ -static ANTLR3_UINT32 -antlr38BitGetCharPosition (pANTLR3_INPUT_STREAM input) -{ - return input->charPositionInLine; -} - -/** Set the current line number as understood by the input stream. - * - * \param input Input stream context pointer - * \param line Line number to tell the input stream we are on - * - * \remark - * This function does not change any pointers, it just allows the programmer to set the - * line number according to some external criterion, such as finding a lexed directive - * like: #nnn "file.c" for instance, such that error reporting and so on in is in sync - * with some original source format. - */ -static void -antlr38BitSetLine (pANTLR3_INPUT_STREAM input, ANTLR3_UINT32 line) -{ - input->line = line; -} - -/** Set the current offset in the current line to be a particular setting. - * - * \param[in] input Input stream context pointer - * \param[in] position New setting for current offset. - * - * \remark - * This does not set the actual pointers in the input stream, it is purely for reporting - * purposes and so on as per antlr38BitSetLine(); - */ -static void -antlr38BitSetCharPosition (pANTLR3_INPUT_STREAM input, ANTLR3_UINT32 position) -{ - input->charPositionInLine = position; -} - -/** Set the newline trigger character in the input stream to the supplied parameter. - * - * \param[in] input Input stream context pointer - * \param[in] newlineChar Character to set to be the newline trigger. - * - * \remark - * - The supplied newLineChar is in UTF32 encoding (which means ASCII and latin1 etc - * are the same encodings), but the input stream catered to by this function is 8 bit - * only, so it is up to the programmer to ensure that the character supplied is valid. - */ -static void -antlr38BitSetNewLineChar (pANTLR3_INPUT_STREAM input, ANTLR3_UINT32 newlineChar) -{ - input->newlineChar = newlineChar; -} - - -/// \brief Common function to setup function interface for a UTF16 or UCS2 input stream. -/// -/// \param input Input stream context pointer -/// -/// \remark -/// - Strictly speaking, there is no such thing as a UCS2 input stream as the term -/// tends to confuse the notions of character encoding, unicode and so on. UCS2 is -/// essentially UTF16 without any surrogates and so the standard UTF16 -/// input stream is able to handle it without any special code. -/// -void -antlr3UTF16SetupStream (pANTLR3_INPUT_STREAM input, ANTLR3_BOOLEAN machineBigEndian, ANTLR3_BOOLEAN inputBigEndian) -{ - // Build a string factory for this stream. This is a UTF16 string factory which is a standard - // part of the ANTLR3 string. The string factory is then passed through the whole chain - // of lexer->parser->tree->treeparser and so on. - // - input->strFactory = antlr3StringFactoryNew(input->encoding); - - // Generic API that does not care about endianess. - // - input->istream->index = antlr3UTF16Index; // Calculate current index in input stream, UTF16 based - input->substr = antlr3UTF16Substr; // Return a string from the input stream - input->istream->seek = antlr3UTF16Seek; // How to seek to a specific point in the stream - - // We must install different UTF16 routines according to whether the input - // is the same endianess as the machine we are executing upon or not. If it is not - // then we must install methods that can convert the endianess on the fly as they go - // - - switch (machineBigEndian) - { - case ANTLR3_TRUE: - - // Machine is Big Endian, if the input is also then install the - // methods that do not access input by bytes and reverse them. - // Otherwise install endian aware methods. - // - if (inputBigEndian == ANTLR3_TRUE) - { - // Input is machine compatible - // - input->istream->consume = antlr3UTF16Consume; // Consume the next UTF16 character in the buffer - input->istream->_LA = antlr3UTF16LA; // Return the UTF32 character at offset n (1 based) - } - else - { - // Need to use methods that know that the input is little endian - // - input->istream->consume = antlr3UTF16ConsumeLE; // Consume the next UTF16 character in the buffer - input->istream->_LA = antlr3UTF16LALE; // Return the UTF32 character at offset n (1 based) - } - break; - - case ANTLR3_FALSE: - - // Machine is Little Endian, if the input is also then install the - // methods that do not access input by bytes and reverse them. - // Otherwise install endian aware methods. - // - if (inputBigEndian == ANTLR3_FALSE) - { - // Input is machine compatible - // - input->istream->consume = antlr3UTF16Consume; // Consume the next UTF16 character in the buffer - input->istream->_LA = antlr3UTF16LA; // Return the UTF32 character at offset n (1 based) - } - else - { - // Need to use methods that know that the input is Big Endian - // - input->istream->consume = antlr3UTF16ConsumeBE; // Consume the next UTF16 character in the buffer - input->istream->_LA = antlr3UTF16LABE; // Return the UTF32 character at offset n (1 based) - } - break; - } - - - input->charByteSize = 2; // Size in bytes of characters in this stream. - -} - -/// \brief Consume the next character in a UTF16 input stream -/// -/// \param input Input stream context pointer -/// -static void -antlr3UTF16Consume(pANTLR3_INT_STREAM is) -{ - pANTLR3_INPUT_STREAM input; - UTF32 ch; - UTF32 ch2; - - input = ((pANTLR3_INPUT_STREAM) (is->super)); - - // Buffer size is always in bytes - // - if ((pANTLR3_UINT8)(input->nextChar) < (((pANTLR3_UINT8)input->data) + input->sizeBuf)) - { - // Indicate one more character in this line - // - input->charPositionInLine++; - - if ((ANTLR3_UCHAR)(*((pANTLR3_UINT16)input->nextChar)) == input->newlineChar) - { - // Reset for start of a new line of input - // - input->line++; - input->charPositionInLine = 0; - input->currentLine = (void *)(((pANTLR3_UINT16)input->nextChar) + 1); - } - - // Increment to next character position, accounting for any surrogates - // - // Next char in natural machine byte order - // - ch = *((UTF16*)input->nextChar); - - // We consumed one 16 bit character - // - input->nextChar = (void *)(((pANTLR3_UINT16)input->nextChar) + 1); - - // If we have a surrogate pair then we need to consume - // a following valid LO surrogate. - // - if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_HIGH_END) { - - // If the 16 bits following the high surrogate are in the source buffer... - // - if ((pANTLR3_UINT8)(input->nextChar) < (((pANTLR3_UINT8)input->data) + input->sizeBuf)) - { - // Next character is in natural machine byte order - // - ch2 = *((UTF16*)input->nextChar); - - // If it's a valid low surrogate, consume it - // - if (ch2 >= UNI_SUR_LOW_START && ch2 <= UNI_SUR_LOW_END) - { - // We consumed one 16 bit character - // - input->nextChar = (void *)(((pANTLR3_UINT16)input->nextChar) + 1); - } - // Note that we ignore a valid hi surrogate that has no lo surrogate to go with - // it. - // - } - // Note that we ignore a valid hi surrogate that has no lo surrogate to go with - // it because the buffer ended - // - } - // Note that we did not check for an invalid low surrogate here, or that fact that the - // lo surrogate was missing. We just picked out one 16 bit character unless the character - // was a valid hi surrogate, in whcih case we consumed two 16 bit characters. - // - } -} - -/// \brief Return the input element assuming an 8 bit ascii input -/// -/// \param[in] input Input stream context pointer -/// \param[in] la 1 based offset of next input stream element -/// -/// \return Next input character in internal ANTLR3 encoding (UTF32) -/// -static ANTLR3_UCHAR -antlr3UTF16LA(pANTLR3_INT_STREAM is, ANTLR3_INT32 la) -{ - pANTLR3_INPUT_STREAM input; - UTF32 ch; - UTF32 ch2; - UTF16 * nextChar; - - // Find the input interface and where we are currently pointing to - // in the input stream - // - input = ((pANTLR3_INPUT_STREAM) (is->super)); - nextChar = input->nextChar; - - // If a positive offset then advance forward, else retreat - // - if (la >= 0) - { - while (--la > 0 && (pANTLR3_UINT8)nextChar < ((pANTLR3_UINT8)input->data) + input->sizeBuf ) - { - // Advance our copy of the input pointer - // - // Next char in natural machine byte order - // - ch = *nextChar++; - - // If we have a surrogate pair then we need to consume - // a following valid LO surrogate. - // - if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_HIGH_END) - { - // If the 16 bits following the high surrogate are in the source buffer... - // - if ((pANTLR3_UINT8)(nextChar) < (((pANTLR3_UINT8)input->data) + input->sizeBuf)) - { - // Next character is in natural machine byte order - // - ch2 = *nextChar; - - // If it's a valid low surrogate, consume it - // - if (ch2 >= UNI_SUR_LOW_START && ch2 <= UNI_SUR_LOW_END) - { - // We consumed one 16 bit character - // - nextChar++; - } - // Note that we ignore a valid hi surrogate that has no lo surrogate to go with - // it. - // - } - // Note that we ignore a valid hi surrogate that has no lo surrogate to go with - // it because the buffer ended - // - } - // Note that we did not check for an invalid low surrogate here, or that fact that the - // lo surrogate was missing. We just picked out one 16 bit character unless the character - // was a valid hi surrogate, in whcih case we consumed two 16 bit characters. - // - } - } - else - { - // We need to go backwards from our input point - // - while (la++ < 0 && (pANTLR3_UINT8)nextChar > (pANTLR3_UINT8)input->data ) - { - // Get the previous 16 bit character - // - ch = *--nextChar; - - // If we found a low surrogate then go back one more character if - // the hi surrogate is there - // - if (ch >= UNI_SUR_LOW_START && ch <= UNI_SUR_LOW_END) - { - ch2 = *(nextChar-1); - if (ch2 >= UNI_SUR_HIGH_START && ch2 <= UNI_SUR_HIGH_END) - { - // Yes, there is a high surrogate to match it so decrement one more and point to that - // - nextChar--; - } - } - } - } - - // Our local copy of nextChar is now pointing to either the correct character or end of file - // - // Input buffer size is always in bytes - // - if ( (pANTLR3_UINT8)nextChar >= (((pANTLR3_UINT8)input->data) + input->sizeBuf)) - { - return ANTLR3_CHARSTREAM_EOF; - } - else - { - // Pick up the next 16 character (native machine byte order) - // - ch = *nextChar++; - - // If we have a surrogate pair then we need to consume - // a following valid LO surrogate. - // - if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_HIGH_END) - { - // If the 16 bits following the high surrogate are in the source buffer... - // - if ((pANTLR3_UINT8)(nextChar) < (((pANTLR3_UINT8)input->data) + input->sizeBuf)) - { - // Next character is in natural machine byte order - // - ch2 = *nextChar; - - // If it's a valid low surrogate, consume it - // - if (ch2 >= UNI_SUR_LOW_START && ch2 <= UNI_SUR_LOW_END) - { - // Construct the UTF32 code point - // - ch = ((ch - UNI_SUR_HIGH_START) << halfShift) - + (ch2 - UNI_SUR_LOW_START) + halfBase; - } - // Note that we ignore a valid hi surrogate that has no lo surrogate to go with - // it. - // - } - // Note that we ignore a valid hi surrogate that has no lo surrogate to go with - // it because the buffer ended - // - } - } - return ch; -} - - -/// \brief Calculate the current index in the output stream. -/// \param[in] input Input stream context pointer -/// -static ANTLR3_MARKER -antlr3UTF16Index(pANTLR3_INT_STREAM is) -{ - pANTLR3_INPUT_STREAM input; - - input = ((pANTLR3_INPUT_STREAM) (is->super)); - - return (ANTLR3_MARKER)(input->nextChar); -} - -/// \brief Rewind the lexer input to the state specified by the supplied mark. -/// -/// \param[in] input Input stream context pointer -/// -/// \remark -/// Assumes UTF16 input stream. -/// -static void -antlr3UTF16Seek (pANTLR3_INT_STREAM is, ANTLR3_MARKER seekPoint) -{ - pANTLR3_INPUT_STREAM input; - - input = ((pANTLR3_INPUT_STREAM) is->super); - - // If the requested seek point is less than the current - // input point, then we assume that we are resetting from a mark - // and do not need to scan, but can just set to there as rewind will - // reset line numbers and so on. - // - if (seekPoint <= (ANTLR3_MARKER)(input->nextChar)) - { - input->nextChar = (void *)seekPoint; - } - else - { - // Call consume until we reach the asked for seek point or EOF - // - while (is->_LA(is, 1) != ANTLR3_CHARSTREAM_EOF && seekPoint < (ANTLR3_MARKER)input->nextChar) - { - is->consume(is); - } - } -} -/// \brief Return a substring of the UTF16 input stream in -/// newly allocated memory. -/// -/// \param input Input stream context pointer -/// \param start Offset in input stream where the string starts -/// \param stop Offset in the input stream where the string ends. -/// -static pANTLR3_STRING -antlr3UTF16Substr (pANTLR3_INPUT_STREAM input, ANTLR3_MARKER start, ANTLR3_MARKER stop) -{ - return input->strFactory->newPtr(input->strFactory, (pANTLR3_UINT8)start, ((ANTLR3_UINT32_CAST(stop - start))/2) + 1); -} - -/// \brief Consume the next character in a UTF16 input stream when the input is Little Endian and the machine is not -/// Note that the UTF16 routines do not do any substantial verification of the input stream as for performance -/// sake, we assume it is validly encoded. So if a low surrogate is found at the curent input position then we -/// just consume it. Surrogate pairs should be seen as Hi, Lo. So if we have a Lo first, then the input stream -/// is fubar but we just ignore that. -/// -/// \param input Input stream context pointer -/// -static void -antlr3UTF16ConsumeLE(pANTLR3_INT_STREAM is) -{ - pANTLR3_INPUT_STREAM input; - UTF32 ch; - UTF32 ch2; - - input = ((pANTLR3_INPUT_STREAM) (is->super)); - - // Buffer size is always in bytes - // - if ((pANTLR3_UINT8)(input->nextChar) < (((pANTLR3_UINT8)input->data) + input->sizeBuf)) - { - // Indicate one more character in this line - // - input->charPositionInLine++; - - if ((ANTLR3_UCHAR)(*((pANTLR3_UINT16)input->nextChar)) == input->newlineChar) - { - // Reset for start of a new line of input - // - input->line++; - input->charPositionInLine = 0; - input->currentLine = (void *)(((pANTLR3_UINT16)input->nextChar) + 1); - } - - // Increment to next character position, accounting for any surrogates - // - // Next char in litle endian form - // - ch = *((pANTLR3_UINT8)input->nextChar) + (*((pANTLR3_UINT8)input->nextChar + 1) <<8); - - // We consumed one 16 bit character - // - input->nextChar = (void *)(((pANTLR3_UINT16)input->nextChar) + 1); - - // If we have a surrogate pair then we need to consume - // a following valid LO surrogate. - // - if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_HIGH_END) { - - // If the 16 bits following the high surrogate are in the source buffer... - // - if ((pANTLR3_UINT8)(input->nextChar) < (((pANTLR3_UINT8)input->data) + input->sizeBuf)) - { - ch2 = *((pANTLR3_UINT8)input->nextChar) + (*((pANTLR3_UINT8)input->nextChar + 1) <<8); - - // If it's a valid low surrogate, consume it - // - if (ch2 >= UNI_SUR_LOW_START && ch2 <= UNI_SUR_LOW_END) - { - // We consumed one 16 bit character - // - input->nextChar = (void *)(((pANTLR3_UINT16)input->nextChar) + 1); - } - // Note that we ignore a valid hi surrogate that has no lo surrogate to go with - // it. - // - } - // Note that we ignore a valid hi surrogate that has no lo surrogate to go with - // it because the buffer ended - // - } - // Note that we did not check for an invalid low surrogate here, or that fact that the - // lo surrogate was missing. We just picked out one 16 bit character unless the character - // was a valid hi surrogate, in whcih case we consumed two 16 bit characters. - // - } -} - -/// \brief Return the input element assuming a UTF16 input when the input is Little Endian and the machine is not -/// -/// \param[in] input Input stream context pointer -/// \param[in] la 1 based offset of next input stream element -/// -/// \return Next input character in internal ANTLR3 encoding (UTF32) -/// -static ANTLR3_UCHAR -antlr3UTF16LALE(pANTLR3_INT_STREAM is, ANTLR3_INT32 la) -{ - pANTLR3_INPUT_STREAM input; - UTF32 ch; - UTF32 ch2; - pANTLR3_UCHAR nextChar; - - // Find the input interface and where we are currently pointing to - // in the input stream - // - input = ((pANTLR3_INPUT_STREAM) (is->super)); - nextChar = input->nextChar; - - // If a positive offset then advance forward, else retreat - // - if (la >= 0) - { - while (--la > 0 && (pANTLR3_UINT8)nextChar < ((pANTLR3_UINT8)input->data) + input->sizeBuf ) - { - // Advance our copy of the input pointer - // - // Next char in Little Endian byte order - // - ch = (*nextChar) + (*(nextChar+1) << 8); - nextChar += 2; - - // If we have a surrogate pair then we need to consume - // a following valid LO surrogate. - // - if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_HIGH_END) - { - // If the 16 bits following the high surrogate are in the source buffer... - // - if ((pANTLR3_UINT8)(nextChar) < (((pANTLR3_UINT8)input->data) + input->sizeBuf)) - { - // Next character is in little endian byte order - // - ch2 = (*nextChar) + (*(nextChar+1) << 8); - - // If it's a valid low surrogate, consume it - // - if (ch2 >= UNI_SUR_LOW_START && ch2 <= UNI_SUR_LOW_END) - { - // We consumed one 16 bit character - // - nextChar += 2; - } - // Note that we ignore a valid hi surrogate that has no lo surrogate to go with - // it. - // - } - // Note that we ignore a valid hi surrogate that has no lo surrogate to go with - // it because the buffer ended - // - } - // Note that we did not check for an invalid low surrogate here, or that fact that the - // lo surrogate was missing. We just picked out one 16 bit character unless the character - // was a valid hi surrogate, in whcih case we consumed two 16 bit characters. - // - } - } - else - { - // We need to go backwards from our input point - // - while (la++ < 0 && (pANTLR3_UINT8)nextChar > (pANTLR3_UINT8)input->data ) - { - // Get the previous 16 bit character - // - ch = (*nextChar - 2) + ((*nextChar -1) << 8); - nextChar -= 2; - - // If we found a low surrogate then go back one more character if - // the hi surrogate is there - // - if (ch >= UNI_SUR_LOW_START && ch <= UNI_SUR_LOW_END) - { - ch2 = (*nextChar - 2) + ((*nextChar -1) << 8); - if (ch2 >= UNI_SUR_HIGH_START && ch2 <= UNI_SUR_HIGH_END) - { - // Yes, there is a high surrogate to match it so decrement one more and point to that - // - nextChar -=2; - } - } - } - } - - // Our local copy of nextChar is now pointing to either the correct character or end of file - // - // Input buffer size is always in bytes - // - if ( (pANTLR3_UINT8)nextChar >= (((pANTLR3_UINT8)input->data) + input->sizeBuf)) - { - return ANTLR3_CHARSTREAM_EOF; - } - else - { - // Pick up the next 16 character (little endian byte order) - // - ch = (*nextChar) + (*(nextChar+1) << 8); - nextChar += 2; - - // If we have a surrogate pair then we need to consume - // a following valid LO surrogate. - // - if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_HIGH_END) - { - // If the 16 bits following the high surrogate are in the source buffer... - // - if ((pANTLR3_UINT8)(nextChar) < (((pANTLR3_UINT8)input->data) + input->sizeBuf)) - { - // Next character is in little endian byte order - // - ch2 = (*nextChar) + (*(nextChar+1) << 8); - - // If it's a valid low surrogate, consume it - // - if (ch2 >= UNI_SUR_LOW_START && ch2 <= UNI_SUR_LOW_END) - { - // Construct the UTF32 code point - // - ch = ((ch - UNI_SUR_HIGH_START) << halfShift) - + (ch2 - UNI_SUR_LOW_START) + halfBase; - } - // Note that we ignore a valid hi surrogate that has no lo surrogate to go with - // it. - // - } - // Note that we ignore a valid hi surrogate that has no lo surrogate to go with - // it because the buffer ended - // - } - } - return ch; -} - -/// \brief Consume the next character in a UTF16 input stream when the input is Big Endian and the machine is not -/// -/// \param input Input stream context pointer -/// -static void -antlr3UTF16ConsumeBE(pANTLR3_INT_STREAM is) -{ - pANTLR3_INPUT_STREAM input; - UTF32 ch; - UTF32 ch2; - - input = ((pANTLR3_INPUT_STREAM) (is->super)); - - // Buffer size is always in bytes - // - if ((pANTLR3_UINT8)(input->nextChar) < (((pANTLR3_UINT8)input->data) + input->sizeBuf)) - { - // Indicate one more character in this line - // - input->charPositionInLine++; - - if ((ANTLR3_UCHAR)(*((pANTLR3_UINT16)input->nextChar)) == input->newlineChar) - { - // Reset for start of a new line of input - // - input->line++; - input->charPositionInLine = 0; - input->currentLine = (void *)(((pANTLR3_UINT16)input->nextChar) + 1); - } - - // Increment to next character position, accounting for any surrogates - // - // Next char in big endian form - // - ch = *((pANTLR3_UINT8)input->nextChar + 1) + (*((pANTLR3_UINT8)input->nextChar ) <<8); - - // We consumed one 16 bit character - // - input->nextChar = (void *)(((pANTLR3_UINT16)input->nextChar) + 1); - - // If we have a surrogate pair then we need to consume - // a following valid LO surrogate. - // - if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_HIGH_END) { - - // If the 16 bits following the high surrogate are in the source buffer... - // - if ((pANTLR3_UINT8)(input->nextChar) < (((pANTLR3_UINT8)input->data) + input->sizeBuf)) - { - // Big endian - // - ch2 = *((pANTLR3_UINT8)input->nextChar + 1) + (*((pANTLR3_UINT8)input->nextChar ) <<8); - - // If it's a valid low surrogate, consume it - // - if (ch2 >= UNI_SUR_LOW_START && ch2 <= UNI_SUR_LOW_END) - { - // We consumed one 16 bit character - // - input->nextChar = (void *)(((pANTLR3_UINT16)input->nextChar) + 1); - } - // Note that we ignore a valid hi surrogate that has no lo surrogate to go with - // it. - // - } - // Note that we ignore a valid hi surrogate that has no lo surrogate to go with - // it because the buffer ended - // - } - // Note that we did not check for an invalid low surrogate here, or that fact that the - // lo surrogate was missing. We just picked out one 16 bit character unless the character - // was a valid hi surrogate, in whcih case we consumed two 16 bit characters. - // - } -} - -/// \brief Return the input element assuming a UTF16 input when the input is Little Endian and the machine is not -/// -/// \param[in] input Input stream context pointer -/// \param[in] la 1 based offset of next input stream element -/// -/// \return Next input character in internal ANTLR3 encoding (UTF32) -/// -static ANTLR3_UCHAR -antlr3UTF16LABE(pANTLR3_INT_STREAM is, ANTLR3_INT32 la) -{ - pANTLR3_INPUT_STREAM input; - UTF32 ch; - UTF32 ch2; - pANTLR3_UCHAR nextChar; - - // Find the input interface and where we are currently pointing to - // in the input stream - // - input = ((pANTLR3_INPUT_STREAM) (is->super)); - nextChar = input->nextChar; - - // If a positive offset then advance forward, else retreat - // - if (la >= 0) - { - while (--la > 0 && (pANTLR3_UINT8)nextChar < ((pANTLR3_UINT8)input->data) + input->sizeBuf ) - { - // Advance our copy of the input pointer - // - // Next char in Big Endian byte order - // - ch = ((*nextChar) << 8) + *(nextChar+1); - nextChar += 2; - - // If we have a surrogate pair then we need to consume - // a following valid LO surrogate. - // - if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_HIGH_END) - { - // If the 16 bits following the high surrogate are in the source buffer... - // - if ((pANTLR3_UINT8)(nextChar) < (((pANTLR3_UINT8)input->data) + input->sizeBuf)) - { - // Next character is in big endian byte order - // - ch2 = ((*nextChar) << 8) + *(nextChar+1); - - // If it's a valid low surrogate, consume it - // - if (ch2 >= UNI_SUR_LOW_START && ch2 <= UNI_SUR_LOW_END) - { - // We consumed one 16 bit character - // - nextChar += 2; - } - // Note that we ignore a valid hi surrogate that has no lo surrogate to go with - // it. - // - } - // Note that we ignore a valid hi surrogate that has no lo surrogate to go with - // it because the buffer ended - // - } - // Note that we did not check for an invalid low surrogate here, or that fact that the - // lo surrogate was missing. We just picked out one 16 bit character unless the character - // was a valid hi surrogate, in whcih case we consumed two 16 bit characters. - // - } - } - else - { - // We need to go backwards from our input point - // - while (la++ < 0 && (pANTLR3_UINT8)nextChar > (pANTLR3_UINT8)input->data ) - { - // Get the previous 16 bit character - // - ch = ((*nextChar - 2) << 8) + (*nextChar -1); - nextChar -= 2; - - // If we found a low surrogate then go back one more character if - // the hi surrogate is there - // - if (ch >= UNI_SUR_LOW_START && ch <= UNI_SUR_LOW_END) - { - ch2 = ((*nextChar - 2) << 8) + (*nextChar -1); - if (ch2 >= UNI_SUR_HIGH_START && ch2 <= UNI_SUR_HIGH_END) - { - // Yes, there is a high surrogate to match it so decrement one more and point to that - // - nextChar -=2; - } - } - } - } - - // Our local copy of nextChar is now pointing to either the correct character or end of file - // - // Input buffer size is always in bytes - // - if ( (pANTLR3_UINT8)nextChar >= (((pANTLR3_UINT8)input->data) + input->sizeBuf)) - { - return ANTLR3_CHARSTREAM_EOF; - } - else - { - // Pick up the next 16 character (big endian byte order) - // - ch = ((*nextChar) << 8) + *(nextChar+1); - nextChar += 2; - - // If we have a surrogate pair then we need to consume - // a following valid LO surrogate. - // - if (ch >= UNI_SUR_HIGH_START && ch <= UNI_SUR_HIGH_END) - { - // If the 16 bits following the high surrogate are in the source buffer... - // - if ((pANTLR3_UINT8)(nextChar) < (((pANTLR3_UINT8)input->data) + input->sizeBuf)) - { - // Next character is in big endian byte order - // - ch2 = ((*nextChar) << 8) + *(nextChar+1); - - // If it's a valid low surrogate, consume it - // - if (ch2 >= UNI_SUR_LOW_START && ch2 <= UNI_SUR_LOW_END) - { - // Construct the UTF32 code point - // - ch = ((ch - UNI_SUR_HIGH_START) << halfShift) - + (ch2 - UNI_SUR_LOW_START) + halfBase; - } - // Note that we ignore a valid hi surrogate that has no lo surrogate to go with - // it. - // - } - // Note that we ignore a valid hi surrogate that has no lo surrogate to go with - // it because the buffer ended - // - } - } - return ch; -} - -/// \brief Common function to setup function interface for a UTF3 input stream. -/// -/// \param input Input stream context pointer -/// -void -antlr3UTF32SetupStream (pANTLR3_INPUT_STREAM input, ANTLR3_BOOLEAN machineBigEndian, ANTLR3_BOOLEAN inputBigEndian) -{ - // Build a string factory for this stream. This is a UTF32 string factory which is a standard - // part of the ANTLR3 string. The string factory is then passed through the whole chain of lexer->parser->tree->treeparser - // and so on. - // - input->strFactory = antlr3StringFactoryNew(input->encoding); - - // Generic API that does not care about endianess. - // - input->istream->index = antlr3UTF32Index; // Calculate current index in input stream, UTF16 based - input->substr = antlr3UTF32Substr; // Return a string from the input stream - input->istream->seek = antlr3UTF32Seek; // How to seek to a specific point in the stream - input->istream->consume = antlr3UTF32Consume; // Consume the next UTF32 character in the buffer - - // We must install different UTF32 LA routines according to whether the input - // is the same endianess as the machine we are executing upon or not. If it is not - // then we must install methods that can convert the endianess on the fly as they go - // - switch (machineBigEndian) - { - case ANTLR3_TRUE: - - // Machine is Big Endian, if the input is also then install the - // methods that do not access input by bytes and reverse them. - // Otherwise install endian aware methods. - // - if (inputBigEndian == ANTLR3_TRUE) - { - // Input is machine compatible - // - input->istream->_LA = antlr3UTF32LA; // Return the UTF32 character at offset n (1 based) - } - else - { - // Need to use methods that know that the input is little endian - // - input->istream->_LA = antlr3UTF32LALE; // Return the UTF32 character at offset n (1 based) - } - break; - - case ANTLR3_FALSE: - - // Machine is Little Endian, if the input is also then install the - // methods that do not access input by bytes and reverse them. - // Otherwise install endian aware methods. - // - if (inputBigEndian == ANTLR3_FALSE) - { - // Input is machine compatible - // - input->istream->_LA = antlr3UTF32LA; // Return the UTF32 character at offset n (1 based) - } - else - { - // Need to use methods that know that the input is Big Endian - // - input->istream->_LA = antlr3UTF32LABE; // Return the UTF32 character at offset n (1 based) - } - break; - } - - input->charByteSize = 4; // Size in bytes of characters in this stream. -} - -/** \brief Consume the next character in a UTF32 input stream - * - * \param input Input stream context pointer - */ -static void -antlr3UTF32Consume(pANTLR3_INT_STREAM is) -{ - pANTLR3_INPUT_STREAM input; - - input = ((pANTLR3_INPUT_STREAM) (is->super)); - - // SizeBuf is always in bytes - // - if ((pANTLR3_UINT8)(input->nextChar) < (((pANTLR3_UINT8)input->data) + input->sizeBuf)) - { - /* Indicate one more character in this line - */ - input->charPositionInLine++; - - if ((ANTLR3_UCHAR)(*((pANTLR3_UINT32)input->nextChar)) == input->newlineChar) - { - /* Reset for start of a new line of input - */ - input->line++; - input->charPositionInLine = 0; - input->currentLine = (void *)(((pANTLR3_UINT32)input->nextChar) + 1); - } - - /* Increment to next character position - */ - input->nextChar = (void *)(((pANTLR3_UINT32)input->nextChar) + 1); - } -} - -/// \brief Calculate the current index in the output stream. -/// \param[in] input Input stream context pointer -/// -static ANTLR3_MARKER -antlr3UTF32Index(pANTLR3_INT_STREAM is) -{ - pANTLR3_INPUT_STREAM input; - - input = ((pANTLR3_INPUT_STREAM) (is->super)); - - return (ANTLR3_MARKER)(input->nextChar); -} - -/// \brief Return a substring of the UTF16 input stream in -/// newly allocated memory. -/// -/// \param input Input stream context pointer -/// \param start Offset in input stream where the string starts -/// \param stop Offset in the input stream where the string ends. -/// -static pANTLR3_STRING -antlr3UTF32Substr (pANTLR3_INPUT_STREAM input, ANTLR3_MARKER start, ANTLR3_MARKER stop) -{ - return input->strFactory->newPtr(input->strFactory, (pANTLR3_UINT8)start, ((ANTLR3_UINT32_CAST(stop - start))/4) + 1); -} - -/// \brief Rewind the lexer input to the state specified by the supplied mark. -/// -/// \param[in] input Input stream context pointer -/// -/// \remark -/// Assumes UTF32 input stream. -/// -static void -antlr3UTF32Seek (pANTLR3_INT_STREAM is, ANTLR3_MARKER seekPoint) -{ - pANTLR3_INPUT_STREAM input; - - input = ((pANTLR3_INPUT_STREAM) is->super); - - // If the requested seek point is less than the current - // input point, then we assume that we are resetting from a mark - // and do not need to scan, but can just set to there as rewind will - // reset line numbers and so on. - // - if (seekPoint <= (ANTLR3_MARKER)(input->nextChar)) - { - input->nextChar = (void *)seekPoint; - } - else - { - // Call consume until we reach the asked for seek point or EOF - // - while (is->_LA(is, 1) != ANTLR3_CHARSTREAM_EOF && seekPoint < (ANTLR3_MARKER)input->nextChar) - { - is->consume(is); - } - } -} - -/** \brief Return the input element assuming a UTF32 input in natural machine byte order - * - * \param[in] input Input stream context pointer - * \param[in] la 1 based offset of next input stream element - * - * \return Next input character in internal ANTLR3 encoding (UTF32) - */ -static ANTLR3_UCHAR -antlr3UTF32LA(pANTLR3_INT_STREAM is, ANTLR3_INT32 la) -{ - pANTLR3_INPUT_STREAM input; - - input = ((pANTLR3_INPUT_STREAM) (is->super)); - - if (( ((pANTLR3_UINT8)input->nextChar) + la - 1) >= (((pANTLR3_UINT8)input->data) + input->sizeBuf)) - { - return ANTLR3_CHARSTREAM_EOF; - } - else - { - return (ANTLR3_UCHAR)(*((pANTLR3_UINT32)input->nextChar + la - 1)); - } -} - -/** \brief Return the input element assuming a UTF32 input in little endian byte order - * - * \param[in] input Input stream context pointer - * \param[in] la 1 based offset of next input stream element - * - * \return Next input character in internal ANTLR3 encoding (UTF32) - */ -static ANTLR3_UCHAR -antlr3UTF32LALE(pANTLR3_INT_STREAM is, ANTLR3_INT32 la) -{ - pANTLR3_INPUT_STREAM input; - - input = ((pANTLR3_INPUT_STREAM) (is->super)); - - if (( ((pANTLR3_UINT8)input->nextChar) + la - 1) >= (((pANTLR3_UINT8)input->data) + input->sizeBuf)) - { - return ANTLR3_CHARSTREAM_EOF; - } - else - { - ANTLR3_UCHAR c; - - c = (ANTLR3_UCHAR)(*((pANTLR3_UINT32)input->nextChar + la - 1)); - - // Swap Endianess to Big Endian - // - return (c>>24) | ((c<<8) & 0x00FF0000) | ((c>>8) & 0x0000FF00) | (c<<24); - } -} - -/** \brief Return the input element assuming a UTF32 input in big endian byte order - * - * \param[in] input Input stream context pointer - * \param[in] la 1 based offset of next input stream element - * - * \return Next input character in internal ANTLR3 encoding (UTF32) - * \remark This is the same code as LE version but seprated in case there are better optimisations fo rendinan swap - */ -static ANTLR3_UCHAR -antlr3UTF32LABE(pANTLR3_INT_STREAM is, ANTLR3_INT32 la) -{ - pANTLR3_INPUT_STREAM input; - - input = ((pANTLR3_INPUT_STREAM) (is->super)); - - if (( ((pANTLR3_UINT8)input->nextChar) + la - 1) >= (((pANTLR3_UINT8)input->data) + input->sizeBuf)) - { - return ANTLR3_CHARSTREAM_EOF; - } - else - { - ANTLR3_UCHAR c; - - c = (ANTLR3_UCHAR)(*((pANTLR3_UINT32)input->nextChar + la - 1)); - - // Swap Endianess to Little Endian - // - return (c>>24) | ((c<<8) & 0x00FF0000) | ((c>>8) & 0x0000FF00) | (c<<24); - } -} - - -/// \brief Common function to setup function interface for a UTF8 input stream. -/// -/// \param input Input stream context pointer -/// -void -antlr3UTF8SetupStream (pANTLR3_INPUT_STREAM input) -{ - // Build a string factory for this stream. This is a UTF16 string factory which is a standard - // part of the ANTLR3 string. The string factory is then passed through the whole chain of lexer->parser->tree->treeparser - // and so on. - // - input->strFactory = antlr3StringFactoryNew(input->encoding); - - // Generic API that does not care about endianess. - // - input->istream->consume = antlr3UTF8Consume; // Consume the next UTF32 character in the buffer - input->istream->_LA = antlr3UTF8LA; // Return the UTF32 character at offset n (1 based) - input->charByteSize = 0; // Size in bytes of characters in this stream. -} - -// ------------------------------------------------------ -// Following is from Unicode.org (see antlr3convertutf.c) -// - -/// Index into the table below with the first byte of a UTF-8 sequence to -/// get the number of trailing bytes that are supposed to follow it. -/// Note that *legal* UTF-8 values can't have 4 or 5-bytes. The table is -/// left as-is for anyone who may want to do such conversion, which was -/// allowed in earlier algorithms. -/// -static const ANTLR3_UINT32 trailingBytesForUTF8[256] = { - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, - 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, - 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, 3,3,3,3,3,3,3,3,4,4,4,4,5,5,5,5 -}; - -/// Magic values subtracted from a buffer value during UTF8 conversion. -/// This table contains as many values as there might be trailing bytes -/// in a UTF-8 sequence. -/// -static const UTF32 offsetsFromUTF8[6] = - { 0x00000000UL, 0x00003080UL, 0x000E2080UL, - 0x03C82080UL, 0xFA082080UL, 0x82082080UL - }; - -// End of Unicode.org tables -// ------------------------- - - -/** \brief Consume the next character in a UTF8 input stream - * - * \param input Input stream context pointer - */ -static void -antlr3UTF8Consume(pANTLR3_INT_STREAM is) -{ - pANTLR3_INPUT_STREAM input; - ANTLR3_UINT32 extraBytesToRead; - ANTLR3_UCHAR ch; - pANTLR3_UINT8 nextChar; - - input = ((pANTLR3_INPUT_STREAM) (is->super)); - - nextChar = input->nextChar; - - if (nextChar < (((pANTLR3_UINT8)input->data) + input->sizeBuf)) - { - // Indicate one more character in this line - // - input->charPositionInLine++; - - // Are there more bytes needed to make up the whole thing? - // - extraBytesToRead = trailingBytesForUTF8[*nextChar]; - - if (nextChar + extraBytesToRead >= (((pANTLR3_UINT8)input->data) + input->sizeBuf)) - { - input->nextChar = (((pANTLR3_UINT8)input->data) + input->sizeBuf); - return; - } - - // Cases deliberately fall through (see note A in antlrconvertutf.c) - // Legal UTF8 is only 4 bytes but 6 bytes could be used in old UTF8 so - // we allow it. - // - ch = 0; - switch (extraBytesToRead) { - case 5: ch += *nextChar++; ch <<= 6; - case 4: ch += *nextChar++; ch <<= 6; - case 3: ch += *nextChar++; ch <<= 6; - case 2: ch += *nextChar++; ch <<= 6; - case 1: ch += *nextChar++; ch <<= 6; - case 0: ch += *nextChar++; - } - - // Magically correct the input value - // - ch -= offsetsFromUTF8[extraBytesToRead]; - if (ch == input->newlineChar) - { - /* Reset for start of a new line of input - */ - input->line++; - input->charPositionInLine = 0; - input->currentLine = (void *)nextChar; - } - - // Update input pointer - // - input->nextChar = nextChar; - } -} -/** \brief Return the input element assuming a UTF8 input - * - * \param[in] input Input stream context pointer - * \param[in] la 1 based offset of next input stream element - * - * \return Next input character in internal ANTLR3 encoding (UTF32) - */ -static ANTLR3_UCHAR -antlr3UTF8LA(pANTLR3_INT_STREAM is, ANTLR3_INT32 la) -{ - pANTLR3_INPUT_STREAM input; - ANTLR3_UINT32 extraBytesToRead; - ANTLR3_UCHAR ch; - pANTLR3_UINT8 nextChar; - - input = ((pANTLR3_INPUT_STREAM) (is->super)); - - nextChar = input->nextChar; - - // Do we need to traverse forwards or backwards? - // - LA(0) is treated as LA(1) and we assume that the nextChar is - // already positioned. - // - LA(n+) ; n>1 means we must traverse forward n-1 characters catering for UTF8 encoding - // - LA(-n) means we must traverse backwards n chracters - // - if (la > 1) { - - // Make sure that we have at least one character left before trying to - // loop through the buffer. - // - if (nextChar < (((pANTLR3_UINT8)input->data) + input->sizeBuf)) - { - // Now traverse n-1 characters forward - // - while (--la > 0) - { - // Does the next character require trailing bytes? - // If so advance the pointer by that many bytes as well as advancing - // one position for what will be at least a single byte character. - // - nextChar += trailingBytesForUTF8[*nextChar] + 1; - - // Does that calculation take us past the byte length of the buffer? - // - if (nextChar >= (((pANTLR3_UINT8)input->data) + input->sizeBuf)) - { - return ANTLR3_CHARSTREAM_EOF; - } - } - } - else - { - return ANTLR3_CHARSTREAM_EOF; - } - } - else - { - // LA is negative so we decrease the pointer by n character positions - // - while (nextChar > (pANTLR3_UINT8)input->data && la++ < 0) - { - // Traversing backwards in UTF8 means decermenting by one - // then continuing to decrement while ever a character pattern - // is flagged as being a trailing byte of an encoded code point. - // Trailing UTF8 bytes always start with 10 in binary. We assumne that - // the UTF8 is well formed and do not check boundary conditions - // - nextChar--; - while ((*nextChar & 0xC0) == 0x80) - { - nextChar--; - } - } - } - - // nextChar is now pointing at the UTF8 encoded character that we need to - // decode and return. - // - // Are there more bytes needed to make up the whole thing? - // - extraBytesToRead = trailingBytesForUTF8[*nextChar]; - if (nextChar + extraBytesToRead >= (((pANTLR3_UINT8)input->data) + input->sizeBuf)) - { - return ANTLR3_CHARSTREAM_EOF; - } - - // Cases deliberately fall through (see note A in antlrconvertutf.c) - // - ch = 0; - switch (extraBytesToRead) { - case 5: ch += *nextChar++; ch <<= 6; - case 4: ch += *nextChar++; ch <<= 6; - case 3: ch += *nextChar++; ch <<= 6; - case 2: ch += *nextChar++; ch <<= 6; - case 1: ch += *nextChar++; ch <<= 6; - case 0: ch += *nextChar++; - } - - // Magically correct the input value - // - ch -= offsetsFromUTF8[extraBytesToRead]; - - return ch; -} - -// EBCDIC to ASCII conversion table -// -// This for EBCDIC EDF04 translated to ISO-8859.1 which is the usually accepted POSIX -// translation and the character tables are published all over the interweb. -// -const ANTLR3_UCHAR e2a[256] = -{ - 0x00, 0x01, 0x02, 0x03, 0x85, 0x09, 0x86, 0x7f, - 0x87, 0x8d, 0x8e, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, - 0x10, 0x11, 0x12, 0x13, 0x8f, 0x0a, 0x08, 0x97, - 0x18, 0x19, 0x9c, 0x9d, 0x1c, 0x1d, 0x1e, 0x1f, - 0x80, 0x81, 0x82, 0x83, 0x84, 0x92, 0x17, 0x1b, - 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x05, 0x06, 0x07, - 0x90, 0x91, 0x16, 0x93, 0x94, 0x95, 0x96, 0x04, - 0x98, 0x99, 0x9a, 0x9b, 0x14, 0x15, 0x9e, 0x1a, - 0x20, 0xa0, 0xe2, 0xe4, 0xe0, 0xe1, 0xe3, 0xe5, - 0xe7, 0xf1, 0x60, 0x2e, 0x3c, 0x28, 0x2b, 0x7c, - 0x26, 0xe9, 0xea, 0xeb, 0xe8, 0xed, 0xee, 0xef, - 0xec, 0xdf, 0x21, 0x24, 0x2a, 0x29, 0x3b, 0x9f, - 0x2d, 0x2f, 0xc2, 0xc4, 0xc0, 0xc1, 0xc3, 0xc5, - 0xc7, 0xd1, 0x5e, 0x2c, 0x25, 0x5f, 0x3e, 0x3f, - 0xf8, 0xc9, 0xca, 0xcb, 0xc8, 0xcd, 0xce, 0xcf, - 0xcc, 0xa8, 0x3a, 0x23, 0x40, 0x27, 0x3d, 0x22, - 0xd8, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, - 0x68, 0x69, 0xab, 0xbb, 0xf0, 0xfd, 0xfe, 0xb1, - 0xb0, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f, 0x70, - 0x71, 0x72, 0xaa, 0xba, 0xe6, 0xb8, 0xc6, 0xa4, - 0xb5, 0xaf, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, - 0x79, 0x7a, 0xa1, 0xbf, 0xd0, 0xdd, 0xde, 0xae, - 0xa2, 0xa3, 0xa5, 0xb7, 0xa9, 0xa7, 0xb6, 0xbc, - 0xbd, 0xbe, 0xac, 0x5b, 0x5c, 0x5d, 0xb4, 0xd7, - 0xf9, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, - 0x48, 0x49, 0xad, 0xf4, 0xf6, 0xf2, 0xf3, 0xf5, - 0xa6, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50, - 0x51, 0x52, 0xb9, 0xfb, 0xfc, 0xdb, 0xfa, 0xff, - 0xd9, 0xf7, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, - 0x59, 0x5a, 0xb2, 0xd4, 0xd6, 0xd2, 0xd3, 0xd5, - 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, - 0x38, 0x39, 0xb3, 0x7b, 0xdc, 0x7d, 0xda, 0x7e -}; - -/// \brief Common function to setup function interface for a EBCDIC input stream. -/// -/// \param input Input stream context pointer -/// -void -antlr3EBCDICSetupStream (pANTLR3_INPUT_STREAM input) -{ - // EBCDIC streams can use the standard 8 bit string factory - // - input->strFactory = antlr3StringFactoryNew(input->encoding); - - // Generic API that does not care about endianess. - // - input->istream->_LA = antlr3EBCDICLA; // Return the UTF32 character at offset n (1 based) - input->charByteSize = 1; // Size in bytes of characters in this stream. -} - -/// \brief Return the input element assuming an 8 bit EBCDIC input -/// -/// \param[in] input Input stream context pointer -/// \param[in] la 1 based offset of next input stream element -/// -/// \return Next input character in internal ANTLR3 encoding (UTF32) after translation -/// from EBCDIC to ASCII -/// -static ANTLR3_UCHAR -antlr3EBCDICLA(pANTLR3_INT_STREAM is, ANTLR3_INT32 la) -{ - pANTLR3_INPUT_STREAM input; - - input = ((pANTLR3_INPUT_STREAM) (is->super)); - - if (( ((pANTLR3_UINT8)input->nextChar) + la - 1) >= (((pANTLR3_UINT8)input->data) + input->sizeBuf)) - { - return ANTLR3_CHARSTREAM_EOF; - } - else - { - // Translate the required character via the constant conversion table - // - return e2a[(*((pANTLR3_UINT8)input->nextChar + la - 1))]; - } -} \ No newline at end of file diff --git a/impl/antlr/libantlr3c-3.4/src/antlr3intstream.c b/impl/antlr/libantlr3c-3.4/src/antlr3intstream.c deleted file mode 100644 index b9d49d8..0000000 --- a/impl/antlr/libantlr3c-3.4/src/antlr3intstream.c +++ /dev/null @@ -1,66 +0,0 @@ -/// \file -/// Implementation of superclass elements of an ANTLR3 int stream. -/// The only methods required are an allocator and a destructor. -/// \addtogroup pANTLR3_INT_STREAM -/// @{ - -// [The "BSD licence"] -// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC -// http://www.temporal-wave.com -// http://www.linkedin.com/in/jimidle -// -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions -// are met: -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// 3. The name of the author may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include - -static void freeStream (pANTLR3_INT_STREAM stream); - -ANTLR3_API pANTLR3_INT_STREAM -antlr3IntStreamNew() -{ - pANTLR3_INT_STREAM stream; - - // Allocate memory - // - stream = (pANTLR3_INT_STREAM) ANTLR3_CALLOC(1, sizeof(ANTLR3_INT_STREAM)); - - if (stream == NULL) - { - return NULL; - } - - stream->free = freeStream; - - return stream; -} - -static void -freeStream (pANTLR3_INT_STREAM stream) -{ - ANTLR3_FREE(stream); -} - -/// @} -/// diff --git a/impl/antlr/libantlr3c-3.4/src/antlr3lexer.c b/impl/antlr/libantlr3c-3.4/src/antlr3lexer.c deleted file mode 100644 index d981ab7..0000000 --- a/impl/antlr/libantlr3c-3.4/src/antlr3lexer.c +++ /dev/null @@ -1,904 +0,0 @@ -/** \file - * - * Base implementation of an antlr 3 lexer. - * - * An ANTLR3 lexer implements a base recongizer, a token source and - * a lexer interface. It constructs a base recognizer with default - * functions, then overrides any of these that are parser specific (usual - * default implementation of base recognizer. - */ - -// [The "BSD licence"] -// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC -// http://www.temporal-wave.com -// http://www.linkedin.com/in/jimidle -// -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions -// are met: -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// 3. The name of the author may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include - -static void mTokens (pANTLR3_LEXER lexer); -static void setCharStream (pANTLR3_LEXER lexer, pANTLR3_INPUT_STREAM input); -static void pushCharStream (pANTLR3_LEXER lexer, pANTLR3_INPUT_STREAM input); -static void popCharStream (pANTLR3_LEXER lexer); - -static void emitNew (pANTLR3_LEXER lexer, pANTLR3_COMMON_TOKEN token); -static pANTLR3_COMMON_TOKEN emit (pANTLR3_LEXER lexer); -static ANTLR3_BOOLEAN matchs (pANTLR3_LEXER lexer, ANTLR3_UCHAR * string); -static ANTLR3_BOOLEAN matchc (pANTLR3_LEXER lexer, ANTLR3_UCHAR c); -static ANTLR3_BOOLEAN matchRange (pANTLR3_LEXER lexer, ANTLR3_UCHAR low, ANTLR3_UCHAR high); -static void matchAny (pANTLR3_LEXER lexer); -static void recover (pANTLR3_LEXER lexer); -static ANTLR3_UINT32 getLine (pANTLR3_LEXER lexer); -static ANTLR3_MARKER getCharIndex (pANTLR3_LEXER lexer); -static ANTLR3_UINT32 getCharPositionInLine (pANTLR3_LEXER lexer); -static pANTLR3_STRING getText (pANTLR3_LEXER lexer); -static pANTLR3_COMMON_TOKEN nextToken (pANTLR3_TOKEN_SOURCE toksource); - -static void displayRecognitionError (pANTLR3_BASE_RECOGNIZER rec, pANTLR3_UINT8 * tokenNames); -static void reportError (pANTLR3_BASE_RECOGNIZER rec); -static void * getCurrentInputSymbol (pANTLR3_BASE_RECOGNIZER recognizer, pANTLR3_INT_STREAM istream); -static void * getMissingSymbol (pANTLR3_BASE_RECOGNIZER recognizer, pANTLR3_INT_STREAM istream, pANTLR3_EXCEPTION e, - ANTLR3_UINT32 expectedTokenType, pANTLR3_BITSET_LIST follow); - -static void reset (pANTLR3_BASE_RECOGNIZER rec); - -static void freeLexer (pANTLR3_LEXER lexer); - - -ANTLR3_API pANTLR3_LEXER -antlr3LexerNew(ANTLR3_UINT32 sizeHint, pANTLR3_RECOGNIZER_SHARED_STATE state) -{ - pANTLR3_LEXER lexer; - pANTLR3_COMMON_TOKEN specialT; - - /* Allocate memory - */ - lexer = (pANTLR3_LEXER) ANTLR3_MALLOC(sizeof(ANTLR3_LEXER)); - - if (lexer == NULL) - { - return NULL; - } - - /* Now we need to create the base recognizer - */ - lexer->rec = antlr3BaseRecognizerNew(ANTLR3_TYPE_LEXER, sizeHint, state); - - if (lexer->rec == NULL) - { - lexer->free(lexer); - return NULL; - } - lexer->rec->super = lexer; - - lexer->rec->displayRecognitionError = displayRecognitionError; - lexer->rec->reportError = reportError; - lexer->rec->reset = reset; - lexer->rec->getCurrentInputSymbol = getCurrentInputSymbol; - lexer->rec->getMissingSymbol = getMissingSymbol; - - /* Now install the token source interface - */ - if (lexer->rec->state->tokSource == NULL) - { - lexer->rec->state->tokSource = (pANTLR3_TOKEN_SOURCE)ANTLR3_CALLOC(1, sizeof(ANTLR3_TOKEN_SOURCE)); - - if (lexer->rec->state->tokSource == NULL) - { - lexer->rec->free(lexer->rec); - lexer->free(lexer); - - return NULL; - } - lexer->rec->state->tokSource->super = lexer; - - /* Install the default nextToken() method, which may be overridden - * by generated code, or by anything else in fact. - */ - lexer->rec->state->tokSource->nextToken = nextToken; - lexer->rec->state->tokSource->strFactory = NULL; - - lexer->rec->state->tokFactory = NULL; - } - - /* Install the lexer API - */ - lexer->setCharStream = setCharStream; - lexer->mTokens = (void (*)(void *))(mTokens); - lexer->setCharStream = setCharStream; - lexer->pushCharStream = pushCharStream; - lexer->popCharStream = popCharStream; - lexer->emit = emit; - lexer->emitNew = emitNew; - lexer->matchs = matchs; - lexer->matchc = matchc; - lexer->matchRange = matchRange; - lexer->matchAny = matchAny; - lexer->recover = recover; - lexer->getLine = getLine; - lexer->getCharIndex = getCharIndex; - lexer->getCharPositionInLine = getCharPositionInLine; - lexer->getText = getText; - lexer->free = freeLexer; - - /* Initialise the eof token - */ - specialT = &(lexer->rec->state->tokSource->eofToken); - antlr3SetTokenAPI (specialT); - specialT->setType (specialT, ANTLR3_TOKEN_EOF); - specialT->factoryMade = ANTLR3_TRUE; // Prevent things trying to free() it - specialT->strFactory = NULL; - specialT->textState = ANTLR3_TEXT_NONE; - specialT->custom = NULL; - specialT->user1 = 0; - specialT->user2 = 0; - specialT->user3 = 0; - - // Initialize the skip token. - // - specialT = &(lexer->rec->state->tokSource->skipToken); - antlr3SetTokenAPI (specialT); - specialT->setType (specialT, ANTLR3_TOKEN_INVALID); - specialT->factoryMade = ANTLR3_TRUE; // Prevent things trying to free() it - specialT->strFactory = NULL; - specialT->custom = NULL; - specialT->user1 = 0; - specialT->user2 = 0; - specialT->user3 = 0; - return lexer; -} - -static void -reset (pANTLR3_BASE_RECOGNIZER rec) -{ - pANTLR3_LEXER lexer; - - lexer = rec->super; - - lexer->rec->state->token = NULL; - lexer->rec->state->type = ANTLR3_TOKEN_INVALID; - lexer->rec->state->channel = ANTLR3_TOKEN_DEFAULT_CHANNEL; - lexer->rec->state->tokenStartCharIndex = -1; - lexer->rec->state->tokenStartCharPositionInLine = -1; - lexer->rec->state->tokenStartLine = -1; - - lexer->rec->state->text = NULL; - - // OK - that's all hunky dory, but we may well have had - // a token factory that needs a reset. Do that here - // - if (lexer->rec->state->tokFactory != NULL) - { - lexer->rec->state->tokFactory->reset(lexer->rec->state->tokFactory); - } -} - -/// -/// \brief -/// Returns the next available token from the current input stream. -/// -/// \param toksource -/// Points to the implementation of a token source. The lexer is -/// addressed by the super structure pointer. -/// -/// \returns -/// The next token in the current input stream or the EOF token -/// if there are no more tokens. -/// -/// \remarks -/// Write remarks for nextToken here. -/// -/// \see nextToken -/// -ANTLR3_INLINE static pANTLR3_COMMON_TOKEN -nextTokenStr (pANTLR3_TOKEN_SOURCE toksource) -{ - pANTLR3_LEXER lexer; - pANTLR3_RECOGNIZER_SHARED_STATE state; - pANTLR3_INPUT_STREAM input; - pANTLR3_INT_STREAM istream; - - lexer = (pANTLR3_LEXER)(toksource->super); - state = lexer->rec->state; - input = lexer->input; - istream = input->istream; - - /// Loop until we get a non skipped token or EOF - /// - for (;;) - { - // Get rid of any previous token (token factory takes care of - // any de-allocation when this token is finally used up. - // - state->token = NULL; - state->error = ANTLR3_FALSE; // Start out without an exception - state->failed = ANTLR3_FALSE; - - // Now call the matching rules and see if we can generate a new token - // - for (;;) - { - // Record the start of the token in our input stream. - // - state->channel = ANTLR3_TOKEN_DEFAULT_CHANNEL; - state->tokenStartCharIndex = (ANTLR3_MARKER)(((pANTLR3_UINT8)input->nextChar)); - state->tokenStartCharPositionInLine = input->charPositionInLine; - state->tokenStartLine = input->line; - state->text = NULL; - state->custom = NULL; - state->user1 = 0; - state->user2 = 0; - state->user3 = 0; - - if (istream->_LA(istream, 1) == ANTLR3_CHARSTREAM_EOF) - { - // Reached the end of the current stream, nothing more to do if this is - // the last in the stack. - // - pANTLR3_COMMON_TOKEN teof = &(toksource->eofToken); - - teof->setStartIndex (teof, lexer->getCharIndex(lexer)); - teof->setStopIndex (teof, lexer->getCharIndex(lexer)); - teof->setLine (teof, lexer->getLine(lexer)); - teof->factoryMade = ANTLR3_TRUE; // This isn't really manufactured but it stops things from trying to free it - return teof; - } - - state->token = NULL; - state->error = ANTLR3_FALSE; // Start out without an exception - state->failed = ANTLR3_FALSE; - - // Call the generated lexer, see if it can get a new token together. - // - lexer->mTokens(lexer->ctx); - - if (state->error == ANTLR3_TRUE) - { - // Recognition exception, report it and try to recover. - // - state->failed = ANTLR3_TRUE; - lexer->rec->reportError(lexer->rec); - lexer->recover(lexer); - } - else - { - if (state->token == NULL) - { - // Emit the real token, which adds it in to the token stream basically - // - emit(lexer); - } - else if (state->token == &(toksource->skipToken)) - { - // A real token could have been generated, but "Computer say's naaaaah" and it - // it is just something we need to skip altogether. - // - continue; - } - - // Good token, not skipped, not EOF token - // - return state->token; - } - } - } -} - -/** - * \brief - * Default implementation of the nextToken() call for a lexer. - * - * \param toksource - * Points to the implementation of a token source. The lexer is - * addressed by the super structure pointer. - * - * \returns - * The next token in the current input stream or the EOF token - * if there are no more tokens in any input stream in the stack. - * - * Write detailed description for nextToken here. - * - * \remarks - * Write remarks for nextToken here. - * - * \see nextTokenStr - */ -static pANTLR3_COMMON_TOKEN -nextToken (pANTLR3_TOKEN_SOURCE toksource) -{ - pANTLR3_COMMON_TOKEN tok; - - // Find the next token in the current stream - // - tok = nextTokenStr(toksource); - - // If we got to the EOF token then switch to the previous - // input stream if there were any and just return the - // EOF if there are none. We must check the next token - // in any outstanding input stream we pop into the active - // role to see if it was sitting at EOF after PUSHing the - // stream we just consumed, otherwise we will return EOF - // on the reinstalled input stream, when in actual fact - // there might be more input streams to POP before the - // real EOF of the whole logical inptu stream. Hence we - // use a while loop here until we find somethign in the stream - // that isn't EOF or we reach the actual end of the last input - // stream on the stack. - // - while (tok->type == ANTLR3_TOKEN_EOF) - { - pANTLR3_LEXER lexer; - - lexer = (pANTLR3_LEXER)(toksource->super); - - if (lexer->rec->state->streams != NULL && lexer->rec->state->streams->size(lexer->rec->state->streams) > 0) - { - // We have another input stream in the stack so we - // need to revert to it, then resume the loop to check - // it wasn't sitting at EOF itself. - // - lexer->popCharStream(lexer); - tok = nextTokenStr(toksource); - } - else - { - // There were no more streams on the input stack - // so this EOF is the 'real' logical EOF for - // the input stream. So we just exit the loop and - // return the EOF we have found. - // - break; - } - - } - - // return whatever token we have, which may be EOF - // - return tok; -} - -ANTLR3_API pANTLR3_LEXER -antlr3LexerNewStream(ANTLR3_UINT32 sizeHint, pANTLR3_INPUT_STREAM input, pANTLR3_RECOGNIZER_SHARED_STATE state) -{ - pANTLR3_LEXER lexer; - - // Create a basic lexer first - // - lexer = antlr3LexerNew(sizeHint, state); - - if (lexer != NULL) - { - // Install the input stream and reset the lexer - // - setCharStream(lexer, input); - } - - return lexer; -} - -static void mTokens (pANTLR3_LEXER lexer) -{ - if (lexer) // Fool compiler, avoid pragmas - { - ANTLR3_FPRINTF(stderr, "lexer->mTokens(): Error: No lexer rules were added to the lexer yet!\n"); - } -} - -static void -reportError (pANTLR3_BASE_RECOGNIZER rec) -{ - // Indicate this recognizer had an error while processing. - // - rec->state->errorCount++; - - rec->displayRecognitionError(rec, rec->state->tokenNames); -} - -#ifdef ANTLR3_WINDOWS -#pragma warning( disable : 4100 ) -#endif - -/** Default lexer error handler (works for 8 bit streams only!!!) - */ -static void -displayRecognitionError (pANTLR3_BASE_RECOGNIZER recognizer, pANTLR3_UINT8 * tokenNames) -{ - pANTLR3_LEXER lexer; - pANTLR3_EXCEPTION ex; - pANTLR3_STRING ftext; - - lexer = (pANTLR3_LEXER)(recognizer->super); - ex = lexer->rec->state->exception; - - // See if there is a 'filename' we can use - // - if (ex->name == NULL) - { - ANTLR3_FPRINTF(stderr, "-unknown source-("); - } - else - { - ftext = ex->streamName->to8(ex->streamName); - ANTLR3_FPRINTF(stderr, "%s(", ftext->chars); - } - - ANTLR3_FPRINTF(stderr, "%d) ", recognizer->state->exception->line); - ANTLR3_FPRINTF(stderr, ": lexer error %d :\n\t%s at offset %d, ", - ex->type, - (pANTLR3_UINT8) (ex->message), - ex->charPositionInLine+1 - ); - { - ANTLR3_INT32 width; - - width = ANTLR3_UINT32_CAST(( (pANTLR3_UINT8)(lexer->input->data) + (lexer->input->size(lexer->input) )) - (pANTLR3_UINT8)(ex->index)); - - if (width >= 1) - { - if (isprint(ex->c)) - { - ANTLR3_FPRINTF(stderr, "near '%c' :\n", ex->c); - } - else - { - ANTLR3_FPRINTF(stderr, "near char(%#02X) :\n", (ANTLR3_UINT8)(ex->c)); - } - ANTLR3_FPRINTF(stderr, "\t%.*s\n", width > 20 ? 20 : width ,((pANTLR3_UINT8)ex->index)); - } - else - { - ANTLR3_FPRINTF(stderr, "(end of input).\n\t This indicates a poorly specified lexer RULE\n\t or unterminated input element such as: \"STRING[\"]\n"); - ANTLR3_FPRINTF(stderr, "\t The lexer was matching from line %d, offset %d, which\n\t ", - (ANTLR3_UINT32)(lexer->rec->state->tokenStartLine), - (ANTLR3_UINT32)(lexer->rec->state->tokenStartCharPositionInLine) - ); - width = ANTLR3_UINT32_CAST(((pANTLR3_UINT8)(lexer->input->data)+(lexer->input->size(lexer->input))) - (pANTLR3_UINT8)(lexer->rec->state->tokenStartCharIndex)); - - if (width >= 1) - { - ANTLR3_FPRINTF(stderr, "looks like this:\n\t\t%.*s\n", width > 20 ? 20 : width ,(pANTLR3_UINT8)(lexer->rec->state->tokenStartCharIndex)); - } - else - { - ANTLR3_FPRINTF(stderr, "is also the end of the line, so you must check your lexer rules\n"); - } - } - } -} - -static void setCharStream (pANTLR3_LEXER lexer, pANTLR3_INPUT_STREAM input) -{ - /* Install the input interface - */ - lexer->input = input; - - /* We may need a token factory for the lexer; we don't destroy any existing factory - * until the lexer is destroyed, as people may still be using the tokens it produced. - * TODO: Later I will provide a dup() method for a token so that it can extract itself - * out of the factory. - */ - if (lexer->rec->state->tokFactory == NULL) - { - lexer->rec->state->tokFactory = antlr3TokenFactoryNew(input); - } - else - { - /* When the input stream is being changed on the fly, rather than - * at the start of a new lexer, then we must tell the tokenFactory - * which input stream to adorn the tokens with so that when they - * are asked to provide their original input strings they can - * do so from the correct text stream. - */ - lexer->rec->state->tokFactory->setInputStream(lexer->rec->state->tokFactory, input); - } - - /* Propagate the string factory so that we preserve the encoding form from - * the input stream. - */ - if (lexer->rec->state->tokSource->strFactory == NULL) - { - lexer->rec->state->tokSource->strFactory = input->strFactory; - - // Set the newly acquired string factory up for our pre-made tokens - // for EOF. - // - if (lexer->rec->state->tokSource->eofToken.strFactory == NULL) - { - lexer->rec->state->tokSource->eofToken.strFactory = input->strFactory; - } - } - - /* This is a lexer, install the appropriate exception creator - */ - lexer->rec->exConstruct = antlr3RecognitionExceptionNew; - - /* Set the current token to nothing - */ - lexer->rec->state->token = NULL; - lexer->rec->state->text = NULL; - lexer->rec->state->tokenStartCharIndex = -1; - - /* Copy the name of the char stream to the token source - */ - lexer->rec->state->tokSource->fileName = input->fileName; -} - -/*! - * \brief - * Change to a new input stream, remembering the old one. - * - * \param lexer - * Pointer to the lexer instance to switch input streams for. - * - * \param input - * New input stream to install as the current one. - * - * Switches the current character input stream to - * a new one, saving the old one, which we will revert to at the end of this - * new one. - */ -static void -pushCharStream (pANTLR3_LEXER lexer, pANTLR3_INPUT_STREAM input) -{ - // Do we need a new input stream stack? - // - if (lexer->rec->state->streams == NULL) - { - // This is the first call to stack a new - // stream and so we must create the stack first. - // - lexer->rec->state->streams = antlr3StackNew(0); - - if (lexer->rec->state->streams == NULL) - { - // Could not do this, we just fail to push it. - // TODO: Consider if this is what we want to do, but then - // any programmer can override this method to do something else. - return; - } - } - - // We have a stack, so we can save the current input stream - // into it. - // - lexer->input->istream->mark(lexer->input->istream); - lexer->rec->state->streams->push(lexer->rec->state->streams, lexer->input, NULL); - - // And now we can install this new one - // - lexer->setCharStream(lexer, input); -} - -/*! - * \brief - * Stops using the current input stream and reverts to any prior - * input stream on the stack. - * - * \param lexer - * Description of parameter lexer. - * - * Pointer to a function that abandons the current input stream, whether it - * is empty or not and reverts to the previous stacked input stream. - * - * \remark - * The function fails silently if there are no prior input streams. - */ -static void -popCharStream (pANTLR3_LEXER lexer) -{ - pANTLR3_INPUT_STREAM input; - - // If we do not have a stream stack or we are already at the - // stack bottom, then do nothing. - // - if (lexer->rec->state->streams != NULL && lexer->rec->state->streams->size(lexer->rec->state->streams) > 0) - { - // We just leave the current stream to its fate, we do not close - // it or anything as we do not know what the programmer intended - // for it. This method can always be overridden of course. - // So just find out what was currently saved on the stack and use - // that now, then pop it from the stack. - // - input = (pANTLR3_INPUT_STREAM)(lexer->rec->state->streams->top); - lexer->rec->state->streams->pop(lexer->rec->state->streams); - - // Now install the stream as the current one. - // - lexer->setCharStream(lexer, input); - lexer->input->istream->rewindLast(lexer->input->istream); - } - return; -} - -static void emitNew (pANTLR3_LEXER lexer, pANTLR3_COMMON_TOKEN token) -{ - lexer->rec->state->token = token; /* Voila! */ -} - -static pANTLR3_COMMON_TOKEN -emit (pANTLR3_LEXER lexer) -{ - pANTLR3_COMMON_TOKEN token; - - /* We could check pointers to token factories and so on, but - * we are in code that we want to run as fast as possible - * so we are not checking any errors. So make sure you have installed an input stream before - * trying to emit a new token. - */ - token = lexer->rec->state->tokFactory->newToken(lexer->rec->state->tokFactory); - - /* Install the supplied information, and some other bits we already know - * get added automatically, such as the input stream it is associated with - * (though it can all be overridden of course) - */ - token->type = lexer->rec->state->type; - token->channel = lexer->rec->state->channel; - token->start = lexer->rec->state->tokenStartCharIndex; - token->stop = lexer->getCharIndex(lexer) - 1; - token->line = lexer->rec->state->tokenStartLine; - token->charPosition = lexer->rec->state->tokenStartCharPositionInLine; - - if (lexer->rec->state->text != NULL) - { - token->textState = ANTLR3_TEXT_STRING; - token->tokText.text = lexer->rec->state->text; - } - else - { - token->textState = ANTLR3_TEXT_NONE; - } - token->lineStart = lexer->input->currentLine; - token->user1 = lexer->rec->state->user1; - token->user2 = lexer->rec->state->user2; - token->user3 = lexer->rec->state->user3; - token->custom = lexer->rec->state->custom; - - lexer->rec->state->token = token; - - return token; -} - -/** - * Free the resources allocated by a lexer - */ -static void -freeLexer (pANTLR3_LEXER lexer) -{ - // This may have ben a delegate or delegator lexer, in which case the - // state may already have been freed (and set to NULL therefore) - // so we ignore the state if we don't have it. - // - if (lexer->rec->state != NULL) - { - if (lexer->rec->state->streams != NULL) - { - lexer->rec->state->streams->free(lexer->rec->state->streams); - } - if (lexer->rec->state->tokFactory != NULL) - { - lexer->rec->state->tokFactory->close(lexer->rec->state->tokFactory); - lexer->rec->state->tokFactory = NULL; - } - if (lexer->rec->state->tokSource != NULL) - { - ANTLR3_FREE(lexer->rec->state->tokSource); - lexer->rec->state->tokSource = NULL; - } - } - if (lexer->rec != NULL) - { - lexer->rec->free(lexer->rec); - lexer->rec = NULL; - } - ANTLR3_FREE(lexer); -} - -/** Implementation of matchs for the lexer, overrides any - * base implementation in the base recognizer. - * - * \remark - * Note that the generated code lays down arrays of ints for constant - * strings so that they are int UTF32 form! - */ -static ANTLR3_BOOLEAN -matchs(pANTLR3_LEXER lexer, ANTLR3_UCHAR * string) -{ - while (*string != ANTLR3_STRING_TERMINATOR) - { - if (lexer->input->istream->_LA(lexer->input->istream, 1) != (*string)) - { - if (lexer->rec->state->backtracking > 0) - { - lexer->rec->state->failed = ANTLR3_TRUE; - return ANTLR3_FALSE; - } - - lexer->rec->exConstruct(lexer->rec); - lexer->rec->state->failed = ANTLR3_TRUE; - - /* TODO: Implement exception creation more fully perhaps - */ - lexer->recover(lexer); - return ANTLR3_FALSE; - } - - /* Matched correctly, do consume it - */ - lexer->input->istream->consume(lexer->input->istream); - string++; - - /* Reset any failed indicator - */ - lexer->rec->state->failed = ANTLR3_FALSE; - } - - - return ANTLR3_TRUE; -} - -/** Implementation of matchc for the lexer, overrides any - * base implementation in the base recognizer. - * - * \remark - * Note that the generated code lays down arrays of ints for constant - * strings so that they are int UTF32 form! - */ -static ANTLR3_BOOLEAN -matchc(pANTLR3_LEXER lexer, ANTLR3_UCHAR c) -{ - if (lexer->input->istream->_LA(lexer->input->istream, 1) == c) - { - /* Matched correctly, do consume it - */ - lexer->input->istream->consume(lexer->input->istream); - - /* Reset any failed indicator - */ - lexer->rec->state->failed = ANTLR3_FALSE; - - return ANTLR3_TRUE; - } - - /* Failed to match, exception and recovery time. - */ - if (lexer->rec->state->backtracking > 0) - { - lexer->rec->state->failed = ANTLR3_TRUE; - return ANTLR3_FALSE; - } - - lexer->rec->exConstruct(lexer->rec); - - /* TODO: Implement exception creation more fully perhaps - */ - lexer->recover(lexer); - - return ANTLR3_FALSE; -} - -/** Implementation of match range for the lexer, overrides any - * base implementation in the base recognizer. - * - * \remark - * Note that the generated code lays down arrays of ints for constant - * strings so that they are int UTF32 form! - */ -static ANTLR3_BOOLEAN -matchRange(pANTLR3_LEXER lexer, ANTLR3_UCHAR low, ANTLR3_UCHAR high) -{ - ANTLR3_UCHAR c; - - /* What is in the stream at the moment? - */ - c = lexer->input->istream->_LA(lexer->input->istream, 1); - if ( c >= low && c <= high) - { - /* Matched correctly, consume it - */ - lexer->input->istream->consume(lexer->input->istream); - - /* Reset any failed indicator - */ - lexer->rec->state->failed = ANTLR3_FALSE; - - return ANTLR3_TRUE; - } - - /* Failed to match, execption and recovery time. - */ - - if (lexer->rec->state->backtracking > 0) - { - lexer->rec->state->failed = ANTLR3_TRUE; - return ANTLR3_FALSE; - } - - lexer->rec->exConstruct(lexer->rec); - - /* TODO: Implement exception creation more fully - */ - lexer->recover(lexer); - - return ANTLR3_FALSE; -} - -static void -matchAny (pANTLR3_LEXER lexer) -{ - lexer->input->istream->consume(lexer->input->istream); -} - -static void -recover (pANTLR3_LEXER lexer) -{ - lexer->input->istream->consume(lexer->input->istream); -} - -static ANTLR3_UINT32 -getLine (pANTLR3_LEXER lexer) -{ - return lexer->input->getLine(lexer->input); -} - -static ANTLR3_UINT32 -getCharPositionInLine (pANTLR3_LEXER lexer) -{ - return lexer->input->charPositionInLine; -} - -static ANTLR3_MARKER getCharIndex (pANTLR3_LEXER lexer) -{ - return lexer->input->istream->index(lexer->input->istream); -} - -static pANTLR3_STRING -getText (pANTLR3_LEXER lexer) -{ - if (lexer->rec->state->text) - { - return lexer->rec->state->text; - - } - return lexer->input->substr( - lexer->input, - lexer->rec->state->tokenStartCharIndex, - lexer->getCharIndex(lexer) - lexer->input->charByteSize - ); - -} - -static void * -getCurrentInputSymbol (pANTLR3_BASE_RECOGNIZER recognizer, pANTLR3_INT_STREAM istream) -{ - return NULL; -} - -static void * -getMissingSymbol (pANTLR3_BASE_RECOGNIZER recognizer, pANTLR3_INT_STREAM istream, pANTLR3_EXCEPTION e, - ANTLR3_UINT32 expectedTokenType, pANTLR3_BITSET_LIST follow) -{ - return NULL; -} diff --git a/impl/antlr/libantlr3c-3.4/src/antlr3parser.c b/impl/antlr/libantlr3c-3.4/src/antlr3parser.c deleted file mode 100644 index 2b7e0e3..0000000 --- a/impl/antlr/libantlr3c-3.4/src/antlr3parser.c +++ /dev/null @@ -1,193 +0,0 @@ -/** \file - * Implementation of the base functionality for an ANTLR3 parser. - */ - -// [The "BSD licence"] -// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC -// http://www.temporal-wave.com -// http://www.linkedin.com/in/jimidle -// -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions -// are met: -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// 3. The name of the author may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include - -/* Parser API - */ -static void setDebugListener (pANTLR3_PARSER parser, pANTLR3_DEBUG_EVENT_LISTENER dbg); -static void setTokenStream (pANTLR3_PARSER parser, pANTLR3_TOKEN_STREAM); -static pANTLR3_TOKEN_STREAM getTokenStream (pANTLR3_PARSER parser); -static void freeParser (pANTLR3_PARSER parser); - -ANTLR3_API pANTLR3_PARSER -antlr3ParserNewStreamDbg (ANTLR3_UINT32 sizeHint, pANTLR3_TOKEN_STREAM tstream, pANTLR3_DEBUG_EVENT_LISTENER dbg, pANTLR3_RECOGNIZER_SHARED_STATE state) -{ - pANTLR3_PARSER parser; - - parser = antlr3ParserNewStream(sizeHint, tstream, state); - - if (parser == NULL) - { - return NULL; - } - - parser->setDebugListener(parser, dbg); - - return parser; -} - -ANTLR3_API pANTLR3_PARSER -antlr3ParserNew (ANTLR3_UINT32 sizeHint, pANTLR3_RECOGNIZER_SHARED_STATE state) -{ - pANTLR3_PARSER parser; - - /* Allocate memory - */ - parser = (pANTLR3_PARSER) ANTLR3_MALLOC(sizeof(ANTLR3_PARSER)); - - if (parser == NULL) - { - return NULL; - } - - /* Install a base parser - */ - parser->rec = antlr3BaseRecognizerNew(ANTLR3_TYPE_PARSER, sizeHint, state); - - if (parser->rec == NULL) - { - parser->free(parser); - return NULL; - } - - parser->rec->super = parser; - - /* Parser overrides - */ - parser->rec->exConstruct = antlr3MTExceptionNew; - - /* Install the API - */ - parser->setDebugListener = setDebugListener; - parser->setTokenStream = setTokenStream; - parser->getTokenStream = getTokenStream; - - parser->free = freeParser; - - return parser; -} - -ANTLR3_API pANTLR3_PARSER -antlr3ParserNewStream (ANTLR3_UINT32 sizeHint, pANTLR3_TOKEN_STREAM tstream, pANTLR3_RECOGNIZER_SHARED_STATE state) -{ - pANTLR3_PARSER parser; - - parser = antlr3ParserNew(sizeHint, state); - - if (parser == NULL) - { - return NULL; - } - - /* Everything seems to be hunky dory so we can install the - * token stream. - */ - parser->setTokenStream(parser, tstream); - - return parser; -} - -static void -freeParser (pANTLR3_PARSER parser) -{ - if (parser->rec != NULL) - { - // This may have ben a delegate or delegator parser, in which case the - // state may already have been freed (and set to NULL therefore) - // so we ignore the state if we don't have it. - // - if (parser->rec->state != NULL) - { - if (parser->rec->state->following != NULL) - { - parser->rec->state->following->free(parser->rec->state->following); - parser->rec->state->following = NULL; - } - } - parser->rec->free(parser->rec); - parser->rec = NULL; - - } - ANTLR3_FREE(parser); -} - -static void -setDebugListener (pANTLR3_PARSER parser, pANTLR3_DEBUG_EVENT_LISTENER dbg) -{ - // Set the debug listener. There are no methods to override - // because currently the only ones that notify the debugger - // are error reporting and recovery. Hence we can afford to - // check and see if the debugger interface is null or not - // there. If there is ever an occasion for a performance - // sensitive function to use the debugger interface, then - // a replacement function for debug mode should be supplied - // and installed here. - // - parser->rec->debugger = dbg; - - // If there was a tokenstream installed already - // then we need to tell it about the debug interface - // - if (parser->tstream != NULL) - { - parser->tstream->setDebugListener(parser->tstream, dbg); - } -} - -static void -setTokenStream (pANTLR3_PARSER parser, pANTLR3_TOKEN_STREAM tstream) -{ - parser->tstream = tstream; - parser->rec->reset(parser->rec); -} - -static pANTLR3_TOKEN_STREAM -getTokenStream (pANTLR3_PARSER parser) -{ - return parser->tstream; -} - - - - - - - - - - - - - - diff --git a/impl/antlr/libantlr3c-3.4/src/antlr3rewritestreams.c b/impl/antlr/libantlr3c-3.4/src/antlr3rewritestreams.c deleted file mode 100644 index 9afb6e1..0000000 --- a/impl/antlr/libantlr3c-3.4/src/antlr3rewritestreams.c +++ /dev/null @@ -1,844 +0,0 @@ -/// \file -/// Implementation of token/tree streams that are used by the -/// tree re-write rules to manipulate the tokens and trees produced -/// by rules that are subject to rewrite directives. -/// - -// [The "BSD licence"] -// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC -// http://www.temporal-wave.com -// http://www.linkedin.com/in/jimidle -// -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions -// are met: -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// 3. The name of the author may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include - -// Static support function forward declarations for the stream types. -// -static void reset (pANTLR3_REWRITE_RULE_ELEMENT_STREAM stream); -static void add (pANTLR3_REWRITE_RULE_ELEMENT_STREAM stream, void * el, void (ANTLR3_CDECL *freePtr)(void *)); -static void * next (pANTLR3_REWRITE_RULE_ELEMENT_STREAM stream); -static pANTLR3_BASE_TREE nextTree (pANTLR3_REWRITE_RULE_ELEMENT_STREAM stream); -static void * nextToken (pANTLR3_REWRITE_RULE_ELEMENT_STREAM stream); -static void * _next (pANTLR3_REWRITE_RULE_ELEMENT_STREAM stream); -static void * dupTok (pANTLR3_REWRITE_RULE_ELEMENT_STREAM stream, void * el); -static void * dupTree (pANTLR3_REWRITE_RULE_ELEMENT_STREAM stream, void * el); -static void * dupTreeNode (pANTLR3_REWRITE_RULE_ELEMENT_STREAM stream, void * el); -static pANTLR3_BASE_TREE toTree (pANTLR3_REWRITE_RULE_ELEMENT_STREAM stream, void * element); -static pANTLR3_BASE_TREE toTreeNode (pANTLR3_REWRITE_RULE_ELEMENT_STREAM stream, void * element); -static ANTLR3_BOOLEAN hasNext (pANTLR3_REWRITE_RULE_ELEMENT_STREAM stream); -static pANTLR3_BASE_TREE nextNode (pANTLR3_REWRITE_RULE_ELEMENT_STREAM stream); -static pANTLR3_BASE_TREE nextNodeNode (pANTLR3_REWRITE_RULE_ELEMENT_STREAM stream); -static pANTLR3_BASE_TREE nextNodeToken (pANTLR3_REWRITE_RULE_ELEMENT_STREAM stream); -static ANTLR3_UINT32 size (pANTLR3_REWRITE_RULE_ELEMENT_STREAM stream); -static void * getDescription (pANTLR3_REWRITE_RULE_ELEMENT_STREAM stream); -static void freeRS (pANTLR3_REWRITE_RULE_ELEMENT_STREAM stream); -static void expungeRS (pANTLR3_REWRITE_RULE_ELEMENT_STREAM stream); - - -// Place a now unused rewrite stream back on the rewrite stream pool -// so we can reuse it if we need to. -// -static void -freeRS (pANTLR3_REWRITE_RULE_ELEMENT_STREAM stream) -{ - // Before placing the stream back in the pool, we - // need to clear any vector it has. This is so any - // free pointers that are associated with the - // entires are called. - // - if (stream->elements != NULL) - { - // Factory generated vectors can be returned to the - // vector factory for later reuse. - // - if (stream->elements->factoryMade == ANTLR3_TRUE) - { - pANTLR3_VECTOR_FACTORY factory = ((pANTLR3_COMMON_TREE_ADAPTOR)(stream->adaptor->super))->arboretum->vFactory; - factory->returnVector(factory, stream->elements); - - stream->elements = NULL; - } - else - { - // Other vectors we clear and allow to be reused if they come off the - // rewrite stream free stack and are reused. - // - stream->elements->clear(stream->elements); - stream->freeElements = ANTLR3_TRUE; - } - } - else - { - stream->freeElements = ANTLR3_FALSE; // Just in case - } - - // Add the stream into the recognizer stream stack vector - // adding the stream memory free routine so that - // it is thrown away when the stack vector is destroyed - // - stream->rec->state->rStreams->add(stream->rec->state->rStreams, stream, (void(*)(void *))expungeRS); -} - -/** Do special nilNode reuse detection for node streams. - */ -static void -freeNodeRS(pANTLR3_REWRITE_RULE_ELEMENT_STREAM stream) -{ - pANTLR3_BASE_TREE tree; - - // Before placing the stream back in the pool, we - // need to clear any vector it has. This is so any - // free pointers that are associated with the - // entires are called. However, if this particular function is called - // then we know that the entries in the stream are definately - // tree nodes. Hence we check to see if any of them were nilNodes as - // if they were, we can reuse them. - // - if (stream->elements != NULL) - { - // We have some elements to traverse - // - ANTLR3_UINT32 i; - - for (i = 1; i<= stream->elements->count; i++) - { - tree = (pANTLR3_BASE_TREE)(stream->elements->elements[i-1].element); - if (tree != NULL && tree->isNilNode(tree)) - { - // Had to remove this for now, check is not comprehensive enough - // tree->reuse(tree); - } - - } - // Factory generated vectors can be returned to the - // vector factory for later reuse. - // - if (stream->elements->factoryMade == ANTLR3_TRUE) - { - pANTLR3_VECTOR_FACTORY factory = ((pANTLR3_COMMON_TREE_ADAPTOR)(stream->adaptor->super))->arboretum->vFactory; - factory->returnVector(factory, stream->elements); - - stream->elements = NULL; - } - else - { - stream->elements->clear(stream->elements); - stream->freeElements = ANTLR3_TRUE; - } - } - else - { - if (stream->singleElement != NULL) - { - tree = (pANTLR3_BASE_TREE)(stream->singleElement); - if (tree->isNilNode(tree)) - { - // Had to remove this for now, check is not comprehensive enough - // tree->reuse(tree); - } - } - stream->singleElement = NULL; - stream->freeElements = ANTLR3_FALSE; // Just in case - } - - // Add the stream into the recognizer stream stack vector - // adding the stream memory free routine so that - // it is thrown away when the stack vector is destroyed - // - stream->rec->state->rStreams->add(stream->rec->state->rStreams, stream, (void(*)(void *))expungeRS); -} -static void -expungeRS(pANTLR3_REWRITE_RULE_ELEMENT_STREAM stream) -{ - - if (stream->freeElements == ANTLR3_TRUE && stream->elements != NULL) - { - stream->elements->free(stream->elements); - } - ANTLR3_FREE(stream); -} - -// Functions for creating streams -// -static pANTLR3_REWRITE_RULE_ELEMENT_STREAM -antlr3RewriteRuleElementStreamNewAE(pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_RECOGNIZER rec, pANTLR3_UINT8 description) -{ - pANTLR3_REWRITE_RULE_ELEMENT_STREAM stream; - - // First - do we already have a rewrite stream that was returned - // to the pool? If we do, then we will just reuse it by resetting - // the generic interface. - // - if (rec->state->rStreams->count > 0) - { - // Remove the entry from the vector. We do not - // cause it to be freed by using remove. - // - stream = rec->state->rStreams->remove(rec->state->rStreams, rec->state->rStreams->count - 1); - - // We found a stream we can reuse. - // If the stream had a vector, then it will have been cleared - // when the freeRS was called that put it in this stack - // - } - else - { - // Ok, we need to allocate a new one as there were none on the stack. - // First job is to create the memory we need. - // - stream = (pANTLR3_REWRITE_RULE_ELEMENT_STREAM) ANTLR3_MALLOC((size_t)(sizeof(ANTLR3_REWRITE_RULE_ELEMENT_STREAM))); - - if (stream == NULL) - { - return NULL; - } - stream->elements = NULL; - stream->freeElements = ANTLR3_FALSE; - } - - // Populate the generic interface - // - stream->rec = rec; - stream->reset = reset; - stream->add = add; - stream->next = next; - stream->nextTree = nextTree; - stream->nextNode = nextNode; - stream->nextToken = nextToken; - stream->_next = _next; - stream->hasNext = hasNext; - stream->size = size; - stream->getDescription = getDescription; - stream->toTree = toTree; - stream->free = freeRS; - stream->singleElement = NULL; - - // Reset the stream to empty. - // - - stream->cursor = 0; - stream->dirty = ANTLR3_FALSE; - - // Install the description - // - stream->elementDescription = description; - - // Install the adaptor - // - stream->adaptor = adaptor; - - return stream; -} - -static pANTLR3_REWRITE_RULE_ELEMENT_STREAM -antlr3RewriteRuleElementStreamNewAEE(pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_RECOGNIZER rec, pANTLR3_UINT8 description, void * oneElement) -{ - pANTLR3_REWRITE_RULE_ELEMENT_STREAM stream; - - // First job is to create the memory we need. - // - stream = antlr3RewriteRuleElementStreamNewAE(adaptor, rec, description); - - if (stream == NULL) - { - return NULL; - } - - // Stream seems good so we need to add the supplied element - // - if (oneElement != NULL) - { - stream->add(stream, oneElement, NULL); - } - return stream; -} - -static pANTLR3_REWRITE_RULE_ELEMENT_STREAM -antlr3RewriteRuleElementStreamNewAEV(pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_RECOGNIZER rec, pANTLR3_UINT8 description, pANTLR3_VECTOR vector) -{ - pANTLR3_REWRITE_RULE_ELEMENT_STREAM stream; - - // First job is to create the memory we need. - // - stream = antlr3RewriteRuleElementStreamNewAE(adaptor, rec, description); - - if (stream == NULL) - { - return stream; - } - - // Stream seems good so we need to install the vector we were - // given. We assume that someone else is going to free the - // vector. - // - if (stream->elements != NULL && stream->elements->factoryMade == ANTLR3_FALSE && stream->freeElements == ANTLR3_TRUE ) - { - stream->elements->free(stream->elements); - } - stream->elements = vector; - stream->freeElements = ANTLR3_FALSE; - return stream; -} - -// Token rewrite stream ... -// -ANTLR3_API pANTLR3_REWRITE_RULE_TOKEN_STREAM -antlr3RewriteRuleTOKENStreamNewAE(pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_RECOGNIZER rec, pANTLR3_UINT8 description) -{ - pANTLR3_REWRITE_RULE_TOKEN_STREAM stream; - - // First job is to create the memory we need. - // - stream = antlr3RewriteRuleElementStreamNewAE(adaptor, rec, description); - - if (stream == NULL) - { - return stream; - } - - // Install the token based overrides - // - stream->dup = dupTok; - stream->nextNode = nextNodeToken; - - // No nextNode implementation for a token rewrite stream - // - return stream; -} - -ANTLR3_API pANTLR3_REWRITE_RULE_TOKEN_STREAM -antlr3RewriteRuleTOKENStreamNewAEE(pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_RECOGNIZER rec, pANTLR3_UINT8 description, void * oneElement) -{ - pANTLR3_REWRITE_RULE_TOKEN_STREAM stream; - - // First job is to create the memory we need. - // - stream = antlr3RewriteRuleElementStreamNewAEE(adaptor, rec, description, oneElement); - - // Install the token based overrides - // - stream->dup = dupTok; - stream->nextNode = nextNodeToken; - - // No nextNode implementation for a token rewrite stream - // - return stream; -} - -ANTLR3_API pANTLR3_REWRITE_RULE_TOKEN_STREAM -antlr3RewriteRuleTOKENStreamNewAEV(pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_RECOGNIZER rec, pANTLR3_UINT8 description, pANTLR3_VECTOR vector) -{ - pANTLR3_REWRITE_RULE_TOKEN_STREAM stream; - - // First job is to create the memory we need. - // - stream = antlr3RewriteRuleElementStreamNewAEV(adaptor, rec, description, vector); - - // Install the token based overrides - // - stream->dup = dupTok; - stream->nextNode = nextNodeToken; - - // No nextNode implementation for a token rewrite stream - // - return stream; -} - -// Subtree rewrite stream -// -ANTLR3_API pANTLR3_REWRITE_RULE_SUBTREE_STREAM -antlr3RewriteRuleSubtreeStreamNewAE(pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_RECOGNIZER rec, pANTLR3_UINT8 description) -{ - pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream; - - // First job is to create the memory we need. - // - stream = antlr3RewriteRuleElementStreamNewAE(adaptor, rec, description); - - if (stream == NULL) - { - return stream; - } - - // Install the subtree based overrides - // - stream->dup = dupTree; - stream->nextNode = nextNode; - stream->free = freeNodeRS; - return stream; - -} -ANTLR3_API pANTLR3_REWRITE_RULE_SUBTREE_STREAM -antlr3RewriteRuleSubtreeStreamNewAEE(pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_RECOGNIZER rec, pANTLR3_UINT8 description, void * oneElement) -{ - pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream; - - // First job is to create the memory we need. - // - stream = antlr3RewriteRuleElementStreamNewAEE(adaptor, rec, description, oneElement); - - if (stream == NULL) - { - return stream; - } - - // Install the subtree based overrides - // - stream->dup = dupTree; - stream->nextNode = nextNode; - stream->free = freeNodeRS; - - return stream; -} - -ANTLR3_API pANTLR3_REWRITE_RULE_SUBTREE_STREAM -antlr3RewriteRuleSubtreeStreamNewAEV(pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_RECOGNIZER rec, pANTLR3_UINT8 description, pANTLR3_VECTOR vector) -{ - pANTLR3_REWRITE_RULE_SUBTREE_STREAM stream; - - // First job is to create the memory we need. - // - stream = antlr3RewriteRuleElementStreamNewAEV(adaptor, rec, description, vector); - - if (stream == NULL) - { - return NULL; - } - - // Install the subtree based overrides - // - stream->dup = dupTree; - stream->nextNode = nextNode; - stream->free = freeNodeRS; - - return stream; -} -// Node rewrite stream ... -// -ANTLR3_API pANTLR3_REWRITE_RULE_NODE_STREAM -antlr3RewriteRuleNODEStreamNewAE(pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_RECOGNIZER rec, pANTLR3_UINT8 description) -{ - pANTLR3_REWRITE_RULE_NODE_STREAM stream; - - // First job is to create the memory we need. - // - stream = antlr3RewriteRuleElementStreamNewAE(adaptor, rec, description); - - if (stream == NULL) - { - return stream; - } - - // Install the node based overrides - // - stream->dup = dupTreeNode; - stream->toTree = toTreeNode; - stream->nextNode = nextNodeNode; - stream->free = freeNodeRS; - - return stream; -} - -ANTLR3_API pANTLR3_REWRITE_RULE_NODE_STREAM -antlr3RewriteRuleNODEStreamNewAEE(pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_RECOGNIZER rec, pANTLR3_UINT8 description, void * oneElement) -{ - pANTLR3_REWRITE_RULE_NODE_STREAM stream; - - // First job is to create the memory we need. - // - stream = antlr3RewriteRuleElementStreamNewAEE(adaptor, rec, description, oneElement); - - // Install the node based overrides - // - stream->dup = dupTreeNode; - stream->toTree = toTreeNode; - stream->nextNode = nextNodeNode; - stream->free = freeNodeRS; - - return stream; -} - -ANTLR3_API pANTLR3_REWRITE_RULE_NODE_STREAM -antlr3RewriteRuleNODEStreamNewAEV(pANTLR3_BASE_TREE_ADAPTOR adaptor, pANTLR3_BASE_RECOGNIZER rec, pANTLR3_UINT8 description, pANTLR3_VECTOR vector) -{ - pANTLR3_REWRITE_RULE_NODE_STREAM stream; - - // First job is to create the memory we need. - // - stream = antlr3RewriteRuleElementStreamNewAEV(adaptor, rec, description, vector); - - // Install the Node based overrides - // - stream->dup = dupTreeNode; - stream->toTree = toTreeNode; - stream->nextNode = nextNodeNode; - stream->free = freeNodeRS; - - return stream; -} - -//---------------------------------------------------------------------- -// Static support functions - -/// Reset the condition of this stream so that it appears we have -/// not consumed any of its elements. Elements themselves are untouched. -/// -static void -reset (pANTLR3_REWRITE_RULE_ELEMENT_STREAM stream) -{ - stream->dirty = ANTLR3_TRUE; - stream->cursor = 0; -} - -// Add a new pANTLR3_BASE_TREE to this stream -// -static void -add (pANTLR3_REWRITE_RULE_ELEMENT_STREAM stream, void * el, void (ANTLR3_CDECL *freePtr)(void *)) -{ - if (el== NULL) - { - return; - } - // As we may be reusing a stream, we may already have allocated - // a rewrite stream vector. If we have then is will be empty if - // we have either zero or just one element in the rewrite stream - // - if (stream->elements != NULL && stream->elements->count > 0) - { - // We already have >1 entries in the stream. So we can just add this new element to the existing - // collection. - // - stream->elements->add(stream->elements, el, freePtr); - return; - } - if (stream->singleElement == NULL) - { - stream->singleElement = el; - return; - } - - // If we got here then we had only the one element so far - // and we must now create a vector to hold a collection of them - // - if (stream->elements == NULL) - { - pANTLR3_VECTOR_FACTORY factory = ((pANTLR3_COMMON_TREE_ADAPTOR)(stream->adaptor->super))->arboretum->vFactory; - - - stream->elements = factory->newVector(factory); - stream->freeElements = ANTLR3_TRUE; // We 'ummed it, so we play it son. - } - - stream->elements->add (stream->elements, stream->singleElement, freePtr); - stream->elements->add (stream->elements, el, freePtr); - stream->singleElement = NULL; - - return; -} - -/// Return the next element in the stream. If out of elements, throw -/// an exception unless size()==1. If size is 1, then return elements[0]. -/// Return a duplicate node/subtree if stream is out of elements and -/// size==1. If we've already used the element, dup (dirty bit set). -/// -static pANTLR3_BASE_TREE -nextTree(pANTLR3_REWRITE_RULE_ELEMENT_STREAM stream) -{ - ANTLR3_UINT32 n; - void * el; - - n = stream->size(stream); - - if ( stream->dirty || (stream->cursor >=n && n==1) ) - { - // if out of elements and size is 1, dup - // - el = stream->_next(stream); - return stream->dup(stream, el); - } - - // test size above then fetch - // - el = stream->_next(stream); - return el; -} - -/// Return the next element for a caller that wants just the token -/// -static void * -nextToken (pANTLR3_REWRITE_RULE_ELEMENT_STREAM stream) -{ - return stream->_next(stream); -} - -/// Return the next element in the stream. If out of elements, throw -/// an exception unless size()==1. If size is 1, then return elements[0]. -/// -static void * -next (pANTLR3_REWRITE_RULE_ELEMENT_STREAM stream) -{ - ANTLR3_UINT32 s; - - s = stream->size(stream); - if (stream->cursor >= s && s == 1) - { - pANTLR3_BASE_TREE el; - - el = stream->_next(stream); - - return stream->dup(stream, el); - } - - return stream->_next(stream); -} - -/// Do the work of getting the next element, making sure that it's -/// a tree node or subtree. Deal with the optimization of single- -/// element list versus list of size > 1. Throw an exception (or something similar) -/// if the stream is empty or we're out of elements and size>1. -/// You can override in a 'subclass' if necessary. -/// -static void * -_next (pANTLR3_REWRITE_RULE_ELEMENT_STREAM stream) -{ - ANTLR3_UINT32 n; - pANTLR3_BASE_TREE t; - - n = stream->size(stream); - - if (n == 0) - { - // This means that the stream is empty - // - return NULL; // Caller must cope with this - } - - // Traversed all the available elements already? - // - if (stream->cursor >= n) - { - if (n == 1) - { - // Special case when size is single element, it will just dup a lot - // - return stream->toTree(stream, stream->singleElement); - } - - // Out of elements and the size is not 1, so we cannot assume - // that we just duplicate the entry n times (such as ID ent+ -> ^(ID ent)+) - // This means we ran out of elements earlier than was expected. - // - return NULL; // Caller must cope with this - } - - // Elements available either for duping or just available - // - if (stream->singleElement != NULL) - { - stream->cursor++; // Cursor advances even for single element as this tells us to dup() - return stream->toTree(stream, stream->singleElement); - } - - // More than just a single element so we extract it from the - // vector. - // - t = stream->toTree(stream, stream->elements->get(stream->elements, stream->cursor)); - stream->cursor++; - return t; -} - -#ifdef ANTLR3_WINDOWS -#pragma warning(push) -#pragma warning(disable : 4100) -#endif -/// When constructing trees, sometimes we need to dup a token or AST -/// subtree. Dup'ing a token means just creating another AST node -/// around it. For trees, you must call the adaptor.dupTree(). -/// -static void * -dupTok (pANTLR3_REWRITE_RULE_ELEMENT_STREAM stream, void * el) -{ - ANTLR3_FPRINTF(stderr, "dup() cannot be called on a token rewrite stream!!"); - return NULL; -} -#ifdef ANTLR3_WINDOWS -#pragma warning(pop) -#endif - -/// When constructing trees, sometimes we need to dup a token or AST -/// subtree. Dup'ing a token means just creating another AST node -/// around it. For trees, you must call the adaptor.dupTree(). -/// -static void * -dupTree (pANTLR3_REWRITE_RULE_ELEMENT_STREAM stream, void * element) -{ - return stream->adaptor->dupNode(stream->adaptor, (pANTLR3_BASE_TREE)element); -} - -#ifdef ANTLR3_WINDOWS -#pragma warning(push) -#pragma warning(disable : 4100) -#endif -/// When constructing trees, sometimes we need to dup a token or AST -/// subtree. Dup'ing a token means just creating another AST node -/// around it. For trees, you must call the adaptor.dupTree(). -/// -static void * -dupTreeNode (pANTLR3_REWRITE_RULE_ELEMENT_STREAM stream, void * element) -{ - ANTLR3_FPRINTF(stderr, "dup() cannot be called on a node rewrite stream!!!"); - return NULL; -} - - -/// We don;t explicitly convert to a tree unless the call goes to -/// nextTree, which means rewrites are heterogeneous -/// -static pANTLR3_BASE_TREE -toTree (pANTLR3_REWRITE_RULE_ELEMENT_STREAM stream, void * element) -{ - return (pANTLR3_BASE_TREE)element; -} -#ifdef ANTLR3_WINDOWS -#pragma warning(pop) -#endif - -/// Ensure stream emits trees; tokens must be converted to AST nodes. -/// AST nodes can be passed through unmolested. -/// -#ifdef ANTLR3_WINDOWS -#pragma warning(push) -#pragma warning(disable : 4100) -#endif - -static pANTLR3_BASE_TREE -toTreeNode (pANTLR3_REWRITE_RULE_ELEMENT_STREAM stream, void * element) -{ - return stream->adaptor->dupNode(stream->adaptor, (pANTLR3_BASE_TREE)element); -} - -#ifdef ANTLR3_WINDOWS -#pragma warning(pop) -#endif - -/// Returns ANTLR3_TRUE if there is a next element available -/// -static ANTLR3_BOOLEAN -hasNext (pANTLR3_REWRITE_RULE_ELEMENT_STREAM stream) -{ - if ( (stream->singleElement != NULL && stream->cursor < 1) - || (stream->elements != NULL && stream->cursor < stream->elements->size(stream->elements))) - { - return ANTLR3_TRUE; - } - else - { - return ANTLR3_FALSE; - } -} - -/// Get the next token from the list and create a node for it -/// This is the implementation for token streams. -/// -static pANTLR3_BASE_TREE -nextNodeToken(pANTLR3_REWRITE_RULE_ELEMENT_STREAM stream) -{ - return stream->adaptor->create(stream->adaptor, stream->_next(stream)); -} - -static pANTLR3_BASE_TREE -nextNodeNode(pANTLR3_REWRITE_RULE_ELEMENT_STREAM stream) -{ - return stream->_next(stream); -} - -/// Treat next element as a single node even if it's a subtree. -/// This is used instead of next() when the result has to be a -/// tree root node. Also prevents us from duplicating recently-added -/// children; e.g., ^(type ID)+ adds ID to type and then 2nd iteration -/// must dup the type node, but ID has been added. -/// -/// Referencing to a rule result twice is ok; dup entire tree as -/// we can't be adding trees; e.g., expr expr. -/// -static pANTLR3_BASE_TREE -nextNode (pANTLR3_REWRITE_RULE_ELEMENT_STREAM stream) -{ - - ANTLR3_UINT32 n; - pANTLR3_BASE_TREE el = stream->_next(stream); - - n = stream->size(stream); - if (stream->dirty == ANTLR3_TRUE || (stream->cursor > n && n == 1)) - { - // We are out of elements and the size is 1, which means we just - // dup the node that we have - // - return stream->adaptor->dupNode(stream->adaptor, el); - } - - // We were not out of nodes, so the one we received is the one to return - // - return el; -} - -/// Number of elements available in the stream -/// -static ANTLR3_UINT32 -size (pANTLR3_REWRITE_RULE_ELEMENT_STREAM stream) -{ - ANTLR3_UINT32 n = 0; - - /// Should be a count of one if singleElement is set. I copied this - /// logic from the java implementation, which I suspect is just guarding - /// against someone setting singleElement and forgetting to NULL it out - /// - if (stream->singleElement != NULL) - { - n = 1; - } - else - { - if (stream->elements != NULL) - { - return (ANTLR3_UINT32)(stream->elements->count); - } - } - return n; -} - -/// Returns the description string if there is one available (check for NULL). -/// -static void * -getDescription (pANTLR3_REWRITE_RULE_ELEMENT_STREAM stream) -{ - if (stream->elementDescription == NULL) - { - stream->elementDescription = ""; - } - - return stream->elementDescription; -} diff --git a/impl/antlr/libantlr3c-3.4/src/antlr3string.c b/impl/antlr/libantlr3c-3.4/src/antlr3string.c deleted file mode 100644 index b29c020..0000000 --- a/impl/antlr/libantlr3c-3.4/src/antlr3string.c +++ /dev/null @@ -1,1402 +0,0 @@ -/** \file - * Implementation of the ANTLR3 string and string factory classes - */ - -// [The "BSD licence"] -// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC -// http://www.temporal-wave.com -// http://www.linkedin.com/in/jimidle -// -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions -// are met: -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// 3. The name of the author may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include - -/* Factory API - */ -static pANTLR3_STRING newRaw8 (pANTLR3_STRING_FACTORY factory); -static pANTLR3_STRING newRawUTF16 (pANTLR3_STRING_FACTORY factory); -static pANTLR3_STRING newSize8 (pANTLR3_STRING_FACTORY factory, ANTLR3_UINT32 size); -static pANTLR3_STRING newSizeUTF16 (pANTLR3_STRING_FACTORY factory, ANTLR3_UINT32 size); -static pANTLR3_STRING newPtr8 (pANTLR3_STRING_FACTORY factory, pANTLR3_UINT8 string, ANTLR3_UINT32 size); -static pANTLR3_STRING newPtrUTF16_8 (pANTLR3_STRING_FACTORY factory, pANTLR3_UINT8 string, ANTLR3_UINT32 size); -static pANTLR3_STRING newPtrUTF16_UTF16 (pANTLR3_STRING_FACTORY factory, pANTLR3_UINT8 string, ANTLR3_UINT32 size); -static pANTLR3_STRING newStr8 (pANTLR3_STRING_FACTORY factory, pANTLR3_UINT8 string); -static pANTLR3_STRING newStrUTF16_8 (pANTLR3_STRING_FACTORY factory, pANTLR3_UINT8 string); -static pANTLR3_STRING newStrUTF16_UTF16 (pANTLR3_STRING_FACTORY factory, pANTLR3_UINT8 string); -static void destroy (pANTLR3_STRING_FACTORY factory, pANTLR3_STRING string); -static pANTLR3_STRING printable8 (pANTLR3_STRING_FACTORY factory, pANTLR3_STRING string); -static pANTLR3_STRING printableUTF16 (pANTLR3_STRING_FACTORY factory, pANTLR3_STRING string); -static void closeFactory(pANTLR3_STRING_FACTORY factory); - -/* String API - */ -static pANTLR3_UINT8 set8 (pANTLR3_STRING string, const char * chars); -static pANTLR3_UINT8 setUTF16_8 (pANTLR3_STRING string, const char * chars); -static pANTLR3_UINT8 setUTF16_UTF16 (pANTLR3_STRING string, const char * chars); -static pANTLR3_UINT8 append8 (pANTLR3_STRING string, const char * newbit); -static pANTLR3_UINT8 appendUTF16_8 (pANTLR3_STRING string, const char * newbit); -static pANTLR3_UINT8 appendUTF16_UTF16 (pANTLR3_STRING string, const char * newbit); -static pANTLR3_UINT8 insert8 (pANTLR3_STRING string, ANTLR3_UINT32 point, const char * newbit); -static pANTLR3_UINT8 insertUTF16_8 (pANTLR3_STRING string, ANTLR3_UINT32 point, const char * newbit); -static pANTLR3_UINT8 insertUTF16_UTF16 (pANTLR3_STRING string, ANTLR3_UINT32 point, const char * newbit); - -static pANTLR3_UINT8 setS (pANTLR3_STRING string, pANTLR3_STRING chars); -static pANTLR3_UINT8 appendS (pANTLR3_STRING string, pANTLR3_STRING newbit); -static pANTLR3_UINT8 insertS (pANTLR3_STRING string, ANTLR3_UINT32 point, pANTLR3_STRING newbit); - -static pANTLR3_UINT8 addc8 (pANTLR3_STRING string, ANTLR3_UINT32 c); -static pANTLR3_UINT8 addcUTF16 (pANTLR3_STRING string, ANTLR3_UINT32 c); -static pANTLR3_UINT8 addi8 (pANTLR3_STRING string, ANTLR3_INT32 i); -static pANTLR3_UINT8 addiUTF16 (pANTLR3_STRING string, ANTLR3_INT32 i); -static pANTLR3_UINT8 inserti8 (pANTLR3_STRING string, ANTLR3_UINT32 point, ANTLR3_INT32 i); -static pANTLR3_UINT8 insertiUTF16 (pANTLR3_STRING string, ANTLR3_UINT32 point, ANTLR3_INT32 i); - -static ANTLR3_UINT32 compare8 (pANTLR3_STRING string, const char * compStr); -static ANTLR3_UINT32 compareUTF16_8 (pANTLR3_STRING string, const char * compStr); -static ANTLR3_UINT32 compareUTF16_UTF16(pANTLR3_STRING string, const char * compStr); -static ANTLR3_UINT32 compareS (pANTLR3_STRING string, pANTLR3_STRING compStr); -static ANTLR3_UCHAR charAt8 (pANTLR3_STRING string, ANTLR3_UINT32 offset); -static ANTLR3_UCHAR charAtUTF16 (pANTLR3_STRING string, ANTLR3_UINT32 offset); -static pANTLR3_STRING subString8 (pANTLR3_STRING string, ANTLR3_UINT32 startIndex, ANTLR3_UINT32 endIndex); -static pANTLR3_STRING subStringUTF16 (pANTLR3_STRING string, ANTLR3_UINT32 startIndex, ANTLR3_UINT32 endIndex); -static ANTLR3_INT32 toInt32_8 (pANTLR3_STRING string); -static ANTLR3_INT32 toInt32_UTF16 (pANTLR3_STRING string); -static pANTLR3_STRING to8_8 (pANTLR3_STRING string); -static pANTLR3_STRING to8_UTF16 (pANTLR3_STRING string); -static pANTLR3_STRING toUTF8_8 (pANTLR3_STRING string); -static pANTLR3_STRING toUTF8_UTF16 (pANTLR3_STRING string); - -/* Local helpers - */ -static void stringInit8 (pANTLR3_STRING string); -static void stringInitUTF16 (pANTLR3_STRING string); -static void ANTLR3_CDECL stringFree (pANTLR3_STRING string); - -ANTLR3_API pANTLR3_STRING_FACTORY -antlr3StringFactoryNew(ANTLR3_UINT32 encoding) -{ - pANTLR3_STRING_FACTORY factory; - - /* Allocate memory - */ - factory = (pANTLR3_STRING_FACTORY) ANTLR3_CALLOC(1, sizeof(ANTLR3_STRING_FACTORY)); - - if (factory == NULL) - { - return NULL; - } - - /* Now we make a new list to track the strings. - */ - factory->strings = antlr3VectorNew(0); - factory->index = 0; - - if (factory->strings == NULL) - { - ANTLR3_FREE(factory); - return NULL; - } - - // Install the API - // - // TODO: These encodings need equivalent functions to - // UTF16 and 8Bit if I am going to support those encodings in the STRING stuff. - // The STRING stuff was intended as a quick and dirty hack for people that did not - // want to worry about memory and performance very much, but nobody ever reads the - // notes or comments or uses the email list search. I want to discourage using these - // interfaces as it is much more efficient to use the pointers within the tokens - // directly, so I am not implementing the string stuff for the newer encodings. - // We install the standard 8 and 16 bit functions for the UTF 8 and 16 but they - // will not be useful beyond returning the text. - // - switch(encoding) - { - case ANTLR3_ENC_UTF32: - break; - - case ANTLR3_ENC_UTF32BE: - break; - - case ANTLR3_ENC_UTF32LE: - break; - - case ANTLR3_ENC_UTF16BE: - case ANTLR3_ENC_UTF16LE: - case ANTLR3_ENC_UTF16: - - factory->newRaw = newRawUTF16; - factory->newSize = newSizeUTF16; - factory->newPtr = newPtrUTF16_UTF16; - factory->newPtr8 = newPtrUTF16_8; - factory->newStr = newStrUTF16_UTF16; - factory->newStr8 = newStrUTF16_8; - factory->printable = printableUTF16; - factory->destroy = destroy; - factory->close = closeFactory; - break; - - case ANTLR3_ENC_UTF8: - case ANTLR3_ENC_EBCDIC: - case ANTLR3_ENC_8BIT: - default: - - factory->newRaw = newRaw8; - factory->newSize = newSize8; - factory->newPtr = newPtr8; - factory->newPtr8 = newPtr8; - factory->newStr = newStr8; - factory->newStr8 = newStr8; - factory->printable = printable8; - factory->destroy = destroy; - factory->close = closeFactory; - break; - } - return factory; -} - - -/** - * - * \param factory - * \return - */ -static pANTLR3_STRING -newRaw8 (pANTLR3_STRING_FACTORY factory) -{ - pANTLR3_STRING string; - - string = (pANTLR3_STRING) ANTLR3_MALLOC(sizeof(ANTLR3_STRING)); - - if (string == NULL) - { - return NULL; - } - - /* Structure is allocated, now fill in the API etc. - */ - stringInit8(string); - string->factory = factory; - - /* Add the string into the allocated list - */ - factory->strings->set(factory->strings, factory->index, (void *) string, (void (ANTLR3_CDECL *)(void *))(stringFree), ANTLR3_TRUE); - string->index = factory->index++; - - return string; -} -/** - * - * \param factory - * \return - */ -static pANTLR3_STRING -newRawUTF16 (pANTLR3_STRING_FACTORY factory) -{ - pANTLR3_STRING string; - - string = (pANTLR3_STRING) ANTLR3_MALLOC(sizeof(ANTLR3_STRING)); - - if (string == NULL) - { - return NULL; - } - - /* Structure is allocated, now fill in the API etc. - */ - stringInitUTF16(string); - string->factory = factory; - - /* Add the string into the allocated list - */ - factory->strings->set(factory->strings, factory->index, (void *) string, (void (ANTLR3_CDECL *)(void *))(stringFree), ANTLR3_TRUE); - string->index = factory->index++; - - return string; -} -static -void ANTLR3_CDECL stringFree (pANTLR3_STRING string) -{ - /* First free the string itself if there was anything in it - */ - if (string->chars) - { - ANTLR3_FREE(string->chars); - } - - /* Now free the space for this string - */ - ANTLR3_FREE(string); - - return; -} -/** - * - * \param string - * \return - */ -static void -stringInit8 (pANTLR3_STRING string) -{ - string->len = 0; - string->size = 0; - string->chars = NULL; - string->encoding = ANTLR3_ENC_8BIT ; - - /* API for 8 bit strings*/ - - string->set = set8; - string->set8 = set8; - string->append = append8; - string->append8 = append8; - string->insert = insert8; - string->insert8 = insert8; - string->addi = addi8; - string->inserti = inserti8; - string->addc = addc8; - string->charAt = charAt8; - string->compare = compare8; - string->compare8 = compare8; - string->subString = subString8; - string->toInt32 = toInt32_8; - string->to8 = to8_8; - string->toUTF8 = toUTF8_8; - string->compareS = compareS; - string->setS = setS; - string->appendS = appendS; - string->insertS = insertS; - -} -/** - * - * \param string - * \return - */ -static void -stringInitUTF16 (pANTLR3_STRING string) -{ - string->len = 0; - string->size = 0; - string->chars = NULL; - string->encoding = ANTLR3_ENC_8BIT; - - /* API for UTF16 strings */ - - string->set = setUTF16_UTF16; - string->set8 = setUTF16_8; - string->append = appendUTF16_UTF16; - string->append8 = appendUTF16_8; - string->insert = insertUTF16_UTF16; - string->insert8 = insertUTF16_8; - string->addi = addiUTF16; - string->inserti = insertiUTF16; - string->addc = addcUTF16; - string->charAt = charAtUTF16; - string->compare = compareUTF16_UTF16; - string->compare8 = compareUTF16_8; - string->subString = subStringUTF16; - string->toInt32 = toInt32_UTF16; - string->to8 = to8_UTF16; - string->toUTF8 = toUTF8_UTF16; - - string->compareS = compareS; - string->setS = setS; - string->appendS = appendS; - string->insertS = insertS; -} -/** - * - * \param string - * \return - * TODO: Implement UTF-8 - */ -static void -stringInitUTF8 (pANTLR3_STRING string) -{ - string->len = 0; - string->size = 0; - string->chars = NULL; - - /* API */ - -} - -// Convert an 8 bit string into a UTF8 representation, which is in fact just the string itself -// a memcpy as we make no assumptions about the 8 bit encoding. -// -static pANTLR3_STRING -toUTF8_8 (pANTLR3_STRING string) -{ - return string->factory->newPtr(string->factory, (pANTLR3_UINT8)(string->chars), string->len); -} - -// Convert a UTF16 string into a UTF8 representation using the Unicode.org -// supplied C algorithms, which are now contained within the ANTLR3 C runtime -// as permitted by the Unicode license (within the source code antlr3convertutf.c/.h -// UCS2 has the same encoding as UTF16 so we can use UTF16 converter. -// -static pANTLR3_STRING -toUTF8_UTF16 (pANTLR3_STRING string) -{ - - UTF8 * outputEnd; - UTF16 * inputEnd; - pANTLR3_STRING utf8String; - - ConversionResult cResult; - - // Allocate the output buffer, which needs to accommodate potentially - // 3X (in bytes) the input size (in chars). - // - utf8String = string->factory->newStr8(string->factory, (pANTLR3_UINT8)""); - - if (utf8String != NULL) - { - // Free existing allocation - // - ANTLR3_FREE(utf8String->chars); - - // Reallocate according to maximum expected size - // - utf8String->size = string->len *3; - utf8String->chars = (pANTLR3_UINT8)ANTLR3_MALLOC(utf8String->size +1); - - if (utf8String->chars != NULL) - { - inputEnd = (UTF16 *) (string->chars); - outputEnd = (UTF8 *) (utf8String->chars); - - // Call the Unicode converter - // - cResult = ConvertUTF16toUTF8 - ( - (const UTF16**)&inputEnd, - ((const UTF16 *)(string->chars)) + string->len, - &outputEnd, - outputEnd + utf8String->size - 1, - lenientConversion - ); - - // We don't really care if things failed or not here, we just converted - // everything that was vaguely possible and stopped when it wasn't. It is - // up to the grammar programmer to verify that the input is sensible. - // - utf8String->len = ANTLR3_UINT32_CAST(((pANTLR3_UINT8)outputEnd) - utf8String->chars); - - *(outputEnd+1) = '\0'; // Always null terminate - } - } - return utf8String; -} - -/** - * Creates a new string with enough capacity for size 8 bit characters plus a terminator. - * - * \param[in] factory - Pointer to the string factory that owns strings - * \param[in] size - In characters - * \return pointer to the new string. - */ -static pANTLR3_STRING -newSize8 (pANTLR3_STRING_FACTORY factory, ANTLR3_UINT32 size) -{ - pANTLR3_STRING string; - - string = factory->newRaw(factory); - - if (string == NULL) - { - return string; - } - - /* Always add one more byte for a terminator ;-) - */ - string->chars = (pANTLR3_UINT8) ANTLR3_MALLOC((size_t)(sizeof(ANTLR3_UINT8) * (size+1))); - *(string->chars) = '\0'; - string->size = size + 1; - - - return string; -} -/** - * Creates a new string with enough capacity for size UTF16 characters plus a terminator. - * - * \param[in] factory - Pointer to the string factory that owns strings - * \param[in] size - In characters (count double for surrogate pairs!!!) - * \return pointer to the new string. - */ -static pANTLR3_STRING -newSizeUTF16 (pANTLR3_STRING_FACTORY factory, ANTLR3_UINT32 size) -{ - pANTLR3_STRING string; - - string = factory->newRaw(factory); - - if (string == NULL) - { - return string; - } - - /* Always add one more byte for a terminator ;-) - */ - string->chars = (pANTLR3_UINT8) ANTLR3_MALLOC((size_t)(sizeof(ANTLR3_UINT16) * (size+1))); - *(string->chars) = '\0'; - string->size = size+1; /* Size is always in characters, as is len */ - - return string; -} - -/** Creates a new 8 bit string initialized with the 8 bit characters at the - * supplied ptr, of pre-determined size. - * \param[in] factory - Pointer to the string factory that owns the strings - * \param[in] ptr - Pointer to 8 bit encoded characters - * \return pointer to the new string - */ -static pANTLR3_STRING -newPtr8 (pANTLR3_STRING_FACTORY factory, pANTLR3_UINT8 ptr, ANTLR3_UINT32 size) -{ - pANTLR3_STRING string; - - string = factory->newSize(factory, size); - - if (string == NULL) - { - return NULL; - } - - if (size <= 0) - { - return string; - } - - if (ptr != NULL) - { - ANTLR3_MEMMOVE(string->chars, (const void *)ptr, size); - *(string->chars + size) = '\0'; /* Terminate, these strings are usually used for Token streams and printing etc. */ - string->len = size; - } - - return string; -} - -/** Creates a new UTF16 string initialized with the 8 bit characters at the - * supplied 8 bit character ptr, of pre-determined size. - * \param[in] factory - Pointer to the string factory that owns the strings - * \param[in] ptr - Pointer to 8 bit encoded characters - * \return pointer to the new string - */ -static pANTLR3_STRING -newPtrUTF16_8 (pANTLR3_STRING_FACTORY factory, pANTLR3_UINT8 ptr, ANTLR3_UINT32 size) -{ - pANTLR3_STRING string; - - /* newSize accepts size in characters, not bytes - */ - string = factory->newSize(factory, size); - - if (string == NULL) - { - return NULL; - } - - if (size <= 0) - { - return string; - } - - if (ptr != NULL) - { - pANTLR3_UINT16 out; - ANTLR3_INT32 inSize; - - out = (pANTLR3_UINT16)(string->chars); - inSize = size; - - while (inSize-- > 0) - { - *out++ = (ANTLR3_UINT16)(*ptr++); - } - - /* Terminate, these strings are usually used for Token streams and printing etc. - */ - *(((pANTLR3_UINT16)(string->chars)) + size) = '\0'; - - string->len = size; - } - - return string; -} - -/** Creates a new UTF16 string initialized with the UTF16 characters at the - * supplied ptr, of pre-determined size. - * \param[in] factory - Pointer to the string factory that owns the strings - * \param[in] ptr - Pointer to UTF16 encoded characters - * \return pointer to the new string - */ -static pANTLR3_STRING -newPtrUTF16_UTF16 (pANTLR3_STRING_FACTORY factory, pANTLR3_UINT8 ptr, ANTLR3_UINT32 size) -{ - pANTLR3_STRING string; - - string = factory->newSize(factory, size); - - if (string == NULL) - { - return NULL; - } - - if (size <= 0) - { - return string; - } - - if (ptr != NULL) - { - ANTLR3_MEMMOVE(string->chars, (const void *)ptr, (size * sizeof(ANTLR3_UINT16))); - - /* Terminate, these strings are usually used for Token streams and printing etc. - */ - *(((pANTLR3_UINT16)(string->chars)) + size) = '\0'; - string->len = size; - } - - return string; -} - -/** Create a new 8 bit string from the supplied, null terminated, 8 bit string pointer. - * \param[in] factory - Pointer to the string factory that owns strings. - * \param[in] ptr - Pointer to the 8 bit encoded string - * \return Pointer to the newly initialized string - */ -static pANTLR3_STRING -newStr8 (pANTLR3_STRING_FACTORY factory, pANTLR3_UINT8 ptr) -{ - return factory->newPtr8(factory, ptr, (ANTLR3_UINT32)strlen((const char *)ptr)); -} - -/** Create a new UTF16 string from the supplied, null terminated, 8 bit string pointer. - * \param[in] factory - Pointer to the string factory that owns strings. - * \param[in] ptr - Pointer to the 8 bit encoded string - * \return POinter to the newly initialized string - */ -static pANTLR3_STRING -newStrUTF16_8 (pANTLR3_STRING_FACTORY factory, pANTLR3_UINT8 ptr) -{ - return factory->newPtr8(factory, ptr, (ANTLR3_UINT32)strlen((const char *)ptr)); -} - -/** Create a new UTF16 string from the supplied, null terminated, UTF16 string pointer. - * \param[in] factory - Pointer to the string factory that owns strings. - * \param[in] ptr - Pointer to the UTF16 encoded string - * \return Pointer to the newly initialized string - */ -static pANTLR3_STRING -newStrUTF16_UTF16 (pANTLR3_STRING_FACTORY factory, pANTLR3_UINT8 ptr) -{ - pANTLR3_UINT16 in; - ANTLR3_UINT32 count; - - /** First, determine the length of the input string - */ - in = (pANTLR3_UINT16)ptr; - count = 0; - - while (*in++ != '\0') - { - count++; - } - return factory->newPtr(factory, ptr, count); -} - -static void -destroy (pANTLR3_STRING_FACTORY factory, pANTLR3_STRING string) -{ - // Record which string we are deleting - // - ANTLR3_UINT32 strIndex = string->index; - - // Ensure that the string was not factory made, or we would try - // to delete memory that wasn't allocated outside the factory - // block. - // Remove the specific indexed string from the vector - // - factory->strings->del(factory->strings, strIndex); - - // One less string in the vector, so decrement the factory index - // so that the next string allocated is indexed correctly with - // respect to the vector. - // - factory->index--; - - // Now we have to reindex the strings in the vector that followed - // the one we just deleted. We only do this if the one we just deleted - // was not the last one. - // - if (strIndex< factory->index) - { - // We must reindex the strings after the one we just deleted. - // The one that follows the one we just deleted is also out - // of whack, so we start there. - // - ANTLR3_UINT32 i; - - for (i = strIndex; i < factory->index; i++) - { - // Renumber the entry - // - ((pANTLR3_STRING)(factory->strings->elements[i].element))->index = i; - } - } - - // The string has been destroyed and the elements of the factory are reindexed. - // - -} - -static pANTLR3_STRING -printable8(pANTLR3_STRING_FACTORY factory, pANTLR3_STRING instr) -{ - pANTLR3_STRING string; - - /* We don't need to be too efficient here, this is mostly for error messages and so on. - */ - pANTLR3_UINT8 scannedText; - ANTLR3_UINT32 i; - - /* Assume we need as much as twice as much space to parse out the control characters - */ - string = factory->newSize(factory, instr->len *2 + 1); - - /* Scan through and replace unprintable (in terms of this routine) - * characters - */ - scannedText = string->chars; - - for (i = 0; i < instr->len; i++) - { - if (*(instr->chars + i) == '\n') - { - *scannedText++ = '\\'; - *scannedText++ = 'n'; - } - else if (*(instr->chars + i) == '\r') - { - *scannedText++ = '\\'; - *scannedText++ = 'r'; - } - else if (!isprint(*(instr->chars +i))) - { - *scannedText++ = '?'; - } - else - { - *scannedText++ = *(instr->chars + i); - } - } - *scannedText = '\0'; - - string->len = (ANTLR3_UINT32)(scannedText - string->chars); - - return string; -} - -static pANTLR3_STRING -printableUTF16(pANTLR3_STRING_FACTORY factory, pANTLR3_STRING instr) -{ - pANTLR3_STRING string; - - /* We don't need to be too efficient here, this is mostly for error messages and so on. - */ - pANTLR3_UINT16 scannedText; - pANTLR3_UINT16 inText; - ANTLR3_UINT32 i; - ANTLR3_UINT32 outLen; - - /* Assume we need as much as twice as much space to parse out the control characters - */ - string = factory->newSize(factory, instr->len *2 + 1); - - /* Scan through and replace unprintable (in terms of this routine) - * characters - */ - scannedText = (pANTLR3_UINT16)(string->chars); - inText = (pANTLR3_UINT16)(instr->chars); - outLen = 0; - - for (i = 0; i < instr->len; i++) - { - if (*(inText + i) == '\n') - { - *scannedText++ = '\\'; - *scannedText++ = 'n'; - outLen += 2; - } - else if (*(inText + i) == '\r') - { - *scannedText++ = '\\'; - *scannedText++ = 'r'; - outLen += 2; - } - else if (!isprint(*(inText +i))) - { - *scannedText++ = '?'; - outLen++; - } - else - { - *scannedText++ = *(inText + i); - outLen++; - } - } - *scannedText = '\0'; - - string->len = outLen; - - return string; -} - -/** Fascist Capitalist Pig function created - * to oppress the workers comrade. - */ -static void -closeFactory (pANTLR3_STRING_FACTORY factory) -{ - /* Delete the vector we were tracking the strings with, this will - * causes all the allocated strings to be deallocated too - */ - factory->strings->free(factory->strings); - - /* Delete the space for the factory itself - */ - ANTLR3_FREE((void *)factory); -} - -static pANTLR3_UINT8 -append8 (pANTLR3_STRING string, const char * newbit) -{ - ANTLR3_UINT32 len; - - len = (ANTLR3_UINT32)strlen(newbit); - - if (string->size < (string->len + len + 1)) - { - string->chars = (pANTLR3_UINT8) ANTLR3_REALLOC((void *)string->chars, (ANTLR3_UINT32)(string->len + len + 1)); - string->size = string->len + len + 1; - } - - /* Note we copy one more byte than the strlen in order to get the trailing - */ - ANTLR3_MEMMOVE((void *)(string->chars + string->len), newbit, (ANTLR3_UINT32)(len+1)); - string->len += len; - - return string->chars; -} - -static pANTLR3_UINT8 -appendUTF16_8 (pANTLR3_STRING string, const char * newbit) -{ - ANTLR3_UINT32 len; - pANTLR3_UINT16 apPoint; - ANTLR3_UINT32 count; - - len = (ANTLR3_UINT32)strlen(newbit); - - if (string->size < (string->len + len + 1)) - { - string->chars = (pANTLR3_UINT8) ANTLR3_REALLOC((void *)string->chars, (ANTLR3_UINT32)((sizeof(ANTLR3_UINT16)*(string->len + len + 1)))); - string->size = string->len + len + 1; - } - - apPoint = ((pANTLR3_UINT16)string->chars) + string->len; - string->len += len; - - for (count = 0; count < len; count++) - { - *apPoint++ = *(newbit + count); - } - *apPoint = '\0'; - - return string->chars; -} - -static pANTLR3_UINT8 -appendUTF16_UTF16 (pANTLR3_STRING string, const char * newbit) -{ - ANTLR3_UINT32 len; - pANTLR3_UINT16 in; - - /** First, determine the length of the input string - */ - in = (pANTLR3_UINT16)newbit; - len = 0; - - while (*in++ != '\0') - { - len++; - } - - if (string->size < (string->len + len + 1)) - { - string->chars = (pANTLR3_UINT8) ANTLR3_REALLOC((void *)string->chars, (ANTLR3_UINT32)( sizeof(ANTLR3_UINT16) *(string->len + len + 1) )); - string->size = string->len + len + 1; - } - - /* Note we copy one more byte than the strlen in order to get the trailing delimiter - */ - ANTLR3_MEMMOVE((void *)(((pANTLR3_UINT16)string->chars) + string->len), newbit, (ANTLR3_UINT32)(sizeof(ANTLR3_UINT16)*(len+1))); - string->len += len; - - return string->chars; -} - -static pANTLR3_UINT8 -set8 (pANTLR3_STRING string, const char * chars) -{ - ANTLR3_UINT32 len; - - len = (ANTLR3_UINT32)strlen(chars); - if (string->size < len + 1) - { - string->chars = (pANTLR3_UINT8) ANTLR3_REALLOC((void *)string->chars, (ANTLR3_UINT32)(len + 1)); - string->size = len + 1; - } - - /* Note we copy one more byte than the strlen in order to get the trailing '\0' - */ - ANTLR3_MEMMOVE((void *)(string->chars), chars, (ANTLR3_UINT32)(len+1)); - string->len = len; - - return string->chars; - -} - -static pANTLR3_UINT8 -setUTF16_8 (pANTLR3_STRING string, const char * chars) -{ - ANTLR3_UINT32 len; - ANTLR3_UINT32 count; - pANTLR3_UINT16 apPoint; - - len = (ANTLR3_UINT32)strlen(chars); - if (string->size < len + 1) - { - string->chars = (pANTLR3_UINT8) ANTLR3_REALLOC((void *)string->chars, (ANTLR3_UINT32)(sizeof(ANTLR3_UINT16)*(len + 1))); - string->size = len + 1; - } - apPoint = ((pANTLR3_UINT16)string->chars); - string->len = len; - - for (count = 0; count < string->len; count++) - { - *apPoint++ = *(chars + count); - } - *apPoint = '\0'; - - return string->chars; -} - -static pANTLR3_UINT8 -setUTF16_UTF16 (pANTLR3_STRING string, const char * chars) -{ - ANTLR3_UINT32 len; - pANTLR3_UINT16 in; - - /** First, determine the length of the input string - */ - in = (pANTLR3_UINT16)chars; - len = 0; - - while (*in++ != '\0') - { - len++; - } - - if (string->size < len + 1) - { - string->chars = (pANTLR3_UINT8) ANTLR3_REALLOC((void *)string->chars, (ANTLR3_UINT32)(sizeof(ANTLR3_UINT16)*(len + 1))); - string->size = len + 1; - } - - /* Note we copy one more byte than the strlen in order to get the trailing '\0' - */ - ANTLR3_MEMMOVE((void *)(string->chars), chars, (ANTLR3_UINT32)((len+1) * sizeof(ANTLR3_UINT16))); - string->len = len; - - return string->chars; - -} - -static pANTLR3_UINT8 -addc8 (pANTLR3_STRING string, ANTLR3_UINT32 c) -{ - if (string->size < string->len + 2) - { - string->chars = (pANTLR3_UINT8) ANTLR3_REALLOC((void *)string->chars, (ANTLR3_UINT32)(string->len + 2)); - string->size = string->len + 2; - } - *(string->chars + string->len) = (ANTLR3_UINT8)c; - *(string->chars + string->len + 1) = '\0'; - string->len++; - - return string->chars; -} - -static pANTLR3_UINT8 -addcUTF16 (pANTLR3_STRING string, ANTLR3_UINT32 c) -{ - pANTLR3_UINT16 ptr; - - if (string->size < string->len + 2) - { - string->chars = (pANTLR3_UINT8) ANTLR3_REALLOC((void *)string->chars, (ANTLR3_UINT32)(sizeof(ANTLR3_UINT16) * (string->len + 2))); - string->size = string->len + 2; - } - ptr = (pANTLR3_UINT16)(string->chars); - - *(ptr + string->len) = (ANTLR3_UINT16)c; - *(ptr + string->len + 1) = '\0'; - string->len++; - - return string->chars; -} - -static pANTLR3_UINT8 -addi8 (pANTLR3_STRING string, ANTLR3_INT32 i) -{ - ANTLR3_UINT8 newbit[32]; - - sprintf((char *)newbit, "%d", i); - - return string->append8(string, (const char *)newbit); -} -static pANTLR3_UINT8 -addiUTF16 (pANTLR3_STRING string, ANTLR3_INT32 i) -{ - ANTLR3_UINT8 newbit[32]; - - sprintf((char *)newbit, "%d", i); - - return string->append8(string, (const char *)newbit); -} - -static pANTLR3_UINT8 -inserti8 (pANTLR3_STRING string, ANTLR3_UINT32 point, ANTLR3_INT32 i) -{ - ANTLR3_UINT8 newbit[32]; - - sprintf((char *)newbit, "%d", i); - return string->insert8(string, point, (const char *)newbit); -} -static pANTLR3_UINT8 -insertiUTF16 (pANTLR3_STRING string, ANTLR3_UINT32 point, ANTLR3_INT32 i) -{ - ANTLR3_UINT8 newbit[32]; - - sprintf((char *)newbit, "%d", i); - return string->insert8(string, point, (const char *)newbit); -} - -static pANTLR3_UINT8 -insert8 (pANTLR3_STRING string, ANTLR3_UINT32 point, const char * newbit) -{ - ANTLR3_UINT32 len; - - if (point >= string->len) - { - return string->append(string, newbit); - } - - len = (ANTLR3_UINT32)strlen(newbit); - - if (len == 0) - { - return string->chars; - } - - if (string->size < (string->len + len + 1)) - { - string->chars = (pANTLR3_UINT8) ANTLR3_REALLOC((void *)string->chars, (ANTLR3_UINT32)(string->len + len + 1)); - string->size = string->len + len + 1; - } - - /* Move the characters we are inserting before, including the delimiter - */ - ANTLR3_MEMMOVE((void *)(string->chars + point + len), (void *)(string->chars + point), (ANTLR3_UINT32)(string->len - point + 1)); - - /* Note we copy the exact number of bytes - */ - ANTLR3_MEMMOVE((void *)(string->chars + point), newbit, (ANTLR3_UINT32)(len)); - - string->len += len; - - return string->chars; -} - -static pANTLR3_UINT8 -insertUTF16_8 (pANTLR3_STRING string, ANTLR3_UINT32 point, const char * newbit) -{ - ANTLR3_UINT32 len; - ANTLR3_UINT32 count; - pANTLR3_UINT16 inPoint; - - if (point >= string->len) - { - return string->append8(string, newbit); - } - - len = (ANTLR3_UINT32)strlen(newbit); - - if (len == 0) - { - return string->chars; - } - - if (string->size < (string->len + len + 1)) - { - string->chars = (pANTLR3_UINT8) ANTLR3_REALLOC((void *)string->chars, (ANTLR3_UINT32)(sizeof(ANTLR3_UINT16)*(string->len + len + 1))); - string->size = string->len + len + 1; - } - - /* Move the characters we are inserting before, including the delimiter - */ - ANTLR3_MEMMOVE((void *)(((pANTLR3_UINT16)string->chars) + point + len), (void *)(((pANTLR3_UINT16)string->chars) + point), (ANTLR3_UINT32)(sizeof(ANTLR3_UINT16)*(string->len - point + 1))); - - string->len += len; - - inPoint = ((pANTLR3_UINT16)(string->chars))+point; - for (count = 0; countchars; -} - -static pANTLR3_UINT8 -insertUTF16_UTF16 (pANTLR3_STRING string, ANTLR3_UINT32 point, const char * newbit) -{ - ANTLR3_UINT32 len; - pANTLR3_UINT16 in; - - if (point >= string->len) - { - return string->append(string, newbit); - } - - /** First, determine the length of the input string - */ - in = (pANTLR3_UINT16)newbit; - len = 0; - - while (*in++ != '\0') - { - len++; - } - - if (len == 0) - { - return string->chars; - } - - if (string->size < (string->len + len + 1)) - { - string->chars = (pANTLR3_UINT8) ANTLR3_REALLOC((void *)string->chars, (ANTLR3_UINT32)(sizeof(ANTLR3_UINT16)*(string->len + len + 1))); - string->size = string->len + len + 1; - } - - /* Move the characters we are inserting before, including the delimiter - */ - ANTLR3_MEMMOVE((void *)(((pANTLR3_UINT16)string->chars) + point + len), (void *)(((pANTLR3_UINT16)string->chars) + point), (ANTLR3_UINT32)(sizeof(ANTLR3_UINT16)*(string->len - point + 1))); - - - /* Note we copy the exact number of characters - */ - ANTLR3_MEMMOVE((void *)(((pANTLR3_UINT16)string->chars) + point), newbit, (ANTLR3_UINT32)(sizeof(ANTLR3_UINT16)*(len))); - - string->len += len; - - return string->chars; -} - -static pANTLR3_UINT8 setS (pANTLR3_STRING string, pANTLR3_STRING chars) -{ - return string->set(string, (const char *)(chars->chars)); -} - -static pANTLR3_UINT8 appendS (pANTLR3_STRING string, pANTLR3_STRING newbit) -{ - /* We may be passed an empty string, in which case we just return the current pointer - */ - if (newbit == NULL || newbit->len == 0 || newbit->size == 0 || newbit->chars == NULL) - { - return string->chars; - } - else - { - return string->append(string, (const char *)(newbit->chars)); - } -} - -static pANTLR3_UINT8 insertS (pANTLR3_STRING string, ANTLR3_UINT32 point, pANTLR3_STRING newbit) -{ - return string->insert(string, point, (const char *)(newbit->chars)); -} - -/* Function that compares the text of a string to the supplied - * 8 bit character string and returns a result a la strcmp() - */ -static ANTLR3_UINT32 -compare8 (pANTLR3_STRING string, const char * compStr) -{ - return strcmp((const char *)(string->chars), compStr); -} - -/* Function that compares the text of a string with the supplied character string - * (which is assumed to be in the same encoding as the string itself) and returns a result - * a la strcmp() - */ -static ANTLR3_UINT32 -compareUTF16_8 (pANTLR3_STRING string, const char * compStr) -{ - pANTLR3_UINT16 ourString; - ANTLR3_UINT32 charDiff; - - ourString = (pANTLR3_UINT16)(string->chars); - - while (((ANTLR3_UCHAR)(*ourString) != '\0') && ((ANTLR3_UCHAR)(*compStr) != '\0')) - { - charDiff = *ourString - *compStr; - if (charDiff != 0) - { - return charDiff; - } - ourString++; - compStr++; - } - - /* At this point, one of the strings was terminated - */ - return (ANTLR3_UINT32)((ANTLR3_UCHAR)(*ourString) - (ANTLR3_UCHAR)(*compStr)); - -} - -/* Function that compares the text of a string with the supplied character string - * (which is assumed to be in the same encoding as the string itself) and returns a result - * a la strcmp() - */ -static ANTLR3_UINT32 -compareUTF16_UTF16 (pANTLR3_STRING string, const char * compStr8) -{ - pANTLR3_UINT16 ourString; - pANTLR3_UINT16 compStr; - ANTLR3_UINT32 charDiff; - - ourString = (pANTLR3_UINT16)(string->chars); - compStr = (pANTLR3_UINT16)(compStr8); - - while (((ANTLR3_UCHAR)(*ourString) != '\0') && ((ANTLR3_UCHAR)(*((pANTLR3_UINT16)compStr)) != '\0')) - { - charDiff = *ourString - *compStr; - if (charDiff != 0) - { - return charDiff; - } - ourString++; - compStr++; - } - - /* At this point, one of the strings was terminated - */ - return (ANTLR3_UINT32)((ANTLR3_UCHAR)(*ourString) - (ANTLR3_UCHAR)(*compStr)); -} - -/* Function that compares the text of a string with the supplied string - * (which is assumed to be in the same encoding as the string itself) and returns a result - * a la strcmp() - */ -static ANTLR3_UINT32 -compareS (pANTLR3_STRING string, pANTLR3_STRING compStr) -{ - return string->compare(string, (const char *)compStr->chars); -} - - -/* Function that returns the character indexed at the supplied - * offset as a 32 bit character. - */ -static ANTLR3_UCHAR -charAt8 (pANTLR3_STRING string, ANTLR3_UINT32 offset) -{ - if (offset > string->len) - { - return (ANTLR3_UCHAR)'\0'; - } - else - { - return (ANTLR3_UCHAR)(*(string->chars + offset)); - } -} - -/* Function that returns the character indexed at the supplied - * offset as a 32 bit character. - */ -static ANTLR3_UCHAR -charAtUTF16 (pANTLR3_STRING string, ANTLR3_UINT32 offset) -{ - if (offset > string->len) - { - return (ANTLR3_UCHAR)'\0'; - } - else - { - return (ANTLR3_UCHAR)(*((pANTLR3_UINT16)(string->chars) + offset)); - } -} - -/* Function that returns a substring of the supplied string a la .subString(s,e) - * in java runtimes. - */ -static pANTLR3_STRING -subString8 (pANTLR3_STRING string, ANTLR3_UINT32 startIndex, ANTLR3_UINT32 endIndex) -{ - pANTLR3_STRING newStr; - - if (endIndex > string->len) - { - endIndex = string->len + 1; - } - newStr = string->factory->newPtr(string->factory, string->chars + startIndex, endIndex - startIndex); - - return newStr; -} - -/* Returns a substring of the supplied string a la .subString(s,e) - * in java runtimes. - */ -static pANTLR3_STRING -subStringUTF16 (pANTLR3_STRING string, ANTLR3_UINT32 startIndex, ANTLR3_UINT32 endIndex) -{ - pANTLR3_STRING newStr; - - if (endIndex > string->len) - { - endIndex = string->len + 1; - } - newStr = string->factory->newPtr(string->factory, (pANTLR3_UINT8)((pANTLR3_UINT16)(string->chars) + startIndex), endIndex - startIndex); - - return newStr; -} - -/* Function that can convert the characters in the string to an integer - */ -static ANTLR3_INT32 -toInt32_8 (struct ANTLR3_STRING_struct * string) -{ - return atoi((const char *)(string->chars)); -} - -/* Function that can convert the characters in the string to an integer - */ -static ANTLR3_INT32 -toInt32_UTF16 (struct ANTLR3_STRING_struct * string) -{ - pANTLR3_UINT16 input; - ANTLR3_INT32 value; - ANTLR3_BOOLEAN negate; - - value = 0; - input = (pANTLR3_UINT16)(string->chars); - negate = ANTLR3_FALSE; - - if (*input == (ANTLR3_UCHAR)'-') - { - negate = ANTLR3_TRUE; - input++; - } - else if (*input == (ANTLR3_UCHAR)'+') - { - input++; - } - - while (*input != '\0' && isdigit(*input)) - { - value = value * 10; - value += ((ANTLR3_UINT32)(*input) - (ANTLR3_UINT32)'0'); - input++; - } - - return negate ? -value : value; -} - -/* Function that returns a pointer to an 8 bit version of the string, - * which in this case is just the string as this is - * 8 bit encodiing anyway. - */ -static pANTLR3_STRING to8_8 (pANTLR3_STRING string) -{ - return string; -} - -/* Function that returns an 8 bit version of the string, - * which in this case is returning all the UTF16 characters - * narrowed back into 8 bits, with characters that are too large - * replaced with '_' - */ -static pANTLR3_STRING to8_UTF16 (pANTLR3_STRING string) -{ - pANTLR3_STRING newStr; - ANTLR3_UINT32 i; - - /* Create a new 8 bit string - */ - newStr = newRaw8(string->factory); - - if (newStr == NULL) - { - return NULL; - } - - /* Always add one more byte for a terminator - */ - newStr->chars = (pANTLR3_UINT8) ANTLR3_MALLOC((size_t)(string->len + 1)); - newStr->size = string->len + 1; - newStr->len = string->len; - - /* Now copy each UTF16 charActer , making it an 8 bit character of - * some sort. - */ - for (i=0; ilen; i++) - { - ANTLR3_UCHAR c; - - c = *(((pANTLR3_UINT16)(string->chars)) + i); - - *(newStr->chars + i) = (ANTLR3_UINT8)(c > 255 ? '_' : c); - } - - /* Terminate - */ - *(newStr->chars + newStr->len) = '\0'; - - return newStr; -} diff --git a/impl/antlr/libantlr3c-3.4/src/antlr3tokenstream.c b/impl/antlr/libantlr3c-3.4/src/antlr3tokenstream.c deleted file mode 100644 index ec06f15..0000000 --- a/impl/antlr/libantlr3c-3.4/src/antlr3tokenstream.c +++ /dev/null @@ -1,1091 +0,0 @@ -/// \file -/// Default implementation of CommonTokenStream -/// - -// [The "BSD licence"] -// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC -// http://www.temporal-wave.com -// http://www.linkedin.com/in/jimidle -// -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions -// are met: -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// 3. The name of the author may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include - -#ifdef ANTLR3_WINDOWS -#pragma warning( disable : 4100 ) -#endif - -// COMMON_TOKEN_STREAM API -// -static void setTokenTypeChannel (pANTLR3_COMMON_TOKEN_STREAM cts, ANTLR3_UINT32 ttype, ANTLR3_UINT32 channel); -static void discardTokenType (pANTLR3_COMMON_TOKEN_STREAM cts, ANTLR3_INT32 ttype); -static void discardOffChannel (pANTLR3_COMMON_TOKEN_STREAM cts, ANTLR3_BOOLEAN discard); -static pANTLR3_VECTOR getTokens (pANTLR3_COMMON_TOKEN_STREAM cts); -static pANTLR3_LIST getTokenRange (pANTLR3_COMMON_TOKEN_STREAM cts, ANTLR3_UINT32 start, ANTLR3_UINT32 stop); -static pANTLR3_LIST getTokensSet (pANTLR3_COMMON_TOKEN_STREAM cts, ANTLR3_UINT32 start, ANTLR3_UINT32 stop, pANTLR3_BITSET types); -static pANTLR3_LIST getTokensList (pANTLR3_COMMON_TOKEN_STREAM cts, ANTLR3_UINT32 start, ANTLR3_UINT32 stop, pANTLR3_LIST list); -static pANTLR3_LIST getTokensType (pANTLR3_COMMON_TOKEN_STREAM cts, ANTLR3_UINT32 start, ANTLR3_UINT32 stop, ANTLR3_UINT32 type); -static void reset (pANTLR3_COMMON_TOKEN_STREAM cts); - -// TOKEN_STREAM API -// -static pANTLR3_COMMON_TOKEN tokLT (pANTLR3_TOKEN_STREAM ts, ANTLR3_INT32 k); -static pANTLR3_COMMON_TOKEN dbgTokLT (pANTLR3_TOKEN_STREAM ts, ANTLR3_INT32 k); -static pANTLR3_COMMON_TOKEN get (pANTLR3_TOKEN_STREAM ts, ANTLR3_UINT32 i); -static pANTLR3_TOKEN_SOURCE getTokenSource (pANTLR3_TOKEN_STREAM ts); -static void setTokenSource (pANTLR3_TOKEN_STREAM ts, pANTLR3_TOKEN_SOURCE tokenSource); -static pANTLR3_STRING toString (pANTLR3_TOKEN_STREAM ts); -static pANTLR3_STRING toStringSS (pANTLR3_TOKEN_STREAM ts, ANTLR3_UINT32 start, ANTLR3_UINT32 stop); -static pANTLR3_STRING toStringTT (pANTLR3_TOKEN_STREAM ts, pANTLR3_COMMON_TOKEN start, pANTLR3_COMMON_TOKEN stop); -static void setDebugListener (pANTLR3_TOKEN_STREAM ts, pANTLR3_DEBUG_EVENT_LISTENER debugger); - -// INT STREAM API -// -static void consume (pANTLR3_INT_STREAM is); -static void dbgConsume (pANTLR3_INT_STREAM is); -static ANTLR3_UINT32 _LA (pANTLR3_INT_STREAM is, ANTLR3_INT32 i); -static ANTLR3_UINT32 dbgLA (pANTLR3_INT_STREAM is, ANTLR3_INT32 i); -static ANTLR3_MARKER mark (pANTLR3_INT_STREAM is); -static ANTLR3_MARKER dbgMark (pANTLR3_INT_STREAM is); -static void release (pANTLR3_INT_STREAM is, ANTLR3_MARKER mark); -static ANTLR3_UINT32 size (pANTLR3_INT_STREAM is); -static ANTLR3_MARKER tindex (pANTLR3_INT_STREAM is); -static void rewindStream (pANTLR3_INT_STREAM is, ANTLR3_MARKER marker); -static void dbgRewindStream (pANTLR3_INT_STREAM is, ANTLR3_MARKER marker); -static void rewindLast (pANTLR3_INT_STREAM is); -static void dbgRewindLast (pANTLR3_INT_STREAM is); -static void seek (pANTLR3_INT_STREAM is, ANTLR3_MARKER index); -static void dbgSeek (pANTLR3_INT_STREAM is, ANTLR3_MARKER index); -static pANTLR3_STRING getSourceName (pANTLR3_INT_STREAM is); -static void antlr3TokenStreamFree (pANTLR3_TOKEN_STREAM stream); -static void antlr3CTSFree (pANTLR3_COMMON_TOKEN_STREAM stream); - -// Helpers -// -static void fillBuffer (pANTLR3_COMMON_TOKEN_STREAM tokenStream); -static ANTLR3_UINT32 skipOffTokenChannels (pANTLR3_COMMON_TOKEN_STREAM tokenStream, ANTLR3_INT32 i); -static ANTLR3_UINT32 skipOffTokenChannelsReverse (pANTLR3_COMMON_TOKEN_STREAM tokenStream, ANTLR3_INT32 i); -static pANTLR3_COMMON_TOKEN LB (pANTLR3_COMMON_TOKEN_STREAM tokenStream, ANTLR3_INT32 i); - -ANTLR3_API pANTLR3_TOKEN_STREAM -antlr3TokenStreamNew() -{ - pANTLR3_TOKEN_STREAM stream; - - // Memory for the interface structure - // - stream = (pANTLR3_TOKEN_STREAM) ANTLR3_MALLOC(sizeof(ANTLR3_TOKEN_STREAM)); - - if (stream == NULL) - { - return NULL; - } - - // Install basic API - // - stream->free = antlr3TokenStreamFree; - - - return stream; -} - -static void -antlr3TokenStreamFree(pANTLR3_TOKEN_STREAM stream) -{ - ANTLR3_FREE(stream); -} - -static void -antlr3CTSFree (pANTLR3_COMMON_TOKEN_STREAM stream) -{ - // We only free up our subordinate interfaces if they belong - // to us, otherwise we let whoever owns them deal with them. - // - if (stream->tstream->super == stream) - { - if (stream->tstream->istream->super == stream->tstream) - { - stream->tstream->istream->free(stream->tstream->istream); - stream->tstream->istream = NULL; - } - stream->tstream->free(stream->tstream); - } - - // Now we free our own resources - // - if (stream->tokens != NULL) - { - stream->tokens->free(stream->tokens); - stream->tokens = NULL; - } - if (stream->discardSet != NULL) - { - stream->discardSet->free(stream->discardSet); - stream->discardSet = NULL; - } - if (stream->channelOverrides != NULL) - { - stream->channelOverrides->free(stream->channelOverrides); - stream->channelOverrides = NULL; - } - - // Free our memory now - // - ANTLR3_FREE(stream); -} - -// Reset a token stream so it can be used again and can reuse it's -// resources. -// -static void -reset (pANTLR3_COMMON_TOKEN_STREAM cts) -{ - - // Free any resources that ar most like specifc to the - // run we just did. - // - if (cts->discardSet != NULL) - { - cts->discardSet->free(cts->discardSet); - cts->discardSet = NULL; - } - if (cts->channelOverrides != NULL) - { - cts->channelOverrides->free(cts->channelOverrides); - cts->channelOverrides = NULL; - } - - // Now, if there were any existing tokens in the stream, - // then we just reset the vector count so that it starts - // again. We must traverse the entries unfortunately as - // there may be free pointers for custom token types and - // so on. However that is just a quick NULL check on the - // vector entries. - // - if (cts->tokens != NULL) - { - cts->tokens->clear(cts->tokens); - } - else - { - /* Install the token tracking tables - */ - cts->tokens = antlr3VectorNew(0); - } - - // Reset to defaults - // - cts->discardOffChannel = ANTLR3_FALSE; - cts->channel = ANTLR3_TOKEN_DEFAULT_CHANNEL; - cts->p = -1; -} - -ANTLR3_API pANTLR3_COMMON_TOKEN_STREAM -antlr3CommonTokenDebugStreamSourceNew(ANTLR3_UINT32 hint, pANTLR3_TOKEN_SOURCE source, pANTLR3_DEBUG_EVENT_LISTENER debugger) -{ - pANTLR3_COMMON_TOKEN_STREAM stream; - - // Create a standard token stream - // - stream = antlr3CommonTokenStreamSourceNew(hint, source); - - // Install the debugger object - // - stream->tstream->debugger = debugger; - - // Override standard token stream methods with debugging versions - // - stream->tstream->initialStreamState = ANTLR3_FALSE; - - stream->tstream->_LT = dbgTokLT; - - stream->tstream->istream->consume = dbgConsume; - stream->tstream->istream->_LA = dbgLA; - stream->tstream->istream->mark = dbgMark; - stream->tstream->istream->rewind = dbgRewindStream; - stream->tstream->istream->rewindLast = dbgRewindLast; - stream->tstream->istream->seek = dbgSeek; - - return stream; -} - -ANTLR3_API pANTLR3_COMMON_TOKEN_STREAM -antlr3CommonTokenStreamSourceNew(ANTLR3_UINT32 hint, pANTLR3_TOKEN_SOURCE source) -{ - pANTLR3_COMMON_TOKEN_STREAM stream; - - stream = antlr3CommonTokenStreamNew(hint); - - stream->channel = ANTLR3_TOKEN_DEFAULT_CHANNEL; - - stream->channelOverrides = NULL; - stream->discardSet = NULL; - stream->discardOffChannel = ANTLR3_FALSE; - - stream->tstream->setTokenSource(stream->tstream, source); - - stream->free = antlr3CTSFree; - return stream; -} - -ANTLR3_API pANTLR3_COMMON_TOKEN_STREAM -antlr3CommonTokenStreamNew(ANTLR3_UINT32 hint) -{ - pANTLR3_COMMON_TOKEN_STREAM stream; - - /* Memory for the interface structure - */ - stream = (pANTLR3_COMMON_TOKEN_STREAM) ANTLR3_MALLOC(sizeof(ANTLR3_COMMON_TOKEN_STREAM)); - - if (stream == NULL) - { - return NULL; - } - - /* Create space for the token stream interface - */ - stream->tstream = antlr3TokenStreamNew(); - stream->tstream->super = stream; - - /* Create space for the INT_STREAM interfacce - */ - stream->tstream->istream = antlr3IntStreamNew(); - stream->tstream->istream->super = (stream->tstream); - stream->tstream->istream->type = ANTLR3_TOKENSTREAM; - - /* Install the token tracking tables - */ - stream->tokens = antlr3VectorNew(0); - - /* Defaults - */ - stream->p = -1; - - /* Install the common token stream API - */ - stream->setTokenTypeChannel = setTokenTypeChannel; - stream->discardTokenType = discardTokenType; - stream->discardOffChannelToks = discardOffChannel; - stream->getTokens = getTokens; - stream->getTokenRange = getTokenRange; - stream->getTokensSet = getTokensSet; - stream->getTokensList = getTokensList; - stream->getTokensType = getTokensType; - stream->reset = reset; - - /* Install the token stream API - */ - stream->tstream->_LT = tokLT; - stream->tstream->get = get; - stream->tstream->getTokenSource = getTokenSource; - stream->tstream->setTokenSource = setTokenSource; - stream->tstream->toString = toString; - stream->tstream->toStringSS = toStringSS; - stream->tstream->toStringTT = toStringTT; - stream->tstream->setDebugListener = setDebugListener; - - /* Install INT_STREAM interface - */ - stream->tstream->istream->_LA = _LA; - stream->tstream->istream->mark = mark; - stream->tstream->istream->release = release; - stream->tstream->istream->size = size; - stream->tstream->istream->index = tindex; - stream->tstream->istream->rewind = rewindStream; - stream->tstream->istream->rewindLast= rewindLast; - stream->tstream->istream->seek = seek; - stream->tstream->istream->consume = consume; - stream->tstream->istream->getSourceName = getSourceName; - - return stream; -} - -// Install a debug listener adn switch to debug mode methods -// -static void -setDebugListener (pANTLR3_TOKEN_STREAM ts, pANTLR3_DEBUG_EVENT_LISTENER debugger) -{ - // Install the debugger object - // - ts->debugger = debugger; - - // Override standard token stream methods with debugging versions - // - ts->initialStreamState = ANTLR3_FALSE; - - ts->_LT = dbgTokLT; - - ts->istream->consume = dbgConsume; - ts->istream->_LA = dbgLA; - ts->istream->mark = dbgMark; - ts->istream->rewind = dbgRewindStream; - ts->istream->rewindLast = dbgRewindLast; - ts->istream->seek = dbgSeek; -} - -/** Get the ith token from the current position 1..n where k=1 is the -* first symbol of lookahead. -*/ -static pANTLR3_COMMON_TOKEN -tokLT (pANTLR3_TOKEN_STREAM ts, ANTLR3_INT32 k) -{ - ANTLR3_INT32 i; - ANTLR3_INT32 n; - pANTLR3_COMMON_TOKEN_STREAM cts; - - cts = (pANTLR3_COMMON_TOKEN_STREAM)ts->super; - - if (k < 0) - { - return LB(cts, -k); - } - - if (cts->p == -1) - { - fillBuffer(cts); - } - - // Here we used to check for k == 0 and return 0, but this seems - // a superfluous check to me. LT(k=0) is therefore just undefined - // and we won't waste the clock cycles on the check - // - - if ((cts->p + k - 1) >= (ANTLR3_INT32)ts->istream->cachedSize) - { - pANTLR3_COMMON_TOKEN teof = &(ts->tokenSource->eofToken); - - teof->setStartIndex (teof, ts->istream->index (ts->istream)); - teof->setStopIndex (teof, ts->istream->index (ts->istream)); - return teof; - } - - i = cts->p; - n = 1; - - /* Need to find k good tokens, skipping ones that are off channel - */ - while ( n < k) - { - /* Skip off-channel tokens */ - i = skipOffTokenChannels(cts, i+1); /* leave p on valid token */ - n++; - } - if ( (ANTLR3_UINT32) i >= ts->istream->cachedSize) - { - pANTLR3_COMMON_TOKEN teof = &(ts->tokenSource->eofToken); - - teof->setStartIndex (teof, ts->istream->index(ts->istream)); - teof->setStopIndex (teof, ts->istream->index(ts->istream)); - return teof; - } - - // Here the token must be in the input vector. Rather then incur - // function call penalty, we just return the pointer directly - // from the vector - // - return (pANTLR3_COMMON_TOKEN)cts->tokens->elements[i].element; - //return (pANTLR3_COMMON_TOKEN)cts->tokens->get(cts->tokens, i); -} - -/// Debug only method to flag consumption of initial off-channel -/// tokens in the input stream -/// -static void -consumeInitialHiddenTokens(pANTLR3_INT_STREAM is) -{ - ANTLR3_MARKER first; - ANTLR3_INT32 i; - pANTLR3_TOKEN_STREAM ts; - - ts = (pANTLR3_TOKEN_STREAM) is->super; - first = is->index(is); - - for (i=0; idebugger->consumeHiddenToken(ts->debugger, ts->get(ts, i)); - } - - ts->initialStreamState = ANTLR3_FALSE; - -} - -/// As per the normal tokLT but sends information to the debugger -/// -static pANTLR3_COMMON_TOKEN -dbgTokLT (pANTLR3_TOKEN_STREAM ts, ANTLR3_INT32 k) -{ - if (ts->initialStreamState == ANTLR3_TRUE) - { - consumeInitialHiddenTokens(ts->istream); - } - return tokLT(ts, k); -} - -#ifdef ANTLR3_WINDOWS - /* When fully optimized VC7 complains about non reachable code. - * Not yet sure if this is an optimizer bug, or a bug in the flow analysis - */ -#pragma warning( disable : 4702 ) -#endif - -static pANTLR3_COMMON_TOKEN -LB(pANTLR3_COMMON_TOKEN_STREAM cts, ANTLR3_INT32 k) -{ - ANTLR3_INT32 i; - ANTLR3_INT32 n; - - if (cts->p == -1) - { - fillBuffer(cts); - } - if (k == 0) - { - return NULL; - } - if ((cts->p - k) < 0) - { - return NULL; - } - - i = cts->p; - n = 1; - - /* Need to find k good tokens, going backwards, skipping ones that are off channel - */ - while (n <= (ANTLR3_INT32) k) - { - /* Skip off-channel tokens - */ - - i = skipOffTokenChannelsReverse(cts, i - 1); /* leave p on valid token */ - n++; - } - if (i < 0) - { - return NULL; - } - // Here the token must be in the input vector. Rather then incut - // function call penalty, we jsut return the pointer directly - // from the vector - // - return (pANTLR3_COMMON_TOKEN)cts->tokens->elements[i].element; -} - -static pANTLR3_COMMON_TOKEN -get (pANTLR3_TOKEN_STREAM ts, ANTLR3_UINT32 i) -{ - pANTLR3_COMMON_TOKEN_STREAM cts; - - cts = (pANTLR3_COMMON_TOKEN_STREAM)ts->super; - - return (pANTLR3_COMMON_TOKEN)(cts->tokens->get(cts->tokens, i)); /* Token index is zero based but vectors are 1 based */ -} - -static pANTLR3_TOKEN_SOURCE -getTokenSource (pANTLR3_TOKEN_STREAM ts) -{ - return ts->tokenSource; -} - -static void -setTokenSource ( pANTLR3_TOKEN_STREAM ts, - pANTLR3_TOKEN_SOURCE tokenSource) -{ - ts->tokenSource = tokenSource; -} - -static pANTLR3_STRING -toString (pANTLR3_TOKEN_STREAM ts) -{ - pANTLR3_COMMON_TOKEN_STREAM cts; - - cts = (pANTLR3_COMMON_TOKEN_STREAM)ts->super; - - if (cts->p == -1) - { - fillBuffer(cts); - } - - return ts->toStringSS(ts, 0, ts->istream->size(ts->istream)); -} - -static pANTLR3_STRING -toStringSS(pANTLR3_TOKEN_STREAM ts, ANTLR3_UINT32 start, ANTLR3_UINT32 stop) -{ - pANTLR3_STRING string; - pANTLR3_TOKEN_SOURCE tsource; - pANTLR3_COMMON_TOKEN tok; - ANTLR3_UINT32 i; - pANTLR3_COMMON_TOKEN_STREAM cts; - - cts = (pANTLR3_COMMON_TOKEN_STREAM) ts->super; - - if (cts->p == -1) - { - fillBuffer(cts); - } - if (stop >= ts->istream->size(ts->istream)) - { - stop = ts->istream->size(ts->istream) - 1; - } - - /* Who is giving us these tokens? - */ - tsource = ts->getTokenSource(ts); - - if (tsource != NULL && cts->tokens != NULL) - { - /* Finally, let's get a string - */ - string = tsource->strFactory->newRaw(tsource->strFactory); - - for (i = start; i <= stop; i++) - { - tok = ts->get(ts, i); - if (tok != NULL) - { - string->appendS(string, tok->getText(tok)); - } - } - - return string; - } - return NULL; - -} - -static pANTLR3_STRING -toStringTT (pANTLR3_TOKEN_STREAM ts, pANTLR3_COMMON_TOKEN start, pANTLR3_COMMON_TOKEN stop) -{ - if (start != NULL && stop != NULL) - { - return ts->toStringSS(ts, (ANTLR3_UINT32)start->getTokenIndex(start), (ANTLR3_UINT32)stop->getTokenIndex(stop)); - } - else - { - return NULL; - } -} - -/** Move the input pointer to the next incoming token. The stream - * must become active with LT(1) available. consume() simply - * moves the input pointer so that LT(1) points at the next - * input symbol. Consume at least one token. - * - * Walk past any token not on the channel the parser is listening to. - */ -static void -consume (pANTLR3_INT_STREAM is) -{ - pANTLR3_COMMON_TOKEN_STREAM cts; - pANTLR3_TOKEN_STREAM ts; - - ts = (pANTLR3_TOKEN_STREAM) is->super; - cts = (pANTLR3_COMMON_TOKEN_STREAM) ts->super; - - if ((ANTLR3_UINT32)cts->p < cts->tokens->count) - { - cts->p++; - cts->p = skipOffTokenChannels(cts, cts->p); - } -} - - -/// As per ordinary consume but notifies the debugger about hidden -/// tokens and so on. -/// -static void -dbgConsume (pANTLR3_INT_STREAM is) -{ - pANTLR3_TOKEN_STREAM ts; - ANTLR3_MARKER a; - ANTLR3_MARKER b; - pANTLR3_COMMON_TOKEN t; - - ts = (pANTLR3_TOKEN_STREAM) is->super; - - if (ts->initialStreamState == ANTLR3_TRUE) - { - consumeInitialHiddenTokens(is); - } - - a = is->index(is); // Where are we right now? - t = ts->_LT(ts, 1); // Current token from stream - - consume(is); // Standard consumer - - b = is->index(is); // Where are we after consuming 1 on channel token? - - ts->debugger->consumeToken(ts->debugger, t); // Tell the debugger that we consumed the first token - - if (b>a+1) - { - // The standard consume caused the index to advance by more than 1, - // which can only happen if it skipped some off-channel tokens. - // we need to tell the debugger about those tokens. - // - ANTLR3_MARKER i; - - for (i = a+1; idebugger->consumeHiddenToken(ts->debugger, ts->get(ts, (ANTLR3_UINT32)i)); - } - - } -} - -/** A simple filter mechanism whereby you can tell this token stream - * to force all tokens of type ttype to be on channel. For example, - * when interpreting, we cannot execute actions so we need to tell - * the stream to force all WS and NEWLINE to be a different, ignored, - * channel. - */ -static void -setTokenTypeChannel (pANTLR3_COMMON_TOKEN_STREAM tokenStream, ANTLR3_UINT32 ttype, ANTLR3_UINT32 channel) -{ - if (tokenStream->channelOverrides == NULL) - { - tokenStream->channelOverrides = antlr3ListNew(10); - } - - /* We add one to the channel so we can distinguish NULL as being no entry in the - * table for a particular token type. - */ - tokenStream->channelOverrides->put(tokenStream->channelOverrides, ttype, ANTLR3_FUNC_PTR((ANTLR3_UINT32)channel + 1), NULL); -} - -static void -discardTokenType (pANTLR3_COMMON_TOKEN_STREAM tokenStream, ANTLR3_INT32 ttype) -{ - if (tokenStream->discardSet == NULL) - { - tokenStream->discardSet = antlr3ListNew(31); - } - - /* We add one to the channel so we can distinguish NULL as being no entry in the - * table for a particular token type. We could use bitsets for this I suppose too. - */ - tokenStream->discardSet->put(tokenStream->discardSet, ttype, ANTLR3_FUNC_PTR((ANTLR3_UINT32)ttype + 1), NULL); -} - -static void -discardOffChannel (pANTLR3_COMMON_TOKEN_STREAM tokenStream, ANTLR3_BOOLEAN discard) -{ - tokenStream->discardOffChannel = discard; -} - -static pANTLR3_VECTOR -getTokens (pANTLR3_COMMON_TOKEN_STREAM tokenStream) -{ - if (tokenStream->p == -1) - { - fillBuffer(tokenStream); - } - - return tokenStream->tokens; -} - -static pANTLR3_LIST -getTokenRange (pANTLR3_COMMON_TOKEN_STREAM tokenStream, ANTLR3_UINT32 start, ANTLR3_UINT32 stop) -{ - return tokenStream->getTokensSet(tokenStream, start, stop, NULL); -} -/** Given a start and stop index, return a List of all tokens in - * the token type BitSet. Return null if no tokens were found. This - * method looks at both on and off channel tokens. - */ -static pANTLR3_LIST -getTokensSet (pANTLR3_COMMON_TOKEN_STREAM tokenStream, ANTLR3_UINT32 start, ANTLR3_UINT32 stop, pANTLR3_BITSET types) -{ - pANTLR3_LIST filteredList; - ANTLR3_UINT32 i; - ANTLR3_UINT32 n; - pANTLR3_COMMON_TOKEN tok; - - if (tokenStream->p == -1) - { - fillBuffer(tokenStream); - } - if (stop > tokenStream->tstream->istream->size(tokenStream->tstream->istream)) - { - stop = tokenStream->tstream->istream->size(tokenStream->tstream->istream); - } - if (start > stop) - { - return NULL; - } - - /* We have the range set, now we need to iterate through the - * installed tokens and create a new list with just the ones we want - * in it. We are just moving pointers about really. - */ - filteredList = antlr3ListNew((ANTLR3_UINT32)tokenStream->tstream->istream->size(tokenStream->tstream->istream)); - - for (i = start, n = 0; i<= stop; i++) - { - tok = tokenStream->tstream->get(tokenStream->tstream, i); - - if ( types == NULL - || types->isMember(types, tok->getType(tok) == ANTLR3_TRUE) - ) - { - filteredList->put(filteredList, n++, (void *)tok, NULL); - } - } - - /* Did we get any then? - */ - if (filteredList->size(filteredList) == 0) - { - filteredList->free(filteredList); - filteredList = NULL; - } - - return filteredList; -} - -static pANTLR3_LIST -getTokensList (pANTLR3_COMMON_TOKEN_STREAM tokenStream, ANTLR3_UINT32 start, ANTLR3_UINT32 stop, pANTLR3_LIST list) -{ - pANTLR3_BITSET bitSet; - pANTLR3_LIST newlist; - - bitSet = antlr3BitsetList(list->table); - - newlist = tokenStream->getTokensSet(tokenStream, start, stop, bitSet); - - bitSet->free(bitSet); - - return newlist; - -} - -static pANTLR3_LIST -getTokensType (pANTLR3_COMMON_TOKEN_STREAM tokenStream, ANTLR3_UINT32 start, ANTLR3_UINT32 stop, ANTLR3_UINT32 type) -{ - pANTLR3_BITSET bitSet; - pANTLR3_LIST newlist; - - bitSet = antlr3BitsetOf(type, -1); - newlist = tokenStream->getTokensSet(tokenStream, start, stop, bitSet); - - bitSet->free(bitSet); - - return newlist; -} - -static ANTLR3_UINT32 -_LA (pANTLR3_INT_STREAM is, ANTLR3_INT32 i) -{ - pANTLR3_TOKEN_STREAM ts; - pANTLR3_COMMON_TOKEN tok; - - ts = (pANTLR3_TOKEN_STREAM) is->super; - - tok = ts->_LT(ts, i); - - if (tok != NULL) - { - return tok->getType(tok); - } - else - { - return ANTLR3_TOKEN_INVALID; - } -} - -/// As per _LA() but for debug mode. -/// -static ANTLR3_UINT32 -dbgLA (pANTLR3_INT_STREAM is, ANTLR3_INT32 i) -{ - pANTLR3_TOKEN_STREAM ts; - - ts = (pANTLR3_TOKEN_STREAM) is->super; - - if (ts->initialStreamState == ANTLR3_TRUE) - { - consumeInitialHiddenTokens(is); - } - ts->debugger->LT(ts->debugger, i, tokLT(ts, i)); - return _LA(is, i); -} - -static ANTLR3_MARKER -mark (pANTLR3_INT_STREAM is) -{ - is->lastMarker = is->index(is); - return is->lastMarker; -} - -/// As per mark() but with a call to tell the debugger we are doing this -/// -static ANTLR3_MARKER -dbgMark (pANTLR3_INT_STREAM is) -{ - pANTLR3_TOKEN_STREAM ts; - - ts = (pANTLR3_TOKEN_STREAM) is->super; - - is->lastMarker = is->index(is); - ts->debugger->mark(ts->debugger, is->lastMarker); - - return is->lastMarker; -} - -static void -release (pANTLR3_INT_STREAM is, ANTLR3_MARKER mark) -{ - return; -} - -static ANTLR3_UINT32 -size (pANTLR3_INT_STREAM is) -{ - pANTLR3_COMMON_TOKEN_STREAM cts; - pANTLR3_TOKEN_STREAM ts; - - if (is->cachedSize > 0) - { - return is->cachedSize; - } - ts = (pANTLR3_TOKEN_STREAM) is->super; - cts = (pANTLR3_COMMON_TOKEN_STREAM) ts->super; - - is->cachedSize = cts->tokens->count; - return is->cachedSize; -} - -static ANTLR3_MARKER -tindex (pANTLR3_INT_STREAM is) -{ - pANTLR3_COMMON_TOKEN_STREAM cts; - pANTLR3_TOKEN_STREAM ts; - - ts = (pANTLR3_TOKEN_STREAM) is->super; - cts = (pANTLR3_COMMON_TOKEN_STREAM) ts->super; - - return cts->p; -} - -static void -dbgRewindLast (pANTLR3_INT_STREAM is) -{ - pANTLR3_TOKEN_STREAM ts; - - ts = (pANTLR3_TOKEN_STREAM) is->super; - - ts->debugger->rewindLast(ts->debugger); - - is->rewind(is, is->lastMarker); -} -static void -rewindLast (pANTLR3_INT_STREAM is) -{ - is->rewind(is, is->lastMarker); -} -static void -rewindStream (pANTLR3_INT_STREAM is, ANTLR3_MARKER marker) -{ - is->seek(is, (ANTLR3_UINT32)(marker)); -} -static void -dbgRewindStream (pANTLR3_INT_STREAM is, ANTLR3_MARKER marker) -{ - pANTLR3_TOKEN_STREAM ts; - - ts = (pANTLR3_TOKEN_STREAM) is->super; - - ts->debugger->rewind(ts->debugger, marker); - - is->seek(is, (ANTLR3_UINT32)(marker)); -} - -static void -seek (pANTLR3_INT_STREAM is, ANTLR3_MARKER index) -{ - pANTLR3_COMMON_TOKEN_STREAM cts; - pANTLR3_TOKEN_STREAM ts; - - ts = (pANTLR3_TOKEN_STREAM) is->super; - cts = (pANTLR3_COMMON_TOKEN_STREAM) ts->super; - - cts->p = (ANTLR3_UINT32)index; -} -static void -dbgSeek (pANTLR3_INT_STREAM is, ANTLR3_MARKER index) -{ - // TODO: Implement seek in debugger when Ter adds it to Java - // - seek(is, index); -} -ANTLR3_API void -fillBufferExt(pANTLR3_COMMON_TOKEN_STREAM tokenStream) -{ - fillBuffer(tokenStream); -} -static void -fillBuffer(pANTLR3_COMMON_TOKEN_STREAM tokenStream) { - ANTLR3_UINT32 index; - pANTLR3_COMMON_TOKEN tok; - ANTLR3_BOOLEAN discard; - void * channelI; - - /* Start at index 0 of course - */ - index = 0; - - /* Pick out the next token from the token source - * Remember we just get a pointer (reference if you like) here - * and so if we store it anywhere, we don't set any pointers to auto free it. - */ - tok = tokenStream->tstream->tokenSource->nextToken(tokenStream->tstream->tokenSource); - - while (tok != NULL && tok->type != ANTLR3_TOKEN_EOF) - { - discard = ANTLR3_FALSE; /* Assume we are not discarding */ - - /* I employ a bit of a trick, or perhaps hack here. Rather than - * store a pointer to a structure in the override map and discard set - * we store the value + 1 cast to a void *. Hence on systems where NULL = (void *)0 - * we can distinguish "not being there" from "being channel or type 0" - */ - - if (tokenStream->discardSet != NULL - && tokenStream->discardSet->get(tokenStream->discardSet, tok->getType(tok)) != NULL) - { - discard = ANTLR3_TRUE; - } - else if ( tokenStream->discardOffChannel == ANTLR3_TRUE - && tok->getChannel(tok) != tokenStream->channel - ) - { - discard = ANTLR3_TRUE; - } - else if (tokenStream->channelOverrides != NULL) - { - /* See if this type is in the override map - */ - channelI = tokenStream->channelOverrides->get(tokenStream->channelOverrides, tok->getType(tok) + 1); - - if (channelI != NULL) - { - /* Override found - */ - tok->setChannel(tok, ANTLR3_UINT32_CAST(channelI) - 1); - } - } - - /* If not discarding it, add it to the list at the current index - */ - if (discard == ANTLR3_FALSE) - { - /* Add it, indicating that we will delete it and the table should not - */ - tok->setTokenIndex(tok, index); - tokenStream->p++; - tokenStream->tokens->add(tokenStream->tokens, (void *) tok, NULL); - index++; - } - - tok = tokenStream->tstream->tokenSource->nextToken(tokenStream->tstream->tokenSource); - } - - /* Cache the size so we don't keep doing indirect method calls. We do this as - * early as possible so that anything after this may utilize the cached value. - */ - tokenStream->tstream->istream->cachedSize = tokenStream->tokens->count; - - /* Set the consume pointer to the first token that is on our channel - */ - tokenStream->p = 0; - tokenStream->p = skipOffTokenChannels(tokenStream, tokenStream->p); - -} - -/// Given a starting index, return the index of the first on-channel -/// token. -/// -static ANTLR3_UINT32 -skipOffTokenChannels(pANTLR3_COMMON_TOKEN_STREAM tokenStream, ANTLR3_INT32 i) { - ANTLR3_INT32 n; - pANTLR3_COMMON_TOKEN tok; - - n = tokenStream->tstream->istream->cachedSize; - - while (i < n) - { - tok = (pANTLR3_COMMON_TOKEN)tokenStream->tokens->elements[i].element; - - if (tok->channel!= tokenStream->channel) - { - i++; - } - else - { - return i; - } - } - return i; -} - -static ANTLR3_UINT32 -skipOffTokenChannelsReverse(pANTLR3_COMMON_TOKEN_STREAM tokenStream, ANTLR3_INT32 x) -{ - pANTLR3_COMMON_TOKEN tok; - - while (x >= 0) - { - tok = (pANTLR3_COMMON_TOKEN)tokenStream->tokens->elements[x].element; - - if ((tok->channel != tokenStream->channel)) - { - x--; - } - else - { - return x; - } - } - return x; -} - -/// Return a string that represents the name assoicated with the input source -/// -/// /param[in] is The ANTLR3_INT_STREAM interface that is representing this token stream. -/// -/// /returns -/// /implements ANTLR3_INT_STREAM_struct::getSourceName() -/// -static pANTLR3_STRING -getSourceName (pANTLR3_INT_STREAM is) -{ - // Slightly convoluted as we must trace back to the lexer's input source - // via the token source. The streamName that is here is not initialized - // because this is a token stream, not a file or string stream, which are the - // only things that have a context for a source name. - // - return ((pANTLR3_TOKEN_STREAM)(is->super))->tokenSource->fileName; -} diff --git a/impl/antlr/libantlr3c-3.4/src/antlr3treeparser.c b/impl/antlr/libantlr3c-3.4/src/antlr3treeparser.c deleted file mode 100644 index b7e035a..0000000 --- a/impl/antlr/libantlr3c-3.4/src/antlr3treeparser.c +++ /dev/null @@ -1,255 +0,0 @@ -/** \file - * Implementation of the tree parser and overrides for the base recognizer - */ - -// [The "BSD licence"] -// Copyright (c) 2005-2009 Jim Idle, Temporal Wave LLC -// http://www.temporal-wave.com -// http://www.linkedin.com/in/jimidle -// -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions -// are met: -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// 3. The name of the author may not be used to endorse or promote products -// derived from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -// IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -// OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -// IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -// NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include - -/* BASE Recognizer overrides - */ -static void mismatch (pANTLR3_BASE_RECOGNIZER recognizer, ANTLR3_UINT32 ttype, pANTLR3_BITSET_LIST follow); - -/* Tree parser API - */ -static void setTreeNodeStream (pANTLR3_TREE_PARSER parser, pANTLR3_COMMON_TREE_NODE_STREAM input); -static pANTLR3_COMMON_TREE_NODE_STREAM - getTreeNodeStream (pANTLR3_TREE_PARSER parser); -static void freeParser (pANTLR3_TREE_PARSER parser); -static void * getCurrentInputSymbol (pANTLR3_BASE_RECOGNIZER recognizer, pANTLR3_INT_STREAM istream); -static void * getMissingSymbol (pANTLR3_BASE_RECOGNIZER recognizer, pANTLR3_INT_STREAM istream, pANTLR3_EXCEPTION e, - ANTLR3_UINT32 expectedTokenType, pANTLR3_BITSET_LIST follow); - - -ANTLR3_API pANTLR3_TREE_PARSER -antlr3TreeParserNewStream(ANTLR3_UINT32 sizeHint, pANTLR3_COMMON_TREE_NODE_STREAM ctnstream, pANTLR3_RECOGNIZER_SHARED_STATE state) -{ - pANTLR3_TREE_PARSER parser; - - /** Allocate tree parser memory - */ - parser =(pANTLR3_TREE_PARSER) ANTLR3_MALLOC(sizeof(ANTLR3_TREE_PARSER)); - - if (parser == NULL) - { - return NULL; - } - - /* Create and install a base recognizer which does most of the work for us - */ - parser->rec = antlr3BaseRecognizerNew(ANTLR3_TYPE_PARSER, sizeHint, state); - - if (parser->rec == NULL) - { - parser->free(parser); - return NULL; - } - - /* Ensure we can track back to the tree parser super structure - * from the base recognizer structure - */ - parser->rec->super = parser; - parser->rec->type = ANTLR3_TYPE_TREE_PARSER; - - /* Install our base recognizer overrides - */ - parser->rec->mismatch = mismatch; - parser->rec->exConstruct = antlr3MTNExceptionNew; - parser->rec->getCurrentInputSymbol = getCurrentInputSymbol; - parser->rec->getMissingSymbol = getMissingSymbol; - - /* Install tree parser API - */ - parser->getTreeNodeStream = getTreeNodeStream; - parser->setTreeNodeStream = setTreeNodeStream; - parser->free = freeParser; - - /* Install the tree node stream - */ - parser->setTreeNodeStream(parser, ctnstream); - - return parser; -} - -/** - * \brief - * Creates a new Mismatched Tree Nde Exception and inserts in the recognizer - * exception stack. - * - * \param recognizer - * Context pointer for this recognizer - * - */ -ANTLR3_API void -antlr3MTNExceptionNew(pANTLR3_BASE_RECOGNIZER recognizer) -{ - /* Create a basic recognition exception structure - */ - antlr3RecognitionExceptionNew(recognizer); - - /* Now update it to indicate this is a Mismatched token exception - */ - recognizer->state->exception->name = ANTLR3_MISMATCHED_TREE_NODE_NAME; - recognizer->state->exception->type = ANTLR3_MISMATCHED_TREE_NODE_EXCEPTION; - - return; -} - - -static void -freeParser (pANTLR3_TREE_PARSER parser) -{ - if (parser->rec != NULL) - { - // This may have ben a delegate or delegator parser, in which case the - // state may already have been freed (and set to NULL therefore) - // so we ignore the state if we don't have it. - // - if (parser->rec->state != NULL) - { - if (parser->rec->state->following != NULL) - { - parser->rec->state->following->free(parser->rec->state->following); - parser->rec->state->following = NULL; - } - } - parser->rec->free(parser->rec); - parser->rec = NULL; - } - - ANTLR3_FREE(parser); -} - -/** Set the input stream and reset the parser - */ -static void -setTreeNodeStream (pANTLR3_TREE_PARSER parser, pANTLR3_COMMON_TREE_NODE_STREAM input) -{ - parser->ctnstream = input; - parser->rec->reset (parser->rec); - parser->ctnstream->reset (parser->ctnstream); -} - -/** Return a pointer to the input stream - */ -static pANTLR3_COMMON_TREE_NODE_STREAM -getTreeNodeStream (pANTLR3_TREE_PARSER parser) -{ - return parser->ctnstream; -} - - -/** Override for standard base recognizer mismatch function - * as we have DOWN/UP nodes in the stream that have no line info, - * plus we want to alter the exception type. - */ -static void -mismatch (pANTLR3_BASE_RECOGNIZER recognizer, ANTLR3_UINT32 ttype, pANTLR3_BITSET_LIST follow) -{ - recognizer->exConstruct(recognizer); - recognizer->recoverFromMismatchedToken(recognizer, ttype, follow); -} - -#ifdef ANTLR3_WINDOWS -#pragma warning (push) -#pragma warning (disable : 4100) -#endif - -// Default implementation is for parser and assumes a token stream as supplied by the runtime. -// You MAY need override this function if the standard TOKEN_STREAM is not what you are using. -// -static void * -getCurrentInputSymbol (pANTLR3_BASE_RECOGNIZER recognizer, pANTLR3_INT_STREAM istream) -{ - pANTLR3_TREE_NODE_STREAM tns; - pANTLR3_COMMON_TREE_NODE_STREAM ctns; - - tns = (pANTLR3_TREE_NODE_STREAM)(istream->super); - ctns = tns->ctns; - return tns->_LT(tns, 1); -} - - -// Default implementation is for parser and assumes a token stream as supplied by the runtime. -// You MAY need override this function if the standard BASE_TREE is not what you are using. -// -static void * -getMissingSymbol (pANTLR3_BASE_RECOGNIZER recognizer, pANTLR3_INT_STREAM istream, pANTLR3_EXCEPTION e, - ANTLR3_UINT32 expectedTokenType, pANTLR3_BITSET_LIST follow) -{ - pANTLR3_TREE_NODE_STREAM tns; - pANTLR3_COMMON_TREE_NODE_STREAM ctns; - pANTLR3_BASE_TREE node; - pANTLR3_BASE_TREE current; - pANTLR3_COMMON_TOKEN token; - pANTLR3_STRING text; - ANTLR3_INT32 i; - - // Dereference the standard pointers - // - tns = (pANTLR3_TREE_NODE_STREAM)(istream->super); - ctns = tns->ctns; - - // Create a new empty node, by stealing the current one, or the previous one if the current one is EOF - // - current = tns->_LT(tns, 1); - i = -1; - - if (current == &ctns->EOF_NODE.baseTree) - { - current = tns->_LT(tns, -1); - i--; - } - while (((pANTLR3_COMMON_TREE)(current->super))->factory == NULL) - { - current = tns->_LT(tns, i--); - } - - node = current->dupNode(current); - - // Find the newly dupicated token - // - token = node->getToken(node); - - // Create the token text that shows it has been inserted - // - token->setText8 (token, (pANTLR3_UINT8)"getText (token); - text->append8 (text, (const char *)recognizer->state->tokenNames[expectedTokenType]); - text->append8 (text, (const char *)">"); - - // Finally return the pointer to our new node - // - return node; -} -#ifdef ANTLR3_WINDOWS -#pragma warning (pop) -#endif - diff --git a/impl/antlr/libantlr3c-3.4/stamp-h1 b/impl/antlr/libantlr3c-3.4/stamp-h1 deleted file mode 100644 index d9e70fd..0000000 --- a/impl/antlr/libantlr3c-3.4/stamp-h1 +++ /dev/null @@ -1 +0,0 @@ -timestamp for antlr3config.h diff --git a/impl/antlr/libantlr3c-3.4/vsrulefiles/antlr3lexer.rules b/impl/antlr/libantlr3c-3.4/vsrulefiles/antlr3lexer.rules deleted file mode 100644 index d80fefa..0000000 --- a/impl/antlr/libantlr3c-3.4/vsrulefiles/antlr3lexer.rules +++ /dev/null @@ -1,199 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/impl/antlr/libantlr3c-3.4/vsrulefiles/antlr3lexerandparser.rules b/impl/antlr/libantlr3c-3.4/vsrulefiles/antlr3lexerandparser.rules deleted file mode 100644 index 12d100a..0000000 --- a/impl/antlr/libantlr3c-3.4/vsrulefiles/antlr3lexerandparser.rules +++ /dev/null @@ -1,201 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/impl/antlr/libantlr3c-3.4/vsrulefiles/antlr3parser.rules b/impl/antlr/libantlr3c-3.4/vsrulefiles/antlr3parser.rules deleted file mode 100644 index 6332946..0000000 --- a/impl/antlr/libantlr3c-3.4/vsrulefiles/antlr3parser.rules +++ /dev/null @@ -1,201 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/impl/antlr/libantlr3c-3.4/vsrulefiles/antlr3treeparser.rules b/impl/antlr/libantlr3c-3.4/vsrulefiles/antlr3treeparser.rules deleted file mode 100644 index 1f60f77..0000000 --- a/impl/antlr/libantlr3c-3.4/vsrulefiles/antlr3treeparser.rules +++ /dev/null @@ -1,201 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/impl/antlr/test-file b/impl/antlr/test-file deleted file mode 100644 index 0e7f8f0..0000000 --- a/impl/antlr/test-file +++ /dev/null @@ -1,2 +0,0 @@ -y = min(1, z) -z = y+1 diff --git a/impl/antlr/test-system b/impl/antlr/test-system deleted file mode 100644 index 68f8d4c..0000000 --- a/impl/antlr/test-system +++ /dev/null @@ -1,100 +0,0 @@ -x0 = max(0) -x1 = x0 -x2 = x1 -x3 = x2 -x4 = x3 -x5 = x4 -x6 = x5 -x7 = x6 -x8 = x7 -x9 = x8 -x10 = x9 -x11 = x10 -x12 = x11 -x13 = x12 -x14 = x13 -x15 = x14 -x16 = x15 -x17 = x16 -x18 = x17 -x19 = x18 -x20 = x19 -x21 = x20 -x22 = x21 -x23 = x22 -x24 = x23 -x25 = x24 -x26 = x25 -x27 = x26 -x28 = x27 -x29 = x28 -x30 = x29 -x31 = x30 -x32 = x31 -x33 = x32 -x34 = x33 -x35 = x34 -x36 = x35 -x37 = x36 -x38 = x37 -x39 = x38 -x40 = x39 -x41 = x40 -x42 = x41 -x43 = x42 -x44 = x43 -x45 = x44 -x46 = x45 -x47 = x46 -x48 = x47 -x49 = x48 -x50 = x49 -x51 = x50 -x52 = x51 -x53 = x52 -x54 = x53 -x55 = x54 -x56 = x55 -x57 = x56 -x58 = x57 -x59 = x58 -x60 = x59 -x61 = x60 -x62 = x61 -x63 = x62 -x64 = x63 -x65 = x64 -x66 = x65 -x67 = x66 -x68 = x67 -x69 = x68 -x70 = x69 -x71 = x70 -x72 = x71 -x73 = x72 -x74 = x73 -x75 = x74 -x76 = x75 -x77 = x76 -x78 = x77 -x79 = x78 -x80 = x79 -x81 = x80 -x82 = x81 -x83 = x82 -x84 = x83 -x85 = x84 -x86 = x85 -x87 = x86 -x88 = x87 -x89 = x88 -x90 = x89 -x91 = x90 -x92 = x91 -x93 = x92 -x94 = x93 -x95 = x94 -x96 = x95 -x97 = x96 -x98 = x97 -x99 = x98 -- cgit v1.2.3